Changeset: d1c774305959 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d1c774305959 Added Files: sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.sql sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.err sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.out Modified Files: sql/test/BugTracker-2020/Tests/All Branch: Oct2020 Log Message:
Added test and expected out,err for Bug-7022 diffs (167 lines): 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 @@ -36,3 +36,4 @@ 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/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." +# 14:14:40 > + diff --git a/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.out b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/transaction_with_unreleased_savepoint.Bug-7022.stable.out @@ -0,0 +1,91 @@ +stdout 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 > + +#start transaction; +#create table savepointtest (id int, primary key(id)); +#savepoint name1; +#insert into savepointtest values(24); +[ 1 ] +#release savepoint name1; +#commit; +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 4, 13, 4, 0, 1, 5, 1, 1, 1 # length +[ 7399, "savepointtest", 2000, NULL, 0, false, 0, 0, 0 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 2 # length +[ 24 ] +#insert into savepointtest values(42); +[ 1 ] +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 4, 13, 4, 0, 1, 5, 1, 1, 1 # length +[ 7399, "savepointtest", 2000, NULL, 0, false, 0, 0, 0 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 2 # length +[ 24 ] +[ 42 ] +#drop table savepointtest; +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 1, 0, 1, 0, 1, 5, 1, 1, 1 # length +#start transaction; +#create table savepointtest (id int, primary key(id)); +#savepoint name1; +#insert into savepointtest values(24); +[ 1 ] +#commit; +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 4, 13, 4, 0, 1, 5, 1, 1, 1 # length +[ 7404, "savepointtest", 2000, NULL, 0, false, 0, 0, 0 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 2 # length +[ 24 ] +#insert into savepointtest values(42); +[ 1 ] +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 4, 13, 4, 0, 1, 5, 1, 1, 1 # length +[ 7404, "savepointtest", 2000, NULL, 0, false, 0, 0, 0 ] +#select * from savepointtest; +% sys.savepointtest # table_name +% id # name +% int # type +% 2 # length +[ 24 ] +[ 42 ] +#drop table savepointtest; +#select * from tables where name = 'savepointtest'; +% .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables, .tables # table_name +% id, name, schema_id, query, type, system, commit_action, access, temporary # name +% int, varchar, int, varchar, smallint, boolean, smallint, smallint, tinyint # type +% 1, 0, 1, 0, 1, 5, 1, 1, 1 # length + +# 14:14:40 > +# 14:14:40 > "Done." +# 14:14:40 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list