mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 13:40:15 +00:00
Distinguish between INT
and INTEGER
types (#525)
* support integer * fmt * Update src/ast/data_type.rs Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
c884fbc388
commit
f29ce10a1a
3 changed files with 23 additions and 5 deletions
|
@ -2859,7 +2859,7 @@ impl<'a> Parser<'a> {
|
|||
Ok(DataType::SmallInt(optional_precision?))
|
||||
}
|
||||
}
|
||||
Keyword::INT | Keyword::INTEGER => {
|
||||
Keyword::INT => {
|
||||
let optional_precision = self.parse_optional_precision();
|
||||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::UnsignedInt(optional_precision?))
|
||||
|
@ -2867,6 +2867,14 @@ impl<'a> Parser<'a> {
|
|||
Ok(DataType::Int(optional_precision?))
|
||||
}
|
||||
}
|
||||
Keyword::INTEGER => {
|
||||
let optional_precision = self.parse_optional_precision();
|
||||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
Ok(DataType::UnsignedInteger(optional_precision?))
|
||||
} else {
|
||||
Ok(DataType::Integer(optional_precision?))
|
||||
}
|
||||
}
|
||||
Keyword::BIGINT => {
|
||||
let optional_precision = self.parse_optional_precision();
|
||||
if self.parse_keyword(Keyword::UNSIGNED) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue