Skip to content

Commit 73af7f1

Browse files
macneale4claude
andcommitted
Fix SET statement behavior differences between server and memory engines
The issue was two-fold: 1. SET statements used an empty schema instead of OkResultSchema, causing the server handler to process them through the wrong code path. 2. In server engine tests, SET statements were routed to the query() path instead of the exec() path, causing them to return empty result sets instead of OkResult. Changes: - sql/plan/set.go: Use types.OkResultSchema instead of empty schema - enginetest/server_engine.go: Remove SET from shouldQuery list so it goes through exec() path which properly handles OkResult This ensures SET statements return consistent OkResult behavior in both memory engine and server engine modes, fixing CI test failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 622acbd commit 73af7f1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

enginetest/server_engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func (s *ServerQueryEngine) queryOrExec(ctx *sql.Context, stmt *gosql.Stmt, pars
250250
shouldQuery = true
251251
}
252252
case *sqlparser.Select, *sqlparser.SetOp, *sqlparser.Show,
253-
*sqlparser.Set, *sqlparser.Call, *sqlparser.Begin,
253+
*sqlparser.Call, *sqlparser.Begin,
254254
*sqlparser.Use, *sqlparser.Load, *sqlparser.Execute,
255255
*sqlparser.Analyze, *sqlparser.Flush, *sqlparser.Explain:
256256
shouldQuery = true

sql/plan/set.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"strings"
2020

2121
"github.com/dolthub/go-mysql-server/sql"
22+
"github.com/dolthub/go-mysql-server/sql/types"
2223
)
2324

2425
// Set represents a set statement. This can be variables, but in some instances can also refer to row values.
@@ -79,7 +80,7 @@ func (s *Set) Expressions() []sql.Expression {
7980

8081
// setSch is used to differentiate from the nil schema,
8182
// because Set does return rows
82-
var setSch = make(sql.Schema, 0)
83+
var setSch = types.OkResultSchema
8384

8485
// Schema implements the sql.Node interface.
8586
func (s *Set) Schema() sql.Schema {

0 commit comments

Comments
 (0)