|
876 | 876 | ]
|
877 | 877 | }
|
878 | 878 | },
|
| 879 | + { |
| 880 | + "comment": "Comments with subquery", |
| 881 | + "query": "select /* comment */ user.col from user where id IN (select id from user where id > 1 and id < 10)", |
| 882 | + "plan": { |
| 883 | + "QueryType": "SELECT", |
| 884 | + "Original": "select /* comment */ user.col from user where id IN (select id from user where id > 1 and id < 10)", |
| 885 | + "Instructions": { |
| 886 | + "OperatorType": "Route", |
| 887 | + "Variant": "Scatter", |
| 888 | + "Keyspace": { |
| 889 | + "Name": "user", |
| 890 | + "Sharded": true |
| 891 | + }, |
| 892 | + "FieldQuery": "select `user`.col from `user` where 1 != 1", |
| 893 | + "Query": "select /* comment */ `user`.col from `user` where id in (select id from `user` where id > 1 and id < 10)", |
| 894 | + "Table": "`user`" |
| 895 | + }, |
| 896 | + "TablesUsed": [ |
| 897 | + "user.user" |
| 898 | + ] |
| 899 | + } |
| 900 | + }, |
| 901 | + { |
| 902 | + "comment": "Comments with subquery not merged into a single route", |
| 903 | + "query": "select /* comment */ user.col from user where foo IN (select id from user where id > 1 and id < 10)", |
| 904 | + "plan": { |
| 905 | + "QueryType": "SELECT", |
| 906 | + "Original": "select /* comment */ user.col from user where foo IN (select id from user where id > 1 and id < 10)", |
| 907 | + "Instructions": { |
| 908 | + "OperatorType": "UncorrelatedSubquery", |
| 909 | + "Variant": "PulloutIn", |
| 910 | + "PulloutVars": [ |
| 911 | + "__sq_has_values", |
| 912 | + "__sq1" |
| 913 | + ], |
| 914 | + "Inputs": [ |
| 915 | + { |
| 916 | + "InputName": "SubQuery", |
| 917 | + "OperatorType": "Route", |
| 918 | + "Variant": "Scatter", |
| 919 | + "Keyspace": { |
| 920 | + "Name": "user", |
| 921 | + "Sharded": true |
| 922 | + }, |
| 923 | + "FieldQuery": "select id from `user` where 1 != 1", |
| 924 | + "Query": "select /* comment */ id from `user` where id > 1 and id < 10", |
| 925 | + "Table": "`user`" |
| 926 | + }, |
| 927 | + { |
| 928 | + "InputName": "Outer", |
| 929 | + "OperatorType": "Route", |
| 930 | + "Variant": "Scatter", |
| 931 | + "Keyspace": { |
| 932 | + "Name": "user", |
| 933 | + "Sharded": true |
| 934 | + }, |
| 935 | + "FieldQuery": "select `user`.col from `user` where 1 != 1", |
| 936 | + "Query": "select /* comment */ `user`.col from `user` where :__sq_has_values and foo in ::__sq1", |
| 937 | + "Table": "`user`" |
| 938 | + } |
| 939 | + ] |
| 940 | + }, |
| 941 | + "TablesUsed": [ |
| 942 | + "user.user" |
| 943 | + ] |
| 944 | + } |
| 945 | + }, |
879 | 946 | {
|
880 | 947 | "comment": "for update",
|
881 | 948 | "query": "select user.col from user join user_extra for update",
|
|
0 commit comments