MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestRejectILIKEInMySQL

Function TestRejectILIKEInMySQL

pkg/sql/parser/dialect_test.go:311–320  ·  view source on GitHub ↗

--------------------------------------------------------------------------- ILIKE dialect gate --------------------------------------------------------------------------- TestRejectILIKEInMySQL checks that ILIKE is rejected in MySQL mode.

(t *testing.T)

Source from the content-addressed store, hash-verified

309
310// TestRejectILIKEInMySQL checks that ILIKE is rejected in MySQL mode.
311func TestRejectILIKEInMySQL(t *testing.T) {
312 sql := "SELECT * FROM users WHERE name ILIKE '%alice%'"
313 _, err := ParseWithDialect(sql, keywords.DialectMySQL)
314 if err == nil {
315 t.Fatal("expected error: ILIKE should be rejected in MySQL dialect")
316 }
317 if !containsAny(err.Error(), "ILIKE", "PostgreSQL", "LIKE", "mysql") {
318 t.Errorf("error should mention ILIKE or MySQL, got: %v", err)
319 }
320}
321
322// TestRejectILIKEInSQLServer checks that ILIKE is rejected in SQL Server mode.
323func TestRejectILIKEInSQLServer(t *testing.T) {

Callers

nothing calls this directly

Calls 4

containsAnyFunction · 0.85
ParseWithDialectFunction · 0.70
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected