Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up plan building test cases #7057

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions go/vt/vtgate/planbuilder/testdata/union_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 0 additions & 8 deletions go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down