lei-jia-xing opened a new issue, #3037:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/3037

   ### Reproduction
   
   With `sqlparser = "=0.64.0"`:
   
   ```rust
   use sqlparser::{dialect::MySqlDialect, parser::Parser};
   
   fn main() {
       let sql = "CREATE TABLE t (c CHAR(1) BINARY);";
       match Parser::parse_sql(&MySqlDialect {}, sql) {
           Ok(statements) => println!("{statements:?}"),
           Err(error) => println!("{error}"),
       }
   }
   ```
   
   ### Actual behavior
   
   ```text
   sql parser error: Expected: ',' or ')' after column definition, found: 
BINARY at Line: 1, Column: 27
   ```
   
   ### Expected behavior
   
   Parse the column as `CHAR(1)` and preserve its `BINARY` attribute in the 
AST. MySQL 8.0 documents the attribute as shorthand for selecting a binary 
collation. It was deprecated in MySQL 8.0.17 and remains relevant when parsing 
existing SQL.
   
   [MySQL 8.0 string type 
syntax](https://dev.mysql.com/doc/refman/8.0/en/string-type-syntax.html)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to