Support MySQL size variants for BLOB and TEXT columns (#1564)

This commit is contained in:
Michael Victor Zink 2024-11-30 04:55:54 -08:00 committed by GitHub
parent a134910a36
commit 48b0e4db4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 59 additions and 0 deletions

View file

@ -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)");
}