Changeset: 6aabecbe1486 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6aabecbe1486 Modified Files: sql/server/rel_psm.c sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql Branch: default Log Message:
fixes for bug 6381, ie allow select in if/while constructs approved output diffs (49 lines): diff --git a/sql/server/rel_psm.c b/sql/server/rel_psm.c --- a/sql/server/rel_psm.c +++ b/sql/server/rel_psm.c @@ -241,8 +241,16 @@ rel_psm_while_do( mvc *sql, sql_subtype n = n->next; whilestmts = sequential_block(sql, res, restypelist, n->data.lval, n->next->data.sval, is_func); - if (sql->session->status || !cond || !whilestmts || rel) + if (sql->session->status || !cond || !whilestmts) return NULL; + if (rel) { + sql_exp *er = exp_rel(sql, rel); + list *b = sa_list(sql->sa); + + append(b, er); + append(b, exp_while( sql->sa, cond, whilestmts )); + return exp_rel(sql, rel_psm_block(sql->sa, b)); + } return exp_while( sql->sa, cond, whilestmts ); } return NULL; diff --git a/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err --- a/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err +++ b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err @@ -32,9 +32,11 @@ stderr of test 'aggr_udf_with_more_than_ MAPI = (monetdb) /var/tmp/mtest-31488/.s.monetdb.35710 QUERY = SELECT groupnr, aggr2(value) FROM grouped_ints GROUP BY groupnr; ERROR = !SELECT: no such aggregate 'aggr2' -MAPI = (monetdb) /var/tmp/mtest-58752/.s.monetdb.37612 +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-7242/.s.monetdb.39126 QUERY = SELECT groupnr, aggr2(value, value, value) FROM grouped_ints GROUP BY groupnr; ERROR = !SELECT: no such aggregate 'aggr2' +CODE = 42000 # 16:36:13 > # 16:36:13 > "Done." diff --git a/sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql b/sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql --- a/sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql +++ b/sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql @@ -21,4 +21,7 @@ begin end while; return s; END; -sql>select * from functions where name ='mycounter2'; +select * from functions where name ='mycounter2'; + +drop function mycounter1; +drop function mycounter2; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list