Changeset: 3b3fce55adef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b3fce55adef
Modified Files:
gdk/gdk.h
Branch: default
Log Message:
Merged with Jan2022
diffs (130 lines):
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3864,7 +3864,8 @@ transaction_check_dependencies_and_remov
for (; he && ok == LOG_OK; he = he->chain) {
sql_dependency_change *schange =
(sql_dependency_change*) he->value;
- if (lchange->objid == schange->objid &&
lchange->type == schange->type)
+ /* conflict only if transactions overlap */
+ if (schange->ts >= tr->ts && lchange->objid ==
schange->objid && lchange->type == schange->type)
ok = LOG_CONFLICT;
}
}
@@ -3878,7 +3879,8 @@ transaction_check_dependencies_and_remov
for (; he && ok == LOG_OK; he = he->chain) {
sql_dependency_change *schange =
(sql_dependency_change*) he->value;
- if (lchange->objid == schange->objid &&
lchange->type == schange->type)
+ /* conflict only if transactions overlap */
+ if (schange->ts >= tr->ts && lchange->objid ==
schange->objid && lchange->type == schange->type)
ok = LOG_CONFLICT;
}
}
diff --git
a/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320-Windows.test
b/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320-Windows.test
--- a/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320-Windows.test
+++ b/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320-Windows.test
@@ -8,14 +8,14 @@ query T nosort
plan copy into cm_tmp from E'\\file1',E'\\file2'
----
insert(
-| table("sys"."cm_tmp") [ "cm_tmp"."i", "cm_tmp"."%TID%" NOT NULL ]
+| table("sys"."cm_tmp") [ "cm_tmp"."i", "cm_tmp"."%TID%" NOT NULL UNIQUE ]
| union (
| | project (
-| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "\\file1", bigint(18) "-1", bigint(18)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
+| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "\\file1", bigint(19) "-1", bigint(19)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
| | | ) [ "cm_tmp"."i" ]
| | ) [ "cm_tmp"."i" ],
| | project (
-| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "\\file2", bigint(18) "-1", bigint(18)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
+| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "\\file2", bigint(19) "-1", bigint(19)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
| | | ) [ "cm_tmp"."i" ]
| | ) [ "cm_tmp"."i" ]
| ) [ int(32) NULL ]
@@ -25,14 +25,14 @@ query T nosort
plan copy into cm_tmp from E'a:\\file1','Z:/file2'
----
insert(
-| table("sys"."cm_tmp") [ "cm_tmp"."i", "cm_tmp"."%TID%" NOT NULL ]
+| table("sys"."cm_tmp") [ "cm_tmp"."i", "cm_tmp"."%TID%" NOT NULL UNIQUE ]
| union (
| | project (
-| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "a:\\file1", bigint(18) "-1", bigint(18)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
+| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "a:\\file1", bigint(19) "-1", bigint(19)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
| | | ) [ "cm_tmp"."i" ]
| | ) [ "cm_tmp"."i" ],
| | project (
-| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "Z:/file2", bigint(18) "-1", bigint(18)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
+| | | table ("sys"."copyfrom"(table("cm_tmp"), varchar "|", varchar "\n",
varchar NULL, varchar "null", varchar "Z:/file2", bigint(19) "-1", bigint(19)
"0", int(9) "0", varchar NULL, int(9) "0", int(9) "1"),
| | | ) [ "cm_tmp"."i" ]
| | ) [ "cm_tmp"."i" ]
| ) [ int(32) NULL ]
diff --git a/sql/test/BugTracker-2022/Tests/All
b/sql/test/BugTracker-2022/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2022/Tests/All
@@ -0,0 +1,1 @@
+transaction-conflict.Bug-7228
diff --git a/sql/test/BugTracker-2022/Tests/SingleServer
b/sql/test/BugTracker-2022/Tests/SingleServer
new file mode 100644
diff --git a/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
b/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2022/Tests/transaction-conflict.Bug-7228.test
@@ -0,0 +1,55 @@
+@connection(id=1, username=monetdb, password=monetdb)
+statement ok
+START TRANSACTION
+
+@connection(id=2, username=monetdb, password=monetdb)
+statement ok
+START TRANSACTION
+
+@connection(id=2)
+statement ok
+CREATE TABLE a(s string, i int, b1 bigint)
+
+@connection(id=2)
+statement ok
+COMMIT
+
+@connection(id=2)
+statement ok
+START TRANSACTION
+
+@connection(id=2)
+statement ok
+ALTER TABLE a ADD UNIQUE (s, b1)
+
+@connection(id=2)
+statement ok
+COMMIT
+
+@connection(id=2)
+statement ok
+START TRANSACTION
+
+@connection(id=2)
+statement ok
+CREATE TABLE b(i int)
+
+@connection(id=2)
+statement ok
+UPDATE a SET i = 1
+
+@connection(id=2)
+statement ok
+DROP TABLE b
+
+@connection(id=2)
+statement ok
+COMMIT
+
+@connection(id=2)
+statement ok
+DROP TABLE a
+
+@connection(id=1)
+statement ok
+ROLLBACK
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list