sqlite3-parser: box the where clause in Update

This commit is contained in:
Jussi Saurio
2025-02-08 18:08:31 +02:00
parent 7426204204
commit 2a82091cb3
2 changed files with 3 additions and 3 deletions

View File

@@ -256,7 +256,7 @@ pub enum Stmt {
/// `FROM`
from: Option<FromClause>,
/// `WHERE` clause
where_clause: Option<Expr>,
where_clause: Option<Box<Expr>>,
/// `RETURNING`
returning: Option<Vec<ResultColumn>>,
/// `ORDER BY`

View File

@@ -791,14 +791,14 @@ cmd ::= with(C) UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from
where_opt_ret(W) orderby_opt(O) limit_opt(L). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Update { with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause, returning, order_by: O, limit: L });
where_clause: where_clause.map(Box::new), returning, order_by: O, limit: L });
}
%else
cmd ::= with(C) UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from(F)
where_opt_ret(W). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Update { with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause, returning, order_by: None, limit: None });
where_clause: where_clause.map(Box::new), returning, order_by: None, limit: None });
}
%endif