Skip to content

Commit

Permalink
test: fix set test case
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Dec 30, 2024
1 parent 2ff63d3 commit ff99643
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
17 changes: 6 additions & 11 deletions go/vt/vtgate/engine/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,18 @@ import (
"fmt"
"strings"

"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/sysvars"

vtgatepb "vitess.io/vitess/go/vt/proto/vtgate"

"vitess.io/vitess/go/vt/log"

"vitess.io/vitess/go/vt/srvtopo"

"vitess.io/vitess/go/vt/vtgate/evalengine"

"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/key"
"vitess.io/vitess/go/vt/log"
querypb "vitess.io/vitess/go/vt/proto/query"
vtgatepb "vitess.io/vitess/go/vt/proto/vtgate"
vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/schema"
"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/srvtopo"
"vitess.io/vitess/go/vt/sysvars"
"vitess.io/vitess/go/vt/vterrors"
"vitess.io/vitess/go/vt/vtgate/evalengine"
"vitess.io/vitess/go/vt/vtgate/vindexes"
)

Expand Down
36 changes: 20 additions & 16 deletions go/vt/vtgate/planbuilder/testdata/set_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,22 +607,26 @@
}
},
{
"QueryType": "SET",
"Original": "set @foo = last_insert_id(1)",
"Instructions": {
"OperatorType": "Set",
"Ops": [
{
"Type": "UserDefinedVariable",
"Name": "foo",
"Expr": "last_insert_id(1)"
}
],
"Inputs": [
{
"OperatorType": "SingleRow"
}
]
"comment": "set last_insert_id with agrument to user defined variable",
"query": "set @foo = last_insert_id(1)",
"plan": {
"QueryType": "SET",
"Original": "set @foo = last_insert_id(1)",
"Instructions": {
"OperatorType": "Set",
"Ops": [
{
"Type": "UserDefinedVariable",
"Name": "foo",
"Expr": "last_insert_id(1)"
}
],
"Inputs": [
{
"OperatorType": "SingleRow"
}
]
}
}
}
]

0 comments on commit ff99643

Please sign in to comment.