#625 adding mediumint support (#630)

This commit is contained in:
AugustoFKL 2022-09-28 17:26:17 -03:00 committed by GitHub
parent 46b7c03788
commit e951cd5278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 2 deletions

View file

@ -552,7 +552,7 @@ fn parse_escaped_string() {
#[test]
fn parse_create_table_with_minimum_display_width() {
let sql = "CREATE TABLE foo (bar_tinyint TINYINT(3), bar_smallint SMALLINT(5), bar_int INT(11), bar_bigint BIGINT(20))";
let sql = "CREATE TABLE foo (bar_tinyint TINYINT(3), bar_smallint SMALLINT(5), bar_mediumint MEDIUMINT(6), bar_int INT(11), bar_bigint BIGINT(20))";
match mysql().verified_stmt(sql) {
Statement::CreateTable { name, columns, .. } => {
assert_eq!(name.to_string(), "foo");
@ -570,6 +570,12 @@ fn parse_create_table_with_minimum_display_width() {
collation: None,
options: vec![],
},
ColumnDef {
name: Ident::new("bar_mediumint"),
data_type: DataType::MediumInt(Some(6)),
collation: None,
options: vec![],
},
ColumnDef {
name: Ident::new("bar_int"),
data_type: DataType::Int(Some(11)),
@ -592,7 +598,7 @@ fn parse_create_table_with_minimum_display_width() {
#[test]
fn parse_create_table_unsigned() {
let sql = "CREATE TABLE foo (bar_tinyint TINYINT(3) UNSIGNED, bar_smallint SMALLINT(5) UNSIGNED, bar_int INT(11) UNSIGNED, bar_bigint BIGINT(20) UNSIGNED)";
let sql = "CREATE TABLE foo (bar_tinyint TINYINT(3) UNSIGNED, bar_smallint SMALLINT(5) UNSIGNED, bar_mediumint MEDIUMINT(13) UNSIGNED, bar_int INT(11) UNSIGNED, bar_bigint BIGINT(20) UNSIGNED)";
match mysql().verified_stmt(sql) {
Statement::CreateTable { name, columns, .. } => {
assert_eq!(name.to_string(), "foo");
@ -610,6 +616,12 @@ fn parse_create_table_unsigned() {
collation: None,
options: vec![],
},
ColumnDef {
name: Ident::new("bar_mediumint"),
data_type: DataType::UnsignedMediumInt(Some(13)),
collation: None,
options: vec![],
},
ColumnDef {
name: Ident::new("bar_int"),
data_type: DataType::UnsignedInt(Some(11)),