mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 15:04:04 +00:00
Redshift alter column type no set (#1912)
This commit is contained in:
parent
a3398223d7
commit
015caca611
7 changed files with 59 additions and 28 deletions
|
@ -5057,22 +5057,21 @@ fn parse_alter_table_alter_column_type() {
|
|||
AlterColumnOperation::SetDataType {
|
||||
data_type: DataType::Text,
|
||||
using: None,
|
||||
had_set: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
verified_stmt(&format!("{alter_stmt} ALTER COLUMN is_active TYPE TEXT"));
|
||||
|
||||
let dialect = TestedDialects::new(vec![Box::new(GenericDialect {})]);
|
||||
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 res =
|
||||
dialect.parse_sql_statements(&format!("{alter_stmt} ALTER COLUMN is_active TYPE TEXT"));
|
||||
assert_eq!(
|
||||
ParserError::ParserError("Expected: SET/DROP NOT NULL, SET DEFAULT, or SET DATA TYPE after ALTER COLUMN, found: TYPE".to_string()),
|
||||
res.unwrap_err()
|
||||
);
|
||||
|
||||
let res = dialect.parse_sql_statements(&format!(
|
||||
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'"
|
||||
));
|
||||
assert_eq!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue