Changeset: 4d49e1eeb095 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4d49e1eeb095
Modified Files:
        gdk/gdk_bat.c
        gdk/gdk_bbp.c
Branch: default
Log Message:

Merge with Sep2022 branch.


diffs (truncated from 700 to 300 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -737,9 +737,9 @@ BATdestroy(BAT *b)
                GDKfree(b->theap);
        }
        if (b->oldtail) {
+               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
                /* the bat has not been committed, so we cannot remove
                 * the old tail file */
-               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
                HEAPdecref(b->oldtail, false);
                b->oldtail = NULL;
        }
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3184,6 +3184,11 @@ BBPdestroy(BAT *b)
                if (vtp != 0)
                        BBPrelease(vtp);
        }
+       if (b->oldtail) {
+               ATOMIC_AND(&b->oldtail->refs, ~DELAYEDREMOVE);
+               HEAPdecref(b->oldtail, true);
+               b->oldtail = NULL;
+       }
        BATdelete(b);
 
        BBPclear(b->batCacheid);        /* if destroyed; de-register from BBP */
diff --git a/sql/test/BugTracker-2021/Tests/concurrent-add-column.Bug-7196.test 
b/sql/test/BugTracker-2021/Tests/concurrent-add-column.Bug-7196.test
--- a/sql/test/BugTracker-2021/Tests/concurrent-add-column.Bug-7196.test
+++ b/sql/test/BugTracker-2021/Tests/concurrent-add-column.Bug-7196.test
@@ -1,12 +1,9 @@
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 create table test (id bigint)
 
-@connection(id=1)
 statement ok
 insert into test values (1)
 
-@connection(id=1)
 statement ok
 start transaction
 
@@ -14,7 +11,6 @@ start transaction
 statement ok
 start transaction
 
-@connection(id=1)
 statement ok
 alter table test add column data int
 
@@ -22,7 +18,6 @@ alter table test add column data int
 statement ok
 insert into test values (2)
 
-@connection(id=1)
 statement ok
 commit
 
@@ -30,7 +25,6 @@ commit
 statement error 40001!COMMIT: transaction is aborted because of concurrency 
conflicts, will ROLLBACK instead
 commit
 
-@connection(id=1)
 query II nosort
 select * from test
 ----
@@ -44,7 +38,6 @@ select * from test
 1
 NULL
 
-@connection(id=1)
 statement ok
 start transaction
 
@@ -52,7 +45,6 @@ start transaction
 statement ok
 start transaction
 
-@connection(id=1)
 statement ok
 alter table test drop column data
 
@@ -60,7 +52,6 @@ alter table test drop column data
 statement ok
 insert into test values (3,4)
 
-@connection(id=1)
 statement ok
 commit
 
@@ -68,7 +59,6 @@ commit
 statement error 40001!COMMIT: transaction is aborted because of concurrency 
conflicts, will ROLLBACK instead
 commit
 
-@connection(id=1)
 query I nosort
 select * from test
 ----
diff --git 
a/sql/test/BugTracker-2021/Tests/replace-transaction-conflict.Bug-7168.test 
b/sql/test/BugTracker-2021/Tests/replace-transaction-conflict.Bug-7168.test
--- a/sql/test/BugTracker-2021/Tests/replace-transaction-conflict.Bug-7168.test
+++ b/sql/test/BugTracker-2021/Tests/replace-transaction-conflict.Bug-7168.test
@@ -1,8 +1,6 @@
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 CREATE OR REPLACE FUNCTION mybooludf(a bool) RETURNS BOOL RETURN a
 
-@connection(id=1)
 statement ok
 start transaction
 
@@ -10,7 +8,6 @@ start transaction
 statement ok
 start transaction
 
-@connection(id=1)
 statement ok
 PLAN CREATE OR REPLACE FUNCTION mybooludf(a bool) RETURNS BOOL RETURN a
 
@@ -18,7 +15,6 @@ PLAN CREATE OR REPLACE FUNCTION myboolud
 statement ok
 PLAN CREATE OR REPLACE FUNCTION mybooludf(a bool) RETURNS BOOL RETURN a
 
-@connection(id=1)
 statement ok
 commit
 
@@ -26,7 +22,6 @@ commit
 statement ok
 commit
 
-@connection(id=1)
 statement ok
 start transaction
 
@@ -34,7 +29,6 @@ start transaction
 statement ok
 start transaction
 
-@connection(id=1)
 statement ok
 CREATE OR REPLACE FUNCTION mybooludf(a bool) RETURNS BOOL RETURN a
 
@@ -42,7 +36,6 @@ CREATE OR REPLACE FUNCTION mybooludf(a b
 statement ok
 CREATE OR REPLACE FUNCTION mybooludf(a bool) RETURNS BOOL RETURN a
 
-@connection(id=1)
 statement ok
 commit
 
@@ -50,7 +43,6 @@ commit
 statement ok
 commit
 
-@connection(id=1)
 statement ok
 DROP FUNCTION mybooludf(bool)
 
diff --git a/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test 
b/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
--- a/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
+++ b/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
@@ -1,8 +1,6 @@
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 CREATE TABLE test(k int NOT NULL)
 
-@connection(id=1)
 statement ok
 START TRANSACTION
 
@@ -10,7 +8,6 @@ START TRANSACTION
 statement ok
 START TRANSACTION
 
-@connection(id=1)
 statement ok
 INSERT INTO test VALUES (1)
 
@@ -18,7 +15,6 @@ INSERT INTO test VALUES (1)
 statement ok
 INSERT INTO test VALUES (2)
 
-@connection(id=1)
 statement ok
 COMMIT
 
@@ -26,7 +22,6 @@ COMMIT
 statement ok
 COMMIT
 
-@connection(id=1)
 query I rowsort
 SELECT k FROM test
 ----
@@ -40,7 +35,6 @@ SELECT k FROM test
 1
 2
 
-@connection(id=1)
 statement ok
 DROP TABLE test
 
diff --git a/sql/test/BugTracker-2022/Tests/python-udf-inside-udf.Bug-7252.test 
b/sql/test/BugTracker-2022/Tests/python-udf-inside-udf.Bug-7252.test
--- a/sql/test/BugTracker-2022/Tests/python-udf-inside-udf.Bug-7252.test
+++ b/sql/test/BugTracker-2022/Tests/python-udf-inside-udf.Bug-7252.test
@@ -1,8 +1,6 @@
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 START TRANSACTION
 
-@connection(id=1)
 statement ok
 CREATE FUNCTION pyfunc(i integer) returns table (pyi integer)
 language P
@@ -11,18 +9,15 @@ language P
        return([x])
 }
 
-@connection(id=1)
 statement ok
 CREATE FUNCTION ups(i integer) returns table (i integer)
 BEGIN
        RETURN SELECT pyi FROM pyfunc(i);
 END
 
-@connection(id=1)
 statement ok
 COMMIT
 
-@connection(id=1)
 query I nosort
 select i from ups(1)
 ----
diff --git a/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test 
b/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
--- a/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
+++ b/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
@@ -1,4 +1,3 @@
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 START TRANSACTION
 
@@ -50,7 +49,6 @@ COMMIT
 statement ok
 DROP TABLE a
 
-@connection(id=1)
 statement ok
 ROLLBACK
 
diff --git a/sql/test/concurrent/Tests/smart-segment-merge.test 
b/sql/test/concurrent/Tests/smart-segment-merge.test
--- a/sql/test/concurrent/Tests/smart-segment-merge.test
+++ b/sql/test/concurrent/Tests/smart-segment-merge.test
@@ -1,20 +1,16 @@
 # INIT
 
-@connection(id=1, username=monetdb, password=monetdb)
 statement ok
 CREATE TABLE Test (k int)
 
-@connection(id=1)
 query I nosort
 SELECT segments FROM sys.deltas('sys', 'test')
 ----
 1
 
-@connection(id=1)
 statement ok
 INSERT INTO Test SELECT value FROM generate_series(1, 11)
 
-@connection(id=1)
 query I nosort
 SELECT segments FROM sys.deltas('sys', 'test')
 ----
@@ -28,7 +24,6 @@ 1
 #  as they are next to each other and the active transaction is not able to 
read them;
 # the fourth commit is able to merge everything, as there are no active 
transactions and all segments are contiguous.
 
-@connection(id=1)
 statement ok
 begin transaction
 
@@ -44,11 +39,9 @@ begin transaction
 statement ok
 begin transaction
 
-@connection(id=1)
 statement ok
 INSERT INTO Test VALUES (11)
 
-@connection(id=1)
 query I nosort
 SELECT segments FROM sys.deltas('sys', 'test')
 ----
@@ -58,7 +51,6 @@ 2
 statement ok
 INSERT INTO Test VALUES (12)
 
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to