Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
y.output
.idea
28 changes: 28 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,34 @@ func TestCreateTable(t *testing.T) {
" unique by_username3 (username) key_block_size 4\n" +
")",
},
{
// test anonymous key definition
input: "create table t (\n" +
" id int auto_increment,\n" +
" username varchar,\n" +
" email varchar,\n" +
" primary key (id),\n" +
" key (username)\n" +
")",
output: "create table t (\n" +
" id int auto_increment,\n" +
" username varchar,\n" +
" email varchar,\n" +
" primary key (id),\n" +
" key username (username)\n" +
")",
},
{
// test signed col
input: "create table t (\n" +
" id int auto_increment,\n" +
" col_tinyint3_signed tinyint(3) signed\n" +
")",
output: "create table t (\n" +
" id int auto_increment,\n" +
" col_tinyint3_signed tinyint(3)\n" +
")",
},
}
for _, tcase := range testCases {
tree, err := ParseStrictDDL(tcase.input)
Expand Down
Loading