diff --git a/src/dbtest/src/convert_sql2cypher.py b/src/dbtest/src/convert_sql2cypher.py new file mode 100644 index 00000000..a6c43358 --- /dev/null +++ b/src/dbtest/src/convert_sql2cypher.py @@ -0,0 +1,95 @@ +import os +import re + +def sql_to_cypher(sql_line: str) -> str: + line = sql_line.strip() + if not line: + return line + + # 保留 serializable 部分原样 + if line.startswith("serializable") or line.startswith("}"): + return line + if re.match(r"^\d+-\d*,?\d*", line) and not any(kw in line.lower() for kw in ["drop", "create", "insert", "select", "update", "begin", "commit"]): + return line + + # 提取前缀 + if "-" in line: + prefix_str, stmt = line.split("-", 2)[0] + "-" + line.split("-", 2)[1], line.split("-", 2)[2] + else: + return line + stmt = stmt.strip().rstrip(";") + + # 获取表名,作为标签(例如 t1 → :T1) + m_table = re.search(r"\bfrom\s+(\w+)|\binto\s+(\w+)|\bupdate\s+(\w+)|\btable\s+(\w+)", stmt, re.I) + label = "Test" + if m_table: + for g in m_table.groups(): + if g: + label = g.capitalize() + + # DROP TABLE + if stmt.lower().startswith("drop table"): + return f"{prefix_str}-MATCH (n:{label}) DETACH DELETE n;" + + # CREATE TABLE + if stmt.lower().startswith("create table"): + return f"{prefix_str}-// CREATE TABLE ignored in Cypher" + + # INSERT + m = re.match(r"insert into \w+ values\s*\((\d+),\s*(\d+)\)", stmt, re.I) + if m: + k, v = m.groups() + return f"{prefix_str}-CREATE (:{label} {{k: {k}, v: {v}}});" + + # SELECT + if stmt.lower().startswith("select"): + if "where" in stmt.lower(): + m = re.match(r"select \* from \w+ where k\s*=\s*(\d+)", stmt, re.I) + if m: + k = m.group(1) + return f"{prefix_str}-MATCH (n:{label} {{k: {k}}}) RETURN n;" + if "order by" in stmt.lower(): + return f"{prefix_str}-MATCH (n:{label}) RETURN n ORDER BY n.k;" + + # UPDATE + m = re.match(r"update \w+ set v\s*=\s*(\d+) where k\s*=\s*(\d+)", stmt, re.I) + if m: + v, k = m.groups() + return f"{prefix_str}-MATCH (n:{label} {{k: {k}}}) SET n.v = {v};" + + # BEGIN + if stmt.lower() == "begin": + return f"{prefix_str}-:begin" + + # COMMIT + if stmt.lower() == "commit": + return f"{prefix_str}-:commit" + + # 默认保留 + return f"{prefix_str}// [Unmapped] {stmt}" + + +def convert_folder(input_folder: str, output_folder: str): + if not os.path.exists(output_folder): + os.makedirs(output_folder) + + for filename in os.listdir(input_folder): + if filename.endswith(".txt"): + input_path = os.path.join(input_folder, filename) + output_path = os.path.join(output_folder, filename) + + with open(input_path, "r", encoding="utf-8") as infile: + lines = infile.readlines() + + converted_lines = [sql_to_cypher(line) for line in lines] + + with open(output_path, "w", encoding="utf-8") as outfile: + outfile.write("\n".join(converted_lines)) + + print(f"Converted {filename} → {output_path}") + + +if __name__ == "__main__": + input_folder = "./../t/pg" + output_folder = "./../t/neo4j" + convert_folder(input_folder, output_folder) diff --git a/src/dbtest/src/mda_generate.py b/src/dbtest/src/mda_generate.py index c10768a7..2b1615c0 100644 --- a/src/dbtest/src/mda_generate.py +++ b/src/dbtest/src/mda_generate.py @@ -63,6 +63,10 @@ def __init__(self, op_type, txn_num, op_num): def init_table(file_name, sql_count, txn_count, table_num, db_type, test_type): data_num = 2 with open(file_name, "a+") as file_test: + if db_type == "neo4j": + # 图数据库无需建表,直接返回 + file_test.write(f"# {sql_count}-{txn_count}-Neo4j: No table creation needed.\n") + return data_num for i in range(1, table_num + 1): drop_sql = str(sql_count) + "-" + str(txn_count) + "-" + "DROP TABLE IF EXISTS t" + str(i) + ";\n" file_test.write(drop_sql) @@ -252,18 +256,27 @@ def insert_data(file_name, sql_count, txn_count, cur_count, partition_num, inser # if it is not initialization, we need to pay attention to whether the transaction should be started if sql_count != 0 and txn[txn_count].begin_ts == -1: txn[txn_count].begin_ts = sql_count - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) sql_count += 1 exist[cur_count] = True - if data_num == 2: + if db_type == "neo4j": + # Cypher: 创建节点 + insert_cypher = f"{sql_count}-{txn_count}-CREATE (n:Test {{k: {cur_count}, v: {cur_count}}});\n" + file_test.write(insert_cypher) + elif data_num == 2: insert_sql = str(sql_count) + "-" + str(txn_count) + "-" + "INSERT INTO t" + \ str(insert_table) + " VALUES (" + str(cur_count) + "," + str(cur_count) + ");\n" + file_test.write(insert_sql) else: insert_sql = str(sql_count) + "-" + str(txn_count) + "-" + "INSERT INTO t" + \ str(insert_table) + " VALUES (" + str(cur_count) + "," + str(partition_num) + \ "," + str(cur_count) + "," + str(cur_count) + ");\n" - file_test.write(insert_sql) + file_test.write(insert_sql) data_value[cur_count] = cur_count except OptionException: if data_num == 2: @@ -308,17 +321,26 @@ def delete_data(file_name, sql_count, txn_count, cur_count, delete_table, data_n else: if txn[txn_count].begin_ts == -1: txn[txn_count].begin_ts = sql_count - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) sql_count += 1 exist[cur_count] = False - if data_num == 2: + if db_type == "neo4j": + # Cypher: 删除节点 + delete_cypher = f"{sql_count}-{txn_count}-MATCH (n:Test {{k: {cur_count}}}) DELETE n;\n" + file_test.write(delete_cypher) + elif data_num == 2: delete_sql = str(sql_count) + "-" + str(txn_count) + "-" + "DELETE FROM t" + \ str(delete_table) + " WHERE k=" + str(cur_count) + ";\n" + file_test.write(delete_sql) else: delete_sql = str(sql_count) + "-" + str(txn_count) + "-" + "DELETE FROM t" + \ str(delete_table) + " WHERE value1=" + str(cur_count) + ";\n" - file_test.write(delete_sql) + file_test.write(delete_sql) data_op_list[cur_count].append(Operation("D", txn_count)) except OptionException: file_test.write("the transaction has ended and cannot be read") @@ -360,17 +382,26 @@ def write_data(file_name, sql_count, txn_count, op_num, data_num, txn, data_valu else: if txn[txn_count].begin_ts == -1: txn[txn_count].begin_ts = sql_count - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) sql_count += 1 - if data_num == 2: + if db_type == "neo4j": + # Cypher: 更新节点属性 + write_cypher = f"{sql_count}-{txn_count}-MATCH (n:Test {{k: {op_num}}}) SET n.v = {data_value[op_num] + 1};\n" + file_test.write(write_cypher) + elif data_num == 2: write_sql = str(sql_count) + "-" + str(txn_count) + "-" + "UPDATE t1 SET v=" + \ str(data_value[op_num] + 1) + " WHERE k=" + str(op_num) + ";\n" + file_test.write(write_sql) else: write_sql = str(sql_count) + "-" + str(txn_count) + "-" + "UPDATE t" + str(txn_count) + \ " SET value2=" + str(data_value[op_num] + 1) + " WHERE value1=" + \ str(op_num) + ";\n" - file_test.write(write_sql) + file_test.write(write_sql) data_op_list[op_num].append(Operation("W", txn_count)) data_value[op_num] += 1 except OptionException: @@ -409,16 +440,25 @@ def read_data(file_name, sql_count, txn_count, op_num, data_num, txn, data_op_li else: if txn[txn_count].begin_ts == -1: txn[txn_count].begin_ts = sql_count - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) sql_count += 1 - if data_num == 2: + if db_type == "neo4j": + # Cypher: 查询节点 + read_cypher = f"{sql_count}-{txn_count}-MATCH (n:Test {{k: {op_num}}}) RETURN n;\n" + file_test.write(read_cypher) + elif data_num == 2: read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t1 WHERE k=" + \ str(op_num) + ";\n" + file_test.write(read_sql) else: read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t" + str(txn_count) + \ " WHERE value1=" + str(op_num) + ";\n" - file_test.write(read_sql) + file_test.write(read_sql) data_op_list[op_num].append(Operation("R", txn_count)) except OptionException: file_test.write("the transaction has ended and cannot be read") @@ -456,16 +496,25 @@ def read_data_predicate(file_name, sql_count, txn_count, op_num, data_num, txn, else: if txn[txn_count].begin_ts == -1: txn[txn_count].begin_ts = sql_count - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) sql_count += 1 - if data_num == 2: + if db_type == "neo4j": + # Cypher: 范围查询 + read_cypher = f"{sql_count}-{txn_count}-MATCH (n:Test) WHERE n.k > {op_num*2} AND n.k < {op_num*2+2} RETURN n;\n" + file_test.write(read_cypher) + elif data_num == 2: read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t1 WHERE k>" + \ str(op_num*2) + " and k<" + str(op_num*2+2) + ";\n" + file_test.write(read_sql) else: read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t" + str(txn_count) + \ " WHERE value1>" + str(op_num*2) + " and value1<" + str(op_num*2+2) + ";\n" - file_test.write(read_sql) + file_test.write(read_sql) data_op_list[op_num].append(Operation("P", txn_count)) except OptionException: file_test.write("the transaction has ended and cannot be read") @@ -499,8 +548,12 @@ def abort_txn(file_name, sql_count, txn_count, txn): raise OptionException else: txn[txn_count].end_ts = sql_count - abort_sql = str(sql_count) + "-" + str(txn_count) + "-" + "ROLLBACK;\n" - file_test.write(abort_sql) + if db_type == "neo4j": + abort_cypher = f"{sql_count}-{txn_count}-:rollback\n" + file_test.write(abort_cypher) + else: + abort_sql = str(sql_count) + "-" + str(txn_count) + "-" + "ROLLBACK;\n" + file_test.write(abort_sql) except OptionException: file_test.write("transaction" + str(txn_count) + " ended and can't be rolled back again") print("transaction" + str(txn_count) + " ended and can't be rolled back again") @@ -533,8 +586,12 @@ def commit_txn(file_name, sql_count, txn_count, txn): raise OptionException else: txn[txn_count].end_ts = sql_count - commit_sql = str(sql_count) + "-" + str(txn_count) + "-" + "COMMIT;\n" - file_test.write(commit_sql) + if db_type == "neo4j": + commit_cypher = f"{sql_count}-{txn_count}-:commit\n" + file_test.write(commit_cypher) + else: + commit_sql = str(sql_count) + "-" + str(txn_count) + "-" + "COMMIT;\n" + file_test.write(commit_sql) except OptionException: file_test.write("transaction" + str(txn_count) + " ended and can't be committed again") print("transaction" + str(txn_count) + " ended and can't be committed again") @@ -558,20 +615,32 @@ def commit_txn(file_name, sql_count, txn_count, txn): """ def execute_check(file_name, sql_count, txn_count, data_num, table_num): with open(file_name, "a+") as file_test: - begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" - file_test.write(begin_sql) - sql_count += 1 - for i in range(1, table_num + 1): - if data_num == 2: - read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t1 ORDER BY k;\n" - else: - read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t" + str(i) + \ - " ORDER BY k;\n" - file_test.write(read_sql) + if db_type == "neo4j": + begin_cypher = f"{sql_count}-{txn_count}-:begin\n" + file_test.write(begin_cypher) + sql_count += 1 + # 只需一次全图查询 + read_cypher = f"{sql_count}-{txn_count}-MATCH (n:Test) RETURN n ORDER BY n.k;\n" + file_test.write(read_cypher) + sql_count += 1 + commit_cypher = f"{sql_count}-{txn_count}-:commit\n" + file_test.write(commit_cypher) + sql_count += 1 + else: + begin_sql = str(sql_count) + "-" + str(txn_count) + "-" + "BEGIN;\n" + file_test.write(begin_sql) + sql_count += 1 + for i in range(1, table_num + 1): + if data_num == 2: + read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t1 ORDER BY k;\n" + else: + read_sql = str(sql_count) + "-" + str(txn_count) + "-" + "SELECT * FROM t" + str(i) + \ + " ORDER BY k;\n" + file_test.write(read_sql) + sql_count += 1 + commit_sql = str(sql_count) + "-" + str(txn_count) + "-" + "COMMIT;\n" + file_test.write(commit_sql) sql_count += 1 - commit_sql = str(sql_count) + "-" + str(txn_count) + "-" + "COMMIT;\n" - file_test.write(commit_sql) - sql_count += 1 """ Check the last operation before the current position in a list of operations. diff --git a/src/dbtest/t/neo4j/iat_dda_read_skew_committed.txt b/src/dbtest/t/neo4j/iat_dda_read_skew_committed.txt new file mode 100644 index 00000000..3d740eec --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_read_skew_committed.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) RETURN n; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +7-1,0 +9-0,1 1,1 + +2-0,1 +7-1,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_dda_read_write_skew1_committed.txt b/src/dbtest/t/neo4j/iat_dda_read_write_skew1_committed.txt new file mode 100644 index 00000000..626cc616 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_read_write_skew1_committed.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +9-0,1 1,2 + +2-0,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_dda_write_skew.txt b/src/dbtest/t/neo4j/iat_dda_write_skew.txt new file mode 100644 index 00000000..948eca7f --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_write_skew.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +8-3-:commit + +serializable { +2-0,0 +4-1,1 +9-0,1 1,1 + +2-0,1 +4-1,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_dda_write_skew_committed.txt b/src/dbtest/t/neo4j/iat_dda_write_skew_committed.txt new file mode 100644 index 00000000..1c2e8a7a --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_write_skew_committed.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +4-1,1 +9-0,1 1,1 + +2-0,1 +4-1,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-intersecting_data.txt b/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-intersecting_data.txt new file mode 100644 index 00000000..7ca6f766 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-intersecting_data.txt @@ -0,0 +1,31 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:Mytab {k: 1, v: 10}); +0-1-CREATE (:Mytab {k: 1, v: 20}); +0-1-CREATE (:Mytab {k: 2, v: 100}); +0-1-CREATE (:Mytab {k: 2, v: 200}); +0-1-:commit +1-1-:begin +2-1// [Unmapped] SELECT SUM(value) FROM mytab WHERE class = 1 +3-1-CREATE (:Mytab {k: 2, v: 30}); +4-2-:begin +5-2// [Unmapped] SELECT SUM(value) FROM mytab WHERE class = 2 +6-2-CREATE (:Mytab {k: 1, v: 300}); +7-2-:commit +8-1-:commit +9-3// [Unmapped] SELECT SUM(value) FROM mytab WHERE class = 1 +10-3// [Unmapped] SELECT SUM(value) FROM mytab WHERE class = 2 +12-3-:commit + +serializable { +2-30, +5-330, +9-330, +10-330, + +2-330, +5-300, +9-330, +10-330, +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-overdraft_protection.txt b/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-overdraft_protection.txt new file mode 100644 index 00000000..097c8272 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_dda_write_skew_predicate_based-overdraft_protection.txt @@ -0,0 +1,26 @@ +ParamNum:3 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1// [Unmapped] insert into account values ('kevin','saving', 500) +0-1// [Unmapped] insert into account values ('kevin','checking', 500) +0-1-:commit +1-1-:begin +2-1// [Unmapped] select type, balance from account where name = 'kevin' +3-2-:begin +4-2// [Unmapped] select type, balance from account where name = 'kevin' +5-2// [Unmapped] update account set balance = balance + 900 where name = 'kevin' and type = 'saving' +6-2-:commit +7-1// [Unmapped] update account set balance = balance + 900 where name = 'kevin' and type = 'checking' +8-1// [Unmapped] COMMIT: +9-3// [Unmapped] select * from account +10-3-:commit + +serializable { +2-checking,500, saving,500, +4-checking,500, saving,1400, +9-kevin,checking,1400 kevin,saving,1400 + +2-checking,1400, saving,500, +4-checking,500, saving,500, +9-kevin,checking,1400 kevin,saving,1400 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat.txt b/src/dbtest/t/neo4j/iat_mda_step_iat.txt new file mode 100644 index 00000000..70b6c72f --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat.txt @@ -0,0 +1,53 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 2}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-3-:begin +6-3-MATCH (n:T1 {k: 1}) RETURN n; +7-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +8-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +9-3-MATCH (n:T1 {k: 2}) SET n.v = 1; +10-1-:commit +11-2-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +2-2,0 +4-0,1 +6-1,1 +13-0,1 1,1 2,1 + +2-2,0 +4-0,1 +6-1,0 +13-0,1 1,1 2,1 + +2-2,0 +4-0,0 +6-1,1 +13-0,1 1,1 2,1 + +2-2,1 +4-0,0 +6-1,1 +13-0,1 1,1 2,1 + +2-2,1 +4-0,1 +6-1,0 +13-0,1 1,1 2,1 + +2-2,1 +4-0,0 +6-1,0 +13-0,1 1,1 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_causality_violation_anomaly.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_causality_violation_anomaly.txt new file mode 100644 index 00000000..530e6802 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_causality_violation_anomaly.txt @@ -0,0 +1,51 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +5-2-:commit +6-3-:begin +7-3-MATCH (n:T1 {k: 0}) RETURN n; +8-3-MATCH (n:T1 {k: 1}) SET n.v = 1; +9-3-:commit +10-1-MATCH (n:T1 {k: 1}) RETURN n; +11-1-:commit +12-4-MATCH (n:T1) RETURN n ORDER BY n.k; +13-4-:commit + +serializable { +2-0,0 +7-0,1 +10-1,0 +12-0,1 1,1 + +2-0,0 +7-0,0 +10-1,0 +12-0,1 1,1 + +2-0,1 +7-0,1 +10-1,1 +12-0,1 1,1 + +2-0,1 +7-0,1 +10-1,0 +12-0,1 1,1 + +2-0,0 +7-0,0 +10-1,1 +12-0,1 1,1 + +2-0,1 +7-0,0 +10-1,1 +12-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_cross_phenomenon.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_cross_phenomenon.txt new file mode 100644 index 00000000..0662862c --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_cross_phenomenon.txt @@ -0,0 +1,108 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-3-:begin +6-3-MATCH (n:T1 {k: 0}) SET n.v = 1; +7-3-:commit +8-4-:begin +9-4-MATCH (n:T1 {k: 1}) SET n.v = 1; +10-4-:commit +11-2-MATCH (n:T1 {k: 0}) RETURN n; +12-2-:commit +13-1-MATCH (n:T1 {k: 1}) RETURN n; +14-1-:commit +15-5-MATCH (n:T1) RETURN n ORDER BY n.k; +16-5-:commit + +serializable { +2-0,0 +4-1,0 +13-1,0 +11-0,0 +15-0,1 1,1 + +2-0,0 +4-1,1 +13-1,0 +11-0,0 +15-0,1 1,1 + +2-0,0 +4-1,0 +13-1,0 +11-0,1 +15-0,1 1,1 + +2-0,0 +4-1,1 +13-1,0 +11-0,1 +15-0,1 1,1 + +2-0,0 +4-1,0 +13-1,1 +11-0,0 +15-0,1 1,1 + +2-0,1 +4-1,0 +13-1,0 +11-0,0 +15-0,1 1,1 + +2-0,1 +4-1,0 +13-1,1 +11-0,0 +15-0,1 1,1 + +2-0,0 +4-1,1 +13-1,1 +11-0,0 +15-0,1 1,1 + +2-0,1 +4-1,0 +13-1,0 +11-0,1 +15-0,1 1,1 + +2-0,1 +4-1,1 +13-1,1 +11-0,1 +15-0,1 1,1 + +2-0,0 +4-1,1 +13-1,1 +11-0,1 +15-0,1 1,1 + +2-0,1 +4-1,1 +13-1,1 +11-0,0 +15-0,1 1,1 + +2-0,1 +4-1,1 +13-1,0 +11-0,1 +15-0,1 1,1 + +2-0,1 +4-1,0 +13-1,1 +11-0,1 +15-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_delete.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_delete.txt new file mode 100644 index 00000000..944ba75f --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_delete.txt @@ -0,0 +1,53 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 2}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-3-:begin +6-3-MATCH (n:T1 {k: 1}) RETURN n; +7-1-DELETE FROM t1 WHERE k=0; +8-2-DELETE FROM t1 WHERE k=1; +9-3-DELETE FROM t1 WHERE k=2; +10-1-:commit +11-2-:commit +12-3-:commit +13-4// [Unmapped] select * from t1 +14-4-:commit + +serializable { +2-2,0 +4-null +6-null +13-null + +2-2,0 +4-null +6-1,0 +13-null + +2-2,0 +4-0,0 +6-null +13-null + +2-null +4-0,0 +6-1,1 +13-null + +2-null +4-null +6-1,0 +13-null + +2-null +4-0,0 +6-1,0 +13-null +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_insert.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_insert.txt new file mode 100644 index 00000000..130f32c5 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_predicate_based_insert.txt @@ -0,0 +1,50 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 2}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-3-:begin +6-3-MATCH (n:T1 {k: 1}) RETURN n; +7-1-CREATE (:T1 {k: 0, v: 0}); +8-2-CREATE (:T1 {k: 1, v: 0}); +9-3-CREATE (:T1 {k: 2, v: 0}); +10-1-:commit +11-2-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +2-null +4-0,1 +6-1,1 +13-0,1 1,1 2,1 + +2-null +4-0,1 +6-null +13-0,1 1,1 2,1 + +2-null +4-null +6-1,1 +13-0,1 1,1 2,1 + +2-2,1 +4-null +6-1,1 +13-0,1 1,1 2,1 + +2-2,1 +4-0,1 +6-null +13-0,1 1,1 2,1 + +2-2,1 +4-null +6-null +13-0,1 1,1 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_read_only_transaction_anomaly.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_read_only_transaction_anomaly.txt new file mode 100644 index 00000000..e18df2f5 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_read_only_transaction_anomaly.txt @@ -0,0 +1,65 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-1-MATCH (n:T1 {k: 1}) RETURN n; +4-2-:begin +5-2-MATCH (n:T1 {k: 1}) RETURN n; +6-2-MATCH (n:T1 {k: 1}) SET n.v = 20; +7-2-:commit +8-3-:begin +9-3-MATCH (n:T1 {k: 0}) RETURN n; +10-3-MATCH (n:T1 {k: 1}) RETURN n; +11-3-:commit +12-1-MATCH (n:T1 {k: 0}) SET n.v = 11; +13-1-:commit +14-3-MATCH (n:T1) RETURN n ORDER BY n.k; +15-3-:commit + +serializable { +2-0,0 +3-1,0 +5-1,0 +9-0,11 +10-1,20 +14-0,11 1,20 + +2-0,0 +3-1,0 +5-1,0 +9-0,11 +10-1,0 +14-0,11 1,20 + +2-0,0 +3-1,20 +5-1,0 +9-0,0 +10-1,20 +14-0,11 1,20 + +2-0,0 +3-1,20 +5-1,0 +9-0,11 +10-1,20 +14-0,11 1,20 + +2-0,0 +3-1,0 +5-1,0 +9-0,0 +10-1,0 +14-0,11 1,20 + +2-0,0 +3-1,20 +5-1,0 +9-0,0 +10-1,0 +14-0,11 1,20 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_mda_step_iat_uname_anomaly.txt b/src/dbtest/t/neo4j/iat_mda_step_iat_uname_anomaly.txt new file mode 100644 index 00000000..96ca6dde --- /dev/null +++ b/src/dbtest/t/neo4j/iat_mda_step_iat_uname_anomaly.txt @@ -0,0 +1,75 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 1}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-2-MATCH (n:T1 {k: 1}) RETURN n; +7-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-2-:commit +9-3-:begin +10-3-MATCH (n:T1 {k: 2}) RETURN n; +11-3-MATCH (n:T1 {k: 2}) SET n.v = 1; +12-3-MATCH (n:T1 {k: 0}) RETURN n; +13-3-MATCH (n:T1 {k: 0}) SET n.v = 2; +14-3-:commit +15-1-MATCH (n:T1 {k: 2}) RETURN n; +16-1-:commit +17-4-MATCH (n:T1) RETURN n ORDER BY n.k; +18-4-:commit + +serializable { +2-1,0 +4-0,0 +6-1,0 +10-2,0 +12-0,1 +15-2,0 +17-0,2 1,1 2,1 + +2-1,0 +4-0,2 +6-1,0 +10-2,0 +12-0,0 +15-2,0 +17-0,2 1,1 2,1 + +2-1,1 +4-0,0 +6-1,0 +10-2,0 +12-0,1 +15-2,0 +17-0,2 1,1 2,1 + +2-1,2 +4-0,0 +6-1,0 +10-2,0 +12-0,1 +15-2,2 +17-0,2 1,1 2,1 + +2-1,0 +4-0,2 +6-1,0 +10-2,0 +12-0,0 +15-2,1 +17-0,2 1,1 2,1 + +2-1,1 +4-0,2 +6-1,0 +10-2,0 +12-0,0 +15-2,1 +17-0,2 1,1 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_sda_lost_update_committed.txt b/src/dbtest/t/neo4j/iat_sda_lost_update_committed.txt new file mode 100644 index 00000000..67060d90 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_sda_lost_update_committed.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-2-:commit +6-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-0,0 +8-0,2 + +2-0,2 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/iat_sda_non_repeatable_read_committed.txt b/src/dbtest/t/neo4j/iat_sda_non_repeatable_read_committed.txt new file mode 100644 index 00000000..68a7e6d2 --- /dev/null +++ b/src/dbtest/t/neo4j/iat_sda_non_repeatable_read_committed.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +5-2-:commit +6-1-MATCH (n:T1 {k: 0}) RETURN n; +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-0,0 +6-0,0 +8-0,1 + +2-0,1 +6-0,1 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_double_write_skew1.txt b/src/dbtest/t/neo4j/rat_dda_double_write_skew1.txt new file mode 100644 index 00000000..a7b69ab6 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_double_write_skew1.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 2; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +5-0,1 +9-0,1 1,1 + +5-0,0 +9-0,1 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_double_write_skew1_committed.txt b/src/dbtest/t/neo4j/rat_dda_double_write_skew1_committed.txt new file mode 100644 index 00000000..0f74f71c --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_double_write_skew1_committed.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 2; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +5-0,1 +9-0,1 1,1 + +5-0,0 +9-0,1 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_double_write_skew2.txt b/src/dbtest/t/neo4j/rat_dda_double_write_skew2.txt new file mode 100644 index 00000000..0baf4cb3 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_double_write_skew2.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-1-MATCH (n:T1 {k: 1}) RETURN n; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +6-1,0 +9-0,2 1,1 + +6-1,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew.txt b/src/dbtest/t/neo4j/rat_dda_read_skew.txt new file mode 100644 index 00000000..067a7f94 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-1-MATCH (n:T1 {k: 1}) RETURN n; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +6-1,0 +9-0,1 1,1 + +2-0,1 +6-1,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew2.txt b/src/dbtest/t/neo4j/rat_dda_read_skew2.txt new file mode 100644 index 00000000..4104b334 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew2.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +4-1,1 +5-0,1 +9-0,1 1,1 + +4-1,0 +5-0,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew2_committed.txt b/src/dbtest/t/neo4j/rat_dda_read_skew2_committed.txt new file mode 100644 index 00000000..c3bf753c --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew2_committed.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +4-1,1 +5-0,1 +9-0,1 1,1 + +4-1,0 +5-0,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_delete.txt b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_delete.txt new file mode 100644 index 00000000..aabd1f60 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_delete.txt @@ -0,0 +1,27 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1// [Unmapped] select * from t1 where v=0 +3-2-:begin +4-2-DELETE FROM t1 WHERE k=1; +5-2-DELETE FROM t1 WHERE k=0; +6-2-:commit +7-1// [Unmapped] select * from t1 where v=0 +8-1// [Unmapped] COMMIT: +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-null +7-null +9-null + + +2-0,0 1,0 +7-0,0 1,0 +9-null +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert.txt b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert.txt new file mode 100644 index 00000000..580bf68e --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-:commit +1-1-:begin +2-1// [Unmapped] select * from t1 where v=0 +3-2-:begin +4-2-CREATE (:T1 {k: 1, v: 0}); +5-2-CREATE (:T1 {k: 0, v: 0}); +6-2-:commit +7-1// [Unmapped] select * from t1 where v=0 +8-1// [Unmapped] COMMIT: +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-null +7-null +9-0,0 1,0 + +2-0,0 1,0 +7-0,0 1,0 +9-0,0 1,0 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert_test.txt b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert_test.txt new file mode 100644 index 00000000..39774484 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_read_skew_predicate_based_insert_test.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-:commit +1-1-:begin +2-1// [Unmapped] SELECT SUM(v) FROM t1 WHERE k >= 1 +3-2-:begin +4-2-CREATE (:T1 {k: 0, v: 1}); +5-2-CREATE (:T1 {k: 1, v: 2}); +6-2-:commit +7-1// [Unmapped] SELECT SUM(v) FROM t1 WHERE k <= 0 +8-1// [Unmapped] COMMIT: +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + + +serializable { +2-, +7-, +9-0,1 1,2 + + +2-1 +7-2 +9-0,1 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_write_read_skew.txt b/src/dbtest/t/neo4j/rat_dda_write_read_skew.txt new file mode 100644 index 00000000..bb00a847 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_write_read_skew.txt @@ -0,0 +1,26 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-1-MATCH (n:T1 {k: 1}) RETURN n; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +5-0,1 +6-1,0 +9-0,1 1,1 + +5-0,0 +6-1,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_dda_write_read_skew_committed.txt b/src/dbtest/t/neo4j/rat_dda_write_read_skew_committed.txt new file mode 100644 index 00000000..6014d627 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_dda_write_read_skew_committed.txt @@ -0,0 +1,28 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) RETURN n; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +5-0,1 +7-1,0 +9-0,1 1,1 + +5-0,0 +7-1,1 +9-0,1 1,1 +} + + diff --git a/src/dbtest/t/neo4j/rat_mda_step_rat.txt b/src/dbtest/t/neo4j/rat_mda_step_rat.txt new file mode 100644 index 00000000..e07aa7df --- /dev/null +++ b/src/dbtest/t/neo4j/rat_mda_step_rat.txt @@ -0,0 +1,53 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) RETURN n; +6-3-:begin +7-3-MATCH (n:T1 {k: 2}) SET n.v = 1; +8-3-MATCH (n:T1 {k: 1}) RETURN n; +9-1-MATCH (n:T1 {k: 2}) RETURN n; +10-1-:commit +11-2-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +5-0,1 +8-1,1 +9-2,0 +13-0,1 1,1 2,1 + +5-0,1 +8-1,0 +9-2,0 +13-0,1 1,1 2,1 + +5-0,0 +8-1,1 +9-2,0 +13-0,1 1,1 2,1 + +5-0,0 +8-1,1 +9-2,1 +13-0,1 1,1 2,1 + +5-0,1 +8-1,0 +9-2,1 +13-0,1 1,1 2,1 + +5-0,0 +8-1,0 +9-2,1 +13-0,1 1,1 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_mda_step_rat_long_fork.txt b/src/dbtest/t/neo4j/rat_mda_step_rat_long_fork.txt new file mode 100644 index 00000000..a60dfbd0 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_mda_step_rat_long_fork.txt @@ -0,0 +1,108 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-4-:begin +2-4-MATCH (n:T1 {k: 0}) RETURN n; +3-1-:begin +4-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +5-3-:begin +6-3-MATCH (n:T1 {k: 1}) RETURN n; +7-3-MATCH (n:T1 {k: 0}) RETURN n; +8-2-:begin +9-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +10-4-MATCH (n:T1 {k: 1}) RETURN n; +11-1-:commit +12-2-:commit +13-3-:commit +14-4-:commit +15-4-MATCH (n:T1) RETURN n ORDER BY n.k; +16-4-:commit + +serializable { +2-0,0 +6-1,0 +7-0,0 +10-1,0 +15-0,1 1,1 + +2-0,1 +6-1,0 +7-0,0 +10-1,1 +15-0,1 1,1 + +2-0,0 +6-1,1 +7-0,1 +10-1,0 +15-0,1 1,1 + +2-0,1 +6-1,1 +7-0,1 +10-1,1 +15-0,1 1,1 + +2-0,1 +6-1,0 +7-0,1 +10-1,0 +15-0,1 1,1 + +2-0,0 +6-1,1 +7-0,0 +10-1,1 +15-0,1 1,1 + +2-0,1 +6-1,1 +7-0,1 +10-1,0 +15-0,1 1,1 + +2-0,1 +6-1,0 +7-0,1 +10-1,1 +15-0,1 1,1 + +2-0,0 +6-1,1 +7-0,1 +10-1,1 +15-0,1 1,1 + +2-0,1 +6-1,1 +7-0,0 +10-1,1 +15-0,1 1,1 + +2-0,0 +6-1,0 +7-0,0 +10-1,1 +15-0,1 1,1 + +2-0,1 +6-1,0 +7-0,0 +10-1,0 +15-0,1 1,1 + +2-0,0 +6-1,0 +7-0,1 +10-1,0 +15-0,1 1,1 + +2-0,0 +6-1,1 +7-0,0 +10-1,0 +15-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_delete.txt b/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_delete.txt new file mode 100644 index 00000000..4f91dc6d --- /dev/null +++ b/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_delete.txt @@ -0,0 +1,53 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 1}); +0-1-CREATE (:T1 {k: 1, v: 1}); +0-1-CREATE (:T1 {k: 2, v: 1}); +0-1-:commit +1-1-:begin +2-1-DELETE FROM t1 WHERE k=0; +3-2-:begin +4-2-DELETE FROM t1 WHERE k=1; +5-2// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 0 +6-3-:begin +7-3-DELETE FROM t1 WHERE k=2; +8-3// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 1 +9-1// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 2 +10-1-:commit +11-2-:commit +12-3-:commit +13-4// [Unmapped] select * from t1 +14-4-:commit + +serializable { +5-, +8-, +9-1, +13-null + +5-, +8-1, +9-1, +13-null + +5-1, +8-, +9-1, +13-null + +5-1, +8-1, +9-, +13-null + +5-, +8-1, +9-, +13-null + +5-1, +8-1, +9-, +13-null +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_insert.txt b/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_insert.txt new file mode 100644 index 00000000..240541a1 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_mda_step_rat_predicate_based_insert.txt @@ -0,0 +1,50 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-:commit +1-1-:begin +2-1-CREATE (:T1 {k: 0, v: 1}); +3-2-:begin +4-2-CREATE (:T1 {k: 1, v: 1}); +5-2// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 0 +6-3-:begin +7-3-CREATE (:T1 {k: 2, v: 1}); +8-3// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 1 +9-1// [Unmapped] SELECT SUM(v) FROM t1 WHERE k = 2 +10-1-:commit +11-2-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +5-, +8-1, +9-1, +13-0,1 1,1 2,1 + +5-, +8-1, +9-, +13-0,1 1,1 2,1 + +5-, +8-, +9-1, +13-0,1 1,1 2,1 + +5-1, +8-, +9-1, +13-0,1 1,1 2,1 + +5-1, +8-1, +9-, +13-0,1 1,1 2,1 + +5-1, +8-, +9-, +13-0,1 1,1 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_sda_dirty_read.txt b/src/dbtest/t/neo4j/rat_sda_dirty_read.txt new file mode 100644 index 00000000..f6a96914 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_dirty_read.txt @@ -0,0 +1,18 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-1-ROLLBACK; +6-2-:commit +7-3// [Unmapped] SELECT * FROM t1 +8-3-:commit + +serializable { +4-0,0 +7-0,0 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_sda_intermediate_read.txt b/src/dbtest/t/neo4j/rat_sda_intermediate_read.txt new file mode 100644 index 00000000..5c610d0a --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_intermediate_read.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-1-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-2-:commit +7-1-:commit +8-3// [Unmapped] SELECT * from t1 +9-3-:commit + +serializable { +4-0,2 +8-0,2 + +4-0,0 +8-0,2 +} diff --git a/src/dbtest/t/neo4j/rat_sda_intermediate_read_committed.txt b/src/dbtest/t/neo4j/rat_sda_intermediate_read_committed.txt new file mode 100644 index 00000000..9eaf2e9c --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_intermediate_read_committed.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) RETURN n; +5-2-:commit +6-1-MATCH (n:T1 {k: 0}) SET n.v = 2; +7-1-:commit +8-3// [Unmapped] SELECT * from t1 +9-3-:commit + +serializable { +4-0,2 +8-0,2 + +4-0,0 +8-0,2 +} diff --git a/src/dbtest/t/neo4j/rat_sda_lost_self_update.txt b/src/dbtest/t/neo4j/rat_sda_lost_self_update.txt new file mode 100644 index 00000000..29e570b6 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_lost_self_update.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-MATCH (n:T1 {k: 0}) RETURN n; +6-1-:commit +7-2-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +5-0,1 +8-0,2 + +5-0,1 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_sda_non_repeatable_read.txt b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read.txt new file mode 100644 index 00000000..c35ed405 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +5-1-MATCH (n:T1 {k: 0}) RETURN n; +6-2-:commit +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-0,0 +5-0,0 +8-0,1 + +2-0,1 +5-0,1 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_delete.txt b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_delete.txt new file mode 100644 index 00000000..35b8aecd --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_delete.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1// [Unmapped] SELECT * from t1 WHERE v=0 +3-2-:begin +4-2-DELETE FROM t1 WHERE k=0; +5-2-:commit +6-1// [Unmapped] SELECT * from t1 WHERE v=0 +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-null +6-null +8-0,0 + +2-0,0 +6-0,0 +8-null +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_insert.txt b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_insert.txt new file mode 100644 index 00000000..e8ae60c7 --- /dev/null +++ b/src/dbtest/t/neo4j/rat_sda_non_repeatable_read_predicate_based-phantom_insert.txt @@ -0,0 +1,23 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-:commit +1-1-:begin +2-1// [Unmapped] SELECT * from t1 WHERE v=0 +3-2-:begin +4-2-CREATE (:T1 {k: 0, v: 0}); +5-2-:commit +6-1// [Unmapped] SELECT * from t1 WHERE v=0 +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-null +6-null +8-0,0 + +2-0,0 +6-0,0 +8-0,0 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_double_write_skew2_committed.txt b/src/dbtest/t/neo4j/wat_dda_double_write_skew2_committed.txt new file mode 100644 index 00000000..dcabbe75 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_double_write_skew2_committed.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 1; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) RETURN n; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +7-1,0 +9-0,2 1,1 + +7-1,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_full_write_skew_c1.txt b/src/dbtest/t/neo4j/wat_dda_full_write_skew_c1.txt new file mode 100644 index 00000000..3f92164e --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_full_write_skew_c1.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +9-0,1 1,1 + +9-0,2 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_full_write_skew_c2.txt b/src/dbtest/t/neo4j/wat_dda_full_write_skew_c2.txt new file mode 100644 index 00000000..c7e7805f --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_full_write_skew_c2.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +9-0,1 1,1 + +9-0,2 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_full_write_skew_committed.txt b/src/dbtest/t/neo4j/wat_dda_full_write_skew_committed.txt new file mode 100644 index 00000000..8671af2d --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_full_write_skew_committed.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +9-0,1 1,1 + +9-0,2 1,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c1.txt b/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c1.txt new file mode 100644 index 00000000..8d1aa256 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c1.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +9-0,1 1,2 + +2-0,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c2.txt b/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c2.txt new file mode 100644 index 00000000..afc45f9b --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_read_write_skew1_c2.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +2-0,0 +9-0,1 1,2 + +2-0,1 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c1.txt b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c1.txt new file mode 100644 index 00000000..8d5c954e --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c1.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-1-:commit +8-2-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +4-1,1 +9-0,2 1,1 + +4-1,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c2.txt b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c2.txt new file mode 100644 index 00000000..539b99af --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_c2.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +7-2-:commit +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +4-1,1 +9-0,2 1,1 + +4-1,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_dda_read_write_skew2_committed.txt b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_committed.txt new file mode 100644 index 00000000..e96e6670 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_dda_read_write_skew2_committed.txt @@ -0,0 +1,24 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) RETURN n; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-2-:commit +7-1-MATCH (n:T1 {k: 1}) SET n.v = 1; +8-1-:commit +9-3-MATCH (n:T1) RETURN n ORDER BY n.k; +10-3-:commit + +serializable { +4-1,1 +9-0,2 1,1 + +4-1,0 +9-0,1 1,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_mda_step_wat_c1.txt b/src/dbtest/t/neo4j/wat_mda_step_wat_c1.txt new file mode 100644 index 00000000..ccf47439 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_mda_step_wat_c1.txt @@ -0,0 +1,35 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +6-3-:begin +7-3-MATCH (n:T1 {k: 2}) SET n.v = 3; +8-3-MATCH (n:T1 {k: 1}) SET n.v = 3; +9-1-MATCH (n:T1 {k: 2}) SET n.v = 1; +10-1-:commit +11-2-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +13-0,2 1,3 2,3 + +13-0,2 1,2 2,3 + +13-0,1 1,3 2,3 + +13-0,1 1,3 2,1 + +13-0,2 1,2 2,1 + +13-0,1 1,2 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_mda_step_wat_c2.txt b/src/dbtest/t/neo4j/wat_mda_step_wat_c2.txt new file mode 100644 index 00000000..5f3d4dea --- /dev/null +++ b/src/dbtest/t/neo4j/wat_mda_step_wat_c2.txt @@ -0,0 +1,35 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-CREATE (:T1 {k: 1, v: 0}); +0-1-CREATE (:T1 {k: 2, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 1}) SET n.v = 2; +5-3-:begin +6-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +7-3-MATCH (n:T1 {k: 2}) SET n.v = 3; +8-3-MATCH (n:T1 {k: 1}) SET n.v = 3; +9-1-MATCH (n:T1 {k: 2}) SET n.v = 1; +10-2-:commit +11-1-:commit +12-3-:commit +13-4-MATCH (n:T1) RETURN n ORDER BY n.k; +14-4-:commit + +serializable { +13-0,2 1,3 2,3 + +13-0,2 1,2 2,3 + +13-0,1 1,3 2,3 + +13-0,1 1,3 2,1 + +13-0,2 1,2 2,1 + +13-0,1 1,2 2,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_dirty_write_1abort.txt b/src/dbtest/t/neo4j/wat_sda_dirty_write_1abort.txt new file mode 100644 index 00000000..f39a3a4a --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_dirty_write_1abort.txt @@ -0,0 +1,20 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-ROLLBACK; +6-2-:commit +7-3// [Unmapped] SELECT * FROM t1 +8-3-MATCH (n:If) DETACH DELETE n; +9-3-:commit + +serializable { +7-0,1 + +7-0,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_dirty_write_2commit.txt b/src/dbtest/t/neo4j/wat_sda_dirty_write_2commit.txt new file mode 100644 index 00000000..a78dc6a4 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_dirty_write_2commit.txt @@ -0,0 +1,21 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-:commit +6-2-:commit +7-3// [Unmapped] SELECT * FROM t1 +8-3-MATCH (n:If) DETACH DELETE n; +9-3-:commit + + +serializable { +7-0,1 + +7-0,2 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_full_write.txt b/src/dbtest/t/neo4j/wat_sda_full_write.txt new file mode 100644 index 00000000..d907f2bb --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_full_write.txt @@ -0,0 +1,20 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-MATCH (n:T1 {k: 0}) SET n.v = 3; +6-1-:commit +7-2-:commit +8-3// [Unmapped] SELECT * from t1 +9-3-:commit + +serializable { +8-0,2 + +8-0,3 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_full_write_committed.txt b/src/dbtest/t/neo4j/wat_sda_full_write_committed.txt new file mode 100644 index 00000000..fdb03701 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_full_write_committed.txt @@ -0,0 +1,20 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-2-:commit +6-1-MATCH (n:T1 {k: 0}) SET n.v = 3; +7-1-:commit +8-3// [Unmapped] SELECT * from t1 +9-3-:commit + +serializable { +8-0,2 + +8-0,3 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_lost_self_update_committed.txt b/src/dbtest/t/neo4j/wat_sda_lost_self_update_committed.txt new file mode 100644 index 00000000..0acedb63 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_lost_self_update_committed.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-2-:commit +6-1-MATCH (n:T1 {k: 0}) RETURN n; +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +6-0,1 +8-0,2 + +6-0,1 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_lost_update_c1.txt b/src/dbtest/t/neo4j/wat_sda_lost_update_c1.txt new file mode 100644 index 00000000..88939996 --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_lost_update_c1.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-1-:commit +7-2-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-0,0 +8-0,2 + +2-0,2 +8-0,1 +} \ No newline at end of file diff --git a/src/dbtest/t/neo4j/wat_sda_lost_update_c2.txt b/src/dbtest/t/neo4j/wat_sda_lost_update_c2.txt new file mode 100644 index 00000000..0ffa313e --- /dev/null +++ b/src/dbtest/t/neo4j/wat_sda_lost_update_c2.txt @@ -0,0 +1,22 @@ +ParamNum:2 +0-1-MATCH (n:If) DETACH DELETE n; +0-1-// CREATE TABLE ignored in Cypher +0-1-CREATE (:T1 {k: 0, v: 0}); +0-1-:commit +1-1-:begin +2-1-MATCH (n:T1 {k: 0}) RETURN n; +3-2-:begin +4-2-MATCH (n:T1 {k: 0}) SET n.v = 2; +5-1-MATCH (n:T1 {k: 0}) SET n.v = 1; +6-2-:commit +7-1-:commit +8-3// [Unmapped] SELECT * FROM t1 +9-3-:commit + +serializable { +2-0,0 +8-0,2 + +2-0,2 +8-0,1 +} \ No newline at end of file