--------------------------------------------------------------------------- ILIKE dialect gate --------------------------------------------------------------------------- TestRejectILIKEInMySQL checks that ILIKE is rejected in MySQL mode.
(t *testing.T)
| 309 | |
| 310 | // TestRejectILIKEInMySQL checks that ILIKE is rejected in MySQL mode. |
| 311 | func 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. |
| 323 | func TestRejectILIKEInSQLServer(t *testing.T) { |
nothing calls this directly
no test coverage detected