lbug 0.12.3-dev.12 → 0.12.3-dev.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lbug-source/.github/workflows/ci-workflow.yml +9 -2
- package/lbug-source/CMakeLists.txt +15 -6
- package/lbug-source/Makefile +1 -2
- package/lbug-source/benchmark/serializer.py +13 -2
- package/lbug-source/extension/httpfs/test/test_files/http.test +1 -0
- package/lbug-source/scripts/generate_binary_demo.sh +1 -1
- package/lbug-source/test/common/string_format.cpp +9 -1
- package/lbug-source/test/copy/copy_test.cpp +4 -4
- package/lbug-source/test/graph_test/CMakeLists.txt +1 -1
- package/lbug-source/test/test_helper/CMakeLists.txt +1 -1
- package/lbug-source/test/test_runner/CMakeLists.txt +1 -1
- package/lbug-source/test/test_runner/insert_by_row.cpp +6 -8
- package/lbug-source/test/test_runner/multi_copy_split.cpp +2 -4
- package/lbug-source/test/transaction/checkpoint_test.cpp +1 -1
- package/lbug-source/test/transaction/transaction_test.cpp +19 -15
- package/lbug-source/tools/shell/test/test_helper.py +1 -1
- package/package.json +1 -1
- package/prebuilt/lbugjs-darwin-arm64.node +0 -0
- package/prebuilt/lbugjs-linux-arm64.node +0 -0
- package/prebuilt/lbugjs-linux-x64.node +0 -0
- package/prebuilt/lbugjs-win32-x64.node +0 -0
|
@@ -1152,6 +1152,9 @@ jobs:
|
|
|
1152
1152
|
name: minimal test
|
|
1153
1153
|
runs-on: ubuntu-latest
|
|
1154
1154
|
needs: [ sanity-checks ]
|
|
1155
|
+
env:
|
|
1156
|
+
GEN: Ninja
|
|
1157
|
+
USE_STD_FORMAT: 1
|
|
1155
1158
|
steps:
|
|
1156
1159
|
- uses: actions/checkout@v4
|
|
1157
1160
|
|
|
@@ -1159,12 +1162,14 @@ jobs:
|
|
|
1159
1162
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
1160
1163
|
with:
|
|
1161
1164
|
key: minimal-test-${{ runner.os }}
|
|
1165
|
+
max-size: 2G
|
|
1166
|
+
restore-keys: minimal-test-
|
|
1162
1167
|
|
|
1163
1168
|
- name: Build
|
|
1164
|
-
run: make
|
|
1169
|
+
run: make relwithdebinfo
|
|
1165
1170
|
|
|
1166
1171
|
- name: Generate datasets
|
|
1167
|
-
run: bash scripts/generate_binary_demo.sh
|
|
1172
|
+
run: bash scripts/generate_binary_demo.sh --lbug-shell-mode relwithdebinfo
|
|
1168
1173
|
|
|
1169
1174
|
- name: Install uv
|
|
1170
1175
|
run: pip3 install uv
|
|
@@ -1210,6 +1215,8 @@ jobs:
|
|
|
1210
1215
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
1211
1216
|
with:
|
|
1212
1217
|
key: minimal-extension-test-${{ runner.os }}
|
|
1218
|
+
max-size: 2G
|
|
1219
|
+
restore-keys: minimal-extension-test-
|
|
1213
1220
|
|
|
1214
1221
|
- name: Update PostgreSQL host
|
|
1215
1222
|
working-directory: extension/postgres/test/test_files
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.15)
|
|
2
2
|
|
|
3
|
-
project(Lbug VERSION 0.12.3.
|
|
3
|
+
project(Lbug VERSION 0.12.3.14 LANGUAGES CXX C)
|
|
4
4
|
|
|
5
5
|
option(SINGLE_THREADED "Single-threaded mode" FALSE)
|
|
6
6
|
if(SINGLE_THREADED)
|
|
@@ -14,15 +14,26 @@ endif()
|
|
|
14
14
|
|
|
15
15
|
set(CMAKE_CXX_STANDARD 20)
|
|
16
16
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
|
17
|
-
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
|
18
|
-
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
|
19
17
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
20
18
|
set(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS TRUE)
|
|
21
19
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
22
|
-
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
|
|
23
20
|
# On Linux, symbols in executables are not accessible by loaded shared libraries (e.g. via dlopen(3)). However, we need to export public symbols in executables so that extensions can access public symbols. This enables that behaviour.
|
|
24
21
|
set(CMAKE_ENABLE_EXPORTS TRUE)
|
|
25
22
|
|
|
23
|
+
# When building tests, we need all symbols visible so tests can link to the shared library
|
|
24
|
+
# instead of static linking (which bloats binary sizes significantly)
|
|
25
|
+
option(BUILD_TESTS "Build C++ tests." FALSE)
|
|
26
|
+
option(BUILD_EXTENSION_TESTS "Build C++ extension tests." FALSE)
|
|
27
|
+
if(BUILD_TESTS OR BUILD_EXTENSION_TESTS)
|
|
28
|
+
set(CMAKE_CXX_VISIBILITY_PRESET default)
|
|
29
|
+
set(CMAKE_C_VISIBILITY_PRESET default)
|
|
30
|
+
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
|
|
31
|
+
else()
|
|
32
|
+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
|
33
|
+
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
|
34
|
+
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
|
|
35
|
+
endif()
|
|
36
|
+
|
|
26
37
|
option(ENABLE_WERROR "Treat all warnings as errors" FALSE)
|
|
27
38
|
if(ENABLE_WERROR)
|
|
28
39
|
if (CMAKE_VERSION VERSION_GREATER "3.24.0" OR CMAKE_VERSION VERSION_EQUAL "3.24.0")
|
|
@@ -302,8 +313,6 @@ option(BUILD_NODEJS "Build NodeJS API." FALSE)
|
|
|
302
313
|
option(BUILD_PYTHON "Build Python API." FALSE)
|
|
303
314
|
option(BUILD_SHELL "Build Interactive Shell" TRUE)
|
|
304
315
|
option(BUILD_SINGLE_FILE_HEADER "Build single file header. Requires Python >= 3.9." TRUE)
|
|
305
|
-
option(BUILD_TESTS "Build C++ tests." FALSE)
|
|
306
|
-
option(BUILD_EXTENSION_TESTS "Build C++ extension tests." FALSE)
|
|
307
316
|
option(BUILD_LBUG "Build Lbug." TRUE)
|
|
308
317
|
option(ENABLE_BACKTRACES "Enable backtrace printing for exceptions and segfaults" FALSE)
|
|
309
318
|
option(USE_STD_FORMAT "Use std::format instead of a custom formatter." FALSE)
|
package/lbug-source/Makefile
CHANGED
|
@@ -294,9 +294,8 @@ extension-release:
|
|
|
294
294
|
-DBUILD_LBUG=FALSE \
|
|
295
295
|
)
|
|
296
296
|
|
|
297
|
-
# pytest expects a `Release` build path.
|
|
298
297
|
shell-test:
|
|
299
|
-
$(call run-cmake-
|
|
298
|
+
$(call run-cmake-relwithdebinfo, \
|
|
300
299
|
-DBUILD_SHELL=TRUE \
|
|
301
300
|
)
|
|
302
301
|
$(MAKE) -C tools/shell/test test
|
|
@@ -95,17 +95,28 @@ if __name__ == '__main__':
|
|
|
95
95
|
parser.add_argument("--single-thread",
|
|
96
96
|
help="If true, copy single threaded, which makes the results more reproducible",
|
|
97
97
|
action="store_true")
|
|
98
|
+
parser.add_argument("--lbug-shell-mode",
|
|
99
|
+
help="debug, release or relwithdebinfo",
|
|
100
|
+
default="release")
|
|
101
|
+
default_mode = "release"
|
|
98
102
|
if sys.platform == "win32":
|
|
99
103
|
default_lbug_exec_path = os.path.join(
|
|
100
|
-
base_dir, '..', 'build',
|
|
104
|
+
base_dir, '..', 'build', default_mode, 'tools', 'shell', 'lbug_shell')
|
|
101
105
|
else:
|
|
102
106
|
default_lbug_exec_path = os.path.join(
|
|
103
|
-
base_dir, '..', 'build',
|
|
107
|
+
base_dir, '..', 'build', default_mode, 'tools', 'shell', 'lbug')
|
|
104
108
|
parser.add_argument("--lbug-shell",
|
|
105
109
|
help="Path of the lbug shell executable. Defaults to the path as built in the default release build directory",
|
|
106
110
|
default=default_lbug_exec_path)
|
|
107
111
|
args = parser.parse_args()
|
|
108
112
|
|
|
113
|
+
if args.lbug_shell == default_lbug_exec_path:
|
|
114
|
+
mode = args.lbug_shell_mode
|
|
115
|
+
if sys.platform == "win32":
|
|
116
|
+
args.lbug_shell = os.path.join(base_dir, '..', 'build', mode, 'tools', 'shell', 'lbug_shell')
|
|
117
|
+
else:
|
|
118
|
+
args.lbug_shell = os.path.join(base_dir, '..', 'build', mode, 'tools', 'shell', 'lbug')
|
|
119
|
+
|
|
109
120
|
try:
|
|
110
121
|
serialize(args.lbug_shell, args.dataset_name, args.dataset_path, args.serialized_graph_path,
|
|
111
122
|
args.benchmark_copy_log_dir, args.single_thread)
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
CD=`dirname "$0"`
|
|
4
4
|
DATASET_DIR=$CD/../dataset
|
|
5
|
-
python3 $CD/../benchmark/serializer.py DemoDB $DATASET_DIR/demo-db/parquet $DATASET_DIR/binary-demo --single-thread
|
|
5
|
+
python3 $CD/../benchmark/serializer.py DemoDB $DATASET_DIR/demo-db/parquet $DATASET_DIR/binary-demo --single-thread $*
|
|
@@ -10,6 +10,7 @@ TEST(StringFormat, Basic) {
|
|
|
10
10
|
"Some formatted data: a and 423");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
#if !USE_STD_FORMAT
|
|
13
14
|
TEST(StringFormat, Escape) {
|
|
14
15
|
ASSERT_EQ(stringFormat("Escape this {{}} but not this {{ }}"),
|
|
15
16
|
"Escape this {} but not this {{ }}");
|
|
@@ -29,6 +30,7 @@ TEST(StringFormat, TooManyArguments) {
|
|
|
29
30
|
TEST(StringFormat, TooFewArguments) {
|
|
30
31
|
ASSERT_THROW(stringFormat("Format with arguments {}"), InternalException);
|
|
31
32
|
}
|
|
33
|
+
#endif
|
|
32
34
|
|
|
33
35
|
TEST(StringFormat, Format8BitTypes) {
|
|
34
36
|
enum TestEnum : uint8_t {
|
|
@@ -38,7 +40,9 @@ TEST(StringFormat, Format8BitTypes) {
|
|
|
38
40
|
char literal_character = 'a';
|
|
39
41
|
TestEnum enum_val = TestEnum::NO;
|
|
40
42
|
int8_t signed_int8 = 4;
|
|
41
|
-
ASSERT_EQ(
|
|
43
|
+
ASSERT_EQ(
|
|
44
|
+
stringFormat("{} {} {}", literal_character, static_cast<uint8_t>(enum_val), signed_int8),
|
|
45
|
+
"a 1 4");
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
TEST(StringFormat, FormatString) {
|
|
@@ -64,5 +68,9 @@ TEST(StringFormat, FormatIntegers) {
|
|
|
64
68
|
TEST(StringFormat, FormatFloats) {
|
|
65
69
|
float a = 2.3;
|
|
66
70
|
double b = 5.4;
|
|
71
|
+
#if USE_STD_FORMAT
|
|
72
|
+
ASSERT_EQ(stringFormat("{} {}", a, b), "2.3 5.4");
|
|
73
|
+
#else
|
|
67
74
|
ASSERT_EQ(stringFormat("{} {}", a, b), "2.300000 5.400000");
|
|
75
|
+
#endif
|
|
68
76
|
}
|
|
@@ -280,7 +280,7 @@ TEST_F(CopyTest, NodeInsertBMExceptionDuringCommitRecovery) {
|
|
|
280
280
|
.executeFunc =
|
|
281
281
|
[](main::Connection* conn, int) {
|
|
282
282
|
const auto queryString = common::stringFormat(
|
|
283
|
-
"UNWIND RANGE(1,{}) AS i CREATE (a:account {ID:i})", numValues);
|
|
283
|
+
"UNWIND RANGE(1,{}) AS i CREATE (a:account {{ID:i}})", numValues);
|
|
284
284
|
return conn->query(queryString);
|
|
285
285
|
},
|
|
286
286
|
.earlyExitOnFailureFunc = [](main::QueryResult*) { return false; },
|
|
@@ -300,7 +300,7 @@ TEST_F(CopyTest, RelInsertBMExceptionDuringCommitRecovery) {
|
|
|
300
300
|
conn->query("CREATE NODE TABLE account(ID INT64, PRIMARY KEY(ID))");
|
|
301
301
|
conn->query("CREATE REL TABLE follows(FROM account TO account);");
|
|
302
302
|
const auto queryString = common::stringFormat(
|
|
303
|
-
"UNWIND RANGE(1,{}) AS i CREATE (a:account {ID:i})", numNodes);
|
|
303
|
+
"UNWIND RANGE(1,{}) AS i CREATE (a:account {{ID:i}})", numNodes);
|
|
304
304
|
ASSERT_TRUE(conn->query(queryString)->isSuccess());
|
|
305
305
|
failureFrequency = 32;
|
|
306
306
|
},
|
|
@@ -309,7 +309,7 @@ TEST_F(CopyTest, RelInsertBMExceptionDuringCommitRecovery) {
|
|
|
309
309
|
return conn->query(common::stringFormat(
|
|
310
310
|
"UNWIND RANGE(1,{}) AS i MATCH (a:account), (b:account) WHERE a.ID = i AND "
|
|
311
311
|
"b.ID = i + 1 CREATE (a)-[f:follows]->(b)",
|
|
312
|
-
numNodes));
|
|
312
|
+
numNodes - 1));
|
|
313
313
|
},
|
|
314
314
|
.earlyExitOnFailureFunc = [](main::QueryResult*) { return false; },
|
|
315
315
|
.checkFunc =
|
|
@@ -407,7 +407,7 @@ TEST_F(CopyTest, NodeInsertBMExceptionDuringCheckpointRecovery) {
|
|
|
407
407
|
.executeFunc =
|
|
408
408
|
[](main::Connection* conn, int) {
|
|
409
409
|
return conn->query(common::stringFormat(
|
|
410
|
-
"UNWIND RANGE(1,{}) AS i CREATE (a:account {ID:i})", numValues));
|
|
410
|
+
"UNWIND RANGE(1,{}) AS i CREATE (a:account {{ID:i}})", numValues));
|
|
411
411
|
},
|
|
412
412
|
.earlyExitOnFailureFunc = [](main::QueryResult*) { return true; },
|
|
413
413
|
.checkFunc =
|
|
@@ -111,23 +111,21 @@ std::string InsertDatasetByRow::TableInfo::getBodyForLoad() const {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
std::string InsertDatasetByRow::NodeTableInfo::getLoadFromQuery() const {
|
|
114
|
-
const std::string query = "LOAD WITH HEADERS ({}) FROM {} "
|
|
115
|
-
"CREATE (:{} {});";
|
|
116
114
|
const auto header = getHeaderForLoad();
|
|
117
115
|
const auto body = getBodyForLoad();
|
|
118
|
-
return stringFormat(
|
|
116
|
+
return stringFormat("LOAD WITH HEADERS ({}) FROM {} CREATE (:{} {{{}}});", header, filePath,
|
|
117
|
+
name, body);
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
std::string InsertDatasetByRow::RelTableInfo::getLoadFromQuery() const {
|
|
122
|
-
const std::string query = "LOAD WITH HEADERS ({}) FROM {} "
|
|
123
|
-
"MATCH (a:{}), (b:{}) WHERE a.{} = aid_ AND b.{} = bid_ "
|
|
124
|
-
"CREATE (a)-[:{} {}]->(b);";
|
|
125
121
|
auto header = stringFormat("aid_ {},bid_ {}", from.type, to.type);
|
|
126
122
|
auto headerRest = getHeaderForLoad();
|
|
127
123
|
header += headerRest.length() == 0 ? "" : "," + getHeaderForLoad();
|
|
128
124
|
const auto body = getBodyForLoad();
|
|
129
|
-
return stringFormat(
|
|
130
|
-
|
|
125
|
+
return stringFormat("LOAD WITH HEADERS ({}) FROM {} "
|
|
126
|
+
"MATCH (a:{}), (b:{}) WHERE a.{} = aid_ AND b.{} = bid_ "
|
|
127
|
+
"CREATE (a)-[:{} {{{}}}]->(b);",
|
|
128
|
+
header, filePath, from.name, to.name, from.property, to.property, name, body);
|
|
131
129
|
}
|
|
132
130
|
|
|
133
131
|
} // namespace testing
|
|
@@ -62,8 +62,7 @@ void SplitMultiCopyRandom::init() {
|
|
|
62
62
|
|
|
63
63
|
const std::string tmpDir = TestHelper::getTempDir("multi_copy");
|
|
64
64
|
auto totalFilePath = TestHelper::joinPath(tmpDir, tableName + ".csv");
|
|
65
|
-
|
|
66
|
-
loadQuery = stringFormat(loadQuery, source, totalFilePath);
|
|
65
|
+
auto loadQuery = stringFormat("COPY (LOAD FROM {} RETURN *) TO '{}';", source, totalFilePath);
|
|
67
66
|
spdlog::info("QUERY: {}", loadQuery);
|
|
68
67
|
validateQuery(connection, loadQuery);
|
|
69
68
|
|
|
@@ -96,9 +95,8 @@ void SplitMultiCopyRandom::init() {
|
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
void SplitMultiCopyRandom::run() {
|
|
99
|
-
const std::string query = "COPY {} FROM \"{}\";";
|
|
100
98
|
for (auto file : splitFilePaths) {
|
|
101
|
-
auto currQuery = stringFormat(
|
|
99
|
+
auto currQuery = stringFormat("COPY {} FROM \"{}\";", tableName, file);
|
|
102
100
|
spdlog::info("QUERY: {}", currQuery);
|
|
103
101
|
validateQuery(connection, currQuery);
|
|
104
102
|
}
|
|
@@ -37,7 +37,7 @@ public:
|
|
|
37
37
|
conn->query("CALL auto_checkpoint=false");
|
|
38
38
|
conn->query("CREATE NODE TABLE test(id INT64 PRIMARY KEY, name STRING);");
|
|
39
39
|
for (auto i = 0; i < 5000; i++) {
|
|
40
|
-
conn->query(stringFormat("CREATE (a:test {id: {}, name: 'name_{}'});", i, i));
|
|
40
|
+
conn->query(stringFormat("CREATE (a:test {{id: {}, name: 'name_{}'}});", i, i));
|
|
41
41
|
}
|
|
42
42
|
auto context = getClientContext(*conn);
|
|
43
43
|
flakyCheckpointer.setCheckpointer(*context);
|
|
@@ -138,7 +138,8 @@ static void insertNodes(uint64_t startID, uint64_t num, lbug::main::Database& da
|
|
|
138
138
|
auto conn = std::make_unique<lbug::main::Connection>(&database);
|
|
139
139
|
for (uint64_t i = 0; i < num; ++i) {
|
|
140
140
|
auto id = startID + i;
|
|
141
|
-
auto res =
|
|
141
|
+
auto res =
|
|
142
|
+
conn->query(stringFormat("CREATE (:test {{id: {}, name: 'Person{}'}});", id, id));
|
|
142
143
|
ASSERT_TRUE(res->isSuccess())
|
|
143
144
|
<< "Failed to insert test" << id << ": " << res->getErrorMessage();
|
|
144
145
|
}
|
|
@@ -181,7 +182,7 @@ static void insertNodesWithMixedTypes(uint64_t startID, uint64_t num,
|
|
|
181
182
|
auto score = 95.5 + (id % 10);
|
|
182
183
|
auto isActive = (id % 2 == 0) ? "true" : "false";
|
|
183
184
|
auto res = conn->query(
|
|
184
|
-
stringFormat("CREATE (:mixed_test {id: {}, score: {}, active: {}, name: 'User{}'});",
|
|
185
|
+
stringFormat("CREATE (:mixed_test {{id: {}, score: {}, active: {}, name: 'User{}'}});",
|
|
185
186
|
id, score, isActive, id));
|
|
186
187
|
ASSERT_TRUE(res->isSuccess())
|
|
187
188
|
<< "Failed to insert mixed_test" << id << ": " << res->getErrorMessage();
|
|
@@ -227,7 +228,7 @@ static void insertRelationships(uint64_t startID, uint64_t num, lbug::main::Data
|
|
|
227
228
|
auto toID = (startID + i + 1) % (num * 4);
|
|
228
229
|
auto weight = 1.0 + (i % 10) * 0.1;
|
|
229
230
|
auto res = conn->query(stringFormat("MATCH (a:person), (b:person) WHERE a.id = {} AND b.id "
|
|
230
|
-
"= {} CREATE (a)-[:knows {weight: {}}]->(b);",
|
|
231
|
+
"= {} CREATE (a)-[:knows {{weight: {}}}]->(b);",
|
|
231
232
|
fromID, toID, weight));
|
|
232
233
|
ASSERT_TRUE(res->isSuccess()) << "Failed to insert relationship from " << fromID << " to "
|
|
233
234
|
<< toID << ": " << res->getErrorMessage();
|
|
@@ -248,7 +249,8 @@ TEST_F(EmptyDBTransactionTest, ConcurrentRelationshipInsertions) {
|
|
|
248
249
|
|
|
249
250
|
conn->query("BEGIN TRANSACTION;");
|
|
250
251
|
for (auto i = 0; i < numTotalInsertions; ++i) {
|
|
251
|
-
auto res =
|
|
252
|
+
auto res =
|
|
253
|
+
conn->query(stringFormat("CREATE (:person {{id: {}, name: 'Person{}'}});", i, i));
|
|
252
254
|
ASSERT_TRUE(res->isSuccess());
|
|
253
255
|
}
|
|
254
256
|
conn->query("COMMIT;");
|
|
@@ -286,7 +288,7 @@ static void insertComplexRelationships(uint64_t startID, uint64_t num,
|
|
|
286
288
|
auto isVerified = (i % 3 == 0) ? "true" : "false";
|
|
287
289
|
auto res =
|
|
288
290
|
conn->query(stringFormat("MATCH (u:user), (p:product) WHERE u.id = {} AND p.id = {} "
|
|
289
|
-
"CREATE (u)-[:rates {rating: {}, verified: {}}]->(p);",
|
|
291
|
+
"CREATE (u)-[:rates {{rating: {}, verified: {}}}]->(p);",
|
|
290
292
|
userID, productID, rating, isVerified));
|
|
291
293
|
ASSERT_TRUE(res->isSuccess())
|
|
292
294
|
<< "Failed to insert rating from user " << userID << " to product " << productID << ": "
|
|
@@ -309,12 +311,12 @@ TEST_F(EmptyDBTransactionTest, ConcurrentComplexRelationshipInsertions) {
|
|
|
309
311
|
|
|
310
312
|
conn->query("BEGIN TRANSACTION;");
|
|
311
313
|
for (auto i = 0; i < numTotalInsertions; ++i) {
|
|
312
|
-
auto res = conn->query(stringFormat("CREATE (:user {id: {}, name: 'User{}'});", i, i));
|
|
314
|
+
auto res = conn->query(stringFormat("CREATE (:user {{id: {}, name: 'User{}'}});", i, i));
|
|
313
315
|
ASSERT_TRUE(res->isSuccess());
|
|
314
316
|
}
|
|
315
317
|
for (auto i = 0; i < numTotalInsertions * 2; ++i) {
|
|
316
318
|
auto res =
|
|
317
|
-
conn->query(stringFormat("CREATE (:product {id: {}, title: 'Product{}'});", i, i));
|
|
319
|
+
conn->query(stringFormat("CREATE (:product {{id: {}, title: 'Product{}'}});", i, i));
|
|
318
320
|
ASSERT_TRUE(res->isSuccess());
|
|
319
321
|
}
|
|
320
322
|
conn->query("COMMIT;");
|
|
@@ -367,7 +369,7 @@ TEST_F(EmptyDBTransactionTest, ConcurrentNodeUpdates) {
|
|
|
367
369
|
|
|
368
370
|
// First insert all nodes
|
|
369
371
|
for (auto i = 0; i < numTotalNodes; ++i) {
|
|
370
|
-
auto res = conn->query(stringFormat("CREATE (:test {id: {}, name: 'Person{}'});", i, i));
|
|
372
|
+
auto res = conn->query(stringFormat("CREATE (:test {{id: {}, name: 'Person{}'}});", i, i));
|
|
371
373
|
ASSERT_TRUE(res->isSuccess());
|
|
372
374
|
}
|
|
373
375
|
|
|
@@ -429,8 +431,8 @@ TEST_F(EmptyDBTransactionTest, ConcurrentMixedTypeUpdates) {
|
|
|
429
431
|
auto score = 95.5 + (i % 10);
|
|
430
432
|
auto isActive = (i % 2 == 0) ? "true" : "false";
|
|
431
433
|
auto res = conn->query(
|
|
432
|
-
stringFormat("CREATE (:mixed_test {id: {}, score: {}, active: {}, name: 'User{}'});",
|
|
433
|
-
score, isActive, i));
|
|
434
|
+
stringFormat("CREATE (:mixed_test {{id: {}, score: {}, active: {}, name: 'User{}'}});",
|
|
435
|
+
i, score, isActive, i));
|
|
434
436
|
ASSERT_TRUE(res->isSuccess());
|
|
435
437
|
}
|
|
436
438
|
|
|
@@ -503,7 +505,8 @@ TEST_F(EmptyDBTransactionTest, ConcurrentRelationshipUpdates) {
|
|
|
503
505
|
|
|
504
506
|
// Create nodes
|
|
505
507
|
for (auto i = 0; i < numTotalUpdates; ++i) {
|
|
506
|
-
auto res =
|
|
508
|
+
auto res =
|
|
509
|
+
conn->query(stringFormat("CREATE (:person {{id: {}, name: 'Person{}'}});", i, i));
|
|
507
510
|
ASSERT_TRUE(res->isSuccess());
|
|
508
511
|
}
|
|
509
512
|
|
|
@@ -513,7 +516,7 @@ TEST_F(EmptyDBTransactionTest, ConcurrentRelationshipUpdates) {
|
|
|
513
516
|
auto toID = (i + 1) % numTotalUpdates;
|
|
514
517
|
auto weight = 1.0 + (i % 10) * 0.1;
|
|
515
518
|
auto res = conn->query(stringFormat("MATCH (a:person), (b:person) WHERE a.id = {} AND b.id "
|
|
516
|
-
"= {} CREATE (a)-[:knows {weight: {}}]->(b);",
|
|
519
|
+
"= {} CREATE (a)-[:knows {{weight: {}}}]->(b);",
|
|
517
520
|
fromID, toID, weight));
|
|
518
521
|
ASSERT_TRUE(res->isSuccess());
|
|
519
522
|
}
|
|
@@ -577,7 +580,7 @@ TEST_F(EmptyDBTransactionTest, ConcurrentNodeUpdatesWithMixedTransactions) {
|
|
|
577
580
|
|
|
578
581
|
// Insert initial nodes
|
|
579
582
|
for (auto i = 0; i < numTotalNodes; ++i) {
|
|
580
|
-
auto res = conn->query(stringFormat("CREATE (:test {id: {}, name: 'Person{}'});", i, i));
|
|
583
|
+
auto res = conn->query(stringFormat("CREATE (:test {{id: {}, name: 'Person{}'}});", i, i));
|
|
581
584
|
ASSERT_TRUE(res->isSuccess());
|
|
582
585
|
}
|
|
583
586
|
|
|
@@ -650,7 +653,8 @@ TEST_F(EmptyDBTransactionTest, ConcurrentRelationshipUpdatesWithMixedTransaction
|
|
|
650
653
|
|
|
651
654
|
// Create nodes
|
|
652
655
|
for (auto i = 0; i < numTotalUpdates; ++i) {
|
|
653
|
-
auto res =
|
|
656
|
+
auto res =
|
|
657
|
+
conn->query(stringFormat("CREATE (:person {{id: {}, name: 'Person{}'}});", i, i));
|
|
654
658
|
ASSERT_TRUE(res->isSuccess());
|
|
655
659
|
}
|
|
656
660
|
|
|
@@ -660,7 +664,7 @@ TEST_F(EmptyDBTransactionTest, ConcurrentRelationshipUpdatesWithMixedTransaction
|
|
|
660
664
|
auto toID = i;
|
|
661
665
|
auto weight = 20.0;
|
|
662
666
|
auto res = conn->query(stringFormat("MATCH (a:person), (b:person) WHERE a.id = {} AND b.id "
|
|
663
|
-
"= {} CREATE (a)-[:knows {weight: {}}]->(b);",
|
|
667
|
+
"= {} CREATE (a)-[:knows {{weight: {}}}]->(b);",
|
|
664
668
|
fromID, toID, weight));
|
|
665
669
|
ASSERT_TRUE(res->isSuccess());
|
|
666
670
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|