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

Function TestRejectLimitInOracle

pkg/sql/parser/dialect_test.go:295–304  ·  view source on GitHub ↗

TestRejectLimitInOracle checks that LIMIT is rejected when dialect is Oracle.

(t *testing.T)

Source from the content-addressed store, hash-verified

293
294// TestRejectLimitInOracle checks that LIMIT is rejected when dialect is Oracle.
295func TestRejectLimitInOracle(t *testing.T) {
296 sql := "SELECT id, name FROM users LIMIT 10"
297 _, err := ParseWithDialect(sql, keywords.DialectOracle)
298 if err == nil {
299 t.Fatal("expected error: LIMIT should be rejected in Oracle dialect")
300 }
301 if !containsAny(err.Error(), "LIMIT", "Oracle", "ROWNUM", "FETCH") {
302 t.Errorf("error should mention LIMIT or Oracle, got: %v", err)
303 }
304}
305
306// ---------------------------------------------------------------------------
307// ILIKE dialect gate

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