-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: when merging routes with reference routing, we should also copy …
…the keyspace Signed-off-by: Andres Taylor <[email protected]>
- Loading branch information
Showing
4 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
go/vt/vtgate/planbuilder/testdata/select_cases_with_default.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# EXISTS subquery when the default ks is different than the inner query | ||
"select exists(select * from user where id = 5)" | ||
{ | ||
"QueryType": "SELECT", | ||
"Original": "select exists(select * from user where id = 5)", | ||
"Instructions": { | ||
"OperatorType": "Subquery", | ||
"Variant": "PulloutExists", | ||
"PulloutVars": [ | ||
"__sq_has_values1", | ||
"__sq1" | ||
], | ||
"Inputs": [ | ||
{ | ||
"OperatorType": "Route", | ||
"Variant": "EqualUnique", | ||
"Keyspace": { | ||
"Name": "user", | ||
"Sharded": true | ||
}, | ||
"FieldQuery": "select * from `user` where 1 != 1", | ||
"Query": "select * from `user` where id = 5", | ||
"Table": "`user`", | ||
"Values": [ | ||
"INT64(5)" | ||
], | ||
"Vindex": "user_index" | ||
}, | ||
{ | ||
"OperatorType": "Route", | ||
"Variant": "Reference", | ||
"Keyspace": { | ||
"Name": "second_user", | ||
"Sharded": true | ||
}, | ||
"FieldQuery": "select :__sq_has_values1 from dual where 1 != 1", | ||
"Query": "select :__sq_has_values1 from dual", | ||
"Table": "dual" | ||
} | ||
] | ||
} | ||
} | ||
{ | ||
"QueryType": "SELECT", | ||
"Original": "select exists(select * from user where id = 5)", | ||
"Instructions": { | ||
"OperatorType": "Route", | ||
"Variant": "EqualUnique", | ||
"Keyspace": { | ||
"Name": "user", | ||
"Sharded": true | ||
}, | ||
"FieldQuery": "select exists (select * from `user` where 1 != 1) from dual where 1 != 1", | ||
"Query": "select exists (select * from `user` where id = 5) from dual", | ||
"Table": "dual", | ||
"Values": [ | ||
"INT64(5)" | ||
], | ||
"Vindex": "user_index" | ||
} | ||
} |