Skip to content

Commit

Permalink
test: update query to use valid column names
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Dec 10, 2024
1 parent 0ab3717 commit 31af9e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ from (select name from t1 group by name having count(t1.id) > 1) t1;

# this query uses last_insert_id with a column argument to show that this works well
select id, last_insert_id(count(*)) as num_segments from t1 group by id;

# checking that we stored the correct value in the last_insert_id
select last_insert_id();
16 changes: 8 additions & 8 deletions go/vt/vtgate/planbuilder/testdata/select_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -2190,10 +2190,10 @@
},
{
"comment": "save column value to session - sharded",
"query": "select bar, 12, last_insert_id(foo) from user",
"query": "select col, 12, last_insert_id(intcol) from user",
"plan": {
"QueryType": "SELECT",
"Original": "select bar, 12, last_insert_id(foo) from user",
"Original": "select col, 12, last_insert_id(intcol) from user",
"Instructions": {
"OperatorType": "SaveToSession",
"Offset": "_vt_column_2",
Expand All @@ -2205,8 +2205,8 @@
"Name": "user",
"Sharded": true
},
"FieldQuery": "select bar, 12, last_insert_id(foo) from `user` where 1 != 1",
"Query": "select bar, 12, last_insert_id(foo) from `user`",
"FieldQuery": "select col, 12, last_insert_id(intcol) from `user` where 1 != 1",
"Query": "select col, 12, last_insert_id(intcol) from `user`",
"Table": "`user`"
}
]
Expand All @@ -2218,10 +2218,10 @@
},
{
"comment": "save column value to session - unsharded",
"query": "select bar, 12, last_insert_id(foo) from unsharded",
"query": "select col1, 12, last_insert_id(id) from unsharded",
"plan": {
"QueryType": "SELECT",
"Original": "select bar, 12, last_insert_id(foo) from unsharded",
"Original": "select col1, 12, last_insert_id(id) from unsharded",
"Instructions": {
"OperatorType": "SaveToSession",
"Offset": "_vt_column_2",
Expand All @@ -2233,8 +2233,8 @@
"Name": "main",
"Sharded": false
},
"FieldQuery": "select bar, 12, last_insert_id(foo) from unsharded where 1 != 1",
"Query": "select bar, 12, last_insert_id(foo) from unsharded",
"FieldQuery": "select col1, 12, last_insert_id(id) from unsharded where 1 != 1",
"Query": "select col1, 12, last_insert_id(id) from unsharded",
"Table": "unsharded"
}
]
Expand Down

0 comments on commit 31af9e0

Please sign in to comment.