You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 464e1a6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(rules): match unanchored set-operation branches to their SELECT tokens
A set-operation branch whose items carry no Polyglot span, such as
SELECT CAST(1 AS INTEGER), CAST('games' AS VARCHAR) after an aliased
first branch, found no SELECT token region. Its SQBRCONTRACT105 cast
types then fell back to Polyglot's spelling and its findings to 1:1,
producing false contract findings. Such a select now takes the next
unclaimed SELECT region after the previous branch, since branches and
CTEs are read in source order.
description:"unaliased later union branches keep their cast types",
99
+
dialect:"duckdb",
100
+
query_sql:"SELECT CAST(1 AS INTEGER) AS customer_id, CAST('books' AS VARCHAR) AS category, CAST(10.25 AS DECIMAL(12,2)) AS amount\nUNION ALL\nSELECT CAST(1 AS INTEGER), CAST('games' AS VARCHAR), CAST(20.50 AS DECIMAL(12,2))\nUNION ALL\nSELECT CAST(2 AS INTEGER), CAST('books' AS VARCHAR), CAST(7.00 AS DECIMAL(12,2))",
description:"an unaliased branch after a subquery-filtered branch keeps its position",
131
+
dialect:"duckdb",
132
+
query_sql:"SELECT CAST(order_id AS INTEGER) AS amount FROM orders WHERE order_id IN (SELECT order_id FROM returns)\nUNION ALL BY NAME\nSELECT CAST(4 AS SMALLINT) AS amount",
0 commit comments