From 41b7693c1361630360f0f75e572eeb195d714cf8 Mon Sep 17 00:00:00 2001 From: Pavan-Nambi Date: Mon, 13 Oct 2025 19:12:35 +0530 Subject: [PATCH] add test --- testing/orderby.test | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testing/orderby.test b/testing/orderby.test index e173d946b..13ca8c762 100755 --- a/testing/orderby.test +++ b/testing/orderby.test @@ -239,4 +239,13 @@ do_execsql_test_on_specific_db {:memory:} orderby_alias_precedence { INSERT INTO t VALUES (1,200),(2,100); SELECT x AS y, y AS x FROM t ORDER BY x; } {2|100 -1|200} \ No newline at end of file +1|200} + +# https://github.com/tursodatabase/turso/issues/3684 +do_execsql_test_on_specific_db {:memory:} orderby_alias_shadows_column { + CREATE TABLE t(a, b); + INSERT INTO t VALUES (1, 1), (2, 2), (3, 3); + SELECT a, -b AS a FROM t ORDER BY a; +} {3|-3 +2|-2 +1|-1}