-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
unsupported_cases.json
387 lines (387 loc) · 18.4 KB
/
unsupported_cases.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
[
{
"comment": "natural join",
"query": "select * from user natural join user_extra",
"plan": "VT12001: unsupported: natural join"
},
{
"comment": "natural left join",
"query": "select * from user natural left join user_extra",
"plan": "VT12001: unsupported: natural left join"
},
{
"comment": "natural right join",
"query": "select * from user natural right join user_extra",
"plan": "VT12001: unsupported: natural right join"
},
{
"comment": "subqueries not supported in group by",
"query": "select id from user group by id, (select id from user_extra)",
"plan": "VT12001: unsupported: subqueries in GROUP BY"
},
{
"comment": "user defined functions used in having clause that needs evaluation on vtgate",
"query": "select col1, udf_aggr( col2 ) r from user group by col1 having r >= 0.3",
"plan": "VT12001: unsupported: Aggregate UDF 'udf_aggr(col2)' must be pushed down to MySQL"
},
{
"comment": "update changes primary vindex column",
"query": "update user set id = 1 where id = 1",
"plan": "VT12001: unsupported: you cannot UPDATE primary vindex columns; invalid update on vindex: user_index"
},
{
"comment": "subquery with an aggregation in order by that cannot be merged into a single route",
"query": "select col, trim((select user_name from user where col = 'a')) val from user_extra where user_id = 3 group by col order by val",
"plan": "VT12001: unsupported: subquery with aggregation in order by"
},
{
"comment": "update change in multicol vindex column",
"query": "update multicol_tbl set colc = 5, colb = 4 where cola = 1 and colb = 2",
"plan": "VT12001: unsupported: you cannot UPDATE primary vindex columns; invalid update on vindex: multicolIdx"
},
{
"comment": "update changes non lookup vindex column",
"query": "update user_metadata set md5 = 1 where user_id = 1",
"plan": "VT12001: unsupported: you can only UPDATE lookup vindexes; invalid update on vindex: user_md5_index"
},
{
"comment": "update with complex set clause",
"query": "update music set id = id + 1 where id = 1",
"plan": "VT12001: unsupported: only values are supported; invalid update on column: `id` with expr: [id + 1]"
},
{
"comment": "update by primary keyspace id, changing one vindex column, limit without order clause",
"query": "update user_metadata set email = 'juan@vitess.io' where user_id = 1 limit 10",
"plan": "VT12001: unsupported: Vindex update should have ORDER BY clause when using LIMIT"
},
{
"comment": "multi table update with dependent column getting updated",
"query": "update user u, user_extra ue set u.name = 'test' + ue.col, ue.col = 5 where u.id = ue.id and u.id = 1;",
"plan": "VT12001: unsupported: 'ue.col' column referenced in update expression ''test' + ue.col' is itself updated"
},
{
"comment": "unsharded insert, col list does not match values",
"query": "insert into unsharded_auto(id, val) values(1)",
"plan": "VT03006: column count does not match value count with the row"
},
{
"comment": "sharded upsert can't change vindex",
"query": "insert into user(id) values(1) on duplicate key update id = 3",
"plan": "VT12001: unsupported: DML cannot update vindex column"
},
{
"comment": "sharded upsert can't change vindex using values function",
"query": "insert into music(user_id, id) values(1, 2) on duplicate key update user_id = values(id)",
"plan": "VT12001: unsupported: DML cannot update vindex column"
},
{
"comment": "sharded replace no vindex",
"query": "replace into user(val) values(1, 'foo')",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "sharded replace with vindex",
"query": "replace into user(id, name) values(1, 'foo')",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace no column list",
"query": "replace into user values(1, 2, 3)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace with mimatched column list",
"query": "replace into user(id) values (1, 2)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace with one vindex",
"query": "replace into user(id) values (1)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace with non vindex on vindex-enabled table",
"query": "replace into user(nonid) values (2)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace with all vindexes supplied",
"query": "replace into user(nonid, name, id) values (2, 'foo', 1)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace for non-vindex autoinc",
"query": "replace into user_extra(nonid) values (2)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "replace with multiple rows",
"query": "replace into user(id) values (1), (2)",
"plan": "VT12001: unsupported: REPLACE INTO with sharded keyspace"
},
{
"comment": "select get_lock with non-dual table",
"query": "select get_lock('xyz', 10) from user",
"plan": "get_lock('xyz', 10) allowed only with dual"
},
{
"comment": "select is_free_lock with non-dual table",
"query": "select is_free_lock('xyz') from user",
"plan": "is_free_lock('xyz') allowed only with dual"
},
{
"comment": "union with SQL_CALC_FOUND_ROWS",
"query": "(select sql_calc_found_rows id from user where id = 1 limit 1) union select id from user where id = 1",
"plan": "VT12001: unsupported: SQL_CALC_FOUND_ROWS not supported with union"
},
{
"comment": "set with DEFAULT - vitess aware",
"query": "set workload = default",
"plan": "VT12001: unsupported: DEFAULT for @@workload"
},
{
"comment": "set with DEFAULT - reserved connection",
"query": "set sql_mode = default",
"plan": "VT12001: unsupported: DEFAULT for @@%s%!(EXTRA sqlparser.IdentifierCI=sql_mode)"
},
{
"comment": "Multi shard query using into outfile s3",
"query": "select * from user into outfile s3 'out_file_name'",
"plan": "VT12001: unsupported: INTO on sharded keyspace"
},
{
"comment": "create view with join that cannot be served in each shard separately",
"query": "create view user.view_a as select user_extra.id from user join user_extra",
"plan": "VT12001: unsupported: Complex select queries are not supported in create or alter view statements"
},
{
"comment": "create view with sharded limit",
"query": "create view user.view_a as select id from user order by id limit 10",
"plan": "VT12001: unsupported: Complex select queries are not supported in create or alter view statements"
},
{
"comment": "create view with top level subquery in select",
"query": "create view user.view_a as select a, (select col from user) from unsharded",
"plan": "VT12001: unsupported: Select query does not belong to the same keyspace as the view statement"
},
{
"comment": "create view with sql_calc_found_rows with limit",
"query": "create view user.view_a as select sql_calc_found_rows * from music limit 100",
"plan": "VT12001: unsupported: Complex select queries are not supported in create or alter view statements"
},
{
"comment": "create view with sql_calc_found_rows with group by and having",
"query": "create view user.view_a as select sql_calc_found_rows user_id, count(id) from music group by user_id having count(user_id) = 1 order by user_id limit 2",
"plan": "VT12001: unsupported: Complex select queries are not supported in create or alter view statements"
},
{
"comment": "create view with incompatible keyspaces",
"query": "create view main.view_a as select * from user.user_extra",
"plan": "VT12001: unsupported: Select query does not belong to the same keyspace as the view statement"
},
{
"comment": "outer and inner subquery route reference the same \"uu.id\" name\n# but they refer to different things. The first reference is to the outermost query,\n# and the second reference is to the innermost 'from' subquery.\n# This query will never work as the inner derived table is only selecting one of the column",
"query": "select id2 from user uu where id in (select id from user where id = uu.id and user.col in (select col from (select id from user_extra where user_id = 5) uu where uu.user_id = uu.id))",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "group concat with order by requiring evaluation at vtgate",
"query": "select group_concat(music.name ORDER BY 1 asc SEPARATOR ', ') as `Group Name` from user join user_extra on user.id = user_extra.user_id left join music on user.id = music.id group by user.id;",
"plan": "VT12001: unsupported: cannot evaluate group concat with distinct or order by"
},
{
"comment": "outer and inner subquery route reference the same \"uu.id\" name\n# but they refer to different things. The first reference is to the outermost query,\n# and the second reference is to the innermost 'from' subquery.\n# changed to project all the columns from the derived tables.",
"query": "select id2 from user uu where id in (select id from user where id = uu.id and user.col in (select col from (select col, id, user_id from user_extra where user_id = 5) uu where uu.user_id = uu.id))",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "unsupported with clause in delete statement",
"query": "with x as (select * from user) delete from x",
"plan": "VT12001: unsupported: WITH expression in DELETE statement"
},
{
"comment": "unsupported with clause in update statement",
"query": "with x as (select * from user) update x set name = 'f'",
"plan": "VT12001: unsupported: WITH expression in UPDATE statement"
},
{
"comment": "insert having subquery in row values",
"query": "insert into user(id, name) values ((select 1 from user where id = 1), 'A')",
"plan": "expr cannot be translated, not supported: (select 1 from `user` where id = 1)"
},
{
"comment": "lateral derived tables",
"query": "select * from user, lateral (select * from user_extra where user_id = user.id) t",
"plan": "VT12001: unsupported: lateral derived tables"
},
{
"comment": "json_table expressions",
"query": "SELECT * FROM JSON_TABLE('[ {\"c1\": null} ]','$[*]' COLUMNS( c1 INT PATH '$.c1' ERROR ON ERROR )) as jt",
"plan": "VT12001: unsupported: json_table expressions"
},
{
"comment": "mix lock with other expr",
"query": "select get_lock('xyz', 10), 1 from dual",
"plan": "VT12001: unsupported: LOCK function and other expression: [1] in same select query"
},
{
"comment": "Assignment expression in select statements",
"query": "select @val := 42",
"plan": "VT12001: unsupported: Assignment expression"
},
{
"comment": "Assignment expression in union statements",
"query": "select @val := 42 union select 1",
"plan": "VT12001: unsupported: Assignment expression"
},
{
"comment": "Assignment expression in update statements",
"query": "update user set name = @val := 42",
"plan": "VT12001: unsupported: Assignment expression"
},
{
"comment": "Assignment expression in insert statement",
"query": "insert into user (id) values (@val := 42)",
"plan": "VT12001: unsupported: Assignment expression"
},
{
"comment": "Assignment expression in delete statement",
"query": "delete from user where x = (@val := 42)",
"plan": "VT12001: unsupported: Assignment expression"
},
{
"comment": "explain - routed table with join on different keyspace table",
"query": "explain select 1, second_user.foo.id, foo.col from second_user.foo join user.user join main.unsharded",
"plan": "VT03031: EXPLAIN is only supported for single keyspace"
},
{
"comment": "extremum on input from both sides",
"query": "insert into music(user_id, id) select foo, bar from music on duplicate key update id = id+1",
"plan": "VT12001: unsupported: DML cannot update vindex column"
},
{
"comment": "drop table with incompatible tables",
"query": "drop table user, unsharded_a",
"plan": "VT12001: unsupported: Tables or Views specified in the query do not belong to the same destination"
},
{
"comment": "drop view with incompatible views",
"query": "drop view user, unsharded_a",
"plan": "VT12001: unsupported: Tables or Views specified in the query do not belong to the same destination"
},
{
"comment": "Rename table with different keyspace tables",
"query": "rename table user_extra to b, main.a to b",
"plan": "VT12001: unsupported: Tables or Views specified in the query do not belong to the same destination"
},
{
"comment": "correlated subquery with different keyspace tables involved",
"query": "select id from user where id in (select col from unsharded where col = user.id)",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "select (select col from user where user_extra.id = 4 limit 1) as a from user join user_extra",
"query": "select (select col from user where user_extra.id = 4 limit 1) as a from user join user_extra",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "correlated subquery part of an OR clause",
"query": "select 1 from user u where u.col = 6 or exists (select 1 from user_extra ue where ue.col = u.col and u.col = ue.col2)",
"plan": "VT12001: unsupported: unmergable subquery can not be inside complex expression"
},
{
"comment": "multi-shard union",
"query": "select 1 from music union (select id from user union all select name from unsharded)",
"plan": "VT12001: unsupported: nesting of UNIONs on the right-hand side"
},
{
"comment": "Cross keyspace query with subquery",
"query": "select 1 from user where id = (select id from t1 where user.foo = t1.bar)",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "multi-shard union",
"query": "select 1 from music union (select id from user union select name from unsharded)",
"plan": "VT12001: unsupported: nesting of UNIONs on the right-hand side"
},
{
"comment": "Cannot have more than one aggr(distinct...",
"query": "select count(distinct a), count(distinct b) from user",
"plan": "VT12001: unsupported: only one DISTINCT aggregation is allowed in a SELECT: count(distinct b)"
},
{
"comment": "subqueries not supported in the join condition of outer joins",
"query": "select unsharded_a.col from unsharded_a left join unsharded_b on unsharded_a.col IN (select col from user)",
"plan": "VT12001: unsupported: subquery in outer join predicate"
},
{
"comment": "subquery in ON clause, with left join primitives",
"query": "select unsharded.col from unsharded left join user on user.col in (select col from user)",
"plan": "VT12001: unsupported: subquery in outer join predicate"
},
{
"comment": "select (select 1 from user u having count(ue.col) > 10) from user_extra ue",
"query": "select (select 1 from user u having count(ue.col) > 10) from user_extra ue",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "CTEs cant use a table with the same name as the CTE alias",
"query": "with user as (select aa from user where user.id=1) select ref.col from ref join user",
"plan": "VT12001: unsupported: do not support CTE that use the CTE alias inside the CTE query"
},
{
"comment": "Alias cannot clash with base tables",
"query": "WITH user AS (SELECT col FROM user) SELECT * FROM user",
"plan": "VT12001: unsupported: do not support CTE that use the CTE alias inside the CTE query"
},
{
"comment": "correlated subqueries in select expressions are unsupported",
"query": "SELECT (SELECT sum(user.name) FROM music LIMIT 1) FROM user",
"plan": "VT12001: unsupported: correlated subquery is only supported for EXISTS"
},
{
"comment": "reference table delete with join",
"query": "delete r from user u join ref_with_source r on u.col = r.col",
"plan": "VT12001: unsupported: DELETE on reference table with join"
},
{
"comment": "group_concat unsupported when needs full evaluation at vtgate with more than 1 column",
"query": "select group_concat(user.col1, music.col2) x from user join music on user.col = music.col order by x",
"plan": "VT12001: unsupported: group_concat with more than 1 column"
},
{
"comment": "count aggregation function having multiple column",
"query": "select count(distinct user_id, name) from user",
"plan": "VT12001: unsupported: distinct aggregation function with multiple expressions 'count(distinct user_id, `name`)'"
},
{
"comment": "count and sum distinct on different columns",
"query": "SELECT COUNT(DISTINCT col), SUM(DISTINCT id) FROM user",
"plan": "VT12001: unsupported: only one DISTINCT aggregation is allowed in a SELECT: sum(distinct id)"
},
{
"comment": "Over clause isn't supported in sharded cases",
"query": "SELECT val, CUME_DIST() OVER w, ROW_NUMBER() OVER w, DENSE_RANK() OVER w, PERCENT_RANK() OVER w, RANK() OVER w AS 'cd' FROM user",
"plan": "VT12001: unsupported: OVER CLAUSE with sharded keyspace"
},
{
"comment": "WITH ROLLUP not supported on sharded queries",
"query": "select a, b, c, sum(d) from user group by a, b, c with rollup",
"plan": "VT12001: unsupported: GROUP BY WITH ROLLUP not supported for sharded queries"
},
{
"comment": "SOME/ANY/ALL comparison operator not supported for unsharded queries",
"query": "select 1 from user where foo = SOME (select 1 from user_extra where foo = 1)",
"plan": "VT12001: unsupported: ANY/ALL/SOME comparison operator"
},
{
"comment": "SOME/ANY/ALL comparison operator not supported for unsharded queries",
"query": "select 1 from user where foo = ANY (select 1 from user_extra where foo = 1)",
"plan": "VT12001: unsupported: ANY/ALL/SOME comparison operator"
},
{
"comment": "SOME/ANY/ALL comparison operator not supported for unsharded queries",
"query": "select 1 from user where foo = ALL (select 1 from user_extra where foo = 1)",
"plan": "VT12001: unsupported: ANY/ALL/SOME comparison operator"
}
]