Skip to content

Commit

Permalink
Merge 'Fix panic when double quoted strings are used for column names…
Browse files Browse the repository at this point in the history
….' 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
  • Loading branch information
penberg committed Jan 28, 2025
2 parents d164ad1 + 61d60cf commit 0eedea0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/translate/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0eedea0

Please sign in to comment.