line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "perlbolt.h" |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
0
|
|
|
|
|
|
void new_rs_uc( struct neo4j_update_counts **uc) { |
5
|
0
|
|
|
|
|
|
Newx(*uc, 1, struct neo4j_update_counts); |
6
|
0
|
|
|
|
|
|
(*uc)->nodes_created=0; |
7
|
0
|
|
|
|
|
|
(*uc)->nodes_deleted=0; |
8
|
0
|
|
|
|
|
|
(*uc)->relationships_created=0; |
9
|
0
|
|
|
|
|
|
(*uc)->relationships_deleted=0; |
10
|
0
|
|
|
|
|
|
(*uc)->properties_set=0; |
11
|
0
|
|
|
|
|
|
(*uc)->labels_added=0; |
12
|
0
|
|
|
|
|
|
(*uc)->labels_removed=0; |
13
|
0
|
|
|
|
|
|
(*uc)->indexes_added=0; |
14
|
0
|
|
|
|
|
|
(*uc)->indexes_removed=0; |
15
|
0
|
|
|
|
|
|
(*uc)->constraints_added=0; |
16
|
0
|
|
|
|
|
|
(*uc)->constraints_removed=0; |
17
|
0
|
|
|
|
|
|
return; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
void new_rs_stats( rs_stats_t **stats ) { |
21
|
|
|
|
|
|
|
struct neo4j_update_counts *uc; |
22
|
0
|
|
|
|
|
|
new_rs_uc(&uc); |
23
|
0
|
|
|
|
|
|
Newx(*stats, 1, rs_stats_t); |
24
|
0
|
|
|
|
|
|
(*stats)->result_count = 0; |
25
|
0
|
|
|
|
|
|
(*stats)->available_after = 0; |
26
|
0
|
|
|
|
|
|
(*stats)->consumed_after = 0; |
27
|
0
|
|
|
|
|
|
(*stats)->update_counts = uc; |
28
|
0
|
|
|
|
|
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
void new_rs_obj (rs_obj_t **rs_obj) { |
32
|
|
|
|
|
|
|
rs_stats_t *stats; |
33
|
0
|
|
|
|
|
|
Newx(*rs_obj, 1, rs_obj_t); |
34
|
0
|
|
|
|
|
|
new_rs_stats(&stats); |
35
|
0
|
|
|
|
|
|
(*rs_obj)->succeed = -1; |
36
|
0
|
|
|
|
|
|
(*rs_obj)->fail = -1; |
37
|
0
|
|
|
|
|
|
(*rs_obj)->fetched = 0; |
38
|
0
|
|
|
|
|
|
(*rs_obj)->failure_details = (struct neo4j_failure_details *) NULL; |
39
|
0
|
|
|
|
|
|
(*rs_obj)->stats = stats; |
40
|
0
|
|
|
|
|
|
(*rs_obj)->eval_errcode = ""; |
41
|
0
|
|
|
|
|
|
(*rs_obj)->eval_errmsg = ""; |
42
|
0
|
|
|
|
|
|
(*rs_obj)->errnum = 0; |
43
|
0
|
|
|
|
|
|
(*rs_obj)->strerror = ""; |
44
|
0
|
|
|
|
|
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
void reset_errstate_rs_obj (rs_obj_t *rs_obj) { |
48
|
0
|
|
|
|
|
|
rs_obj->succeed = -1; |
49
|
0
|
|
|
|
|
|
rs_obj->fail = -1; |
50
|
0
|
|
|
|
|
|
rs_obj->failure_details = (struct neo4j_failure_details *) NULL; |
51
|
0
|
|
|
|
|
|
rs_obj->eval_errcode = ""; |
52
|
0
|
|
|
|
|
|
rs_obj->eval_errmsg = ""; |
53
|
0
|
|
|
|
|
|
rs_obj->errnum = 0; |
54
|
0
|
|
|
|
|
|
rs_obj->strerror = ""; |
55
|
0
|
|
|
|
|
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
int update_errstate_rs_obj (rs_obj_t *rs_obj) { |
59
|
|
|
|
|
|
|
const char *evalerr, *evalmsg; |
60
|
|
|
|
|
|
|
char *climsg; |
61
|
|
|
|
|
|
|
char *s, *t; |
62
|
|
|
|
|
|
|
int fail; |
63
|
0
|
|
|
|
|
|
fail = neo4j_check_failure(rs_obj->res_stream); |
64
|
0
|
0
|
|
|
|
|
if (fail != 0) { |
65
|
0
|
|
|
|
|
|
rs_obj->succeed = 0; |
66
|
0
|
|
|
|
|
|
rs_obj->fail = 1; |
67
|
0
|
|
|
|
|
|
rs_obj->fetched = -1; |
68
|
0
|
|
|
|
|
|
rs_obj->errnum = fail; |
69
|
0
|
|
|
|
|
|
Newx(climsg, BUFLEN, char); |
70
|
0
|
|
|
|
|
|
rs_obj->strerror = neo4j_strerror(fail, climsg, BUFLEN); |
71
|
0
|
0
|
|
|
|
|
if (fail == NEO4J_STATEMENT_EVALUATION_FAILED) { |
72
|
0
|
|
|
|
|
|
rs_obj->failure_details = neo4j_failure_details(rs_obj->res_stream); |
73
|
0
|
|
|
|
|
|
Newx(s, strlen(rs_obj->failure_details->code)+1,char); |
74
|
0
|
|
|
|
|
|
rs_obj->eval_errcode = strncpy(s,rs_obj->failure_details->code, (size_t) |
75
|
0
|
|
|
|
|
|
strlen(rs_obj->failure_details->code)); |
76
|
0
|
|
|
|
|
|
Newx(t, strlen(rs_obj->failure_details->message)+1,char); |
77
|
0
|
|
|
|
|
|
rs_obj->eval_errmsg = strncpy(t,rs_obj->failure_details->message, |
78
|
0
|
|
|
|
|
|
(size_t) strlen(rs_obj->failure_details->message)); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
else { |
82
|
0
|
|
|
|
|
|
rs_obj->succeed = 1; |
83
|
0
|
|
|
|
|
|
rs_obj->fail = 0; |
84
|
0
|
|
|
|
|
|
rs_obj->strerror = ""; |
85
|
|
|
|
|
|
|
} |
86
|
0
|
|
|
|
|
|
return fail; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
MODULE = Neo4j::Bolt::CResultStream PACKAGE = Neo4j::Bolt::CResultStream |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |