make offset and limit Expr

This commit is contained in:
bit-aloo
2025-08-21 20:07:40 +05:30
parent ea3ab2a9c7
commit 28439efd09

View File

@@ -154,8 +154,8 @@ pub enum Plan {
CompoundSelect {
left: Vec<(SelectPlan, ast::CompoundOperator)>,
right_most: SelectPlan,
limit: Option<isize>,
offset: Option<isize>,
limit: Option<Expr>,
offset: Option<Expr>,
order_by: Option<Vec<(ast::Expr, SortOrder)>>,
},
Delete(DeletePlan),
@@ -292,9 +292,9 @@ pub struct SelectPlan {
/// all the aggregates collected from the result columns, order by, and (TODO) having clauses
pub aggregates: Vec<Aggregate>,
/// limit clause
pub limit: Option<isize>,
pub limit: Option<Expr>,
/// offset clause
pub offset: Option<isize>,
pub offset: Option<Expr>,
/// query contains a constant condition that is always false
pub contains_constant_false_condition: bool,
/// the destination of the resulting rows from this plan.
@@ -378,9 +378,9 @@ pub struct DeletePlan {
/// order by clause
pub order_by: Vec<(Box<ast::Expr>, SortOrder)>,
/// limit clause
pub limit: Option<isize>,
pub limit: Option<Expr>,
/// offset clause
pub offset: Option<isize>,
pub offset: Option<Expr>,
/// query contains a constant condition that is always false
pub contains_constant_false_condition: bool,
/// Indexes that must be updated by the delete operation.
@@ -394,8 +394,8 @@ pub struct UpdatePlan {
pub set_clauses: Vec<(usize, Box<ast::Expr>)>,
pub where_clause: Vec<WhereTerm>,
pub order_by: Vec<(Box<ast::Expr>, SortOrder)>,
pub limit: Option<isize>,
pub offset: Option<isize>,
pub limit: Option<Expr>,
pub offset: Option<Expr>,
// TODO: optional RETURNING clause
pub returning: Option<Vec<ResultSetColumn>>,
// whether the WHERE clause is always false