Support tinyint (#320)

* Support tinyint

* Add tests
This commit is contained in:
sundyli 2021-07-17 20:16:38 +08:00 committed by GitHub
parent c5de1225e9
commit e5991f3ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View file

@ -1017,6 +1017,17 @@ fn parse_cast() {
},
expr_from_projection(only(&select.projection))
);
let sql = "SELECT CAST(id AS TINYINT) FROM customer";
let select = verified_only_select(sql);
assert_eq!(
&Expr::Cast {
expr: Box::new(Expr::Identifier(Ident::new("id"))),
data_type: DataType::TinyInt
},
expr_from_projection(only(&select.projection))
);
one_statement_parses_to(
"SELECT CAST(id AS BIGINT) FROM customer",
"SELECT CAST(id AS BIGINT) FROM customer",