mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
Generalize positive tests
This commit is contained in:
parent
6b9925b713
commit
16639bc108
2 changed files with 8 additions and 5 deletions
|
@ -5064,6 +5064,9 @@ fn parse_alter_table_alter_column_type() {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let dialects = all_dialects_where(|d| d.supports_alter_column_type_without_set());
|
||||||
|
dialects.verified_stmt(&format!("{alter_stmt} ALTER COLUMN is_active TYPE TEXT"));
|
||||||
|
|
||||||
let dialects = all_dialects_except(|d| d.supports_alter_column_type_without_set());
|
let dialects = all_dialects_except(|d| d.supports_alter_column_type_without_set());
|
||||||
let res =
|
let res =
|
||||||
dialects.parse_sql_statements(&format!("{alter_stmt} ALTER COLUMN is_active TYPE TEXT"));
|
dialects.parse_sql_statements(&format!("{alter_stmt} ALTER COLUMN is_active TYPE TEXT"));
|
||||||
|
@ -5072,6 +5075,11 @@ fn parse_alter_table_alter_column_type() {
|
||||||
res.unwrap_err()
|
res.unwrap_err()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let dialects = all_dialects_where(|d| d.supports_alter_column_type_using());
|
||||||
|
dialects.verified_stmt(&format!(
|
||||||
|
"{alter_stmt} ALTER COLUMN is_active SET DATA TYPE TEXT USING 'text'"
|
||||||
|
));
|
||||||
|
|
||||||
let dialects = all_dialects_except(|d| d.supports_alter_column_type_using());
|
let dialects = all_dialects_except(|d| d.supports_alter_column_type_using());
|
||||||
let res = dialects.parse_sql_statements(&format!(
|
let res = dialects.parse_sql_statements(&format!(
|
||||||
"{alter_stmt} ALTER COLUMN is_active SET DATA TYPE TEXT USING 'text'"
|
"{alter_stmt} ALTER COLUMN is_active SET DATA TYPE TEXT USING 'text'"
|
||||||
|
|
|
@ -402,8 +402,3 @@ fn parse_extract_single_quotes() {
|
||||||
fn parse_string_literal_backslash_escape() {
|
fn parse_string_literal_backslash_escape() {
|
||||||
redshift().one_statement_parses_to(r#"SELECT 'l\'auto'"#, "SELECT 'l''auto'");
|
redshift().one_statement_parses_to(r#"SELECT 'l\'auto'"#, "SELECT 'l''auto'");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_alter_column_type() {
|
|
||||||
redshift().verified_stmt("ALTER TABLE customers ALTER COLUMN email TYPE TEXT");
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue