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

Function TestScan_UnionWithNulls

pkg/sql/security/scanner_test.go:229–253  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestScan_UnionWithNulls(t *testing.T) {
230 scanner := NewScanner()
231
232 // Create UNION SELECT NULL, NULL, NULL
233 setOp := &ast.SetOperation{
234 Left: &ast.SelectStatement{
235 Columns: []ast.Expression{&ast.Identifier{Name: "id"}},
236 },
237 Operator: "UNION",
238 Right: &ast.SelectStatement{
239 Columns: []ast.Expression{
240 &ast.Identifier{Name: "NULL"},
241 &ast.Identifier{Name: "NULL"},
242 &ast.Identifier{Name: "NULL"},
243 },
244 },
245 }
246
247 tree := &ast.AST{Statements: []ast.Statement{setOp}}
248 result := scanner.Scan(tree)
249
250 if result.HighCount == 0 {
251 t.Error("expected at least one high severity finding for UNION with multiple NULLs")
252 }
253}
254
255func TestScan_UnionSystemTables(t *testing.T) {
256 scanner := NewScanner()

Callers

nothing calls this directly

Calls 3

ScanMethod · 0.95
NewScannerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected