Skip to content

Commit ba16e56

Browse files
committed
fix server errs
1 parent afd3745 commit ba16e56

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

enginetest/queries/script_queries.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var ScriptTests = []ScriptTest{
129129
},
130130
Assertions: []ScriptTestAssertion{
131131
{
132-
// Test UNION with BIT column and integer constant (related to customer's "48 is beyond maximum value" error)
132+
// Reproduces customer's "48 is beyond maximum value" error when BIT and integer constants are UNIONed
133133
Query: `SELECT archived FROM report_card WHERE id = 1
134134
UNION ALL
135135
SELECT 48 FROM report_card WHERE id = 1`,
@@ -181,8 +181,8 @@ var ScriptTests = []ScriptTest{
181181
WHERE archived = FALSE AND id <> 1
182182
) AS dummy_alias`,
183183
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)},
184+
{int64(5), int64(1), "Card1", int64(0), int64(0), int64(2)},
185+
{int64(7), int64(2), "Collection1", int64(0), nil, int64(2)},
186186
},
187187
},
188188
},

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/dolthub/go-icu-regex v0.0.0-20250327004329-6799764f2dad
77
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
88
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
9-
github.com/dolthub/vitess v0.0.0-20250730174048-497aebb8cea7
9+
github.com/dolthub/vitess v0.0.0-20250813175212-45844169a751
1010
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
1111
github.com/gocraft/dbr/v2 v2.7.2
1212
github.com/google/uuid v1.3.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9X
2020
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
2121
github.com/dolthub/vitess v0.0.0-20250730174048-497aebb8cea7 h1:l+mWO0xoh4eG1J9gMS87opL6N6WGAQitF36R/Lg4bWs=
2222
github.com/dolthub/vitess v0.0.0-20250730174048-497aebb8cea7/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
23+
github.com/dolthub/vitess v0.0.0-20250813175212-45844169a751 h1:BBQKyvyODewdQxS+ICklMn1d/fFj2pVlkmMN1QFY4ms=
24+
github.com/dolthub/vitess v0.0.0-20250813175212-45844169a751/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
2325
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
2426
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
2527
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=

sql/analyzer/resolve_unions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func finalizeUnions(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scope
100100
return nil, transform.SameTree, err
101101
}
102102

103-
// UNION operations can return multiple rows, so Max1Row optimization is invalid
103+
// UNION can return multiple rows even when child queries use LIMIT 1, so disable Max1Row optimization
104104
qFlags.Unset(sql.QFlagMax1Row)
105105

106106
return newN, transform.NewTree, nil

0 commit comments

Comments
 (0)