mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-07 12:40:22 +00:00
MySQL: Allow optional SIGNED
suffix on integer data types (#1985)
This commit is contained in:
parent
3d2db8c69b
commit
f5f51eb6f1
5 changed files with 83 additions and 0 deletions
|
@ -9848,6 +9848,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::TinyIntUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::TinyInt(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
@ -9864,6 +9867,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::SmallIntUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::SmallInt(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
@ -9872,6 +9878,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::MediumIntUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::MediumInt(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
@ -9880,6 +9889,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::IntUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::Int(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
@ -9909,6 +9921,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::IntegerUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::Integer(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
@ -9917,6 +9932,9 @@ impl<'a> Parser<'a> {
|
|||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::BigIntUnsigned(optional_precision?))
|
||||
} else {
|
||||
if dialect.supports_data_type_signed_suffix() {
|
||||
let _ = self.parse_keyword(Keyword::SIGNED);
|
||||
}
|
||||
Ok(DataType::BigInt(optional_precision?))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue