MySQL: Allow optional SIGNED suffix on integer data types (#1985)

This commit is contained in:
Michael Victor Zink 2025-08-01 03:33:43 -07:00 committed by GitHub
parent 3d2db8c69b
commit f5f51eb6f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 83 additions and 0 deletions

View file

@ -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?))
}
}