|
933 | 933 | ]
|
934 | 934 | }
|
935 | 935 | },
|
| 936 | + { |
| 937 | + "comment": "Comments with subquery", |
| 938 | + "query": "select /* comment */ user.col from user where id IN (select id from user where id > 1 and id < 10)", |
| 939 | + "plan": { |
| 940 | + "Type": "Scatter", |
| 941 | + "QueryType": "SELECT", |
| 942 | + "Original": "select /* comment */ user.col from user where id IN (select id from user where id > 1 and id < 10)", |
| 943 | + "Instructions": { |
| 944 | + "OperatorType": "Route", |
| 945 | + "Variant": "Scatter", |
| 946 | + "Keyspace": { |
| 947 | + "Name": "user", |
| 948 | + "Sharded": true |
| 949 | + }, |
| 950 | + "FieldQuery": "select `user`.col from `user` where 1 != 1", |
| 951 | + "Query": "select /* comment */ `user`.col from `user` where id in (select id from `user` where id > 1 and id < 10)" |
| 952 | + }, |
| 953 | + "TablesUsed": [ |
| 954 | + "user.user" |
| 955 | + ] |
| 956 | + }, |
| 957 | + "skip_e2e": true |
| 958 | + }, |
| 959 | + { |
| 960 | + "comment": "Comments with subquery not merged into a single route", |
| 961 | + "query": "select /* comment */ user.col from user where foo IN (select id from user where id > 1 and id < 10)", |
| 962 | + "plan": { |
| 963 | + "Type": "Complex", |
| 964 | + "QueryType": "SELECT", |
| 965 | + "Original": "select /* comment */ user.col from user where foo IN (select id from user where id > 1 and id < 10)", |
| 966 | + "Instructions": { |
| 967 | + "OperatorType": "UncorrelatedSubquery", |
| 968 | + "Variant": "PulloutIn", |
| 969 | + "PulloutVars": [ |
| 970 | + "__sq_has_values", |
| 971 | + "__sq1" |
| 972 | + ], |
| 973 | + "Inputs": [ |
| 974 | + { |
| 975 | + "InputName": "SubQuery", |
| 976 | + "OperatorType": "Route", |
| 977 | + "Variant": "Scatter", |
| 978 | + "Keyspace": { |
| 979 | + "Name": "user", |
| 980 | + "Sharded": true |
| 981 | + }, |
| 982 | + "FieldQuery": "select id from `user` where 1 != 1", |
| 983 | + "Query": "select /* comment */ id from `user` where id > 1 and id < 10" |
| 984 | + }, |
| 985 | + { |
| 986 | + "InputName": "Outer", |
| 987 | + "OperatorType": "Route", |
| 988 | + "Variant": "Scatter", |
| 989 | + "Keyspace": { |
| 990 | + "Name": "user", |
| 991 | + "Sharded": true |
| 992 | + }, |
| 993 | + "FieldQuery": "select `user`.col from `user` where 1 != 1", |
| 994 | + "Query": "select /* comment */ `user`.col from `user` where :__sq_has_values and foo in ::__sq1" |
| 995 | + } |
| 996 | + ] |
| 997 | + }, |
| 998 | + "TablesUsed": [ |
| 999 | + "user.user" |
| 1000 | + ] |
| 1001 | + }, |
| 1002 | + "skip_e2e": true |
| 1003 | + }, |
936 | 1004 | {
|
937 | 1005 | "comment": "for update",
|
938 | 1006 | "query": "select user.col from user join user_extra for update",
|
|
0 commit comments