-
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.
- Loading branch information
Showing
12 changed files
with
196 additions
and
36 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,78 @@ | ||
[ | ||
{ | ||
"comment": "Add your test case here for debugging and run go test -run=One.", | ||
"query": "", | ||
"comment": "Update in a table with shard-scoped foreign keys with cascade that requires a validation of a different parent foreign key", | ||
"query": "update u_tbl6 set col6 = 'foo'", | ||
"plan": { | ||
|
||
"QueryType": "UPDATE", | ||
"Original": "update u_tbl6 set col6 = 'foo'", | ||
"Instructions": { | ||
"OperatorType": "FkCascade", | ||
"Inputs": [ | ||
{ | ||
"InputName": "Selection", | ||
"OperatorType": "Route", | ||
"Variant": "Unsharded", | ||
"Keyspace": { | ||
"Name": "unsharded_fk_allow", | ||
"Sharded": false | ||
}, | ||
"FieldQuery": "select u_tbl6.col6 from u_tbl6 where 1 != 1", | ||
"Query": "select u_tbl6.col6 from u_tbl6 for update", | ||
"Table": "u_tbl6" | ||
}, | ||
{ | ||
"InputName": "CascadeChild-1", | ||
"OperatorType": "FKVerify", | ||
"BvName": "fkc_vals", | ||
"Cols": [ | ||
0 | ||
], | ||
"Inputs": [ | ||
{ | ||
"InputName": "VerifyParent-1", | ||
"OperatorType": "Route", | ||
"Variant": "Unsharded", | ||
"Keyspace": { | ||
"Name": "unsharded_fk_allow", | ||
"Sharded": false | ||
}, | ||
"FieldQuery": "select 1 from u_tbl8 left join u_tbl9 on u_tbl9.col9 = cast('foo' as CHAR) where 1 != 1", | ||
"Query": "select 1 from u_tbl8 left join u_tbl9 on u_tbl9.col9 = cast('foo' as CHAR) where u_tbl9.col9 is null and not (u_tbl8.col8) <=> (cast('foo' as CHAR)) and (u_tbl8.col8) in ::fkc_vals limit 1 for share nowait", | ||
"Table": "u_tbl8, u_tbl9" | ||
}, | ||
{ | ||
"InputName": "PostVerify", | ||
"OperatorType": "Update", | ||
"Variant": "Unsharded", | ||
"Keyspace": { | ||
"Name": "unsharded_fk_allow", | ||
"Sharded": false | ||
}, | ||
"TargetTabletType": "PRIMARY", | ||
"Query": "update /*+ SET_VAR(foreign_key_checks=OFF) */ u_tbl8 set col8 = 'foo' where (col8) in ::fkc_vals", | ||
"Table": "u_tbl8" | ||
} | ||
] | ||
}, | ||
{ | ||
"InputName": "Parent", | ||
"OperatorType": "Update", | ||
"Variant": "Unsharded", | ||
"Keyspace": { | ||
"Name": "unsharded_fk_allow", | ||
"Sharded": false | ||
}, | ||
"TargetTabletType": "PRIMARY", | ||
"Query": "update u_tbl6 set col6 = 'foo'", | ||
"Table": "u_tbl6" | ||
} | ||
] | ||
}, | ||
"TablesUsed": [ | ||
"unsharded_fk_allow.u_tbl6", | ||
"unsharded_fk_allow.u_tbl8", | ||
"unsharded_fk_allow.u_tbl9" | ||
] | ||
} | ||
} | ||
] |
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
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