This commit is contained in:
meteorgan
2025-06-11 23:34:08 +08:00
committed by Jussi Saurio
parent 6179d8de23
commit fd09675d8c
3 changed files with 5 additions and 5 deletions

View File

@@ -37,8 +37,8 @@ impl Display for Plan {
order_by,
} => {
for (plan, operator) in left {
writeln!(f, "{}", operator)?;
plan.fmt(f)?;
writeln!(f, "{}", operator)?;
}
right_most.fmt(f)?;
if let Some(limit) = limit {
@@ -283,7 +283,7 @@ impl ToSqlString for Plan {
let mut ret = Vec::new();
for (plan, operator) in left {
ret.push(format!("{} {}", operator, plan.to_sql_string(context)));
ret.push(format!("{} {}", plan.to_sql_string(context), operator));
}
ret.push(right_most.to_sql_string(context));
if let Some(order_by) = &order_by {

View File

@@ -149,10 +149,10 @@ pub fn prepare_select_plan<'a>(
)?;
}
// Ensure all subplans have same number of result columns
let first_num_result_columns = last.result_columns.len();
// Ensure all subplans have the same number of result columns
let right_most_num_result_columns = last.result_columns.len();
for (plan, operator) in left.iter() {
if plan.result_columns.len() != first_num_result_columns {
if plan.result_columns.len() != right_most_num_result_columns {
crate::bail_parse_error!("SELECTs to the left and right of {} do not have the same number of result columns", operator);
}
}

Binary file not shown.