MonetDB: default - approved output
Changeset: 1c86bb3c1851 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1c86bb3c1851 Modified Files: sql/test/Dependencies/Tests/dependency_loop.stable.out sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 Branch: default Log Message: approved output diffs (24 lines): diff --git a/sql/test/Dependencies/Tests/dependency_loop.stable.out b/sql/test/Dependencies/Tests/dependency_loop.stable.out --- a/sql/test/Dependencies/Tests/dependency_loop.stable.out +++ b/sql/test/Dependencies/Tests/dependency_loop.stable.out @@ -118,7 +118,7 @@ stdout of test 'dependency_loop` in dire % %1 # name % bigint # type % 3 # length -[ 581 ] +[ 582 ] # 10:37:19 > # 10:37:19 > Done. diff --git a/sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 b/sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 --- a/sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 +++ b/sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 @@ -118,7 +118,7 @@ stdout of test 'dependency_loop` in dire % %1 # name % bigint # type % 3 # length -[ 581 ] +[ 582 ] # 10:37:19 > # 10:37:19 > Done. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - approved output
Changeset: a7729d485113 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7729d485113 Modified Files: sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out Branch: default Log Message: approved output diffs (19 lines): diff --git a/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out b/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out --- a/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out +++ b/sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out @@ -73,6 +73,7 @@ stdout of test 'crash_correlated_subquer [ "sys", 2000, "dependency_functions_on_types",true, 6 ] [ "sys", 2000, "dependency_args_on_types", true, 8 ] [ "sys", 2000, "sessions", true, 9 ] +[ "sys", 2000, "prepared_statements", true, 5 ] [ "sys", 2000, "optimizers", true, 3 ] [ "sys", 2000, "environment", true, 2 ] [ "sys", 2000, "queue",true, 9 ] @@ -126,6 +127,7 @@ stdout of test 'crash_correlated_subquer [ "sys", 2000, "dependency_functions_on_types",true, 6 ] [ "sys", 2000, "dependency_args_on_types", true, 8 ] [ "sys", 2000, "sessions", true, 9 ] +[ "sys", 2000, "prepared_statements", true, 5 ] [ "sys", 2000, "optimizers", true, 3 ] [ "sys", 2000, "environment", true, 2 ] [ "sys", 2000, "queue",true, 9 ] ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - fixed handling of latest sqlsmith-exits probl...
Changeset: 125dacdd084d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=125dacdd084d Modified Files: sql/server/rel_unnest.c sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out sql/test/mergetables/Tests/sqlsmith-exists.stable.out Branch: default Log Message: fixed handling of latest sqlsmith-exits problem (ie right join/semijoin rewrite) diffs (124 lines): diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -1061,7 +1061,6 @@ push_up_join(mvc *sql, sql_rel *rel, lis /* left of rel should be a set */ if (d && is_distinct_set(sql, d, ad) && j && (is_join(j->op) || is_semi(j->op))) { - int crossproduct = 0; sql_rel *jl = j->l, *jr = j->r; /* op_join if F(jl) intersect A(D) = empty -> jl join (D djoin jr) *F(jr) intersect A(D) = empty -> (D djoin jl) join jr @@ -1074,7 +1073,6 @@ push_up_join(mvc *sql, sql_rel *rel, lis rel->r = j = push_up_select_l(sql, j); return rel; /* ie try again */ } - crossproduct = list_empty(j->exps); rd = (j->op != op_full && j->op != op_right)?rel_dependent_var(sql, d, jr):(list*)1; ld = ((j->op == op_join || j->op == op_right))?rel_dependent_var(sql, d, jl):(list*)1; @@ -1135,37 +1133,16 @@ push_up_join(mvc *sql, sql_rel *rel, lis move_join_exps(sql, j, rel); return j; } - if (/* DISABLES CODE */ (0) && !ld && is_left(rel->op) && crossproduct) { - sql_exp *l = exp_atom_int(sql->sa, 1); - sql_exp *r = exp_atom_int(sql->sa, 1); - rel->r = jr; - j->l = rel; - j->r = jl; - - assert(!rel_is_ref(j)); - if (!is_simple_project(jr->op)) - rel->r = jr = rel_project(sql->sa, jr, rel_projections(sql, jr, NULL, 1, 1)); - if (!is_simple_project(jl->op)) - j->r = jl = rel_project(sql->sa, jl, rel_projections(sql, jl, NULL, 1, 1)); - l = exp_label(sql->sa, l, ++sql->label); - r = exp_label(sql->sa, r, ++sql->label); - append(jl->exps, l); - append(jr->exps, r); - l = exp_ref(sql->sa, l); - r = exp_ref(sql->sa, r); - l = exp_compare(sql->sa, r, l, cmp_equal_nil); - j->op = rel->op; - move_join_exps(sql, j, rel); - if (!j->exps) - j->exps = sa_list(sql->sa); - append(j->exps, l); - return j; - } else if (!ld) { + if (!ld) { rel->r = rel_dup(jr); sql_rel *nj = rel_crossproduct(sql->sa, rel_dup(jl), rel, j->op); nj->exps = exps_copy(sql, j->exps); rel_destroy(j); j = nj; + if (is_semi(rel->op)) { + //assert(!is_semi(rel->op)); + rel->op = op_left; + } move_join_exps(sql, j, rel); return j; } diff --git a/sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out b/sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out --- a/sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out +++ b/sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out @@ -49,12 +49,12 @@ stdout of test 'querycache.Bug-3212` in % .%1, .%1 # table_name % query, count # name % clob,int # type -% 78, 1 # length +% 70, 1 # length [ "select * from querycache();", 1 ] -[ "select i, s from qrys where i = 3 and s = \\'new\\';", 1 ] -[ "select i, s from qrys where i = 2 and s = \\'brave\\';",1 ] -[ "select i, s from qrys where i = 1 and s = \\'hello\\';",1 ] -[ "insert into qrys values (1,\\'hello\\'),(2,\\'brave\\'),(3,\\'new\\'),(4,\\'world\\');",1 ] +[ "select i, s from qrys where i = 3 and s = 'new';", 1 ] +[ "select i, s from qrys where i = 2 and s = 'brave';",1
MonetDB: mosaic - Forgot to add test file.
Changeset: ad0f123ef5da for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ad0f123ef5da Added Files: monetdb5/modules/mosaic/Tests/mosaic_dbl_with_nils.mal Branch: mosaic Log Message: Forgot to add test file. diffs (truncated from 3016 to 300 lines): diff --git a/monetdb5/modules/mosaic/Tests/mosaic_dbl_with_nils.mal b/monetdb5/modules/mosaic/Tests/mosaic_dbl_with_nils.mal new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mosaic/Tests/mosaic_dbl_with_nils.mal @@ -0,0 +1,3011 @@ +a:= bat.new(:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.01:dbl); +bat.append(a,9.99:dbl); +bat.append(a,10.02:dbl); +bat.append(a,9.98:dbl); +bat.append(a,10.10:dbl); +bat.append(a,9.90:dbl); +bat.append(a,nil:dbl); +bat.append(a,9.95:dbl); +bat.append(a,10.05:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.01:dbl); +bat.append(a,nil:dbl); +bat.append(a,9.99:dbl); +bat.append(a,10.02:dbl); +bat.append(a,92233720368547758.00:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.01:dbl); +bat.append(a,10.01:dbl); +bat.append(a,10.01:dbl); +bat.append(a,10.01:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,9.98:dbl); +bat.append(a,9.98:dbl); +bat.append(a,9.98:dbl); +bat.append(a,9.98:dbl); +bat.append(a,nil:dbl); +bat.append(a,9.99:dbl); +bat.append(a,9.99:dbl); +bat.append(a,9.99:dbl); +bat.append(a,9.99:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.10:dbl); +bat.append(a,10.10:dbl); +bat.append(a,10.10:dbl); +bat.append(a,10.10:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,nil:dbl); +bat.append(a,9.90:dbl); +bat.append(a,9.90:dbl); +bat.append(a,9.90:dbl); +bat.append(a,9.90:dbl); +bat.append(a,nil:dbl); +bat.append(a,9.95:dbl); +bat.append(a,9.95:dbl); +bat.append(a,9.95:dbl); +bat.append(a,9.95:dbl); +bat.append(a,10.05:dbl); +bat.append(a,10.05:dbl); +bat.append(a,10.05:dbl); +bat.append(a,10.05:dbl); +bat.append(a,9.98:dbl); +bat.append(a,10.10:dbl); +bat.append(a,9.90:dbl); +bat.append(a,9.95:dbl); +bat.append(a,10.05:dbl); +bat.append(a,92233720368547758.00:dbl); +bat.append(a,nil:dbl); +bat.append(a,10.02:dbl); +bat.append(a,10.00:dbl); +bat.append(a,10.01:dbl); +bat.append(a,9.99:dbl); +bat.append(a,10.02:dbl); +bat.append(a,9.98:dbl); +bat.append(a,10.10:dbl); +bat.append(a,9.90:dbl); +bat.append(a,9.95:dbl); +bat.append(a,10.05:dbl); +bat.append(a,10.02:dbl); +mosaic.compress(a,"{compression_type}"); +c:= mosaic.decompress(a); +eq := batcalc.==(a, c, true:bit); +io.print(eq); + +b:= bat.new(:dbl); +bat.append(b,10.00:dbl); +bat.append(b,10.01:dbl); +bat.append(b,9.99:dbl); +bat.append(b,nil:dbl); +bat.append(b,10.03:dbl); +bat.append(b,9.97:dbl); +bat.append(b,10.10:dbl); +bat.append(b,nil:dbl); +bat.append(b,nil:dbl); +bat.append(b,nil:dbl); +bat.append(b,9.91:dbl); +bat.append(b,9.92:dbl); +bat.append(b,9.93:dbl); +bat.append(b,10.00:dbl); + + +#materialized candidate list for column b +mcl_b:= bat.new(:oid); +bat.append(mcl_b,2:oid); +bat.append(mcl_b,4:oid); +bat.append(mcl_b,6:oid); +bat.append(mcl_b,8:oid); +bat.append(mcl_b,10:oid); +bat.append(mcl_b,12:oid); +bat.append(mcl_b,14:oid); +bat.append(mcl_b,16:oid); +bat.append(mcl_b,18:oid); +bat.append(mcl_b,20:oid); + +#dense candidate list for column b +dcl_b := bat.densebat(6:lng); + +#materialized candidate list for columns a/c +mcl_a:= bat.new(:oid); +bat.append(mcl_a,2:oid); +bat.append(mcl_a,4:oid); +bat.append(mcl_a,6:oid); +bat.append(mcl_a,8:oid); +bat.append(mcl_a,10:oid); +bat.append(mcl_a,12:oid); +bat.append(mcl_a,14:oid); +bat.append(mcl_a,16:oid); +bat.append(mcl_a,18:oid); +bat.append(mcl_a,20:oid); +bat.append(mcl_a,22:oid); +bat.append(mcl_a,24:oid); +bat.append(mcl_a,26:oid); +bat.append(mcl_a,28:oid); +bat.append(mcl_a,30:oid); +bat.append(mcl_a,32:oid); +bat.append(mcl_a,34:oid); +bat.append(mcl_a,36:oid); +bat.append(mcl_a,38:oid); +bat.append(mcl_a,40:oid); +bat.append(mcl_a,42:oid); +bat.append(mcl_a,44:oid); +bat.append(mcl_a,46:oid); +bat.append(mcl_a,48:oid); +bat.append(mcl_a,50:oid); +bat.append(mcl_a,52:oid); +bat.append(mcl_a,54:oid); +bat.append(mcl_a,56:oid); +bat.append(mcl_a,58:oid); +bat.append(mcl_a,60:oid); +bat.append(mcl_a,62:oid); +bat.append(mcl_a,64:oid); +bat.append(mcl_a,66:oid); +bat.append(mcl_a,68:oid); + +# partially covering dense set. +dcl_a := bat.densebat(35:lng); + +size_a:lng := aggr.count(a); +# fully covering dense set. +fdcl_a := bat.densebat(size_a); + +# projection with materialized candidate list +tsap:= algebra.projection(mcl_a, a); +tsapc := mosaic.projection(mcl_a, c); +eq := batcalc.==(tsap, tsapc, true:bit); +io.print(eq); + +# projection with dense
MonetDB: default - Approved output
Changeset: ac24a744daad for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac24a744daad Modified Files: sql/test/BugTracker-2019/Tests/date_trunc.stable.out sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out Branch: default Log Message: Approved output diffs (42 lines): diff --git a/sql/test/BugTracker-2019/Tests/date_trunc.stable.out b/sql/test/BugTracker-2019/Tests/date_trunc.stable.out --- a/sql/test/BugTracker-2019/Tests/date_trunc.stable.out +++ b/sql/test/BugTracker-2019/Tests/date_trunc.stable.out @@ -138,7 +138,7 @@ stdout of test 'date_trunc` in directory % %1 # name % timestamp # type % 26 # length -[ 1999-12-31 23:36:00.00 ] +[ 1999-12-31 23:00:00.00 ] #select date_trunc('day', timestamp '1999-12-31 23:59:59.987654'); % . # table_name % %1 # name @@ -162,7 +162,7 @@ stdout of test 'date_trunc` in directory % %1 # name % timestamp # type % 26 # length -[ 1999-04-01 00:00:00.00 ] +[ 1999-10-01 00:00:00.00 ] #select date_trunc('year', timestamp '1999-12-31 23:59:59.987654'); % . # table_name % %1 # name diff --git a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out --- a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out +++ b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out @@ -76,7 +76,7 @@ stdout of test 'date_trunc_bulk` in dire % 26 # length [ 2119-02-17 02:00:00.00 ] [ NULL ] -[ 1999-12-31 23:36:00.00 ] +[ 1999-12-31 23:00:00.00 ] #select date_trunc('day', t) from dt_tmp; % . # table_name % %1 # name @@ -108,7 +108,7 @@ stdout of test 'date_trunc_bulk` in dire % 26 # length [ 2119-01-01 00:00:00.00 ] [ NULL ] -[ 1999-04-01 00:00:00.00 ] +[ 1999-10-01 00:00:00.00 ] #select date_trunc('year', t) from dt_tmp; % . # table_name % %1 # name ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Updated ChangeLog and tests approval
Changeset: 2f7b76be7873 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f7b76be7873 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 sql/ChangeLog sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 sql/test/miscellaneous/Tests/deallocate.sql sql/test/miscellaneous/Tests/deallocate.stable.err sql/test/miscellaneous/Tests/deallocate.stable.out sql/test/sys-schema/Tests/systemfunctions.stable.out sql/test/sys-schema/Tests/systemfunctions.stable.out.int128 Branch: default Log Message: Updated ChangeLog and tests approval diffs (truncated from 509 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -11757,6 +11757,7 @@ stdout of test 'MAL-signatures` in direc [ "sql", "password", "pattern sql.password(user:str):str ", "db_password_wrap;","Return password hash of user" ] [ "sql", "percent_rank", "pattern sql.percent_rank(b:any_1, p:bit, o:bit):dbl ", "SQLpercent_rank;", "return the percentage into the total number of groups for each row"] [ "sql", "prelude", "pattern sql.prelude():void ", "SQLprelude;", "" ] +[ "sql", "prepared_statements", "pattern sql.prepared_statements() (sessionid:bat[:int], user:bat[:str], statementid:bat[:int], statementt:bat[:str], createdd:bat[:timestamp]) ", "SQLsession_prepared_statements;", "Available prepared statements in the current session" ] [ "sql", "prod", "pattern sql.prod(b:bte, s:lng, e:lng):lng ", "SQLprod;", "return the product of groups" ] [ "sql", "prod", "pattern sql.prod(b:dbl, s:lng, e:lng):dbl ", "SQLprod;", "return the product of groups" ] [ "sql", "prod", "pattern sql.prod(b:flt, s:lng, e:lng):dbl ", "SQLprod;", "return the product of groups" ] diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -16163,6 +16163,7 @@ stdout of test 'MAL-signatures` in direc [ "sql", "password", "pattern sql.password(user:str):str ", "db_password_wrap;","Return password hash of user" ] [ "sql", "percent_rank", "pattern sql.percent_rank(b:any_1, p:bit, o:bit):dbl ", "SQLpercent_rank;", "return the percentage into the total number of groups for each row"] [ "sql", "prelude", "pattern sql.prelude():void ", "SQLprelude;", "" ] +[ "sql", "prepared_statements", "pattern sql.prepared_statements() (sessionid:bat[:int], user:bat[:str], statementid:bat[:int], statementt:bat[:str], createdd:bat[:timestamp]) ", "SQLsession_prepared_statements;", "Available prepared statements in the current session" ] [ "sql", "prod", "pattern sql.prod(b:bte, s:lng, e:lng):hge ", "SQLprod;", "return the product of groups" ] [ "sql", "prod", "pattern sql.prod(b:bte, s:lng, e:lng):lng ", "SQLprod;", "return the product of groups" ] [ "sql", "prod", "pattern sql.prod(b:dbl, s:lng, e:lng):dbl ", "SQLprod;", "return the product of groups" ] diff --git a/sql/ChangeLog b/sql/ChangeLog --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -2,9 +2,11 @@ # This file is updated with Maddlog * Fri Dec 13 2019 Pedro Ferreira +- Added sys.prepared_statements view, which depicts the available prepared + statements in the current session. - Added deallocate statements with the syntax 'DEALLOCATE [PREPARE] - { number | ALL }', to close an existing prepared statement or all, - through the SQL layer. Previously this feature was available via MAPI + { number | ALL }', to close an existing prepared statement or all, + through the SQL layer. Previously this feature was available via MAPI exclusively with the "release" command. * Wed Nov 27 2019 Pedro Ferreira diff --git a/sql/test/emptydb/Tests/check.stable.out b/sql/test/emptydb/Tests/check.stable.out --- a/sql/test/emptydb/Tests/check.stable.out +++ b/sql/test/emptydb/Tests/check.stable.out @@ -118,6 +118,7 @@ stdout of test 'check` in directory 'sql \dSv sys.geometry_columns \dSv sys.ids \dSv sys.optimizers +\dSv sys.prepared_statements \dSv sys.querylog_calls \dSv sys.querylog_catalog \dSv sys.querylog_history @@ -217,6 +218,7 @@ stdout of test 'check` in directory 'sql \dSf sys."optimizers" \dSf sys."password_hash" \dSf sys."pause" +\dSf sys."prepared_statements" \dSf sys."quantile" \dSf sys."quantile_avg" \dSf sys."querycache" @@ -436,6 +438,7 @@ SYSTEM VIEW sys.environment SYSTEM VIEW sys.geometry_columns SYSTEM VIEW sys.ids SYSTEM VIEW
MonetDB: default - As per user request, just DEALLOCATE keyword ...
Changeset: f5733b8e8c16 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5733b8e8c16 Modified Files: clients/mapiclient/mclient.c sql/ChangeLog sql/backends/monet5/sql_upgrades.c sql/scripts/51_sys_schema_extension.sql sql/server/sql_parser.y sql/server/sql_scan.c sql/test/miscellaneous/Tests/deallocate.sql Branch: default Log Message: As per user request, just DEALLOCATE keyword will suffice, ie removed DEALLOC abbreviation diffs (120 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2452,7 +2452,7 @@ doFile(Mapi mid, stream *fp, bool useins break; case 'e': case 'E': - /* a bit of a hack for prepare/exec/dealloc + /* a bit of a hack for prepare/exec/deallocate * tests: replace "exec[ute] **" with the * ID of the last prepared statement */ if (mode == SQL && formatter == TESTformatter) { @@ -2470,17 +2470,12 @@ doFile(Mapi mid, stream *fp, bool useins break; case 'd': case 'D': - /* a bit of a hack for prepare/exec/dealloc -* tests: replace "dealloc[ate] **" with the + /* a bit of a hack for prepare/exec/deallocate +* tests: replace "deallocate **" with the * ID of the last prepared statement */ - if (mode == SQL && formatter == TESTformatter) { - if (strncasecmp(line, "dealloc **", 10) == 0) { - line[8] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[9] = prepno % 10 + '0'; - } else if (strncasecmp(line, "deallocate **", 13) == 0) { - line[11] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[12] = prepno % 10 + '0'; - } + if (mode == SQL && formatter == TESTformatter && strncasecmp(line, "deallocate **", 13) == 0) { + line[11] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[12] = prepno % 10 + '0'; } break; case 'q': diff --git a/sql/ChangeLog b/sql/ChangeLog --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -2,7 +2,7 @@ # This file is updated with Maddlog * Fri Dec 13 2019 Pedro Ferreira -- Added deallocate statements with the syntax 'DEALLOC[ATE] [PREPARE] +- Added deallocate statements with the syntax 'DEALLOCATE [PREPARE] { number | ALL }', to close an existing prepared statement or all, through the SQL layer. Previously this feature was available via MAPI exclusively with the "release" command. diff --git a/sql/backends/monet5/sql_upgrades.c b/sql/backends/monet5/sql_upgrades.c --- a/sql/backends/monet5/sql_upgrades.c +++ b/sql/backends/monet5/sql_upgrades.c @@ -2521,7 +2521,7 @@ sql_update_default(Client c, mvc *sql, c pos += snprintf(buf + pos, bufsize - pos, "ALTER TABLE sys.keywords SET READ WRITE;\n" - "insert into sys.keywords values ('CUBE'), ('DEALLOC'), ('DEALLOCATE'), ('GROUPING'), ('ROLLUP'), ('SETS');\n"); + "insert into sys.keywords values ('CUBE'), ('DEALLOCATE'), ('GROUPING'), ('ROLLUP'), ('SETS');\n"); pos += snprintf(buf + pos, bufsize - pos, "commit;\n"); pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", prev_schema); diff --git a/sql/scripts/51_sys_schema_extension.sql b/sql/scripts/51_sys_schema_extension.sql --- a/sql/scripts/51_sys_schema_extension.sql +++ b/sql/scripts/51_sys_schema_extension.sql @@ -60,7 +60,6 @@ INSERT INTO sys.keywords (keyword) VALUE ('CURRENT_TIMESTAMP'), ('CURRENT_USER'), ('DAY'), - ('DEALLOC'), ('DEALLOCATE'), ('DEC'), ('DECIMAL'), diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -694,7 +694,7 @@ SQLCODE SQLERROR UNDER WHENEVER %token CHECK CONSTRAINT CREATE COMMENT NULLS FIRST LAST %token TYPE PROCEDURE FUNCTION sqlLOADER AGGREGATE RETURNS EXTERNAL sqlNAME DECLARE %token CALL LANGUAGE -%token ANALYZE MINMAX SQL_EXPLAIN SQL_PLAN SQL_DEBUG SQL_TRACE PREP PREPARE EXEC EXECUTE DEALLOC DEALLOCATE +%token ANALYZE MINMAX SQL_EXPLAIN SQL_PLAN SQL_DEBUG SQL_TRACE PREP
MonetDB: default - New sqlsmith crash
Changeset: 4e0476c109d0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4e0476c109d0 Modified Files: sql/test/mergetables/Tests/sqlsmith-exists.sql Branch: default Log Message: New sqlsmith crash diffs (97 lines): diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.sql b/sql/test/mergetables/Tests/sqlsmith-exists.sql --- a/sql/test/mergetables/Tests/sqlsmith-exists.sql +++ b/sql/test/mergetables/Tests/sqlsmith-exists.sql @@ -1311,4 +1311,93 @@ where subq_0.c0 is null limit 92; --empty +select + 34 as c0, + ref_7.col1 as c1 +from + (select + cast(nullif(ref_1.bb, + ref_0.col1) as int) as c0, + ref_1.bb as c1, + ref_0.col2 as c2, + ref_1.bb as c3, + ref_0.col2 as c4, + cast(nullif(ref_0.col0, + ref_1.bb) as int) as c5, + ref_0.col1 as c6, + ref_1.bb as c7, + ref_0.col2 as c8, + ref_0.col0 as c9, + ref_1.cc as c10, + ref_0.col0 as c11, + ref_1.aa as c12 + from + tab0 as ref_0 + inner join analytics as ref_1 + on (((ref_1.aa is null) + or ((ref_1.bb is null) + or ((63 is null) + or ((ref_1.bb is not null) + and (false) + or ((ref_0.col0 is not null) + or ((ref_1.aa is not null) + or ((false) + and (exists ( + select + ref_2.i as c0, + ref_2.i as c1, + ref_0.col2 as c2, + ref_2.i as c3, + ref_1.aa as c4, + ref_0.col0 as c5, + ref_2.i as c6 + from + integers as ref_2 + where ref_0.col1 is null))) + or (true)) + or (true)) + and (ref_1.aa is not null)) + or (ref_1.aa is not null) + where exists ( + select + ref_3.col2 as c0, + ref_0.col2 as c1, + ref_0.col1 as c2, + ref_1.aa as c3, + ref_3.col0 as c4, + ref_3.col0 as c5 + from + tab2 as ref_3 + right join analytics as ref_4 + on (((false) + and (ref_1.aa is not null)) + or (ref_4.bb is not null)) + where ref_0.col2 is not null) + limit 183) as subq_0 + right join another_t as ref_5 + right join longtable as ref_6 + inner join longtable as ref_7 + right join tbl_productsales as ref_8 + inner join integers as ref_9 + on (ref_8.col4 = ref_9.i ) + on (ref_9.i is not null) + on ((ref_7.col5 is not null) + and (ref_6.col5 is not null)) + left join (select + ref_10.i as c0, + ref_10.i as c1, + ref_10.i as c2, + ref_10.i as c3, + ref_10.i as c4, + ref_10.i as c5 + from + integers as ref_10 + where 67 is null + limit 151) as subq_1 + on (subq_1.c1 is null) + on (ref_5.col5 = ref_6.col1 ) + on (ref_5.col7 is null) +where ref_7.col8 is not null +limit 151; --empty + ROLLBACK; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Nov2019
Changeset: eba15b5140ae for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eba15b5140ae Removed Files: sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.sql sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.err sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Jira-292.stable.out Modified Files: geom/monetdb5/geom.c geom/monetdb5/geomBulk.c monetdb5/extras/rapi/rapi.c monetdb5/mal/mal_atom.c monetdb5/mal/mal_authorize.c monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_exception.c monetdb5/mal/mal_factory.c monetdb5/mal/mal_import.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_interpreter.c monetdb5/mal/mal_namespace.c monetdb5/mal/mal_parser.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_session.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/blob.c monetdb5/modules/atoms/inet.c monetdb5/modules/atoms/json.c monetdb5/modules/atoms/mtime.c monetdb5/modules/atoms/str.c monetdb5/modules/atoms/streams.c monetdb5/modules/atoms/url.c monetdb5/modules/atoms/uuid.c monetdb5/modules/atoms/xml.c monetdb5/modules/kernel/alarm.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/batcolor.c monetdb5/modules/kernel/batmmath.c monetdb5/modules/kernel/batstr.c monetdb5/modules/kernel/status.c monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/bbp.c monetdb5/modules/mal/calc.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/groupby.c monetdb5/modules/mal/inspect.c monetdb5/modules/mal/iterator.c monetdb5/modules/mal/json_util.c monetdb5/modules/mal/language.c monetdb5/modules/mal/mal_io.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/manual.c monetdb5/modules/mal/mat.c monetdb5/modules/mal/mdb.c monetdb5/modules/mal/mkey.c monetdb5/modules/mal/oltp.c monetdb5/modules/mal/orderidx.c monetdb5/modules/mal/pcre.c monetdb5/modules/mal/projectionpath.c monetdb5/modules/mal/querylog.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/sysmon.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/tokenizer.c monetdb5/modules/mal/txtsim.c monetdb5/modules/mal/wlc.c monetdb5/optimizer/opt_aliases.c monetdb5/optimizer/opt_coercion.c monetdb5/optimizer/opt_commonTerms.c monetdb5/optimizer/opt_constants.c monetdb5/optimizer/opt_dataflow.c monetdb5/optimizer/opt_deadcode.c monetdb5/optimizer/opt_emptybind.c monetdb5/optimizer/opt_evaluate.c monetdb5/optimizer/opt_garbageCollector.c monetdb5/optimizer/opt_generator.c monetdb5/optimizer/opt_jit.c monetdb5/optimizer/opt_json.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_matpack.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_multiplex.c monetdb5/optimizer/opt_oltp.c monetdb5/optimizer/opt_pipes.c monetdb5/optimizer/opt_postfix.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_pushselect.c monetdb5/optimizer/opt_querylog.c monetdb5/optimizer/opt_remap.c monetdb5/optimizer/opt_remoteQueries.c monetdb5/optimizer/opt_reorder.c monetdb5/optimizer/opt_volcano.c monetdb5/optimizer/opt_wlc.c monetdb5/optimizer/opt_wrapper.c monetdb5/scheduler/run_adder.c monetdb5/scheduler/run_memo.c sql/backends/monet5/UDF/capi/capi.c sql/backends/monet5/UDF/pyapi/connection.c sql/backends/monet5/UDF/pyapi/conversion.c sql/backends/monet5/UDF/pyapi/convert_loops.h sql/backends/monet5/UDF/pyapi/formatinput.c sql/backends/monet5/UDF/pyapi/pyapi.c sql/backends/monet5/UDF/pyapi/pyloader.c sql/backends/monet5/UDF/pyapi/type_conversion.c sql/backends/monet5/UDF/udf/udf.c sql/backends/monet5/generator/generator.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql.c sql/backends/monet5/sql_bat2time.c sql/backends/monet5/sql_cast.c sql/backends/monet5/sql_cast_impl_down_from_flt.h sql/backends/monet5/sql_cast_impl_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_cat.c sql/backends/monet5/sql_datetrunc.c sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_fround_impl.h sql/backends/monet5/sql_gencode.c
MonetDB: default - Added table returning function and view "prep...
Changeset: fb5890189fc7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb5890189fc7 Modified Files: sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/backends/monet5/sql.mal sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_session.mal sql/backends/monet5/sql_upgrades.c sql/scripts/22_clients.sql sql/server/sql_qc.c sql/server/sql_qc.h Branch: default Log Message: Added table returning function and view "prepared_statements", which depicts the available session's prepared statements. Some minor notes: - Added "created" field to the query cache struct with the timestamp of the query's creation. - The "codestring" field is no longer escaped, so the prepared statement query can be viewed as raw at the "prepared_statements" view. - Later we can the possibility for the monetdb user to view all the server's prepared statements. However this requires to add authentication to the query cache and a global lock I think. diffs (truncated from 371 to 300 lines): diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c --- a/sql/backends/monet5/sql.c +++ b/sql/backends/monet5/sql.c @@ -5277,3 +5277,85 @@ SQLhot_snapshot(void *ret, const str *ta else throw(SQL, "sql.hot_snapshot", GDK_EXCEPTION); } + +str +SQLsession_prepared_statements(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) +{ + BAT *sessionid, *user, *statementid, *statement, *created; + bat *sid = getArgReference_bat(stk,pci,0); + bat *u = getArgReference_bat(stk,pci,1); + bat *i = getArgReference_bat(stk,pci,2); + bat *s = getArgReference_bat(stk,pci,3); + bat *c = getArgReference_bat(stk,pci,4); + str msg = MAL_SUCCEED, usr; + mvc *sql = NULL; + cq *q = NULL; + + (void) stk; + (void) pci; + if ((msg = getSQLContext(cntxt, mb, , NULL)) != NULL) + return msg; + if ((msg = checkSQLContext(cntxt)) != NULL) + return msg; + + assert(sql->qc); + + sessionid = COLnew(0, TYPE_int, 256, TRANSIENT); + user = COLnew(0, TYPE_str, 256, TRANSIENT); + statementid = COLnew(0, TYPE_int, 256, TRANSIENT); + statement = COLnew(0, TYPE_str, 256, TRANSIENT); + created = COLnew(0, TYPE_timestamp, 256, TRANSIENT); + if (sessionid == NULL || user == NULL || statementid == NULL || statement == NULL || created == NULL) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + + for (q = sql->qc->q; q; q = q->next) { + if (q->prepared) { + gdk_return bun_res; + if (BUNappend(sessionid, &(cntxt->idx), false) != GDK_SUCCEED) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + + msg = AUTHgetUsername(, cntxt); + if (msg != MAL_SUCCEED) + goto bailout; + bun_res = BUNappend(user, usr, false); + GDKfree(usr); + if (bun_res != GDK_SUCCEED) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + + if (BUNappend(statementid, &(q->id), false) != GDK_SUCCEED) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + if (BUNappend(statement, q->codestring, false) != GDK_SUCCEED) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + if (BUNappend(created, &(q->created), false) != GDK_SUCCEED) { + msg = createException(SQL, "sql.session_prepared_statements", SQLSTATE(HY001) MAL_MALLOC_FAIL); + goto bailout; + } + } + } + +bailout: + if (msg) { + BBPreclaim(sessionid); + BBPreclaim(user); + BBPreclaim(statementid); + BBPreclaim(statement); + BBPreclaim(created); + } else { + BBPkeepref(*sid = sessionid->batCacheid); + BBPkeepref(*u = user->batCacheid); + BBPkeepref(*i = statementid->batCacheid); + BBPkeepref(*s = statement->batCacheid); +
MonetDB: default - fixed next sqlsmith problem (order of rewrite...
Changeset: 8997f3730efa for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8997f3730efa Modified Files: monetdb5/optimizer/opt_mergetable.c sql/server/rel_unnest.c sql/test/BugTracker-2019/Tests/All sql/test/mergetables/Tests/sqlsmith-exists.stable.out Branch: default Log Message: fixed next sqlsmith problem (order of rewrites fixed) diffs (72 lines): diff --git a/monetdb5/optimizer/opt_mergetable.c b/monetdb5/optimizer/opt_mergetable.c --- a/monetdb5/optimizer/opt_mergetable.c +++ b/monetdb5/optimizer/opt_mergetable.c @@ -1843,6 +1843,7 @@ OPTmergetableImplementation(Client cntxt } bailout = 1; } + /* if (isTopn(p)) topn_res = getArg(p, 0); diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -2724,8 +2724,8 @@ rel_unnest(mvc *sql, sql_rel *rel) rel = rel_visitor(sql, rel, _or_exp); rel = rel_exp_visitor(sql, rel, _rank); rel = rel_exp_visitor(sql, rel, _anyequal); + rel = rel_exp_visitor(sql, rel, _exists); rel = rel_exp_visitor(sql, rel, _compare); - rel = rel_exp_visitor(sql, rel, _exists); rel = rel_exp_visitor(sql, rel, _ifthenelse); /* add isnull handling */ rel = rel_exp_visitor(sql, rel, _exp_rel); rel = rel_visitor(sql, rel, _join2semi);/* where possible convert anyequal functions into marks */ diff --git a/sql/test/BugTracker-2019/Tests/All b/sql/test/BugTracker-2019/Tests/All --- a/sql/test/BugTracker-2019/Tests/All +++ b/sql/test/BugTracker-2019/Tests/All @@ -56,4 +56,4 @@ cast-interval.Bug-6793 could-not-allocate-space.Bug-6795 HAVE_LIBPY3?python3-udf-modules.Bug-6797 json-text-empty-separator.Bug-6798 -orderby-alias-expr.Bug-6799 +KNOWNFAIL?orderby-alias-expr.Bug-6799 diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out --- a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out +++ b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out @@ -463,6 +463,35 @@ stdout of test 'sqlsmith-exists` in dire % c0, c1 # name % varchar, varchar # type % 0, 0 # length +#select +# subq_0.c1 as c0, +# subq_0.c1 as c1, +# subq_0.c1 as c2, +# cast( +#nullif( +# subq_0.c3, +# cast( +#nullif( +# subq_0.c2, +# case when ( +#(subq_0.c1 is not null) +#and (subq_0.c3 is not null) +# ) +# or ( +#( +# (subq_0.c4 is not null) +# or ( +#( +# ( +#(true) +#or ( +# ( +#exists ( +# select +% ., ., ., ., . # table_name +% c0, c1, c2, c3, c4 # name +% int, int,int,int,int # type +% 1, 1, 1, 1, 1 # length #ROLLBACK; # 19:56:32 > ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Nov2019 - knownfail/feature test
Changeset: 1d68863f3d30 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d68863f3d30 Modified Files: sql/test/BugTracker-2019/Tests/All Branch: Nov2019 Log Message: knownfail/feature test diffs (9 lines): diff --git a/sql/test/BugTracker-2019/Tests/All b/sql/test/BugTracker-2019/Tests/All --- a/sql/test/BugTracker-2019/Tests/All +++ b/sql/test/BugTracker-2019/Tests/All @@ -56,4 +56,4 @@ cast-interval.Bug-6793 could-not-allocate-space.Bug-6795 HAVE_LIBPY3?python3-udf-modules.Bug-6797 json-text-empty-separator.Bug-6798 -orderby-alias-expr.Bug-6799 +KNOWNFAIL?orderby-alias-expr.Bug-6799 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Nov2019 - bailout on sample, the partitioning isn't use...
Changeset: 8147abdf81ae for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8147abdf81ae Modified Files: monetdb5/optimizer/opt_mergetable.c Branch: Nov2019 Log Message: bailout on sample, the partitioning isn't usefull and was incorrect diffs (13 lines): diff --git a/monetdb5/optimizer/opt_mergetable.c b/monetdb5/optimizer/opt_mergetable.c --- a/monetdb5/optimizer/opt_mergetable.c +++ b/monetdb5/optimizer/opt_mergetable.c @@ -1847,6 +1847,9 @@ OPTmergetableImplementation(Client cntxt #endif bailout = 1; } + if (isSample(p)) { + bailout = 1; + } /* if (isTopn(p)) topn_res = getArg(p, 0); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Nov2019 - Use SQL state HY013 for server side memory al...
Changeset: c326d82643e6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c326d82643e6 Modified Files: geom/monetdb5/geom.c geom/monetdb5/geomBulk.c monetdb5/extras/rapi/rapi.c monetdb5/mal/mal_atom.c monetdb5/mal/mal_authorize.c monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_exception.c monetdb5/mal/mal_factory.c monetdb5/mal/mal_import.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_interpreter.c monetdb5/mal/mal_namespace.c monetdb5/mal/mal_parser.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_session.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/blob.c monetdb5/modules/atoms/inet.c monetdb5/modules/atoms/json.c monetdb5/modules/atoms/mtime.c monetdb5/modules/atoms/str.c monetdb5/modules/atoms/streams.c monetdb5/modules/atoms/url.c monetdb5/modules/atoms/uuid.c monetdb5/modules/atoms/xml.c monetdb5/modules/kernel/alarm.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/batcolor.c monetdb5/modules/kernel/batmmath.c monetdb5/modules/kernel/batstr.c monetdb5/modules/kernel/status.c monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/bbp.c monetdb5/modules/mal/calc.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/groupby.c monetdb5/modules/mal/inspect.c monetdb5/modules/mal/iterator.c monetdb5/modules/mal/json_util.c monetdb5/modules/mal/language.c monetdb5/modules/mal/mal_io.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/manual.c monetdb5/modules/mal/mat.c monetdb5/modules/mal/mdb.c monetdb5/modules/mal/mkey.c monetdb5/modules/mal/oltp.c monetdb5/modules/mal/orderidx.c monetdb5/modules/mal/pcre.c monetdb5/modules/mal/projectionpath.c monetdb5/modules/mal/querylog.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/sysmon.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/tokenizer.c monetdb5/modules/mal/txtsim.c monetdb5/modules/mal/wlc.c monetdb5/optimizer/opt_aliases.c monetdb5/optimizer/opt_coercion.c monetdb5/optimizer/opt_commonTerms.c monetdb5/optimizer/opt_constants.c monetdb5/optimizer/opt_dataflow.c monetdb5/optimizer/opt_deadcode.c monetdb5/optimizer/opt_emptybind.c monetdb5/optimizer/opt_evaluate.c monetdb5/optimizer/opt_garbageCollector.c monetdb5/optimizer/opt_generator.c monetdb5/optimizer/opt_jit.c monetdb5/optimizer/opt_json.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_matpack.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_multiplex.c monetdb5/optimizer/opt_oltp.c monetdb5/optimizer/opt_pipes.c monetdb5/optimizer/opt_postfix.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_pushselect.c monetdb5/optimizer/opt_querylog.c monetdb5/optimizer/opt_remap.c monetdb5/optimizer/opt_remoteQueries.c monetdb5/optimizer/opt_reorder.c monetdb5/optimizer/opt_volcano.c monetdb5/optimizer/opt_wlc.c monetdb5/optimizer/opt_wrapper.c monetdb5/scheduler/run_adder.c monetdb5/scheduler/run_memo.c sql/backends/monet5/UDF/capi/capi.c sql/backends/monet5/UDF/pyapi/connection.c sql/backends/monet5/UDF/pyapi/conversion.c sql/backends/monet5/UDF/pyapi/convert_loops.h sql/backends/monet5/UDF/pyapi/formatinput.c sql/backends/monet5/UDF/pyapi/pyapi.c sql/backends/monet5/UDF/pyapi/pyloader.c sql/backends/monet5/UDF/pyapi/type_conversion.c sql/backends/monet5/UDF/udf/udf.c sql/backends/monet5/generator/generator.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql.c sql/backends/monet5/sql_bat2time.c sql/backends/monet5/sql_cast.c sql/backends/monet5/sql_cast_impl_down_from_flt.h sql/backends/monet5/sql_cast_impl_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_cat.c sql/backends/monet5/sql_datetrunc.c sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_fround_impl.h sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_rank.c sql/backends/monet5/sql_result.c sql/backends/monet5/sql_round_impl.h sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_statistics.c sql/backends/monet5/sql_subquery.c sql/backends/monet5/sql_transaction.c
MonetDB: gdk_tracer - Merge with default
Changeset: 3305f108809f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3305f108809f Added Files: sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.sql sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.err sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.out sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.sql sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.err sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.out sql/test/miscellaneous/Tests/deallocate.sql sql/test/miscellaneous/Tests/deallocate.stable.err sql/test/miscellaneous/Tests/deallocate.stable.out Modified Files: .hgtags MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/mapiclient/ReadlineTools.c clients/mapiclient/mclient.c clients/mapiclient/mhelp.c clients/mapilib/mapi.rc clients/odbc/driver/ODBCConvert.c clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag debian/changelog gdk/libbat.rc geom/monetdb5/geom.c libversions monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_instruction.h monetdb5/mal/mal_listing.c monetdb5/mal/mal_module.c monetdb5/mal/mal_parser.c monetdb5/modules/mal/orderidx.c monetdb5/optimizer/opt_aliases.c monetdb5/optimizer/opt_candidates.c monetdb5/optimizer/opt_coercion.c monetdb5/optimizer/opt_commonTerms.c monetdb5/optimizer/opt_constants.c monetdb5/optimizer/opt_costModel.c monetdb5/optimizer/opt_dataflow.c monetdb5/optimizer/opt_deadcode.c monetdb5/optimizer/opt_emptybind.c monetdb5/optimizer/opt_evaluate.c monetdb5/optimizer/opt_garbageCollector.c monetdb5/optimizer/opt_generator.c monetdb5/optimizer/opt_inline.c monetdb5/optimizer/opt_jit.c monetdb5/optimizer/opt_json.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_matpack.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_multiplex.c monetdb5/optimizer/opt_oltp.c monetdb5/optimizer/opt_postfix.c monetdb5/optimizer/opt_profiler.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_pushselect.c monetdb5/optimizer/opt_querylog.c monetdb5/optimizer/opt_reduce.c monetdb5/optimizer/opt_remap.c monetdb5/optimizer/opt_remoteQueries.c monetdb5/optimizer/opt_reorder.c monetdb5/optimizer/opt_volcano.c monetdb5/optimizer/opt_wlc.c monetdb5/tools/libmonetdb5.rc sql/ChangeLog sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_upgrades.c sql/include/sql_relation.h sql/scripts/51_sys_schema_extension.sql sql/server/rel_unnest.c sql/server/sql_mvc.c sql/server/sql_mvc.h sql/server/sql_parser.y sql/server/sql_qc.c sql/server/sql_qc.h sql/server/sql_scan.c sql/test/BugTracker-2019/Tests/All sql/test/BugTracker-2019/Tests/date_trunc.sql sql/test/BugTracker-2019/Tests/date_trunc.stable.out sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out sql/test/mergetables/Tests/sqlsmith-exists.sql sql/test/mergetables/Tests/sqlsmith-exists.stable.out sql/test/miscellaneous/Tests/All vertoo.data Branch: gdk_tracer Log Message: Merge with default diffs (truncated from 3640 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -742,3 +742,5 @@ 90486f8f87ff0602f3ab143c629ba0aed2153d64 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_3 90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_release +fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_5 +fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -114,7 +114,7 @@ Group: Applications/Databases License: MPLv2.0 URL: https://www.monetdb.org/ BugURL: https://bugs.monetdb.org/ -Source: https://www.monetdb.org/downloads/sources/Nov2019/%{name}-%{version}.tar.bz2 +Source: https://www.monetdb.org/downloads/sources/Nov2019-SP1/%{name}-%{version}.tar.bz2 # we need systemd for the _unitdir macro to exist # we need checkpolicy and selinux-policy-devel for the SELinux policy @@ -1061,6 +1061,27 @@ fi %postun -p /sbin/ldconfig %changelog +* Thu Dec 12 2019 Sjoerd Mullender - 11.35.5-20191212 +- Rebuilt. +- BZ#6723: columns aliases duplicates should not be
MonetDB: default - dealloc is not an officially reserved word
Changeset: 59cb9b5d6234 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=59cb9b5d6234 Modified Files: sql/server/sql_parser.y Branch: default Log Message: dealloc is not an officially reserved word diffs (19 lines): diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -5732,7 +5732,6 @@ non_reserved_word: | COLUMN { $$ = sa_strdup(SA, "column"); } /* sloppy: officially reserved */ | CYCLE{ $$ = sa_strdup(SA, "cycle"); }/* sloppy: officially reserved */ | sqlDATE { $$ = sa_strdup(SA, "date"); } /* sloppy: officially reserved */ -| DEALLOC { $$ = sa_strdup(SA, "dealloc"); } /* sloppy: officially reserved */ | DEALLOCATE { $$ = sa_strdup(SA, "deallocate"); } /* sloppy: officially reserved */ | DISTINCT { $$ = sa_strdup(SA, "distinct"); } /* sloppy: officially reserved */ | EXEC { $$ = sa_strdup(SA, "exec"); } /* sloppy: officially reserved */ @@ -5762,6 +5761,7 @@ non_reserved_word: | CLIENT { $$ = sa_strdup(SA, "client"); } | COMMENT { $$ = sa_strdup(SA, "comment"); } | DATA { $$ = sa_strdup(SA, "data"); } +| DEALLOC { $$ = sa_strdup(SA, "dealloc"); } | DECADE { $$ = sa_strdup(SA, "decade"); } | SQL_DEBUG{ $$ = sa_strdup(SA, "debug"); } | DIAGNOSTICS { $$ = sa_strdup(SA, "diagnostics"); } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Updated ChangeLog and updated test
Changeset: cf9bf545606d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cf9bf545606d Modified Files: sql/ChangeLog sql/test/miscellaneous/Tests/deallocate.sql sql/test/miscellaneous/Tests/deallocate.stable.err Branch: default Log Message: Updated ChangeLog and updated test diffs (57 lines): diff --git a/sql/ChangeLog b/sql/ChangeLog --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog file for sql # This file is updated with Maddlog +* Fri Dec 13 2019 Pedro Ferreira +- Added deallocate statements with the syntax 'DEALLOC[ATE] [PREPARE] + { number | ALL }', to close an existing prepared statement or all, + through the SQL layer. Previously this feature was available via MAPI + exclusively with the "release" command. + * Wed Nov 27 2019 Pedro Ferreira - Implemented ROLLUP, CUBE and GROUPING SETS from SQL:1999. They define grouping subsets used at GROUP BY clause in order to compute partial diff --git a/sql/test/miscellaneous/Tests/deallocate.sql b/sql/test/miscellaneous/Tests/deallocate.sql --- a/sql/test/miscellaneous/Tests/deallocate.sql +++ b/sql/test/miscellaneous/Tests/deallocate.sql @@ -1,10 +1,13 @@ prepare select "system" or ? from _tables WHERE false; - EXEC **(false); dealloc **; exec **(false); --error, the last prepared statement, no longer exists; +DEALLOCATE **; --error, last prepared statement already closed prepare select "system" or ? from _tables WHERE false; execute **(false); DEALLOCATE prepare all; EXECUTE **(false); --error, the last prepared statement, no longer exists; + +DEALLOCATE 10; --error, it doesn't exist +DEALLOCATE ALL; diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.err b/sql/test/miscellaneous/Tests/deallocate.stable.err --- a/sql/test/miscellaneous/Tests/deallocate.stable.err +++ b/sql/test/miscellaneous/Tests/deallocate.stable.err @@ -30,10 +30,18 @@ MAPI = (monetdb) /var/tmp/mtest-170269/ QUERY = exec 3(false); --error, the last prepared statement, no longer exists; ERROR = !No prepared statement with id: 3 CODE = 07003 -MAPI = (monetdb) /var/tmp/mtest-170269/.s.monetdb.35105 +MAPI = (monetdb) /var/tmp/mtest-174632/.s.monetdb.34143 +QUERY = DEALLOCATE 3; --error, last prepared statement already closed +ERROR = !No prepared statement with id: 3 +CODE = 07003 +MAPI = (monetdb) /var/tmp/mtest-174156/.s.monetdb.39989 QUERY = EXECUTE 5(false); --error, the last prepared statement, no longer exists; ERROR = !No prepared statement with id: 5 CODE = 07003 +MAPI = (monetdb) /var/tmp/mtest-175193/.s.monetdb.31597 +QUERY = DEALLOCATE 10; --error, it doesn't exist +ERROR = !No prepared statement with id: 10 +CODE = 07003 # 13:56:29 > # 13:56:29 > "Done." ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Cleanup of (very) old debugging code. Debuggi...
Changeset: 2fd92ee233b0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2fd92ee233b0 Modified Files: monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_interpreter.h monetdb5/mal/mal_listing.c monetdb5/mal/mal_module.c monetdb5/optimizer/opt_aliases.c monetdb5/optimizer/opt_candidates.c monetdb5/optimizer/opt_coercion.c monetdb5/optimizer/opt_commonTerms.c monetdb5/optimizer/opt_constants.c monetdb5/optimizer/opt_costModel.c monetdb5/optimizer/opt_dataflow.c monetdb5/optimizer/opt_deadcode.c monetdb5/optimizer/opt_emptybind.c monetdb5/optimizer/opt_evaluate.c monetdb5/optimizer/opt_garbageCollector.c monetdb5/optimizer/opt_generator.c monetdb5/optimizer/opt_inline.c monetdb5/optimizer/opt_jit.c monetdb5/optimizer/opt_json.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_matpack.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_multiplex.c monetdb5/optimizer/opt_oltp.c monetdb5/optimizer/opt_postfix.c monetdb5/optimizer/opt_profiler.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_pushselect.c monetdb5/optimizer/opt_querylog.c monetdb5/optimizer/opt_reduce.c monetdb5/optimizer/opt_remap.c monetdb5/optimizer/opt_remoteQueries.c monetdb5/optimizer/opt_reorder.c monetdb5/optimizer/opt_volcano.c monetdb5/optimizer/opt_wlc.c Branch: default Log Message: Cleanup of (very) old debugging code. Debugging the optimizers can be doen with the DEBUG sqlstmt, whereafter the results are available in the mal block history. diffs (truncated from 1405 to 300 lines): diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c --- a/monetdb5/mal/mal_dataflow.c +++ b/monetdb5/mal/mal_dataflow.c @@ -798,11 +798,6 @@ runMALdataflow(Client cntxt, MalBlkPtr m bit *ret; int i; -#ifdef DEBUG_FLOW - fprintf(stderr, "#runMALdataflow for block %d - %d\n", startpc, stoppc); - fprintFunction(stderr, mb, 0, LIST_ALL); -#endif - /* in debugging mode we should not start multiple threads */ if (stk == NULL) throw(MAL, "dataflow", "runMALdataflow(): Called with stk == NULL"); diff --git a/monetdb5/mal/mal_interpreter.h b/monetdb5/mal/mal_interpreter.h --- a/monetdb5/mal/mal_interpreter.h +++ b/monetdb5/mal/mal_interpreter.h @@ -23,8 +23,6 @@ * to be passed by a handle. */ -/* #define DEBUG_FLOW */ - mal_export MalStkPtr prepareMALstack(MalBlkPtr mb, int size); mal_export str runMAL(Client c, MalBlkPtr mb, MalBlkPtr mbcaller, MalStkPtr env); mal_export str runMALsequence(Client cntxt, MalBlkPtr mb, int startpc, int stoppc, MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller); diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c --- a/monetdb5/mal/mal_listing.c +++ b/monetdb5/mal/mal_listing.c @@ -582,9 +582,6 @@ mal2str(MalBlkPtr mb, int first, int las txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), LIST_MAL_NAME | LIST_MAL_TYPE | LIST_MAL_PROPS); else txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), LIST_MAL_CALL | LIST_MAL_PROPS | LIST_MAL_REMOTE); -#ifdef _DEBUG_LISTING_ - fprintf(stderr,"%s\n",txt[i]); -#endif if ( txt[i]) totlen += len[i] = strlen(txt[i]); diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c --- a/monetdb5/mal/mal_module.c +++ b/monetdb5/mal/mal_module.c @@ -29,7 +29,6 @@ * * All modules are persistent during a server session */ -/* #define _DEBUG_MODULE_*/ #define MODULE_HASH_SIZE 1024 Module moduleIndex[MODULE_HASH_SIZE] = { NULL }; @@ -71,9 +70,6 @@ mal_module_reset(void) int i; Module m; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#et the globale module structure \n"); -#endif for(i = 0; i < MODULE_HASH_SIZE; i++) { m= moduleIndex[i]; moduleIndex[i] = 0; @@ -163,9 +159,6 @@ Module globalModule(str nme) // Global modules are not named 'user' assert (strcmp(nme, "user")); -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#create new global module %s\n",nme); -#endif nme = putName(nme); cur = (Module) GDKzalloc(sizeof(ModuleRecord)); if (cur == NULL) @@ -223,9 +216,6 @@ static void freeSubScope(Module scope) if (scope->space == NULL) return; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#freeSubScope %s \n", scope->name); -#endif for(i = 0; i < MAXSCOPE; i++) { if( scope->space[i]){ s= scope->space[i]; @@ -253,9 +243,6 @@ void freeModule(Module m) (void)ret; } } -#ifdef _DEBUG_MODULE_
MonetDB: default - Fixed mclient TESTformatter cases and test ap...
Changeset: 2ec5b40f8549 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2ec5b40f8549 Added Files: sql/test/miscellaneous/Tests/deallocate.sql sql/test/miscellaneous/Tests/deallocate.stable.err sql/test/miscellaneous/Tests/deallocate.stable.out Modified Files: clients/mapiclient/mclient.c Branch: default Log Message: Fixed mclient TESTformatter cases and test approval diffs (202 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2455,12 +2455,14 @@ doFile(Mapi mid, stream *fp, bool useins /* a bit of a hack for prepare/exec/dealloc * tests: replace "exec[ute] **" with the * ID of the last prepared statement */ - if (mode == SQL && - formatter == TESTformatter && - (strncasecmp(line, "exec **", 7) == 0 || -strncasecmp(line, "execute **", 10) == 0)) { - line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[6] = prepno % 10 + '0'; + if (mode == SQL && formatter == TESTformatter) { + if (strncasecmp(line, "exec **", 7) == 0) { + line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[6] = prepno % 10 + '0'; + } else if (strncasecmp(line, "execute **", 10) == 0) { + line[8] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[9] = prepno % 10 + '0'; + } } if (strncasecmp(line, "exit\n", 5) == 0) { goto bailout; @@ -2471,12 +2473,14 @@ doFile(Mapi mid, stream *fp, bool useins /* a bit of a hack for prepare/exec/dealloc * tests: replace "dealloc[ate] **" with the * ID of the last prepared statement */ - if (mode == SQL && - formatter == TESTformatter && - (strncasecmp(line, "dealloc **", 10) == 0 || -strncasecmp(line, "deallocate **", 13) == 0)) { - line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; - line[6] = prepno % 10 + '0'; + if (mode == SQL && formatter == TESTformatter) { + if (strncasecmp(line, "dealloc **", 10) == 0) { + line[8] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[9] = prepno % 10 + '0'; + } else if (strncasecmp(line, "deallocate **", 13) == 0) { + line[11] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[12] = prepno % 10 + '0'; + } } break; case 'q': diff --git a/sql/test/miscellaneous/Tests/deallocate.sql b/sql/test/miscellaneous/Tests/deallocate.sql new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/deallocate.sql @@ -0,0 +1,10 @@ +prepare select "system" or ? from _tables WHERE false; + +EXEC **(false); +dealloc **; +exec **(false); --error, the last prepared statement, no longer exists; + +prepare select "system" or ? from _tables WHERE false; +execute **(false); +DEALLOCATE prepare all; +EXECUTE **(false); --error, the last prepared statement, no longer exists; diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.err b/sql/test/miscellaneous/Tests/deallocate.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/deallocate.stable.err @@ -0,0 +1,41 @@ +stderr of test 'deallocate` in directory 'sql/test/miscellaneous` itself: + + +# 13:56:29 > +# 13:56:29 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35105" "--set" "mapi_usock=/var/tmp/mtest-170269/.s.monetdb.35105" "--forcemito" "--dbpath=/home/ferreira/repositories/MonetDB-default/BUILD/var/MonetDB/mTests_sql_test_miscellaneous" "--set" "embedded_c=true" +# 13:56:29 > + +# builtin opt gdk_dbpath = /home/ferreira/repositories/MonetDB-default/BUILD/var/monetdb5/dbfarm/demo +# builtin opt mapi_port = 5 +#
MonetDB: default - New sqlsmith crash
Changeset: f5fc90a5a19b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5fc90a5a19b Modified Files: sql/test/mergetables/Tests/sqlsmith-exists.sql Branch: default Log Message: New sqlsmith crash diffs (151 lines): diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.sql b/sql/test/mergetables/Tests/sqlsmith-exists.sql --- a/sql/test/mergetables/Tests/sqlsmith-exists.sql +++ b/sql/test/mergetables/Tests/sqlsmith-exists.sql @@ -1168,4 +1168,147 @@ SELECT ) ; --empty +select + subq_0.c1 as c0, + subq_0.c1 as c1, + subq_0.c1 as c2, + cast( +nullif( + subq_0.c3, + cast( +nullif( + subq_0.c2, + case when ( +(subq_0.c1 is not null) +and (subq_0.c3 is not null) + ) + or ( +( + (subq_0.c4 is not null) + or ( +( + ( +(true) +or ( + ( +exists ( + select +ref_5.bb as c0, +ref_5.aa as c1 + from +analytics as ref_5 + where +true +) + ) + and ( +(false) +or ( + (false) + and ( +(75 is null) +and ( + ( +(true) +and ( + (true) + and (subq_0.c1 is not null) +) + ) + or (subq_0.c3 is null) +) + ) +) + ) +) + ) + or ( +(false) +or ( + exists ( +select + subq_0.c1 as c0, + 32 as c1, + subq_0.c2 as c2, + ref_6.col7 as c3, + subq_0.c0 as c4, + ref_6.col7 as c5, + subq_0.c1 as c6 +from + longtable as ref_6 +where + ( +( + (false) + and (ref_6.col8 is not null) +) +or (ref_6.col8 is null) + ) + and (subq_0.c3 is null) + ) +) + ) +) +and (false) + ) +) +or ( + (subq_0.c3 is null) + or (subq_0.c2 is null) +) + ) then subq_0.c1 else subq_0.c1 end +) as int + ) +) as int + ) as c3, + subq_0.c0 as c4 +from + ( +select + ref_4.aa as c0, + ref_1.col0 as c1, + ref_2.col1 as c2, + ref_2.col2 as c3, + ref_2.col0 as c4 +from + tbl_productsales as ref_0 + inner join tab2 as ref_1 on ( +(false) +or (false) + ) + right join tab0 as ref_2 on ( +( + exists ( +select + ref_2.col2 as c0, + ref_0.col6 as c1, + ref_3.i as c2, + ref_1.col1 as c3, + ref_1.col0 as c4, + ref_2.col0 as c5, + ref_3.i as c6, + ref_0.col3 as c7 +from + integers as ref_3 +where + (true) + or ( +(ref_3.i is not null) +or (true) + ) + ) +) +and (false) + ) + inner join analytics as ref_4 on (ref_4.bb is null) +where + (ref_1.col1 is not null) + or (true) +limit + 76 + ) as subq_0 +where + subq_0.c0 is null +limit 92; --empty + ROLLBACK; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Added missing TESTformatter cases to mclient
Changeset: 2a3455d719f4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2a3455d719f4 Modified Files: clients/mapiclient/mclient.c Branch: default Log Message: Added missing TESTformatter cases to mclient diffs (48 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2451,22 +2451,37 @@ doFile(Mapi mid, stream *fp, bool useins case '\0': break; case 'e': - /* a bit of a hack for prepare/exec -* tests: replace "exec **" with the -* ID of the last prepared -* statement */ + case 'E': + /* a bit of a hack for prepare/exec/dealloc +* tests: replace "exec[ute] **" with the +* ID of the last prepared statement */ if (mode == SQL && formatter == TESTformatter && - strncmp(line, "exec **", 7) == 0) { + (strncasecmp(line, "exec **", 7) == 0 || +strncasecmp(line, "execute **", 10) == 0)) { line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; line[6] = prepno % 10 + '0'; } - if (strcmp(line, "exit\n") == 0) { + if (strncasecmp(line, "exit\n", 5) == 0) { goto bailout; } break; + case 'd': + case 'D': + /* a bit of a hack for prepare/exec/dealloc +* tests: replace "dealloc[ate] **" with the +* ID of the last prepared statement */ + if (mode == SQL && + formatter == TESTformatter && + (strncasecmp(line, "dealloc **", 10) == 0 || +strncasecmp(line, "deallocate **", 13) == 0)) { + line[5] = prepno < 10 ? ' ' : prepno / 10 + '0'; + line[6] = prepno % 10 + '0'; + } + break; case 'q': - if (strcmp(line, "quit\n") == 0) { + case 'Q': + if (strncasecmp(line, "quit\n", 5) == 0) { goto bailout; } break; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - merged
Changeset: b9b6547577d3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b9b6547577d3 Modified Files: clients/mapiclient/ReadlineTools.c clients/mapiclient/mhelp.c clients/odbc/driver/ODBCConvert.c configure.ag geom/monetdb5/geom.c Branch: default Log Message: merged diffs (185 lines): diff --git a/clients/mapiclient/ReadlineTools.c b/clients/mapiclient/ReadlineTools.c --- a/clients/mapiclient/ReadlineTools.c +++ b/clients/mapiclient/ReadlineTools.c @@ -86,7 +86,6 @@ sql_tablename_generator(const char *text static char * sql_command_generator(const char *text, int state) { - static int idx, len; const char *name; @@ -95,20 +94,14 @@ sql_command_generator(const char *text, len = strlen(text); } - while ((name = sql_commands[idx++])) { -#ifdef HAVE_STRNCASECMP if (strncasecmp(name, text, len) == 0) -#else - if (strncmp(name, text, len) == 0) -#endif return strdup(name); } return NULL; } - static char ** sql_completion(const char *text, int start, int end) { @@ -224,11 +217,7 @@ mal_command_generator(const char *text, printf("currentline:%s\n",rl_line_buffer); */ while (mal_commands[idx] && (name = mal_commands[idx++])) { -#ifdef HAVE_STRNCASECMP if (strncasecmp(name, text, len) == 0) -#else - if (strncmp(name, text, len) == 0) -#endif return strdup(name); } /* try the server to answer */ diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -935,27 +935,6 @@ SQLhelp sqlhelp2[] = { {NULL, NULL, NULL, NULL, NULL} /* End of list marker */ }; -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char *s1, const char *s2, size_t n) -{ - int c1, c2; - - while (n > 0) { - c1 = (unsigned char) *s1++; - c2 = (unsigned char) *s2++; - if (c1 == 0) - return -c2; - if (c2 == 0) - return c1; - if (c1 != c2 && tolower(c1) != tolower(c2)) - return tolower(c1) - tolower(c2); - n--; - } - return 0; -} -#endif - static const char * sql_grammar_rule(const char *word, stream *toConsole) { diff --git a/clients/odbc/driver/ODBCConvert.c b/clients/odbc/driver/ODBCConvert.c --- a/clients/odbc/driver/ODBCConvert.c +++ b/clients/odbc/driver/ODBCConvert.c @@ -39,27 +39,6 @@ typedef struct { #endif } bignum_t; -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char *s1, const char *s2, size_t n) -{ - int c1, c2; - - while (n > 0) { - c1 = (unsigned char) *s1++; - c2 = (unsigned char) *s2++; - if (c1 == 0) - return -c2; - if (c2 == 0) - return c1; - if (c1 != c2 && tolower(c1) != tolower(c2)) - return tolower(c1) - tolower(c2); - n--; - } - return 0; -} -#endif - /* Parse a number and store in a bignum_t. * 1 is returned if all is well; * 2 is returned if there is loss of precision (i.e. overflow of the value); diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2665,6 +2665,8 @@ typedef enum { @%:@include @%:@include @%:@include +@%:@include +@%:@include @%:@ifndef static_assert /* static_assert is a C11 feature, defined in assert.h which also exists @@ -2684,6 +2686,35 @@ stpcpy(char *restrict dst, const char *r } @%:@endif +@%:@ifndef HAVE_STPCPY +#ifndef HAVE_STRNCASECMP +#ifdef WIN32 +#ifndef strncasecmp +#define strncasecmp _strnicmp +#endif +#else +static inline int +strncasecmp(const char *s1, const char *s2, size_t n) +{ + int c1, c2; + + while (n > 0) { + c1 = (unsigned char) *s1++; + c2 = (unsigned char) *s2++; + if (c1 == 0) + return -c2; + if (c2 == 0) + return c1; + if (c1 != c2 && tolower(c1) != tolower(c2)) + return tolower(c1) - tolower(c2); + n--; + } + return 0; +} +#endif +#endif +@%:@endif + @%:@if defined(HAVE___INT128) typedef __int128 hge; typedef unsigned __int128 uhge; diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -2116,27 +2116,6 @@ wkba_size(int items) return size; } -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char *s1, const char *s2, size_t n) -{ - int c1, c2; - - while (n > 0) { - c1 = (unsigned char) *s1++; - c2 = (unsigned char) *s2++; - if (c1 == 0) - return -c2; -
MonetDB: default - approved output
Changeset: 254767e0b8b5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=254767e0b8b5 Modified Files: sql/test/mergetables/Tests/sqlsmith-exists.stable.out Branch: default Log Message: approved output diffs (33 lines): diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out --- a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out +++ b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out @@ -440,6 +440,29 @@ stdout of test 'sqlsmith-exists` in dire % c0 # name % int # type % 1 # length +#SELECT +#subq_1.c2 AS c0 +#,subq_1.c0 AS c1 +#FROM +#( +#SELECT +#subq_0.c7 AS c0 +#,subq_0.c7 AS c1 +#,CASE +#WHEN TRUE +#THEN subq_0.c7 +#ELSE subq_0.c7 +#END AS c2 +#FROM +#( +#SELECT +#ref_0.col1 AS c0 +#,89 AS c1 +#,ref_0.col2 AS c2 +% ., . # table_name +% c0, c1 # name +% varchar, varchar # type +% 0, 0 # length #ROLLBACK; # 19:56:32 > ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Cleanup. Move strncasecmp declaration to conf...
Changeset: f516879accd6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f516879accd6 Modified Files: clients/mapiclient/ReadlineTools.c clients/mapiclient/mhelp.c clients/odbc/driver/ODBCConvert.c configure.ag geom/monetdb5/geom.c Branch: default Log Message: Cleanup. Move strncasecmp declaration to configure.ag. Declare it as an inline function in monetdb_config.h for the platforms not available instead of re-declaring it for every translation unit. On Windows we can use the equivalent _strnicmp function. diffs (185 lines): diff --git a/clients/mapiclient/ReadlineTools.c b/clients/mapiclient/ReadlineTools.c --- a/clients/mapiclient/ReadlineTools.c +++ b/clients/mapiclient/ReadlineTools.c @@ -86,7 +86,6 @@ sql_tablename_generator(const char *text static char * sql_command_generator(const char *text, int state) { - static int idx, len; const char *name; @@ -95,20 +94,14 @@ sql_command_generator(const char *text, len = strlen(text); } - while ((name = sql_commands[idx++])) { -#ifdef HAVE_STRNCASECMP if (strncasecmp(name, text, len) == 0) -#else - if (strncmp(name, text, len) == 0) -#endif return strdup(name); } return NULL; } - static char ** sql_completion(const char *text, int start, int end) { @@ -224,11 +217,7 @@ mal_command_generator(const char *text, printf("currentline:%s\n",rl_line_buffer); */ while (mal_commands[idx] && (name = mal_commands[idx++])) { -#ifdef HAVE_STRNCASECMP if (strncasecmp(name, text, len) == 0) -#else - if (strncmp(name, text, len) == 0) -#endif return strdup(name); } /* try the server to answer */ diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -935,27 +935,6 @@ SQLhelp sqlhelp2[] = { {NULL, NULL, NULL, NULL, NULL} /* End of list marker */ }; -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char *s1, const char *s2, size_t n) -{ - int c1, c2; - - while (n > 0) { - c1 = (unsigned char) *s1++; - c2 = (unsigned char) *s2++; - if (c1 == 0) - return -c2; - if (c2 == 0) - return c1; - if (c1 != c2 && tolower(c1) != tolower(c2)) - return tolower(c1) - tolower(c2); - n--; - } - return 0; -} -#endif - static const char * sql_grammar_rule(const char *word, stream *toConsole) { diff --git a/clients/odbc/driver/ODBCConvert.c b/clients/odbc/driver/ODBCConvert.c --- a/clients/odbc/driver/ODBCConvert.c +++ b/clients/odbc/driver/ODBCConvert.c @@ -39,27 +39,6 @@ typedef struct { #endif } bignum_t; -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char *s1, const char *s2, size_t n) -{ - int c1, c2; - - while (n > 0) { - c1 = (unsigned char) *s1++; - c2 = (unsigned char) *s2++; - if (c1 == 0) - return -c2; - if (c2 == 0) - return c1; - if (c1 != c2 && tolower(c1) != tolower(c2)) - return tolower(c1) - tolower(c2); - n--; - } - return 0; -} -#endif - /* Parse a number and store in a bignum_t. * 1 is returned if all is well; * 2 is returned if there is loss of precision (i.e. overflow of the value); diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -2665,6 +2665,8 @@ typedef enum { @%:@include @%:@include @%:@include +@%:@include +@%:@include @%:@ifndef static_assert /* static_assert is a C11 feature, defined in assert.h which also exists @@ -2684,6 +2686,35 @@ stpcpy(char *restrict dst, const char *r } @%:@endif +@%:@ifndef HAVE_STPCPY +#ifndef HAVE_STRNCASECMP +#ifdef WIN32 +#ifndef strncasecmp +#define strncasecmp _strnicmp +#endif +#else +static inline int +strncasecmp(const char *s1, const char *s2, size_t n) +{ + int c1, c2; + + while (n > 0) { + c1 = (unsigned char) *s1++; + c2 = (unsigned char) *s2++; + if (c1 == 0) + return -c2; + if (c2 == 0) + return c1; + if (c1 != c2 && tolower(c1) != tolower(c2)) + return tolower(c1) - tolower(c2); + n--; + } + return 0; +} +#endif +#endif +@%:@endif + @%:@if defined(HAVE___INT128) typedef __int128 hge; typedef unsigned __int128 uhge; diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -2116,27 +2116,6 @@ wkba_size(int items) return size; } -#ifndef HAVE_STRNCASECMP -static int -strncasecmp(const char
MonetDB: default - removed incorrect assert
Changeset: f4971227e48b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f4971227e48b Modified Files: sql/server/rel_unnest.c Branch: default Log Message: removed incorrect assert diffs (14 lines): diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -619,9 +619,8 @@ rel_general_unnest(mvc *sql, sql_rel *re sql_rel *D = rel_project(sql->sa, rel_dup(l), exps_copy(sql, ad)); set_distinct(D); - assert(!rel_is_ref(r)); r = rel_crossproduct(sql->sa, D, r, rel->op); - r->op = /*is_semi(rel->op)?op_left:*/op_join; + r->op = op_join; move_join_exps(sql, rel, r); set_dependent(r); inner_r = r; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: gdk_tracer - Leave error message behind.
Changeset: 9f9fc3618eb0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9f9fc3618eb0 Modified Files: gdk/gdk_utils.c Branch: gdk_tracer Log Message: Leave error message behind. diffs (16 lines): diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -142,8 +142,10 @@ gdk_return GDKsetenv(const char *name, const char *value) { if (BUNappend(GDKkey, name, false) != GDK_SUCCEED || - BUNappend(GDKval, value, false) != GDK_SUCCEED) - return GDK_FAIL; + BUNappend(GDKval, value, false) != GDK_SUCCEED){ + GDKerror("GDKsetenv: failed to keep enviroment property.\n"); + return GDK_FAIL; + } return GDK_SUCCEED; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: gdk_tracer - Debugging fixes
Changeset: 347e524c6b21 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=347e524c6b21 Modified Files: monetdb5/mal/mal_dataflow.c Branch: gdk_tracer Log Message: Debugging fixes diffs (33 lines): diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c --- a/monetdb5/mal/mal_dataflow.c +++ b/monetdb5/mal/mal_dataflow.c @@ -669,7 +669,7 @@ DFLOWinitBlk(DataFlow flow, MalBlkPtr mb if (flow->edges[j] == -1) break; } - TRC_INFO(MAL_DATAFLOW, "[%d] %d dependents block count %d wakeup, %s\n", flow->start + n, n, flow->status[n].blocks, buf); + TRC_DEBUG(MAL_DATAFLOW, "[%d] %d dependents block count %d wakeup, %s\n", flow->start + n, n, flow->status[n].blocks, buf); } } */ @@ -692,10 +692,10 @@ static void showFlowEvent(DataFlow flow, int i; FlowEvent fe = flow->status; - TRC_INFO(MAL_DATAFLOW, "End of data flow '%d' done '%d'\n", pc, flow->stop - flow->start); + TRC_DEBUG(MAL_DATAFLOW, "End of data flow '%d' done '%d'\n", pc, flow->stop - flow->start); for (i = 0; i < flow->stop - flow->start; i++) if (fe[i].state != DFLOWwrapup && fe[i].pc >= 0) { - TRC_INFO(MAL_DATAFLOW, "Missed pc %d status %d %d blocks %d\n", fe[i].state, i, fe[i].pc, fe[i].blocks); + TRC_DEBUG(MAL_DATAFLOW, "Missed pc %d status %d %d blocks %d\n", fe[i].state, i, fe[i].pc, fe[i].blocks); debugInstruction(MAL_DATAFLOW, fe[i].flow->mb, 0, getInstrPtr(fe[i].flow->mb, fe[i].pc), LIST_MAL_MAPI); } } @@ -801,7 +801,6 @@ runMALdataflow(Client cntxt, MalBlkPtr m int i; TRC_DEBUG(MAL_DATAFLOW, "Running for block: %d - %d\n", startpc, stoppc); - debugFunction(MAL_DATAFLOW, mb, 0, LIST_MAL_ALL); /* in debugging mode we should not start multiple threads */ if (stk == NULL) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: gdk_tracer - Fixes
Changeset: ac1af6dcb648 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac1af6dcb648 Modified Files: monetdb5/mal/mal_client.c Branch: gdk_tracer Log Message: Fixes diffs (45 lines): diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c --- a/monetdb5/mal/mal_client.c +++ b/monetdb5/mal/mal_client.c @@ -68,9 +68,7 @@ MCinit(void) maxclients = atoi(max_clients); if (maxclients <= 0) { maxclients = 64; - if (GDKsetenv("max_clients", "64") != GDK_SUCCEED) { - TRC_ERROR(MAL_CLIENT, "GDKsetenv failed\n"); - } + GDKsetenv("max_clients", "64") ; } MAL_MAXCLIENTS = /* client connections */ maxclients; @@ -79,8 +77,9 @@ MCinit(void) TRC_CRITICAL(MAL_CLIENT, "Initialization failed: " MAL_MALLOC_FAIL "\n"); return false; } - for (int i = 0; i < MAL_MAXCLIENTS; i++) + for (int i = 0; i < MAL_MAXCLIENTS; i++){ ATOMIC_INIT(_clients[i].lastprint, 0); + } return true; } @@ -217,9 +216,7 @@ MCinitClientRecord(Client c, oid user, b c->fdin = fin ? fin : bstream_create(GDKstdin, 0); if ( c->fdin == NULL){ - MT_lock_set(_contextLock); c->mode = FREECLIENT; - MT_lock_unset(_contextLock); TRC_ERROR(MAL_CLIENT, "No stdin channel available\n"); return NULL; } @@ -253,9 +250,7 @@ MCinitClientRecord(Client c, oid user, b if (fin == NULL) { c->fdin->s = NULL; bstream_destroy(c->fdin); - MT_lock_set(_contextLock); c->mode = FREECLIENT; - MT_lock_unset(_contextLock); } TRC_ERROR(MAL_CLIENT, "Client prompt undefined\n"); return NULL; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - New sqlsmith crash
Changeset: f858e8a29dd0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f858e8a29dd0 Modified Files: sql/test/mergetables/Tests/sqlsmith-exists.sql sql/test/miscellaneous/Tests/All Branch: default Log Message: New sqlsmith crash diffs (truncated from 317 to 300 lines): diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.sql b/sql/test/mergetables/Tests/sqlsmith-exists.sql --- a/sql/test/mergetables/Tests/sqlsmith-exists.sql +++ b/sql/test/mergetables/Tests/sqlsmith-exists.sql @@ -867,4 +867,305 @@ where (subq_1.c9 is not null) or (ref_7.col1 is null) limit 111; --empty on PostgreSQL +SELECT +subq_1.c2 AS c0 +,subq_1.c0 AS c1 +FROM +( +SELECT +subq_0.c7 AS c0 +,subq_0.c7 AS c1 +,CASE +WHEN TRUE +THEN subq_0.c7 +ELSE subq_0.c7 +END AS c2 +FROM +( +SELECT +ref_0.col1 AS c0 +,89 AS c1 +,ref_0.col2 AS c2 +,ref_0.col5 AS c3 +,93 AS c4 +,ref_0.col2 AS c5 +,ref_0.col4 AS c6 +,ref_0.col2 AS c7 +,ref_0.col5 AS c8 +,ref_0.col1 AS c9 +,ref_0.col1 AS c10 +,ref_0.col3 AS c11 +,ref_0.col3 AS c12 +FROM +tbl_productsales AS ref_0 +WHERE +( +(FALSE) +OR ( +EXISTS ( +SELECT +ref_0.col6 AS c0 +,ref_0.col3 AS c1 +,ref_1.col0 AS c2 +,ref_1.col2 AS c3 +,ref_0.col1 AS c4 +,ref_1.col0 AS c5 +,69 AS c6 +,ref_1.col2 AS c7 +,ref_0.col6 AS c8 +,ref_1.col1 AS c9 +FROM +tab1 AS ref_1 +WHERE +(FALSE) +AND ( +( +( +ref_1.col2 IS NOT NULL +) +OR ( +ref_0.col2 IS NOT NULL +) +) +AND (TRUE) +) +) +) +) +AND ( +( +EXISTS ( +SELECT +ref_0.col4 AS c0 +FROM +analytics AS ref_2 +WHERE +( +( +ref_0.col4 IS NULL +) +AND (TRUE) +) +AND (TRUE) +) +) +AND (FALSE) +) LIMIT 137 +) AS subq_0 +WHERE +( +
MonetDB: default - Introducing deallocate statements, which allo...
Changeset: 633c63b5ecb7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=633c63b5ecb7 Modified Files: sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_upgrades.c sql/scripts/51_sys_schema_extension.sql sql/server/sql_mvc.c sql/server/sql_mvc.h sql/server/sql_parser.y sql/server/sql_qc.c sql/server/sql_qc.h sql/server/sql_scan.c Branch: default Log Message: Introducing deallocate statements, which allow users to close a prepared statement via SQL: DEALLOC[ATE] [PREPARE] { number | ALL } diffs (truncated from 552 to 300 lines): diff --git a/sql/backends/monet5/sql_execute.c b/sql/backends/monet5/sql_execute.c --- a/sql/backends/monet5/sql_execute.c +++ b/sql/backends/monet5/sql_execute.c @@ -763,7 +763,7 @@ SQLengineIntern(Client c, backend *be) cleanup_engine: if (m->type == Q_SCHEMA && m->qc != NULL) - qc_clean(m->qc); + qc_clean(m->qc, false); if (msg) { /* don't print exception decoration, just the message */ /* diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -217,7 +217,7 @@ SQLepilogue(void *ret) } #define SQLglobal(name, val, failure) \ - if(!stack_push_var(sql, name, ) || !stack_set_var(sql, name, VALset(, ctype.type->localtype, (char*)(val \ + if (!stack_push_var(sql, name, ) || !stack_set_var(sql, name, VALset(, ctype.type->localtype, (char*)(val \ failure--; #define NR_GLOBAL_VARS 9 @@ -286,17 +286,17 @@ SQLprepareClient(Client c, int login) c->getquery = SQLgetquery; if (c->sqlcontext == 0) { m = mvc_create(c->idx, 0, SQLdebug, c->fdin, c->fdout); - if( m == NULL) { + if (m == NULL) { throw(SQL,"sql.initClient",SQLSTATE(HY001) MAL_MALLOC_FAIL); } - if(global_variables(m, "monetdb", "sys") < 0) { + if (global_variables(m, "monetdb", "sys") < 0) { mvc_destroy(m); throw(SQL,"sql.initClient",SQLSTATE(HY001) MAL_MALLOC_FAIL); } if (c->scenario && strcmp(c->scenario, "msql") == 0) m->reply_size = -1; be = (void *) backend_create(m, c); - if( be == NULL) { + if ( be == NULL) { mvc_destroy(m); throw(SQL,"sql.initClient", SQLSTATE(HY001) MAL_MALLOC_FAIL); } @@ -306,10 +306,10 @@ SQLprepareClient(Client c, int login) /* Only reset if there is no active transaction which * can happen when we combine sql.init with msql. */ - if(m->session->tr->active) { + if (m->session->tr->active) { return NULL; } - if(mvc_reset(m, c->fdin, c->fdout, SQLdebug, NR_GLOBAL_VARS) < 0) { + if (mvc_reset(m, c->fdin, c->fdout, SQLdebug, NR_GLOBAL_VARS) < 0) { throw(SQL,"sql.initClient", SQLSTATE(HY001) MAL_MALLOC_FAIL); } backend_reset(be); @@ -364,9 +364,9 @@ SQLresetClient(Client c) c->sqlcontext = NULL; } c->state[MAL_SCENARIO_READER] = NULL; - if(other && !msg) + if (other && !msg) msg = other; - else if(other && msg) + else if (other && msg) freeException(other); return msg; } @@ -420,7 +420,7 @@ SQLinit(Client c) stream *buf; bstream *fdin; - if( b == NULL || cbuf == NULL) { + if ( b == NULL || cbuf == NULL) { MT_lock_unset(_contextLock); GDKfree(b); GDKfree(cbuf); @@ -429,21 +429,21 @@ SQLinit(Client c) buffer_init(b, cbuf, len); buf = buffer_rastream(b, "si"); - if( buf == NULL) { + if ( buf == NULL) { MT_lock_unset(_contextLock); buffer_destroy(b); throw(SQL,"sql.init",SQLSTATE(HY001) MAL_MALLOC_FAIL); } fdin = bstream_create(buf, b->len); - if( fdin == NULL) { + if ( fdin == NULL) { MT_lock_unset(_contextLock); buffer_destroy(b); throw(SQL,"sql.init",SQLSTATE(HY001) MAL_MALLOC_FAIL); } bstream_next(fdin); - if( MCpushClientInput(c, fdin, 0, "") < 0) + if ( MCpushClientInput(c,
MonetDB: default - merged
Changeset: 031ea0b598ef for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=031ea0b598ef Added Files: sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.sql sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.err sql/test/BugTracker-2019/Tests/orderby-alias-expr.Bug-6799.stable.out sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.sql sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.err sql/test/BugTracker-2019/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.out Modified Files: .hgtags MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag debian/changelog gdk/libbat.rc libversions monetdb5/mal/mal_instruction.h monetdb5/mal/mal_parser.c monetdb5/modules/mal/orderidx.c monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_querylog.c monetdb5/optimizer/opt_remap.c monetdb5/tools/libmonetdb5.rc sql/backends/monet5/sql_scenario.c sql/include/sql_relation.h sql/test/BugTracker-2019/Tests/All sql/test/BugTracker-2019/Tests/date_trunc.sql sql/test/BugTracker-2019/Tests/date_trunc.stable.out sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out vertoo.data Branch: default Log Message: merged diffs (truncated from 976 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -742,3 +742,5 @@ 90486f8f87ff0602f3ab143c629ba0aed2153d64 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_3 90486f8f87ff0602f3ab143c629ba0aed2153d64 Nov2019_release 13efc12c95a279d41dbc4440369defc1d7c21d0f Nov2019_release +fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_5 +fffd3aabeae5e2c5b535179471e5730742962a76 Nov2019_SP1_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -114,7 +114,7 @@ Group: Applications/Databases License: MPLv2.0 URL: https://www.monetdb.org/ BugURL: https://bugs.monetdb.org/ -Source: https://www.monetdb.org/downloads/sources/Nov2019/%{name}-%{version}.tar.bz2 +Source: https://www.monetdb.org/downloads/sources/Nov2019-SP1/%{name}-%{version}.tar.bz2 # we need systemd for the _unitdir macro to exist # we need checkpolicy and selinux-policy-devel for the SELinux policy @@ -1061,6 +1061,27 @@ fi %postun -p /sbin/ldconfig %changelog +* Thu Dec 12 2019 Sjoerd Mullender - 11.35.5-20191212 +- Rebuilt. +- BZ#6723: columns aliases duplicates should not be allowed. automatic + aliasing required. +- BZ#6724: Prepare confuses types when more than one argument is used +- BZ#6726: Python aggregation does not create aggr_group when aggregating + over all rows +- BZ#6765: GRANT SELECT privilege on a subset of table columns results + in access denied error when selecting the same columns from the table +- BZ#6790: Count distinct giving wrong results +- BZ#6791: str_to_time('11:40', '%H:%M') creates wrong time value +- BZ#6792: JSON path compiler accepts invalid input +- BZ#6793: cast(interval second value to int or decimal) is wrong (by + a factor of 1000), cast(interval month value to decimal or floating + point) fails +- BZ#6794: external name fits.listdir not bound (sys.listdir) Fatal + error during initialization: +- BZ#6796: Incorrect crash time reported by monetdb tool after crash + of mserver5 +- BZ#6798: json.text off by one error + * Mon Nov 25 2019 Sjoerd Mullender - 11.35.3-20191125 - Rebuilt. - BZ#3533: SQL aggregate functions avg(), sum() and median() return an diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +monetdb (11.35.5) unstable; urgency=low + + * Rebuilt. + * BZ#6723: columns aliases duplicates should not be allowed. automatic +aliasing required. + * BZ#6724: Prepare confuses types when more than one argument is used + * BZ#6726: Python aggregation does not create aggr_group when aggregating +over all rows + * BZ#6765: GRANT SELECT privilege on a subset of table columns results +in access denied error when selecting the same columns from the table + * BZ#6790: Count distinct giving wrong results + * BZ#6791: str_to_time('11:40', '%H:%M') creates wrong time value + * BZ#6792: JSON path compiler accepts invalid input + * BZ#6793: cast(interval second value to int or decimal) is wrong (by +a factor of 1000), cast(interval month value to decimal or floating +point) fails + * BZ#6794: external name fits.listdir not bound (sys.listdir) Fatal +error during initialization: + * BZ#6796: Incorrect crash time reported by monetdb tool after crash +of mserver5 + *
MonetDB: default - fixed push_up_join in combinations of semijoi...
Changeset: 9db1cd2c9335 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9db1cd2c9335 Modified Files: sql/server/rel_unnest.c sql/test/mergetables/Tests/sqlsmith-exists.stable.out Branch: default Log Message: fixed push_up_join in combinations of semijoins with right outer joins diffs (76 lines): diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -1082,24 +1082,29 @@ push_up_join(mvc *sql, sql_rel *rel, lis if (ld && rd) { node *m; sql_rel *n, *nr, *nj; + list *inner_exps = exps_copy(sql, j->exps); + list *outer_exps = exps_copy(sql, rel->exps); rel->r = rel_dup(jl); + rel->exps = sa_list(sql->sa); nj = rel_crossproduct(sql->sa, rel_dup(d), rel_dup(jr), j->op); - nj->exps = exps_copy(sql, j->exps); rel_destroy(j); j = nj; set_dependent(j); n = rel_crossproduct(sql->sa, rel, j, j->op); + n->exps = outer_exps; + if (!n->exps) + n->exps = inner_exps; + else + n->exps = list_merge(n->exps, inner_exps, (fdup)NULL); j->op = rel->op; if (is_semi(rel->op)) { - //assert(!is_semi(rel->op)); j->op = op_left; rel->op = op_left; } n->l = rel_project(sql->sa, n->l, rel_projections(sql, n->l, NULL, 1, 1)); nr = n->r; nr = n->r = rel_project(sql->sa, n->r, is_semi(nr->op)?sa_list(sql->sa):rel_projections(sql, nr->r, NULL, 1, 1)); - move_join_exps(sql, n, j); /* add nr->l exps with labels */ /* create jexps */ if (!n->exps) diff --git a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out --- a/sql/test/mergetables/Tests/sqlsmith-exists.stable.out +++ b/sql/test/mergetables/Tests/sqlsmith-exists.stable.out @@ -410,6 +410,36 @@ stdout of test 'sqlsmith-exists` in dire % c0 # name % int # type % 1 # length +#select +# subq_1.c0 as c0 +#from +# (select +# case when ((false) +# or (subq_0.c3 is not null)) +# and (true) then subq_0.c11 else subq_0.c11 end +# as c0, +# case when subq_0.c0 is null then subq_0.c5 else subq_0.c5 end +# as c1, +# subq_0.c6 as c2, +# case when true then subq_0.c3 else subq_0.c3 end +# as c3, +# subq_0.c3 as c4, +# subq_0.c0 as c5, +# subq_0.c6 as c6, +# subq_0.c3 as c7, +# subq_0.c8 as c8, +# 42 as c9, +# subq_0.c6 as c10 +# from +# (select +# ref_0.col0 as c0, +# 85 as c1, +# ref_0.col1 as c2, +# ref_0.col2 as c3, +% . # table_name +% c0 # name +% int # type +% 1 # length #ROLLBACK; # 19:56:32 > ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Use addArgument in the situation where you ha...
Changeset: 8b4539e0e112 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b4539e0e112 Modified Files: monetdb5/modules/mal/orderidx.c Branch: default Log Message: Use addArgument in the situation where you have constructed a MAL instruction not part of a MAL block diffs (56 lines): diff --git a/monetdb5/modules/mal/orderidx.c b/monetdb5/modules/mal/orderidx.c --- a/monetdb5/modules/mal/orderidx.c +++ b/monetdb5/modules/mal/orderidx.c @@ -107,7 +107,7 @@ OIDXcreateImplementation(Client cntxt, i smb = snew->def; q = getInstrPtr(smb, 0); arg = newTmpVariable(smb, tpe); - q= pushArgument(smb, q, arg); + q= addArgument(smb, q, arg); getArg(q,0) = newTmpVariable(smb, TYPE_void); resizeMalBlk(smb, 2*pieces+10); // large enough @@ -119,7 +119,7 @@ OIDXcreateImplementation(Client cntxt, i goto bailout; } pack->argv[0] = newTmpVariable(smb, TYPE_void); - pack = pushArgument(smb, pack, arg); + pack = addArgument(smb, pack, arg); setVarFixed(smb, getArg(pack, 0)); /* the costly part executed as a parallel block */ @@ -133,11 +133,11 @@ OIDXcreateImplementation(Client cntxt, i o = 0; for (i = 0; i < pieces; i++) { /* add slice instruction */ - q = newStmt(smb, putName("algebra"),putName("slice")); + q = newInstruction(smb, putName("algebra"),putName("slice")); setVarType(smb, getArg(q,0), tpe); setVarFixed(smb, getArg(q,0)); - q = pushArgument(smb, q, arg); - pack = pushArgument(smb, pack, getArg(q,0)); + q = addArgument(smb, q, arg); + pack = addArgument(smb, pack, getArg(q,0)); q = pushOid(smb, q, o); if (i == pieces-1) { o = cnt; @@ -145,15 +145,17 @@ OIDXcreateImplementation(Client cntxt, i o += step; } q = pushOid(smb, q, o - 1); + pushInstruction(smb, q); } for (i = 0; i < pieces; i++) { /* add sort instruction */ - q = newStmt(smb, putName("algebra"), putName("orderidx")); + q = newInstruction(smb, putName("algebra"), putName("orderidx")); setVarType(smb, getArg(q, 0), tpe); setVarFixed(smb, getArg(q, 0)); - q = pushArgument(smb, q, pack->argv[2+i]); + q = addArgument(smb, q, pack->argv[2+i]); q = pushBit(smb, q, 1); pack->argv[2+i] = getArg(q, 0); + pushInstruction(smb, q); } /* finalize OID packing, check, and evaluate */ pushInstruction(smb,pack); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Use addArgument in the situation where you ha...
Changeset: 6c310c9c17af for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c310c9c17af Modified Files: monetdb5/optimizer/opt_mergetable.c Branch: default Log Message: Use addArgument in the situation where you have constructed a MAL instruction not part of a MAL block diffs (128 lines): diff --git a/monetdb5/optimizer/opt_mergetable.c b/monetdb5/optimizer/opt_mergetable.c --- a/monetdb5/optimizer/opt_mergetable.c +++ b/monetdb5/optimizer/opt_mergetable.c @@ -331,7 +331,7 @@ mat_delta(matlist_t *ml, MalBlkPtr mb, I freeInstruction(r); return NULL; } - r = pushArgument(mb, r, getArg(q, 0)); + r = addArgument(mb, r, getArg(q, 0)); nr++; break; @@ -364,7 +364,7 @@ mat_delta(matlist_t *ml, MalBlkPtr mb, I freeInstruction(r); return NULL; } - r = pushArgument(mb, r, getArg(q, 0)); + r = addArgument(mb, r, getArg(q, 0)); } if (evar == 1 && e >= 0 && mat[e].type == mat_slc && is_projectdelta) { InstrPtr q = newInstruction(mb, algebraRef, projectionRef); @@ -456,7 +456,7 @@ mat_apply1(MalBlkPtr mb, InstrPtr p, mat freeInstruction(r); return NULL; } - r = pushArgument(mb, r, getArg(q, 0)); + r = addArgument(mb, r, getArg(q, 0)); } return r; } @@ -506,7 +506,7 @@ mat_apply2(matlist_t *ml, MalBlkPtr mb, GDKfree(r); return -1; } - r[l] = pushArgument(mb, r[l], getArg(q, l)); + r[l] = addArgument(mb, r[l], getArg(q, l)); } } @@ -563,7 +563,7 @@ mat_apply3(MalBlkPtr mb, InstrPtr p, mat GDKfree(r); return -1; } - r[l] = pushArgument(mb, r[l], getArg(q, l)); + r[l] = addArgument(mb, r[l], getArg(q, l)); } } for(k=0; k < p->retc; k++) { @@ -637,7 +637,7 @@ mat_setop(MalBlkPtr mb, InstrPtr p, matl } pushInstruction(mb,q); - r = pushArgument(mb,r,getArg(q,0)); + r = addArgument(mb,r,getArg(q,0)); nr++; } } else { @@ -657,7 +657,7 @@ mat_setop(MalBlkPtr mb, InstrPtr p, matl freeInstruction(r); return -1; } - r = pushArgument(mb, r, getArg(q,0)); + r = addArgument(mb, r, getArg(q,0)); } } @@ -701,7 +701,7 @@ mat_projection(MalBlkPtr mb, InstrPtr p, freeInstruction(r); return -1; } - r = pushArgument(mb,r,getArg(q,0)); + r = addArgument(mb,r,getArg(q,0)); nr++; break; @@ -728,7 +728,7 @@ mat_projection(MalBlkPtr mb, InstrPtr p, freeInstruction(r); return -1; } - r = pushArgument(mb, r, getArg(q,0)); + r = addArgument(mb, r, getArg(q,0)); } } @@ -781,8 +781,8 @@ mat_join2(MalBlkPtr mb, InstrPtr p, matl } /* add result to mat */ - l = pushArgument(mb,l,getArg(q,0)); - r = pushArgument(mb,r,getArg(q,1)); + l = addArgument(mb,l,getArg(q,0)); + r = addArgument(mb,r,getArg(q,1)); nr++; } } @@ -813,8 +813,8 @@ mat_join2(MalBlkPtr mb, InstrPtr p, matl } /* add result to mat */ - l = pushArgument(mb, l, getArg(q,0)); - r = pushArgument(mb, r, getArg(q,1)); + l = addArgument(mb, l, getArg(q,0)); + r = addArgument(mb, r, getArg(q,1)); } } return mat_add(ml, l, mat_none, getFunctionId(p)) || mat_add(ml, r, mat_none, getFunctionId(p)); @@ -929,8
MonetDB: default - Use addArgument in the situation where you ha...
Changeset: 1b8465489133 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b8465489133 Modified Files: monetdb5/optimizer/opt_projectionpath.c Branch: default Log Message: Use addArgument in the situation where you have constructed a MAL instruction not part of a MAL block diffs (15 lines): diff --git a/monetdb5/optimizer/opt_projectionpath.c b/monetdb5/optimizer/opt_projectionpath.c --- a/monetdb5/optimizer/opt_projectionpath.c +++ b/monetdb5/optimizer/opt_projectionpath.c @@ -256,9 +256,9 @@ OPTprojectionpathImplementation(Client c if ( getFunctionId(p) == projectionRef){ if( r && getModuleId(r)== algebraRef && ( getFunctionId(r)== projectionRef || getFunctionId(r)== projectionpathRef) ){ for(k= r->retc; kargc; k++) - q = pushArgument(mb,q,getArg(r,k)); + q = addArgument(mb,q,getArg(r,k)); } else - q = pushArgument(mb,q,getArg(p,j)); + q = addArgument(mb,q,getArg(p,j)); } } if(q->argc<= p->argc){ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Use addArgument in the situation where you ha...
Changeset: c2fa0ce8cb17 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c2fa0ce8cb17 Modified Files: monetdb5/optimizer/opt_querylog.c Branch: default Log Message: Use addArgument in the situation where you have constructed a MAL instruction not part of a MAL block diffs (16 lines): diff --git a/monetdb5/optimizer/opt_querylog.c b/monetdb5/optimizer/opt_querylog.c --- a/monetdb5/optimizer/opt_querylog.c +++ b/monetdb5/optimizer/opt_querylog.c @@ -63,10 +63,10 @@ OPTquerylogImplementation(Client cntxt, /* collect the initial statistics */ q = newStmt(mb, "clients", "getUsername"); name= getArg(q,0)= newVariable(mb,"name",4,TYPE_str); - defineQuery = pushArgument(mb,defineQuery,name); + defineQuery = addArgument(mb,defineQuery,name); q = newStmt(mb, "mtime", "current_timestamp"); start= getArg(q,0)= newVariable(mb,"start",5,TYPE_timestamp); - defineQuery = pushArgument(mb,defineQuery,start); + defineQuery = addArgument(mb,defineQuery,start); pushInstruction(mb, defineQuery); q = newStmt(mb, sqlRef, "argRecord"); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Use addArgument in the situation where you ha...
Changeset: 58039a93fe2c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58039a93fe2c Modified Files: monetdb5/optimizer/opt_remap.c Branch: default Log Message: Use addArgument in the situation where you have constructed a MAL instruction not part of a MAL block diffs (75 lines): diff --git a/monetdb5/optimizer/opt_remap.c b/monetdb5/optimizer/opt_remap.c --- a/monetdb5/optimizer/opt_remap.c +++ b/monetdb5/optimizer/opt_remap.c @@ -53,7 +53,7 @@ OPTremapDirect(Client cntxt, MalBlkPtr m p = pushReturn(mb, p, getArg(pci,i)); p->retc= p->argc= pci->retc; for(i= pci->retc+2; iargc; i++) - p= pushArgument(mb,p,getArg(pci,i)); + p= addArgument(mb,p,getArg(pci,i)); if( OPTdebug & OPTremap){ fprintInstruction(stderr,mb,0,p,LIST_MAL_ALL); @@ -235,7 +235,8 @@ OPTmultiplexInline(Client cntxt, MalBlkP setVarType(mq,getArg(q,0),tpe); setModuleId(q,algebraRef); setFunctionId(q,projectRef); - q= pushArgument(mb,q, getArg(q,1)); + q= addArgument(mb,q, getArg(q,1)); + mq->stmt[i] = q; getArg(q,1)= refbat; } } @@ -269,7 +270,8 @@ OPTmultiplexInline(Client cntxt, MalBlkP !(isaBatType( getArgType(mq,q,1))) ){ setModuleId(q,algebraRef); setFunctionId(q,projectRef); - q= pushArgument(mq,q, getArg(q,1)); + q= addArgument(mq,q, getArg(q,1)); + mq->stmt[i] = q; getArg(q,1)= refbat; q->typechk = TYPE_UNKNOWN; @@ -452,35 +454,35 @@ OPTremapImplementation(Client cntxt, Mal t = newInstruction(mb, batcalcRef, putName("==")); getArg(t,0) = newTmpVariable(mb, newBatType(TYPE_bit)); - t = pushArgument(mb, t, getDestVar(cnt)); + t = addArgument(mb, t, getDestVar(cnt)); t = pushLng(mb, t, 0); pushInstruction(mb, t); iszero = t; t = newInstruction(mb, batcalcRef, dblRef); getArg(t,0) = newTmpVariable(mb, getArgType(mb, p, 0)); - t = pushArgument(mb, t, getDestVar(sum)); + t = addArgument(mb, t, getDestVar(sum)); pushInstruction(mb, t); sum = t; t = newInstruction(mb, batcalcRef, putName("ifthenelse")); getArg(t,0) = newTmpVariable(mb, getArgType(mb, p, 0)); - t = pushArgument(mb, t, getDestVar(iszero)); + t = addArgument(mb, t, getDestVar(iszero)); t = pushNil(mb, t, TYPE_dbl); - t = pushArgument(mb, t, getDestVar(sum)); + t = addArgument(mb, t, getDestVar(sum)); pushInstruction(mb, t); sum = t; t = newInstruction(mb, batcalcRef, dblRef); getArg(t,0) = newTmpVariable(mb, getArgType(mb, p, 0)); - t = pushArgument(mb, t, getDestVar(cnt)); + t = addArgument(mb, t, getDestVar(cnt)); pushInstruction(mb, t); cnt = t; avg = newInstruction(mb, batcalcRef, divRef); getArg(avg, 0) = getArg(p, 0); - avg = pushArgument(mb, avg, getDestVar(sum)); - avg = pushArgument(mb, avg, getDestVar(cnt)); + avg = addArgument(mb, avg, getDestVar(sum)); + avg = addArgument(mb, avg, getDestVar(cnt)); freeInstruction(p); pushInstruction(mb, avg); } else { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Minor addition
Changeset: 8823923658fe for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8823923658fe Modified Files: monetdb5/mal/mal_instruction.h monetdb5/mal/mal_parser.c Branch: default Log Message: Minor addition diffs (23 lines): diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h --- a/monetdb5/mal/mal_instruction.h +++ b/monetdb5/mal/mal_instruction.h @@ -38,6 +38,7 @@ #define garbageControl(P) ((P)->gc & GARBAGECONTROL) #define getInstrPtr(M,I) (M)->stmt[I] +#define putInstrPtr(M,I,P) (M)->stmt[I] = P #define getSignature(S)getInstrPtr((S)->def,0) #define isMain(M) ((getInstrPtr(M,0))->fcnname== putName("main",4)) #define getFcnName(M) getFunctionId(getInstrPtr(M,0)) diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c --- a/monetdb5/mal/mal_parser.c +++ b/monetdb5/mal/mal_parser.c @@ -1261,7 +1261,7 @@ fcnHeader(Client cntxt, int kind) } if (curInstr != getInstrPtr(curBlk, 0)) { freeInstruction(getInstrPtr(curBlk, 0)); - getInstrPtr(curBlk, 0) = curInstr; + putInstrPtr(curBlk, 0, curInstr); } return curBlk; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list