Changeset: 0359765d0bfa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0359765d0bfa
Modified Files:
        sql/test/miscellaneous/Tests/transaction_isolation.SQL.py
Branch: Jul2021
Log Message:

Delete count mismatch


diffs (55 lines):

diff --git a/sql/test/miscellaneous/Tests/transaction_isolation.SQL.py 
b/sql/test/miscellaneous/Tests/transaction_isolation.SQL.py
--- a/sql/test/miscellaneous/Tests/transaction_isolation.SQL.py
+++ b/sql/test/miscellaneous/Tests/transaction_isolation.SQL.py
@@ -50,4 +50,51 @@ with SQLTestCase() as mdb1:
         mdb1.execute('SELECT i FROM 
integers;').assertDataResultMatch([(4,),(7,)])
         mdb2.execute('SELECT i FROM 
integers;').assertDataResultMatch([(4,),(7,)])
 
+        mdb1.execute('TRUNCATE integers;').assertRowCount(2)
+        mdb1.execute("insert into integers (select value from 
generate_series(1,21,1));").assertRowCount(20) # 1 - 20
+
+        mdb1.execute('start transaction;').assertSucceeded()
+        mdb2.execute('start transaction;').assertSucceeded()
+        mdb1.execute("delete from integers where i % 5 <> 
0;").assertRowCount(16)
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(4,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(20,)])
+        mdb1.execute("update integers set i = i + 1 where i % 2 = 
0;").assertRowCount(2)
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(4,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(20,)])
+        mdb1.execute("insert into integers (select value from 
generate_series(1,11,1));").assertRowCount(10)
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(14,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(20,)])
+        mdb1.execute("delete from integers where i between 1 and 
5;").assertRowCount(6)
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(8,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(20,)])
+        mdb1.execute('TRUNCATE integers;').assertRowCount(8)
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(0,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(20,)])
+        mdb1.execute('rollback;').assertSucceeded()
+        mdb2.execute('rollback;').assertSucceeded()
+
+        mdb1.execute("insert into integers (select value from 
generate_series(1,21,1));").assertRowCount(20) # 1 - 20, 1 - 20
+
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(40,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(40,)])
+
+        mdb1.execute("insert into integers (select value from 
generate_series(1,201,1));").assertRowCount(200) # 1 - 20, 1 - 20, 1 - 200
+        mdb1.execute('start transaction;').assertSucceeded()
+        mdb1.execute("delete from integers where i < 21;").assertRowCount(60) 
# 1 - 180
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(180,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(240,)])
+        mdb1.execute("insert into integers (select value from 
generate_series(11,301,1));").assertRowCount(290) # 1 - 180, 11 - 300
+        mdb1.execute('commit;').assertSucceeded()
+
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(470,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(470,)])
+
+        mdb1.execute('start transaction;').assertSucceeded()
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(470,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(470,)])
+        mdb1.execute("delete from integers where i < 
101;").assertRowCount(190) # 101 - 180, 101 - 300
+        mdb1.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(280,)])
+        mdb2.execute('SELECT count(*) FROM 
integers;').assertDataResultMatch([(470,)])
+        mdb1.execute('commit;').assertSucceeded()
+
         mdb1.execute("drop table integers;")
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to