--------------------------------------------------------------------------- LIMIT dialect gate --------------------------------------------------------------------------- TestRejectLimitInSQLServer checks that LIMIT is rejected when the dialect is explicitly set to SQL Server.
(t *testing.T)
| 192 | // TestRejectLimitInSQLServer checks that LIMIT is rejected when the dialect is |
| 193 | // explicitly set to SQL Server. |
| 194 | func TestRejectLimitInSQLServer(t *testing.T) { |
| 195 | sql := "SELECT id, name FROM users LIMIT 10" |
| 196 | _, err := ParseWithDialect(sql, keywords.DialectSQLServer) |
| 197 | if err == nil { |
| 198 | t.Fatal("expected error: LIMIT should be rejected in SQL Server dialect") |
| 199 | } |
| 200 | if !containsAny(err.Error(), "LIMIT", "SQL Server", "TOP", "FETCH") { |
| 201 | t.Errorf("error should mention LIMIT or SQL Server, got: %v", err) |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | // TestAcceptLimitInMySQL checks that LIMIT is accepted in MySQL dialect. |
| 206 | func TestAcceptLimitInMySQL(t *testing.T) { |
nothing calls this directly
no test coverage detected