Changeset: 9fb3c2dad0a7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9fb3c2dad0a7 Modified Files: sql/server/rel_select.c sql/test/miscellaneous/Tests/simple_plans.stable.out sql/test/miscellaneous/Tests/simple_plans.stable.out.single Branch: octbugs Log Message:
Reverting my change. This optimiztion is not allowed eg order by col1, col2, col1 The second col1 ordering is needed diffs (54 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -4224,7 +4224,7 @@ rel_order_by(sql_query *query, sql_rel * if (order->token == SQL_COLUMN || order->token == SQL_IDENT) { symbol *col = order->data.lval->h->data.sym; int direction = order->data.lval->h->next->data.i_val; - sql_exp *e = NULL, *oe = NULL; + sql_exp *e = NULL; assert(order->data.lval->h->next->type == type_int); if ((selection = simple_selection(col)) != NULL) { @@ -4283,8 +4283,7 @@ rel_order_by(sql_query *query, sql_rel * if (!e) return NULL; set_direction(e, direction); - if (!(oe = exps_any_match_same_or_no_alias(exps, e)) || is_ascending(oe) != is_ascending(e) || nulls_last(oe) != nulls_last(e)) - list_append(exps, e); + list_append(exps, e); } else { return sql_error(sql, 02, SQLSTATE(42000) "SELECT: order not of type SQL_COLUMN"); } diff --git a/sql/test/miscellaneous/Tests/simple_plans.stable.out b/sql/test/miscellaneous/Tests/simple_plans.stable.out --- a/sql/test/miscellaneous/Tests/simple_plans.stable.out +++ b/sql/test/miscellaneous/Tests/simple_plans.stable.out @@ -40,10 +40,10 @@ project ( % .plan # table_name % rel # name % clob # type -% 54 # length +% 71 # length project ( | table(sys.myy) [ "myy"."col1", "myy"."col2" ] COUNT -) [ "myy"."col2" ] [ "myy"."col1" NULLS LAST ] +) [ "myy"."col2" ] [ "myy"."col1" NULLS LAST, "myy"."col1" NULLS LAST ] #create table myx (x uuid, y uuid); #plan select * from myx where x in ('1aea00e5db6e0810b554fde31d961965') or y = '1aea00e5db6e0810b554fde31d961965'; % .plan # table_name diff --git a/sql/test/miscellaneous/Tests/simple_plans.stable.out.single b/sql/test/miscellaneous/Tests/simple_plans.stable.out.single --- a/sql/test/miscellaneous/Tests/simple_plans.stable.out.single +++ b/sql/test/miscellaneous/Tests/simple_plans.stable.out.single @@ -40,10 +40,10 @@ project ( % .plan # table_name % rel # name % clob # type -% 54 # length +% 71 # length project ( | table(sys.myy) [ "myy"."col1", "myy"."col2" ] COUNT -) [ "myy"."col2" ] [ "myy"."col1" NULLS LAST ] +) [ "myy"."col2" ] [ "myy"."col1" NULLS LAST, "myy"."col1" NULLS LAST ] #create table myx (x uuid, y uuid); #plan select * from myx where x in ('1aea00e5db6e0810b554fde31d961965') or y = '1aea00e5db6e0810b554fde31d961965'; % .plan # table_name _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list