mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
fix: ignore non-constants
This commit is contained in:
@@ -805,14 +805,10 @@ impl ProgramBuilder {
|
||||
_ => break 'value None,
|
||||
};
|
||||
|
||||
let Some(default) = default else {
|
||||
let Some(ast::Expr::Literal(ref literal)) = default else {
|
||||
break 'value None;
|
||||
};
|
||||
|
||||
let ast::Expr::Literal(ref literal) = default else {
|
||||
panic!("column added by ALTER TABLE should be constant")
|
||||
};
|
||||
|
||||
Some(match literal {
|
||||
ast::Literal::Numeric(s) => match Numeric::from(s) {
|
||||
Numeric::Null => Value::Null,
|
||||
|
||||
@@ -51,6 +51,10 @@ do_execsql_test_on_specific_db {:memory:} alter-table-add-column-default {
|
||||
|
||||
CREATE INDEX idx ON test (b);
|
||||
SELECT b FROM test WHERE b = 0.1;
|
||||
|
||||
ALTER TABLE test DROP a;
|
||||
SELECT * FROM test;
|
||||
|
||||
} {
|
||||
"1|0.1"
|
||||
"2|0.1"
|
||||
@@ -59,6 +63,10 @@ do_execsql_test_on_specific_db {:memory:} alter-table-add-column-default {
|
||||
"0.1"
|
||||
"0.1"
|
||||
"0.1"
|
||||
|
||||
"0.1"
|
||||
"0.1"
|
||||
"0.1"
|
||||
}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} alter-table-drop-column {
|
||||
|
||||
Reference in New Issue
Block a user