diff --git a/go/vt/vtgate/planbuilder/testdata/union_cases.txt b/go/vt/vtgate/planbuilder/testdata/union_cases.txt index 493f68f1d04..97052ea565e 100644 --- a/go/vt/vtgate/planbuilder/testdata/union_cases.txt +++ b/go/vt/vtgate/planbuilder/testdata/union_cases.txt @@ -807,3 +807,11 @@ ] } } + +# ambiguous LIMIT +"select id from user limit 1 union all select id from music limit 1" +"Incorrect usage of UNION and LIMIT - add parens to disambiguate your query (errno 1221) (sqlstate 21000)" + +# different number of columns +"select id, 42 from user where id = 1 union all select id from user where id = 5" +"The used SELECT statements have a different number of columns (errno 1222) (sqlstate 21000) during query: select id, 42 from user where id = 1 union all select id from user where id = 5" diff --git a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt index 063d3332e60..3e2806ba659 100644 --- a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt +++ b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt @@ -346,18 +346,10 @@ "(select 1 from user order by 1 desc) order by 1 asc limit 2" "can't do ORDER BY on top of ORDER BY" -# different number of columns -"select id, 42 from user where id = 1 union all select id from user where id = 5" -"The used SELECT statements have a different number of columns (errno 1222) (sqlstate 21000) during query: select id, 42 from user where id = 1 union all select id from user where id = 5" - # ambiguous ORDER BY "select id from user order by id union all select id from music order by id desc" "Incorrect usage of UNION and ORDER BY - add parens to disambiguate your query (errno 1221) (sqlstate 21000)" -# ambiguous LIMIT -"select id from user limit 1 union all select id from music limit 1" -"Incorrect usage of UNION and LIMIT - add parens to disambiguate your query (errno 1221) (sqlstate 21000)" - # select get_lock with non-dual table "select get_lock('xyz', 10) from user" "get_lock('xyz', 10) allowed only with dual"