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:
Andrey Frolov 2022-06-21 16:32:10 +03:00 committed by GitHub
parent c884fbc388
commit f29ce10a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View file

@ -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) {