Skip to content

Commit

Permalink
added plan test
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal authored and arthurschreiber committed Nov 16, 2023
1 parent 12df838 commit b71da5e
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions go/vt/vtgate/planbuilder/testdata/lock_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,95 @@
"main.dual"
]
}
},
{
"comment": "select nowait",
"query": "select u.col, u.bar from user u join music m on u.foo = m.foo for update nowait",
"plan": {
"QueryType": "SELECT",
"Original": "select u.col, u.bar from user u join music m on u.foo = m.foo for update nowait",
"Instructions": {
"OperatorType": "Join",
"Variant": "Join",
"JoinColumnIndexes": "L:0,L:1",
"JoinVars": {
"u_foo": 2
},
"TableName": "`user`_music",
"Inputs": [
{
"OperatorType": "Route",
"Variant": "Scatter",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"FieldQuery": "select u.col, u.bar, u.foo from `user` as u where 1 != 1",
"Query": "select u.col, u.bar, u.foo from `user` as u for update nowait",
"Table": "`user`"
},
{
"OperatorType": "Route",
"Variant": "Scatter",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"FieldQuery": "select 1 from music as m where 1 != 1",
"Query": "select 1 from music as m where m.foo = :u_foo for update nowait",
"Table": "music"
}
]
},
"TablesUsed": [
"user.music",
"user.user"
]
}
},
{
"comment": "select skip locked",
"query": "select u.col, u.bar from user u join music m on u.foo = m.foo for share skip locked",
"plan": {
"QueryType": "SELECT",
"Original": "select u.col, u.bar from user u join music m on u.foo = m.foo for share skip locked",
"Instructions": {
"OperatorType": "Join",
"Variant": "Join",
"JoinColumnIndexes": "L:0,L:1",
"JoinVars": {
"u_foo": 2
},
"TableName": "`user`_music",
"Inputs": [
{
"OperatorType": "Route",
"Variant": "Scatter",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"FieldQuery": "select u.col, u.bar, u.foo from `user` as u where 1 != 1",
"Query": "select u.col, u.bar, u.foo from `user` as u for share skip locked",
"Table": "`user`"
},
{
"OperatorType": "Route",
"Variant": "Scatter",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"FieldQuery": "select 1 from music as m where 1 != 1",
"Query": "select 1 from music as m where m.foo = :u_foo for share skip locked",
"Table": "music"
}
]
},
"TablesUsed": [
"user.music",
"user.user"
]
}
}
]

0 comments on commit b71da5e

Please sign in to comment.