datafusion-sqlparse/tests
Nickolay Ponomarev 66505ebf9e Don't fail parsing a column definition with unexpected tokens
Since PR https://github.com/ballista-compute/sqlparser-rs/pull/93
`parse_column_def` parses a set of column options in a loop, e.g. given:

```
                  _______ column_def _______
CREATE TABLE foo (bar INT NOT NULL DEFAULT 1, )
                          -------- ---------
                          option 1  option 2
````

it parses column options until it encounters one of the delimiter tokens

First when we only supported `CREATE TABLE`, the set of delimiters that
stopped the parsing used to be `Token::Comma | Token::RParen`.

Then we added support for `ALTER TABLE ADD COLUMN <column_def>`. Turns
out the parser started to bail if the statement ended with a semicolon,
while attempting to parse the semicolon as a column option, as we forgot
to add it to the set of delimiter tokens.

This was recently fixed in https://github.com/ballista-compute/sqlparser-rs/pull/246
by including Token::SemiColon to the list, but it felt wrong to have
to update this list, and to have a common list of delimiters for two
different contexts (CREATE TABLE with parens vs ALTER TABLE ADD COLUMN
without parens).

Also our current approach cannot handle multiple statements NOT
separated by a semicolon, as is common in MS SQL DDL. We don't
explicitly support it in `parse_statements`, but that's a use-case
like to keep in mind nevertheless.
2020-08-10 17:12:33 +03:00
..
queries/tpch Add TPCH reggression tests (#221) 2020-07-14 21:48:07 +02:00
sqlparser_common.rs Don't fail parsing a column definition with unexpected tokens 2020-08-10 17:12:33 +03:00
sqlparser_mssql.rs Add support for MSSQL's SELECT TOP N syntax (#150) 2020-01-12 23:20:48 -05:00
sqlparser_mysql.rs Support identifiers quoted with backticks in the MySQL dialect (#247) 2020-07-30 04:22:29 +03:00
sqlparser_postgres.rs Fix "unused stmt" warning in tests, with default features 2020-07-29 02:08:17 +03:00
sqlparser_regression.rs provide missing license header 2020-07-31 09:01:32 -07:00
sqlparser_sqlite.rs Add SQLite dialect (#248) 2020-07-31 15:09:54 +03:00