Merge 'Fix panic when double quoted strings are used for column names.' from Krishna Vishal

Now:
```sql
limbo> create table t (a,b,c); insert into t (a,b,c) values ("hello", 234, 432);
thread 'main' panicked at core/translate/expr.rs:1621:29:
internal error: entered unreachable code: Id should be resolved to a Column before translation
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
After fix:
```sql
limbo> create table t (a,b,c); insert into t (a,b,c) values ("hello", 234, 432);

  × Parse error: no such column: "hello" - should this be a string literal in single-quotes?

limbo>
```
Closes #800

Reviewed-by: Diego Reis (@diegoreis42)
Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #801
This commit is contained in:
Pekka Enberg
2025-01-28 14:20:58 +02:00

View File

@@ -1626,7 +1626,12 @@ pub fn translate_expr(
}
}
ast::Expr::FunctionCallStar { .. } => todo!(),
ast::Expr::Id(_) => unreachable!("Id should be resolved to a Column before translation"),
ast::Expr::Id(id) => {
crate::bail_parse_error!(
"no such column: {} - should this be a string literal in single-quotes?",
id.0
)
}
ast::Expr::Column {
database: _,
table,