Changeset: a8d28d9e8a4a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a8d28d9e8a4a Modified Files: sql/test/BugTracker-2020/Tests/All Branch: mtest Log Message:
merged with default diffs (truncated from 398 to 300 lines): diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c --- a/monetdb5/mal/mal_interpreter.c +++ b/monetdb5/mal/mal_interpreter.c @@ -764,9 +764,16 @@ str runMALsequence(Client cntxt, MalBlkP } if (ret == MAL_SUCCEED && ii == pci->argc) { ret = runMALsequence(cntxt, pci->blk, 1, pci->blk->stop, nstk, stk, pci); + //garbageCollector(cntxt, pci->blk, nstk, 0); for (ii = 0; ii < nstk->stktop; ii++) if (ATOMextern(nstk->stk[ii].vtype)) GDKfree(nstk->stk[ii].val.pval); + arg = q->retc; + for (ii = pci->retc; ii < pci->argc; ii++,arg++) { + lhs = &nstk->stk[q->argv[arg]]; + if (lhs->vtype == TYPE_bat) + BBPrelease(lhs->val.bval); + } GDKfree(nstk); } } 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 @@ -206,6 +206,7 @@ SQLrun(Client c, mvc *m) *m->errstr=0; return msg; } + TRC_INFO(SQL_EXECUTION, "Executing: %s", c->query); MT_thread_setworking(c->query); // locate and inline the query template instruction mb = copyMalBlk(c->curprg->def); diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -35,3 +35,6 @@ deallocate-id.Bug-7010 values-groupby.Bug-7013 txtsim-parallel.Bug-7016 release_old_savepoint.Bug-7020 +savepoints_crash_mserver5_1.Bug-7021 +savepoints_crash_mserver5_2.Bug-7021 +transaction_with_unreleased_savepoint.Bug-7022 diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.sql b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.sql @@ -0,0 +1,15 @@ +-- triggers a SIGSEGV in sql/storage/store.c:185: if (--(i->base.refcnt) > 0) +start transaction; +create table savepointtest (id int, primary key(id)); +savepoint name1; +insert into savepointtest values(1), (2), (3); +savepoint name2; +insert into savepointtest values(4), (5), (6); +insert into savepointtest values(7), (8), (9); +--savepoint name3; +select * from savepointtest; +commit; + +select 42; +select * from savepointtest; + diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.err b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.err @@ -0,0 +1,12 @@ +stderr of test 'savepoints_crash_mserver5_1.Bug-7021` in directory 'sql/test/BugTracker-2020` itself: + + +# 11:57:43 > +# 11:57:43 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-153790" "--port=36420" +# 11:57:43 > + + +# 11:57:44 > +# 11:57:44 > "Done." +# 11:57:44 > + diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.out b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_1.Bug-7021.stable.out @@ -0,0 +1,57 @@ +stdout of test 'savepoints_crash_mserver5_1.Bug-7021` in directory 'sql/test/BugTracker-2020` itself: + + +# 11:57:43 > +# 11:57:43 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-153790" "--port=36420" +# 11:57:43 > + +#start transaction; +#create table savepointtest (id int, primary key(id)); +#savepoint name1; +#insert into savepointtest values(1), (2), (3); +[ 3 ] +#savepoint name2; +#insert into savepointtest values(4), (5), (6); +[ 3 ] +#insert into savepointtest values(7), (8), (9); +[ 3 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 1 # length +[ 1 ] +[ 2 ] +[ 3 ] +[ 4 ] +[ 5 ] +[ 6 ] +[ 7 ] +[ 8 ] +[ 9 ] +#commit; +#select 42; +% .%2 # table_name +% %2 # name +% tinyint # type +% 2 # length +[ 42 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 1 # length +[ 1 ] +[ 2 ] +[ 3 ] +[ 4 ] +[ 5 ] +[ 6 ] +[ 7 ] +[ 8 ] +[ 9 ] + +# 11:57:44 > +# 11:57:44 > "Done." +# 11:57:44 > + diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.sql b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.sql @@ -0,0 +1,15 @@ +-- triggers: sql/storage/store.c:3940: trans_init: Assertion `istmp || !c->base.allocated' failed. +start transaction; +create table savepointtest (id int, primary key(id)); +savepoint name1; +insert into savepointtest values(1), (2), (3); +--savepoint name2; +insert into savepointtest values(4), (5), (6); +insert into savepointtest values(7), (8), (9); +savepoint name3; +select * from savepointtest; +commit; + +select 42; +select * from savepointtest; + diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.err b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.err @@ -0,0 +1,12 @@ +stderr of test 'savepoints_crash_mserver5_2.Bug-7021` in directory 'sql/test/BugTracker-2020` itself: + + +# 12:00:17 > +# 12:00:17 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-154330" "--port=38327" +# 12:00:17 > + + +# 12:00:17 > +# 12:00:17 > "Done." +# 12:00:17 > + diff --git a/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.out b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_2.Bug-7021.stable.out @@ -0,0 +1,57 @@ +stdout of test 'savepoints_crash_mserver5_2.Bug-7021` in directory 'sql/test/BugTracker-2020` itself: + + +# 12:00:17 > +# 12:00:17 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-154330" "--port=38327" +# 12:00:17 > + +#start transaction; +#create table savepointtest (id int, primary key(id)); +#savepoint name1; +#insert into savepointtest values(1), (2), (3); +[ 3 ] +#insert into savepointtest values(4), (5), (6); +[ 3 ] +#insert into savepointtest values(7), (8), (9); +[ 3 ] +#savepoint name3; +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 1 # length +[ 1 ] +[ 2 ] +[ 3 ] +[ 4 ] +[ 5 ] +[ 6 ] +[ 7 ] +[ 8 ] +[ 9 ] +#commit; +#select 42; +% .%2 # table_name +% %2 # name +% tinyint # type +% 2 # length +[ 42 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 1 # length +[ 1 ] +[ 2 ] +[ 3 ] +[ 4 ] +[ 5 ] +[ 6 ] +[ 7 ] +[ 8 ] +[ 9 ] + +# 12:00:17 > +# 12:00:17 > "Done." +# 12:00:17 > + diff --git a/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.sql b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.sql @@ -0,0 +1,33 @@ +-- this works +start transaction; +create table savepointtest (id int, primary key(id)); +savepoint name1; +insert into savepointtest values(24); +release savepoint name1; +commit; +select * from tables where name = 'savepointtest'; +select * from savepointtest; + +create table savepointtest (id int, primary key(id)); +insert into savepointtest values(42); +select * from tables where name = 'savepointtest'; +select * from savepointtest; +drop table savepointtest; +select * from tables where name = 'savepointtest'; + +-- this shows errors +start transaction; +create table savepointtest (id int, primary key(id)); +savepoint name1; +insert into savepointtest values(24); +commit; +select * from tables where name = 'savepointtest'; +select * from savepointtest; + +create table savepointtest (id int, primary key(id)); +insert into savepointtest values(42); +select * from tables where name = 'savepointtest'; +-- the 2nd 'savepointtest` is used by SELECT and DROP +select * from savepointtest; +drop table savepointtest; +select * from tables where name = 'savepointtest'; diff --git a/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.err b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.err @@ -0,0 +1,20 @@ +stderr of test 'transaction_with_unreleased_savepoint.Bug-7022` in directory 'sql/test/BugTracker-2020` itself: + + +# 14:14:39 > +# 14:14:39 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-162442" "--port=32313" +# 14:14:39 > + +MAPI = (monetdb) /var/tmp/mtest-162442/.s.monetdb.32313 +QUERY = create table savepointtest (id int, primary key(id)); +ERROR = !CREATE TABLE: name 'savepointtest' already in use +CODE = 42S01 +MAPI = (monetdb) /var/tmp/mtest-162442/.s.monetdb.32313 +QUERY = create table savepointtest (id int, primary key(id)); +ERROR = !CREATE TABLE: name 'savepointtest' already in use +CODE = 42S01 + +# 14:14:40 > +# 14:14:40 > "Done." _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list