mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 13:58:15 +00:00
parent
46b7c03788
commit
e951cd5278
5 changed files with 42 additions and 2 deletions
|
@ -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)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue