Changeset: 98b6553e19db for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/98b6553e19db
Added Files:
sql/test/BugTracker-2026/Tests/8034-orderby-concat.test
Modified Files:
sql/backends/monet5/rel_bin.c
Branch: Dec2025
Log Message:
fixed issue # 8034, ie in case of no reduce directly call exp_bin with both
sides (as they are one relation).
diffs (46 lines):
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1936,7 +1936,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
oldstop = be->mb->stop;
s = NULL;
if (!swapped)
- s = exp_bin(be, n->data, left, NULL,
grp, ext, cnt, NULL, depth+1, 0, push);
+ s = exp_bin(be, n->data, left,
!reduce?right:NULL, grp, ext, cnt, NULL, depth+1, 0, push);
if (!s && right && (first || swapped)) {
clean_mal_statements(be, oldstop,
oldvtop);
s = exp_bin(be, n->data, right, NULL,
grp, ext, cnt, NULL, depth+1, 0, push);
@@ -1959,7 +1959,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
return NULL;
args = e->r;
for (n = args->h; n; n = n->next) {
- s = exp_bin(be, n->data, (swapped ||
!right)?left:right, NULL, grp, ext, cnt, NULL, depth+1, 0, push);
+ s = exp_bin(be, n->data, (swapped ||
!right)?left:right, !reduce?left:NULL, grp, ext, cnt, NULL, depth+1, 0, push);
if (!s)
return s;
list_append(ops, s);
diff --git a/sql/test/BugTracker-2026/Tests/8034-orderby-concat.test
b/sql/test/BugTracker-2026/Tests/8034-orderby-concat.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/8034-orderby-concat.test
@@ -0,0 +1,20 @@
+statement ok
+CREATE TABLE t(s VARCHAR(10))
+
+statement ok
+INSERT INTO t VALUES ('x')
+
+query T nosort
+SELECT CAST(s LIKE s AS VARCHAR(5)) <> (s || s || s) FROM t;
+----
+True
+
+query T nosort
+SELECT CAST(s LIKE s AS VARCHAR(5)) <> (s || s) FROM t ORDER BY s;
+----
+True
+
+query T nosort
+SELECT CAST(s LIKE s AS VARCHAR(5)) <> (s || s || s) FROM t ORDER BY s;
+----
+True
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]