Skip to content

Commit db0f0db

Browse files
committed
add repro query for customer
1 parent abe337e commit db0f0db

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

enginetest/queries/script_queries.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,56 @@ var ScriptTests = []ScriptTest{
137137
},
138138
},
139139
},
140+
{
141+
// Regression test for https://github.com/dolthub/dolt/issues/9641
142+
Name: "bit union comprehensive regression test dolt#9641",
143+
SetUpScript: []string{
144+
`CREATE TABLE t1 (
145+
id int PRIMARY KEY,
146+
name varchar(254),
147+
archived bit(1) NOT NULL DEFAULT b'0',
148+
archived_directly bit(1) NOT NULL DEFAULT b'0'
149+
)`,
150+
`CREATE TABLE t2 (
151+
id int PRIMARY KEY,
152+
name varchar(254),
153+
archived bit(1) NOT NULL DEFAULT b'0'
154+
)`,
155+
"INSERT INTO t1 VALUES (1, 'Card1', b'0', b'0')",
156+
"INSERT INTO t2 VALUES (2, 'Collection1', b'0')",
157+
},
158+
Assertions: []ScriptTestAssertion{
159+
{
160+
Query: `SELECT *,
161+
COUNT(*) OVER () AS total_count
162+
FROM (
163+
SELECT
164+
5 AS model_ranking,
165+
id,
166+
name,
167+
archived,
168+
archived_directly
169+
FROM t1
170+
WHERE archived_directly = FALSE
171+
172+
UNION ALL
173+
174+
SELECT
175+
7 AS model_ranking,
176+
id,
177+
name,
178+
archived,
179+
NULL AS archived_directly
180+
FROM t2
181+
WHERE archived = FALSE AND id <> 1
182+
) AS dummy_alias`,
183+
Expected: []sql.Row{
184+
{int64(5), int64(1), "Card1", uint64(0), int64(0), int64(2)},
185+
{int64(7), int64(2), "Collection1", uint64(0), nil, int64(2)},
186+
},
187+
},
188+
},
189+
},
140190
{
141191
Name: "outer join finish unmatched right side",
142192
SetUpScript: []string{

0 commit comments

Comments
 (0)