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

Function TestRejectTopInOracle

pkg/sql/parser/dialect_test.go:283–292  ·  view source on GitHub ↗

TestRejectTopInOracle checks that TOP is rejected when dialect is Oracle.

(t *testing.T)

Source from the content-addressed store, hash-verified

281
282// TestRejectTopInOracle checks that TOP is rejected when dialect is Oracle.
283func TestRejectTopInOracle(t *testing.T) {
284 sql := "SELECT TOP 10 id, name FROM users"
285 _, err := ParseWithDialect(sql, keywords.DialectOracle)
286 if err == nil {
287 t.Fatal("expected error: TOP should be rejected in Oracle dialect")
288 }
289 if !containsAny(err.Error(), "TOP", "oracle", "LIMIT") {
290 t.Errorf("error should mention TOP or Oracle, got: %v", err)
291 }
292}
293
294// TestRejectLimitInOracle checks that LIMIT is rejected when dialect is Oracle.
295func TestRejectLimitInOracle(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