Skip to content

Commit

Permalink
Merge pull request #292 from dolthub/nicktobey/collatebinary
Browse files Browse the repository at this point in the history
Parse COLLATE BINARY on individual columns.
  • Loading branch information
nicktobey authored Dec 1, 2023
2 parents d142ec4 + 75ae711 commit 8b522c3
Show file tree
Hide file tree
Showing 3 changed files with 5,590 additions and 5,511 deletions.
33 changes: 30 additions & 3 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2979,6 +2979,36 @@ var (
}, {
input: "create table test (pk varchar(255)) collate utf8_unicode_ci",
output: "create table test (\n\tpk varchar(255)\n) collate utf8_unicode_ci",
}, {
input: "create table test (pk varchar(255) charset binary)",
output: "create table test (\n\tpk varchar(255) character set binary\n)",
}, {
input: "create table test (pk varchar(255) charset utf8mb4)",
output: "create table test (\n\tpk varchar(255) character set utf8mb4\n)",
}, {
input: "create table test (pk varchar(255) character set binary)",
output: "create table test (\n\tpk varchar(255) character set binary\n)",
}, {
input: "create table test (pk varchar(255) character set utf8mb4)",
output: "create table test (\n\tpk varchar(255) character set utf8mb4\n)",
}, {
input: "create table test (pk varchar(255) collate binary)",
output: "create table test (\n\tpk varchar(255) collate binary\n)",
}, {
input: "create table test (pk varchar(255) collate utf8_unicode_ci)",
output: "create table test (\n\tpk varchar(255) collate utf8_unicode_ci\n)",
}, {
input: "create table test (pk varchar(255) charset binary collate binary)",
output: "create table test (\n\tpk varchar(255) character set binary collate binary\n)",
}, {
input: "create table test (pk varchar(255) charset utf8mb4 collate utf8_unicode_ci)",
output: "create table test (\n\tpk varchar(255) character set utf8mb4 collate utf8_unicode_ci\n)",
}, {
input: "create table test (pk varchar(255) character set binary collate binary)",
output: "create table test (\n\tpk varchar(255) character set binary collate binary\n)",
}, {
input: "create table test (pk varchar(255) character set utf8mb4 collate utf8_unicode_ci)",
output: "create table test (\n\tpk varchar(255) character set utf8mb4 collate utf8_unicode_ci\n)",
}, {
input: "select * from current",
output: "select * from `current`",
Expand Down Expand Up @@ -4815,9 +4845,6 @@ func runParseTestCaseWithParserOptions(t *testing.T, tcase parseTest, options Pa
tcase.output = tcase.input
}
tree, err := ParseWithOptions(tcase.input, options)
if err != nil {
panic(tcase.input)
}
require.NoError(t, err)

assertTestcaseOutput(t, tcase, tree)
Expand Down
Loading

0 comments on commit 8b522c3

Please sign in to comment.