Merge 'select: fix bug with referring to a mixed-case alias' from Jussi Saurio

was running some clickbench queries against limbo and noticed this one

Closes #1006
This commit is contained in:
Pekka Enberg
2025-02-15 10:49:17 +02:00
2 changed files with 6 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ pub fn bind_column_references(
for result_column in result_columns.iter() {
if result_column
.name(referenced_tables)
.map_or(false, |name| name == &normalized_id)
.map_or(false, |name| name.eq_ignore_ascii_case(&normalized_id))
{
*expr = result_column.expr.clone();
return Ok(());

View File

@@ -136,4 +136,8 @@ do_execsql_test order-by-agg-not-mentioned-in-select {
Carolyn|118
Katelyn|40
Erik|88
Collin|15}
Collin|15}
do_execsql_test case-insensitive-alias {
select u.first_name as fF, count(1) > 0 as cC from users u where fF = 'Jamie' group by fF order by cC;
} {Jamie|1}