mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-10 16:06:22 +00:00
636 Adjusting VARBINARY and BINARY with optional precision (#637)
This commit is contained in:
parent
c2d68255d0
commit
300e28bd85
3 changed files with 22 additions and 10 deletions
|
@ -3404,8 +3404,8 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
Keyword::CLOB => Ok(DataType::Clob(self.parse_precision()?)),
|
||||
Keyword::BINARY => Ok(DataType::Binary(self.parse_precision()?)),
|
||||
Keyword::VARBINARY => Ok(DataType::Varbinary(self.parse_precision()?)),
|
||||
Keyword::BINARY => Ok(DataType::Binary(self.parse_optional_precision()?)),
|
||||
Keyword::VARBINARY => Ok(DataType::Varbinary(self.parse_optional_precision()?)),
|
||||
Keyword::BLOB => Ok(DataType::Blob(self.parse_precision()?)),
|
||||
Keyword::UUID => Ok(DataType::Uuid),
|
||||
Keyword::DATE => Ok(DataType::Date),
|
||||
|
@ -5260,6 +5260,10 @@ mod tests {
|
|||
fn test_parse_data_type() {
|
||||
test_parse_data_type("DOUBLE PRECISION", "DOUBLE PRECISION");
|
||||
test_parse_data_type("DOUBLE", "DOUBLE");
|
||||
test_parse_data_type("VARBINARY", "VARBINARY");
|
||||
test_parse_data_type("VARBINARY(20)", "VARBINARY(20)");
|
||||
test_parse_data_type("BINARY", "BINARY");
|
||||
test_parse_data_type("BINARY(20)", "BINARY(20)");
|
||||
|
||||
fn test_parse_data_type(input: &str, expected: &str) {
|
||||
all_dialects().run_parser_method(input, |parser| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue