Generalize positive tests

This commit is contained in:
Yoav Cohen 2025-06-29 18:26:46 +02:00
parent 6b9925b713
commit 16639bc108
2 changed files with 8 additions and 5 deletions

View file

@ -5064,6 +5064,9 @@ fn parse_alter_table_alter_column_type() {
_ => 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 res =
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()
);
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 res = dialects.parse_sql_statements(&format!(
"{alter_stmt} ALTER COLUMN is_active SET DATA TYPE TEXT USING 'text'"

View file

@ -402,8 +402,3 @@ fn parse_extract_single_quotes() {
fn parse_string_literal_backslash_escape() {
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");
}