-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2149 from kuzudb/fix-issue
Fix bug in generic scan rel tables
- Loading branch information
Showing
16 changed files
with
180 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-GROUP EmptyCreateNodeTest | ||
-DATASET CSV empty | ||
|
||
-- | ||
|
||
-CASE CreateStruct | ||
-STATEMENT CREATE NODE TABLE test(id INT64, prop STRUCT(age INT64, name STRING), PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT CREATE (a:test {id:1, prop:{age:10, name:'A'}}) | ||
---- ok | ||
-STATEMENT MATCH (a:test) RETURN a.prop | ||
---- 1 | ||
{age: 10, name: A} | ||
|
||
-CASE CreateStructWithWriteTransaction | ||
-STATEMENT CREATE NODE TABLE test(id INT64, prop STRUCT(age INT64, name STRING), PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT BEGIN TRANSACTION | ||
---- ok | ||
-STATEMENT CREATE (a:test {id:1, prop:{age:10, name:'A'}}) | ||
---- ok | ||
-STATEMENT MATCH (a:test) RETURN a.prop | ||
---- 1 | ||
{age: 10, name: A} | ||
-STATEMENT COMMIT | ||
---- ok | ||
|
||
-CASE CreateDeleteNodeOnEmptyTable | ||
-STATEMENT CREATE NODE TABLE emptyTable(id INT64, prop INT64[], PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT CREATE (e:emptyTable {id: 0, prop: [3,2]}) | ||
---- ok | ||
-STATEMENT MATCH (a:emptyTable) RETURN a.* | ||
---- 1 | ||
0|[3,2] | ||
-STATEMENT MATCH (a:emptyTable) DELETE a | ||
---- ok | ||
-STATEMENT CREATE (e:emptyTable {id: 2, prop: [1,5,6]}) | ||
---- ok | ||
-STATEMENT MATCH (a:emptyTable) RETURN a.* | ||
---- 1 | ||
2|[1,5,6] | ||
|
||
-CASE CreateMap | ||
-STATEMENT CREATE NODE TABLE test(name STRING, m MAP(STRING,STRING), PRIMARY KEY(name)); | ||
---- ok | ||
-STATEMENT CREATE (t:test {name:"foo"}); | ||
---- ok | ||
-STATEMENT CREATE (t:test {name:"foobar"}); | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.*; | ||
---- 2 | ||
foo| | ||
foobar| |
2 changes: 1 addition & 1 deletion
2
...iles/tinysnb/update_node/create_read.test → ...iles/update_node/create_read_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateNodeTest | ||
-GROUP TinySnbCreateReadNodeTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...est_files/tinysnb/update_node/delete.test → ...est_files/update_node/delete_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateNodeTest | ||
-GROUP TinySnbDeleteNodeTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
2 changes: 1 addition & 1 deletion
2
...test_files/tinysnb/update_node/merge.test → ...test_files/update_node/merge_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateNodeTest | ||
-GROUP TinySnbMergeNodeTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
-GROUP EmptySetNodeTest | ||
-DATASET CSV empty | ||
|
||
-- | ||
|
||
-CASE SetStructValueToNonNull | ||
-STATEMENT CREATE NODE TABLE test(id INT64, prop STRUCT(age INT64, name STRING), PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:1, prop:{age:10, name:'Alice'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:2, prop:{age:20, name:'Bobdjiweknfwhuwiehfuw'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:3, prop:{age:30, name:'Delta'}}) | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
{age: 10, name: Alice} | ||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} | ||
-STATEMENT MATCH (t:test) WHERE t.id=1 SET t.prop={age:11, name:'Alicennewjfnwefwfw'} | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
{age: 11, name: Alicennewjfnwefwfw} | ||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} | ||
|
||
-CASE SetStructValueWithWriteTransaction | ||
-STATEMENT CREATE NODE TABLE test(id INT64, prop STRUCT(age INT64, name STRING), PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:1, prop:{age:10, name:'Alice'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:2, prop:{age:20, name:'Bobdjiweknfwhuwiehfuw'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:3, prop:{age:30, name:'Delta'}}) | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
{age: 10, name: Alice} | ||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} | ||
-STATEMENT BEGIN TRANSACTION | ||
---- ok | ||
-STATEMENT MATCH (t:test) WHERE t.id=1 SET t.prop={age:11, name:'Alicennewjfnwefwfw'} | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
{age: 11, name: Alicennewjfnwefwfw} | ||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} | ||
-STATEMENT COMMIT | ||
---- ok | ||
|
||
-CASE SetStructValueToNull | ||
-STATEMENT CREATE NODE TABLE test(id INT64, prop STRUCT(age INT64, name STRING), PRIMARY KEY(id)); | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:1, prop:{age:10, name:'Alice'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:2, prop:{age:20, name:'Bobdjiweknfwhuwiehfuw'}}) | ||
---- ok | ||
-STATEMENT CREATE (t:test {id:3, prop:{age:30, name:'Delta'}}) | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
{age: 10, name: Alice} | ||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} | ||
-STATEMENT MATCH (t:test) WHERE t.id=1 SET t.prop=NULL | ||
---- ok | ||
-STATEMENT MATCH (t:test) RETURN t.prop | ||
---- 3 | ||
|
||
{age: 20, name: Bobdjiweknfwhuwiehfuw} | ||
{age: 30, name: Delta} |
2 changes: 1 addition & 1 deletion
2
...t_files/tinysnb/update_node/set_read.test → test/test_files/update_node/set_read.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateNodeTest | ||
-GROUP TinySnbSetReadNodeTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-GROUP EmptyCreateRelTest | ||
-DATASET CSV empty | ||
|
||
-- | ||
|
||
-CASE CreateRels | ||
-STATEMENT CREATE NODE TABLE N1(name STRING, PRIMARY KEY(name)); | ||
---- ok | ||
-STATEMENT CREATE NODE TABLE N2(name STRING, PRIMARY KEY(name)); | ||
---- ok | ||
-STATEMENT CREATE REL TABLE Rel1(FROM N1 TO N2); | ||
---- ok | ||
-STATEMENT CREATE REL TABLE Rel2(FROM N1 TO N2); | ||
---- ok | ||
-STATEMENT CREATE (n1:N1 {name: "n1a"}), (n2:N2 {name: "n2a"}), (n1)-[:Rel1]->(n2); | ||
---- ok | ||
-STATEMENT MATCH ()-[e:Rel1]->() RETURN e; | ||
---- 1 | ||
(0:0)-{_LABEL: Rel1, _ID: 2:0}->(1:0) | ||
-STATEMENT MATCH ()-[e:Rel2]->() RETURN e; | ||
---- 0 | ||
-STATEMENT MATCH ()-[e]->() RETURN e; | ||
---- 1 | ||
(0:0)-{_LABEL: Rel1, _ID: 2:0}->(1:0) |
2 changes: 1 addition & 1 deletion
2
...files/tinysnb/update_rel/create_read.test → ...files/update_rel/create_read_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateTest | ||
-GROUP TinySnbCreateReadRelTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
2 changes: 1 addition & 1 deletion
2
...test_files/tinysnb/update_rel/delete.test → ...test_files/update_rel/delete_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateRelTest | ||
-GROUP TinySnbDeleteRelTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
2 changes: 1 addition & 1 deletion
2
.../test_files/tinysnb/update_rel/merge.test → .../test_files/update_rel/merge_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateRelTest | ||
-GROUP TinySnbMergeRelTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
2 changes: 1 addition & 1 deletion
2
...st_files/tinysnb/update_rel/set_read.test → ...st_files/update_rel/set_read_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateRelTest | ||
-GROUP TinySnbSetReadRelTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|
2 changes: 1 addition & 1 deletion
2
test/test_files/tinysnb/update_rel/set.test → test/test_files/update_rel/set_tinysnb.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-GROUP TinySnbUpdateRelTest | ||
-GROUP TinySnbSetRelTest | ||
-DATASET CSV tinysnb | ||
|
||
-- | ||
|