Changeset: e134609ff6ec for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e134609ff6ec Modified Files: sql/src/server/rel_bin.mx Branch: Jun2010 Log Message:
fix bug in order by with multiple expressions and limit (bug 2634) diffs (21 lines): diff -r 6490d659f543 -r e134609ff6ec sql/src/server/rel_bin.mx --- a/sql/src/server/rel_bin.mx Fri Jul 30 20:08:24 2010 +0200 +++ b/sql/src/server/rel_bin.mx Fri Jul 30 20:09:53 2010 +0200 @@ -1604,6 +1604,17 @@ } stmt_destroy(psub); psub = stmt_list(npl); + + /* also rebuild sub as multiple orderby expressions may use the sub table (ie aren't part of the result columns) */ + pl = sub->op1.lval; + npl = create_stmt_list(); + for ( n=pl->h ; n; n = n->next) { + list_append(npl, + stmt_semijoin(column(stmt_dup(n->data)), + stmt_dup(limit))); + } + stmt_destroy(sub); + sub = stmt_list(npl); } if (need_distinct(rel)) psub = rel2bin_distinct(psub); _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list