select: fix bug with referring to a mixed-case alias

This commit is contained in:
Jussi Saurio
2025-02-14 16:40:04 +02:00
parent d9f4558255
commit a7300a4e0c
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}