Support DOUBLE data types with precision for Mysql (#1611)

This commit is contained in:
artorias1024 2024-12-20 01:11:39 +08:00 committed by GitHub
parent eae5629fb8
commit c973df35d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 9 deletions

View file

@ -3009,7 +3009,7 @@ fn parse_create_table() {
},
ColumnDef {
name: "lat".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![ColumnOptionDef {
name: None,
@ -3018,7 +3018,7 @@ fn parse_create_table() {
},
ColumnDef {
name: "lng".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![],
},
@ -3198,7 +3198,7 @@ fn parse_create_table_with_constraint_characteristics() {
},
ColumnDef {
name: "lat".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![ColumnOptionDef {
name: None,
@ -3207,7 +3207,7 @@ fn parse_create_table_with_constraint_characteristics() {
},
ColumnDef {
name: "lng".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![],
},
@ -3838,7 +3838,7 @@ fn parse_create_external_table() {
},
ColumnDef {
name: "lat".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![ColumnOptionDef {
name: None,
@ -3847,7 +3847,7 @@ fn parse_create_external_table() {
},
ColumnDef {
name: "lng".into(),
data_type: DataType::Double,
data_type: DataType::Double(ExactNumberInfo::None),
collation: None,
options: vec![],
},

View file

@ -3022,3 +3022,13 @@ fn parse_longblob_type() {
fn parse_begin_without_transaction() {
mysql().verified_stmt("BEGIN");
}
#[test]
fn parse_double_precision() {
mysql().verified_stmt("CREATE TABLE foo (bar DOUBLE)");
mysql().verified_stmt("CREATE TABLE foo (bar DOUBLE(11,0))");
mysql().one_statement_parses_to(
"CREATE TABLE foo (bar DOUBLE(11, 0))",
"CREATE TABLE foo (bar DOUBLE(11,0))",
);
}