Skip to content

Commit 6f80b2d

Browse files
committed
null value in rust codegen and errorcode update
1 parent d964311 commit 6f80b2d

File tree

8 files changed

+298
-15
lines changed

8 files changed

+298
-15
lines changed

modules/graph/grin/c/test.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include "../include/common/error.h"
23
#include "../include/index/label.h"
34
#include "../include/index/order.h"
45
#include "../include/partition/partition.h"
@@ -16,8 +17,6 @@
1617
#include "../include/topology/structure.h"
1718
#include "../include/topology/vertexlist.h"
1819

19-
extern __thread GRIN_ERROR_CODE grin_error_code;
20-
2120
GRIN_GRAPH get_graph(int argc, char** argv) {
2221
#ifdef GRIN_ENABLE_GRAPH_PARTITION
2322
GRIN_PARTITIONED_GRAPH pg =
@@ -450,10 +449,10 @@ void test_property_vertex_table(int argc, char** argv) {
450449
GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp);
451450
const void* pv =
452451
grin_get_value_from_vertex_property_table(g, vpt, v, vp);
453-
if (grin_error_code == GRIN_NO_ERROR) {
452+
if (grin_get_last_error_code() == GRIN_NO_ERROR) {
454453
printf("(Correct) no error\n");
455454
} else {
456-
printf("(Wrong) error code: %d\n", grin_error_code);
455+
printf("(Wrong) error code: %d\n", grin_get_last_error_code());
457456
}
458457
const void* rv = grin_get_value_from_row(g, row, dt, j);
459458
if (dt == Int64) {
@@ -803,10 +802,10 @@ void test_error_code(int argc, char** argv) {
803802
GRIN_VERTEX v = get_one_vertex(g);
804803

805804
const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp);
806-
if (grin_error_code == GRIN_INVALID_VALUE) {
805+
if (grin_get_last_error_code() == GRIN_INVALID_VALUE) {
807806
printf("(Correct) invalid value\n");
808807
} else {
809-
printf("(Wrong) error code: %d\n", grin_error_code);
808+
printf("(Wrong) error code: %d\n", grin_get_last_error_code());
810809
}
811810
}
812811

modules/graph/grin/c/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# launch vineyardd & load modern graph
22
# 1. copy modern_graph folder from GraphScope/charts/gie-standalone/data to build
33
# 2. copy v6d_modern_loader to modern_graph folder
4-
# 3. in build folder, run: bin/vineyardd --socket=tmp.sock
5-
# 4. in build folder, run: bin/vineyard-graph-loader --socket=tmp.sock --config modern_graph/config.json
4+
# 3. in build folder, run: bin/vineyardd --socket tmp.sock
5+
# 4. in build folder, run: bin/vineyard-graph-loader --socket tmp.sock --config modern_graph/config.json
66

77
rm -rf ./test
88
gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test
9-
./test /workspaces/v6d/build/tmp.sock 3493598830228844
9+
./test /home/graphscope/gie-grin/v6d/build/tmp.sock 134785075056209698

modules/graph/grin/include

0 commit comments

Comments
 (0)