Skip to content

Commit

Permalink
Fix #212: unsupported expression InList
Browse files Browse the repository at this point in the history
  • Loading branch information
jussisaurio committed Jul 24, 2024
1 parent 40cb4ef commit b33ba2e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
18 changes: 18 additions & 0 deletions core/translate/where_clause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,24 @@ fn introspect_expression_for_cursors(
}
}
}
ast::Expr::InList { lhs, rhs, .. } => {
cursors.extend(introspect_expression_for_cursors(
program,
select,
lhs,
cursor_hint,
)?);
if let Some(rhs_list) = rhs {
for rhs_expr in rhs_list {
cursors.extend(introspect_expression_for_cursors(
program,
select,
rhs_expr,
cursor_hint,
)?);
}
}
}
other => {
anyhow::bail!("Parse error: unsupported expression: {:?}", other);
}
Expand Down
21 changes: 20 additions & 1 deletion testing/cmdlineshell.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl

do_execsql_test schema {
.schema
} {{CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT,
price REAL
);
CREATE TABLE users (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
email TEXT,
phone_number TEXT,
address TEXT,
city TEXT,
state TEXT,
zipcode TEXT,
age INTEGER
);}}

do_execsql_test schema-1 {
.schema users
} {{CREATE TABLE users (
Expand All @@ -25,4 +45,3 @@ do_execsql_test schema-2 {
name TEXT,
price REAL
);}}

0 comments on commit b33ba2e

Please sign in to comment.