Changeset: e31fcceece23 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e31fcceece23 Modified Files: gdk/gdk_logger.c sql/test/BugTracker/Tests/rank_over.SF-1691098.sql sql/test/BugTracker/Tests/rank_over.SF-1691098.stable.out sql/test/BugTracker/Tests/with_only_once.SF-1720293.sql sql/test/BugTracker/Tests/with_only_once.SF-1720293.stable.out testing/Mtest.py.in Branch: generator Log Message:
Merge with default branch. diffs (truncated from 335 to 300 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -1159,160 +1159,13 @@ logger_new(int debug, char *fn, char *lo snprintf(bak, BUFSIZ, "%s_catalog", fn); bid = BBPindex(bak); - /* upgrade from old logger format; all errors are fatal since - * this should only happen on startup */ - if (bid) { - /* split catalog -> catalog_bid, catalog_nme */ - BAT *b = BATdescriptor(bid); - BAT *v; - - if (b == 0) - logger_fatal("Logger_new: inconsistent database, " - "'%s' does not exist",bak,0,0); - lg->catalog_bid = logbat_new(TYPE_int, BATSIZE, PERSISTENT); - lg->catalog_nme = logbat_new(TYPE_str, BATSIZE, PERSISTENT); - - v = BATmark(b, 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->catalog_bid, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - v = BATmark(BATmirror(b), 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->catalog_nme, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - - /* Make persistent */ - bid = lg->catalog_bid->batCacheid; - BBPincref(bid, TRUE); - snprintf(bak, BUFSIZ, "%s_catalog_bid", fn); - if (BBPrename(lg->catalog_bid->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - - /* Make persistent */ - bid = lg->catalog_nme->batCacheid; - BBPincref(bid, TRUE); - snprintf(bak, BUFSIZ, "%s_catalog_nme", fn); - if (BBPrename(lg->catalog_nme->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - - logbat_destroy(b); - - /* split snapshots -> snapshots_bid, snapshots_tid */ - bid = logger_find_bat(lg, "snapshots"); - b = BATdescriptor(bid); - if (b == 0) - logger_fatal("Logger_new: inconsistent database, '%s' " - "snapshots does not exist", bak, 0, 0); - - lg->snapshots_bid = logbat_new(TYPE_int, 1, PERSISTENT); - if (lg->snapshots_bid == NULL) - logger_fatal("Logger_new: cannot create snapshot bat", - 0, 0, 0); - v = BATmark(b, 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->snapshots_bid, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - snprintf(bak, BUFSIZ, "%s_snapshots_bid", fn); - if (BBPrename(lg->snapshots_bid->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - logger_add_bat(lg, lg->snapshots_bid, "snapshots_bid"); - - lg->snapshots_tid = logbat_new(TYPE_int, 1, PERSISTENT); - if (lg->snapshots_tid == NULL) - logger_fatal("Logger_new: cannot create snapshot bat", - 0, 0, 0); - v = BATmark(BATmirror(b), 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->snapshots_tid, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - snprintf(bak, BUFSIZ, "%s_snapshots_tid", fn); - if (BBPrename(lg->snapshots_tid->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - logger_add_bat(lg, lg->snapshots_tid, "snapshots_tid"); - - logbat_destroy(b); - - /* split seqs -> seqs_id, seqs_val */ - bid = logger_find_bat(lg, "seqs"); - b = BATdescriptor(bid); - if (b == 0) - logger_fatal("Logger_new: inconsistent database, '%s' " - "seqs does not exist", bak, 0, 0); - - lg->seqs_id = logbat_new(TYPE_int, 1, PERSISTENT); - if (lg->seqs_id == NULL) - logger_fatal("Logger_new: cannot create sequences bat", - 0, 0, 0); - v = BATmark(b, 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->seqs_id, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - snprintf(bak, BUFSIZ, "%s_seqs_id", fn); - if (BBPrename(lg->seqs_id->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - logger_add_bat(lg, lg->seqs_id, "seqs_id"); - - lg->seqs_val = logbat_new(TYPE_lng, 1, PERSISTENT); - if (lg->seqs_val == NULL) - logger_fatal("Logger_new: cannot create sequences bat", - 0, 0, 0); - v = BATmark(BATmirror(b), 0); - if (v == NULL) - logger_fatal("Logger_new: cannot create view on bat", - 0, 0, 0); - if (BATappend(lg->seqs_val, BATmirror(v), FALSE) == NULL) - logger_fatal("Logger_new: BATappend failed", 0, 0, 0); - BBPunfix(v->batCacheid); - snprintf(bak, BUFSIZ, "%s_seqs_val", fn); - if (BBPrename(lg->seqs_val->batCacheid, bak) < 0) - logger_fatal("Logger_new: BBPrename to %s failed", - bak, 0, 0); - logger_add_bat(lg, lg->seqs_val, "seqs_val"); - - logbat_destroy(b); - - if (bm_subcommit(lg->catalog_bid, lg->catalog_nme, - lg->catalog_bid, lg->catalog_nme, - NULL, lg->debug) < 0) - logger_fatal("Logger_new: commit of logger conversion " - "failed", 0, 0, 0); - logbat_destroy(lg->catalog_bid); - logbat_destroy(lg->catalog_nme); - logbat_destroy(lg->snapshots_bid); - logbat_destroy(lg->snapshots_tid); - logbat_destroy(lg->seqs_id); - logbat_destroy(lg->seqs_val); - lg->catalog_bid = NULL; - lg->catalog_nme = NULL; - lg->snapshots_bid = NULL; - lg->snapshots_tid = NULL; - lg->seqs_id = NULL; - lg->seqs_val = NULL; - } - snprintf(bak, BUFSIZ, "%s_catalog_bid", fn); catalog_bid = BBPindex(bak); + if (bid != 0 && catalog_bid == 0) + logger_fatal("Logger_new: ancient database, please upgrade " + "first to Jan2014 (11.17.X) release", 0, 0, 0); + if (catalog_bid == 0) { log_bid bid = 0; diff --git a/sql/test/BugTracker/Tests/rank_over.SF-1691098.sql b/sql/test/BugTracker/Tests/rank_over.SF-1691098.sql --- a/sql/test/BugTracker/Tests/rank_over.SF-1691098.sql +++ b/sql/test/BugTracker/Tests/rank_over.SF-1691098.sql @@ -1,1 +1,9 @@ -select RANK () OVER () as foo from tables; +create table rankbug (id int); +insert into rankbug values (42); +insert into rankbug select * from rankbug; +insert into rankbug select * from rankbug; +insert into rankbug select * from rankbug; +insert into rankbug select * from rankbug; +insert into rankbug select * from rankbug; +select RANK () OVER () as foo from rankbug; +drop table rankbug; diff --git a/sql/test/BugTracker/Tests/rank_over.SF-1691098.stable.out b/sql/test/BugTracker/Tests/rank_over.SF-1691098.stable.out --- a/sql/test/BugTracker/Tests/rank_over.SF-1691098.stable.out +++ b/sql/test/BugTracker/Tests/rank_over.SF-1691098.stable.out @@ -24,8 +24,21 @@ Ready. # 16:03:46 > Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb --host=localhost --port=38533 # 16:03:46 > -#select RANK () OVER () as foo from tables; -% .L # table_name +#create table rankbug (id int); +#insert into rankbug values (42); +[ 1 ] +#insert into rankbug select * from rankbug; +[ 1 ] +#insert into rankbug select * from rankbug; +[ 2 ] +#insert into rankbug select * from rankbug; +[ 4 ] +#insert into rankbug select * from rankbug; +[ 8 ] +#insert into rankbug select * from rankbug; +[ 16 ] +#select RANK () OVER () as foo from rankbug; +% sys.L # table_name % foo # name % int # type % 2 # length @@ -61,14 +74,7 @@ Ready. [ 30 ] [ 31 ] [ 32 ] -[ 33 ] -[ 34 ] -[ 35 ] -[ 36 ] -[ 37 ] -[ 38 ] -[ 39 ] -[ 40 ] +#drop table rankbug; # 17:29:50 > # 17:29:50 > "Done." diff --git a/sql/test/BugTracker/Tests/with_only_once.SF-1720293.sql b/sql/test/BugTracker/Tests/with_only_once.SF-1720293.sql --- a/sql/test/BugTracker/Tests/with_only_once.SF-1720293.sql +++ b/sql/test/BugTracker/Tests/with_only_once.SF-1720293.sql @@ -1,2 +1,10 @@ -WITH t AS ( SELECT count(*) FROM tables ) SELECT * FROM t; -WITH t AS ( SELECT count(*) FROM tables ) SELECT * FROM t; +create table withonlybug (id int); +insert into withonlybug values (42); +insert into withonlybug select * from withonlybug; +insert into withonlybug select * from withonlybug; +insert into withonlybug select * from withonlybug; +insert into withonlybug select * from withonlybug; +insert into withonlybug select * from withonlybug; +WITH t AS ( SELECT count(*) FROM withonlybug ) SELECT * FROM t; +WITH t AS ( SELECT count(*) FROM withonlybug ) SELECT * FROM t; +drop table withonlybug; diff --git a/sql/test/BugTracker/Tests/with_only_once.SF-1720293.stable.out b/sql/test/BugTracker/Tests/with_only_once.SF-1720293.stable.out --- a/sql/test/BugTracker/Tests/with_only_once.SF-1720293.stable.out +++ b/sql/test/BugTracker/Tests/with_only_once.SF-1720293.stable.out @@ -14,27 +14,63 @@ stdout of test 'with_only_once.SF-172029 # MonetDB/SQL module v2.25.0 loaded Ready. -#function user.main():void; -# clients.quit(); -#end main; +# SQL catalog created, loading sql scripts once +# loading sql script: 09_like.sql +# loading sql script: 10_math.sql +# loading sql script: 11_times.sql +# loading sql script: 12_url.sql +# loading sql script: 13_date.sql +# loading sql script: 14_inet.sql +# loading sql script: 15_querylog.sql +# loading sql script: 16_tracelog.sql +# loading sql script: 17_compress.sql +# loading sql script: 18_dictionary.sql +# loading sql script: 19_cluster.sql +# loading sql script: 20_vacuum.sql +# loading sql script: 21_dependency_functions.sql +# loading sql script: 22_clients.sql +# loading sql script: 23_skyserver.sql +# loading sql script: 24_zorder.sql +# loading sql script: 25_debug.sql +# loading sql script: 26_sysmon.sql +# loading sql script: 39_analytics.sql +# loading sql script: 40_geom.sql +# loading sql script: 46_gsl.sql +# loading sql script: 75_storagemodel.sql +# loading sql script: 80_statistics.sql +# loading sql script: 80_udf.sql +# loading sql script: 99_system.sql +# 17:55:39 > +# 17:55:39 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-30978" "--port=32166" +# 17:55:39 > -# 22:41:45 > -# 22:41:45 > Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb --host=localhost --port=32869 -# 22:41:45 > - -#WITH t AS ( SELECT count(*) FROM tables ) SELECT * FROM t; -% .t # table_name +#create table withonlybug (id int); +#insert into withonlybug values (42); +[ 1 ] +#insert into withonlybug select * from withonlybug; +[ 1 ] +#insert into withonlybug select * from withonlybug; +[ 2 ] +#insert into withonlybug select * from withonlybug; +[ 4 ] +#insert into withonlybug select * from withonlybug; +[ 8 ] +#insert into withonlybug select * from withonlybug; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list