Skip to content

Commit f56983d

Browse files
committed
feat: adding check for unquoted literals in values()
1 parent 06a01c4 commit f56983d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/translate/select.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,15 @@ fn prepare_one_select_plan(
525525

526526
for value_row in values.iter_mut() {
527527
for value in value_row.iter_mut() {
528+
// Before binding, we check for unquoted literals. Sqlite throws an error in this case
529+
if let ast::Expr::Id(id) = value.as_ref() {
530+
if !id.quoted() {
531+
crate::bail_parse_error!(
532+
"Unquoted identifier in VALUES clause: {}",
533+
id.as_str()
534+
);
535+
}
536+
}
528537
bind_and_rewrite_expr(
529538
value,
530539
None,

0 commit comments

Comments
 (0)