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

Function TestRejectTopInSQLite

pkg/sql/parser/dialect_test.go:271–280  ·  view source on GitHub ↗

TestRejectTopInSQLite checks that TOP is rejected when dialect is SQLite.

(t *testing.T)

Source from the content-addressed store, hash-verified

269
270// TestRejectTopInSQLite checks that TOP is rejected when dialect is SQLite.
271func TestRejectTopInSQLite(t *testing.T) {
272 sql := "SELECT TOP 10 id, name FROM users"
273 _, err := ParseWithDialect(sql, keywords.DialectSQLite)
274 if err == nil {
275 t.Fatal("expected error: TOP should be rejected in SQLite dialect")
276 }
277 if !containsAny(err.Error(), "TOP", "sqlite", "LIMIT") {
278 t.Errorf("error should mention TOP or SQLite, got: %v", err)
279 }
280}
281
282// TestRejectTopInOracle checks that TOP is rejected when dialect is Oracle.
283func TestRejectTopInOracle(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