mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Support MySQL size variants for BLOB and TEXT columns (#1564)
This commit is contained in:
parent
a134910a36
commit
48b0e4db4e
4 changed files with 59 additions and 0 deletions
|
@ -3014,3 +3014,20 @@ fn parse_bitstring_literal() {
|
|||
))]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_longblob_type() {
|
||||
let sql = "CREATE TABLE foo (bar LONGBLOB)";
|
||||
let stmt = mysql_and_generic().verified_stmt(sql);
|
||||
if let Statement::CreateTable(CreateTable { columns, .. }) = stmt {
|
||||
assert_eq!(columns.len(), 1);
|
||||
assert_eq!(columns[0].data_type, DataType::LongBlob);
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
mysql_and_generic().verified_stmt("CREATE TABLE foo (bar TINYBLOB)");
|
||||
mysql_and_generic().verified_stmt("CREATE TABLE foo (bar MEDIUMBLOB)");
|
||||
mysql_and_generic().verified_stmt("CREATE TABLE foo (bar TINYTEXT)");
|
||||
mysql_and_generic().verified_stmt("CREATE TABLE foo (bar MEDIUMTEXT)");
|
||||
mysql_and_generic().verified_stmt("CREATE TABLE foo (bar LONGTEXT)");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue