Skip to content

Commit 62b69ba

Browse files
macneale4claude
andcommitted
Fix multiple test suites to expect OkResult for SET statements
Updated test expectations across multiple test suites: - TestJoinPlanning: Fixed SET disable_merge_join expectation - TestAnsiQuotesSqlMode: Fixed 7 SET sql_mode statements - TestPersist: Fixed 3 SET PERSIST statements - TestScripts: Fixed 4 SET time_zone statements - TestIndexPrefix: Fixed SET strict_mysql_compatibility statement All tests now expect types.NewOkResult(0) instead of empty rows {} for SET statements, matching the corrected MySQL-compatible behavior from the SET statement fix. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent be71ca2 commit 62b69ba

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

enginetest/enginetests.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5277,17 +5277,17 @@ func TestPersist(t *testing.T, harness Harness, newPersistableSess func(ctx *sql
52775277
}{
52785278
{
52795279
Query: "SET PERSIST max_connections = 1000;",
5280-
Expected: []sql.Row{{}},
5280+
Expected: []sql.Row{{types.NewOkResult(0)}},
52815281
ExpectedGlobal: int64(1000),
52825282
ExpectedPersist: int64(1000),
52835283
}, {
52845284
Query: "SET @@PERSIST.max_connections = 1000;",
5285-
Expected: []sql.Row{{}},
5285+
Expected: []sql.Row{{types.NewOkResult(0)}},
52865286
ExpectedGlobal: int64(1000),
52875287
ExpectedPersist: int64(1000),
52885288
}, {
52895289
Query: "SET PERSIST_ONLY max_connections = 1000;",
5290-
Expected: []sql.Row{{}},
5290+
Expected: []sql.Row{{types.NewOkResult(0)}},
52915291
ExpectedGlobal: int64(151),
52925292
ExpectedPersist: int64(1000),
52935293
},

enginetest/join_planning_tests.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/dolthub/go-mysql-server/sql/plan"
2929
"github.com/dolthub/go-mysql-server/sql/planbuilder"
3030
"github.com/dolthub/go-mysql-server/sql/transform"
31+
"github.com/dolthub/go-mysql-server/sql/types"
3132
)
3233

3334
type JoinPlanTest struct {
@@ -103,7 +104,7 @@ var JoinPlanningTests = []joinPlanScript{
103104
},
104105
{
105106
q: "set @@SESSION.disable_merge_join = 1",
106-
exp: []sql.Row{{}},
107+
exp: []sql.Row{{types.NewOkResult(0)}},
107108
},
108109
{
109110
q: "select /*+ JOIN_ORDER(ab, xy) MERGE_JOIN(ab, xy)*/ * from ab join xy on y = a order by 1, 3",

enginetest/queries/ansi_quotes_queries.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var AnsiQuotesTests = []ScriptTest{
7171
{
7272
// Disable ANSI_QUOTES and make sure we can still run queries
7373
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
74-
Expected: []sql.Row{{}},
74+
Expected: []sql.Row{{types.NewOkResult(0)}},
7575
},
7676
{
7777
Query: `select "data" from auctions order by "ai" desc;`,
@@ -154,7 +154,7 @@ var AnsiQuotesTests = []ScriptTest{
154154
{
155155
// Disable ANSI_QUOTES mode
156156
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
157-
Expected: []sql.Row{{}},
157+
Expected: []sql.Row{{types.NewOkResult(0)}},
158158
},
159159
{
160160
Query: `show create table view1;`,
@@ -197,7 +197,7 @@ var AnsiQuotesTests = []ScriptTest{
197197
{
198198
// Disable ANSI_QUOTES mode
199199
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
200-
Expected: []sql.Row{{}},
200+
Expected: []sql.Row{{types.NewOkResult(0)}},
201201
},
202202
{
203203
Query: `insert into t values (2, 'George', 'SomethingElse');`,
@@ -237,7 +237,7 @@ var AnsiQuotesTests = []ScriptTest{
237237
{
238238
// Disable ANSI_QUOTES mode
239239
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
240-
Expected: []sql.Row{{}},
240+
Expected: []sql.Row{{types.NewOkResult(0)}},
241241
},
242242
{
243243
// Assert the procedure runs correctly with ANSI_QUOTES mode disabled
@@ -269,7 +269,7 @@ var AnsiQuotesTests = []ScriptTest{
269269
{
270270
// Disable ANSI_QUOTES mode
271271
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
272-
Expected: []sql.Row{{}},
272+
Expected: []sql.Row{{types.NewOkResult(0)}},
273273
},
274274
{
275275
// Insert a row with ANSI_QUOTES mode disabled
@@ -298,7 +298,7 @@ var AnsiQuotesTests = []ScriptTest{
298298
{
299299
// Disable ANSI_QUOTES mode
300300
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
301-
Expected: []sql.Row{{}},
301+
Expected: []sql.Row{{types.NewOkResult(0)}},
302302
},
303303
{
304304
// Assert the check constraint runs correctly when ANSI_QUOTES mode is disabled
@@ -328,7 +328,7 @@ var AnsiQuotesTests = []ScriptTest{
328328
{
329329
// Disable ANSI_QUOTES mode and make sure we can still list and run events
330330
Query: `SET @@sql_mode='NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES';`,
331-
Expected: []sql.Row{{}},
331+
Expected: []sql.Row{{types.NewOkResult(0)}},
332332
},
333333
{
334334
Query: `SHOW EVENTS;`,

enginetest/queries/index_queries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4011,7 +4011,7 @@ var IndexPrefixQueries = []ScriptTest{
40114011
Assertions: []ScriptTestAssertion{
40124012
{
40134013
Query: "set @@strict_mysql_compatibility = true;",
4014-
Expected: []sql.Row{{}},
4014+
Expected: []sql.Row{{types.NewOkResult(0)}},
40154015
},
40164016
{
40174017
Query: "select @@strict_mysql_compatibility;",

enginetest/queries/script_queries.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5338,7 +5338,7 @@ CREATE TABLE tab3 (
53385338
Assertions: []ScriptTestAssertion{
53395339
{
53405340
Query: "SET time_zone = '+07:00';",
5341-
Expected: []sql.Row{{}},
5341+
Expected: []sql.Row{{types.NewOkResult(0)}},
53425342
},
53435343
{
53445344
Query: "SELECT UNIX_TIMESTAMP('2023-09-25 07:02:57');",
@@ -5350,15 +5350,15 @@ CREATE TABLE tab3 (
53505350
},
53515351
{
53525352
Query: "SET time_zone = '+00:00';",
5353-
Expected: []sql.Row{{}},
5353+
Expected: []sql.Row{{types.NewOkResult(0)}},
53545354
},
53555355
{
53565356
Query: "SELECT UNIX_TIMESTAMP('2023-09-25 07:02:57');",
53575357
Expected: []sql.Row{{1695625377}},
53585358
},
53595359
{
53605360
Query: "SET time_zone = '-06:00';",
5361-
Expected: []sql.Row{{}},
5361+
Expected: []sql.Row{{types.NewOkResult(0)}},
53625362
},
53635363
{
53645364
Query: "SELECT UNIX_TIMESTAMP('2023-09-25 07:02:57');",
@@ -9977,7 +9977,7 @@ var BrokenScriptTests = []ScriptTest{
99779977
Assertions: []ScriptTestAssertion{
99789978
{
99799979
Query: "SET SESSION time_zone = '-05:00';",
9980-
Expected: []sql.Row{{}},
9980+
Expected: []sql.Row{{types.NewOkResult(0)}},
99819981
},
99829982
{
99839983
Query: "SELECT DATE_FORMAT(ts, '%H:%i:%s'), DATE_FORMAT(dt, '%H:%i:%s') from timezone_test;",

0 commit comments

Comments
 (0)