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

Function TestRejectILIKEInSQLServer

pkg/sql/parser/dialect_test.go:323–332  ·  view source on GitHub ↗

TestRejectILIKEInSQLServer checks that ILIKE is rejected in SQL Server mode.

(t *testing.T)

Source from the content-addressed store, hash-verified

321
322// TestRejectILIKEInSQLServer checks that ILIKE is rejected in SQL Server mode.
323func TestRejectILIKEInSQLServer(t *testing.T) {
324 sql := "SELECT * FROM users WHERE name ILIKE '%alice%'"
325 _, err := ParseWithDialect(sql, keywords.DialectSQLServer)
326 if err == nil {
327 t.Fatal("expected error: ILIKE should be rejected in SQL Server dialect")
328 }
329 if !containsAny(err.Error(), "ILIKE", "PostgreSQL", "LIKE") {
330 t.Errorf("error should mention ILIKE, got: %v", err)
331 }
332}
333
334// TestRejectNotILIKEInMySQL checks that NOT ILIKE is rejected in MySQL mode.
335func TestRejectNotILIKEInMySQL(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