Skip to content

Commit

Permalink
Format codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
emotionbug committed Mar 4, 2022
1 parent 57aa7ce commit d9f6ee9
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 65 deletions.
28 changes: 15 additions & 13 deletions src/backend/executor/cypher_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,21 @@ static Datum create_vertex(cypher_create_custom_scan_state *css,

static void process_pattern(cypher_create_custom_scan_state *css);

const CustomExecMethods cypher_create_exec_methods = {CREATE_SCAN_STATE_NAME,
begin_cypher_create,
exec_cypher_create,
end_cypher_create,
rescan_cypher_create,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL};
const CustomExecMethods cypher_create_exec_methods = {
CREATE_SCAN_STATE_NAME,
begin_cypher_create,
exec_cypher_create,
end_cypher_create,
rescan_cypher_create,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};

static void begin_cypher_create(CustomScanState *node, EState *estate,
int eflags)
Expand Down
28 changes: 15 additions & 13 deletions src/backend/executor/cypher_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,21 @@ static agtype_value *extract_entity(CustomScanState *node,
static void delete_entity(EState *estate, ResultRelInfo *resultRelInfo,
HeapTuple tuple);

const CustomExecMethods cypher_delete_exec_methods = {DELETE_SCAN_STATE_NAME,
begin_cypher_delete,
exec_cypher_delete,
end_cypher_delete,
rescan_cypher_delete,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL};
const CustomExecMethods cypher_delete_exec_methods = {
DELETE_SCAN_STATE_NAME,
begin_cypher_delete,
exec_cypher_delete,
end_cypher_delete,
rescan_cypher_delete,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};

/*
* Initialization at the beginning of execution. Setup the child node,
Expand Down
28 changes: 15 additions & 13 deletions src/backend/executor/cypher_merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,21 @@ static bool check_path(cypher_merge_custom_scan_state *css,
static void process_path(cypher_merge_custom_scan_state *css);
static void mark_tts_isnull(TupleTableSlot *slot);

const CustomExecMethods cypher_merge_exec_methods = {MERGE_SCAN_STATE_NAME,
begin_cypher_merge,
exec_cypher_merge,
end_cypher_merge,
rescan_cypher_merge,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL};
const CustomExecMethods cypher_merge_exec_methods = {
MERGE_SCAN_STATE_NAME,
begin_cypher_merge,
exec_cypher_merge,
end_cypher_merge,
rescan_cypher_merge,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};

/*
* Initializes the MERGE Execution Node at the begginning of the execution
Expand Down
28 changes: 15 additions & 13 deletions src/backend/executor/cypher_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
TupleTableSlot *elemTupleSlot,
EState *estate, HeapTuple old_tuple);

const CustomExecMethods cypher_set_exec_methods = {SET_SCAN_STATE_NAME,
begin_cypher_set,
exec_cypher_set,
end_cypher_set,
rescan_cypher_set,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL};
const CustomExecMethods cypher_set_exec_methods = {
SET_SCAN_STATE_NAME,
begin_cypher_set,
exec_cypher_set,
end_cypher_set,
rescan_cypher_set,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};

static void begin_cypher_set(CustomScanState *node, EState *estate, int eflags)
{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/executor/cypher_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool entity_exists(EState *estate, uint32 graph_id, graphid id)
result = false;
}

heap_endscan(scan_desc);
table_endscan(scan_desc);
table_close(rel, RowExclusiveLock);

return result;
Expand Down
16 changes: 12 additions & 4 deletions src/backend/optimizer/cypher_createplan.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@
#include "optimizer/cypher_createplan.h"

const CustomScanMethods cypher_create_plan_methods = {
"Cypher Create", create_cypher_create_plan_state};
"Cypher Create",
create_cypher_create_plan_state,
};
const CustomScanMethods cypher_set_plan_methods = {
"Cypher Set", create_cypher_set_plan_state};
"Cypher Set",
create_cypher_set_plan_state,
};
const CustomScanMethods cypher_delete_plan_methods = {
"Cypher Delete", create_cypher_delete_plan_state};
"Cypher Delete",
create_cypher_delete_plan_state,
};
const CustomScanMethods cypher_merge_plan_methods = {
"Cypher Merge", create_cypher_merge_plan_state};
"Cypher Merge",
create_cypher_merge_plan_state,
};

Plan *plan_cypher_create_path(PlannerInfo *root, RelOptInfo *rel,
CustomPath *best_path, List *tlist, List *clauses,
Expand Down
22 changes: 17 additions & 5 deletions src/backend/optimizer/cypher_pathnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@
#include "optimizer/cypher_pathnode.h"

const CustomPathMethods cypher_create_path_methods = {
CREATE_PATH_NAME, plan_cypher_create_path, NULL};
const CustomPathMethods cypher_set_path_methods = {SET_PATH_NAME,
plan_cypher_set_path, NULL};
CREATE_PATH_NAME,
plan_cypher_create_path,
NULL,
};
const CustomPathMethods cypher_set_path_methods = {
SET_PATH_NAME,
plan_cypher_set_path,
NULL,
};
const CustomPathMethods cypher_delete_path_methods = {
DELETE_PATH_NAME, plan_cypher_delete_path, NULL};
DELETE_PATH_NAME,
plan_cypher_delete_path,
NULL,
};
const CustomPathMethods cypher_merge_path_methods = {
MERGE_PATH_NAME, plan_cypher_merge_path, NULL};
MERGE_PATH_NAME,
plan_cypher_merge_path,
NULL,
};

CustomPath *create_cypher_create_path(PlannerInfo *root, RelOptInfo *rel,
List *custom_private)
Expand Down
6 changes: 3 additions & 3 deletions src/backend/utils/adt/age_global_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static List *get_ag_labels_names(Snapshot snapshot, uint32 graph_id,
}

/* close up scan */
heap_endscan(scan_desc);
table_endscan(scan_desc);
table_close(ag_label, ShareLock);

return labels;
Expand Down Expand Up @@ -392,7 +392,7 @@ static void load_vertex_hashtable(GRAPH_global_context *ggctx)
}

/* end the scan and close the relation */
heap_endscan(scan_desc);
table_endscan(scan_desc);
table_close(graph_vertex_label, ShareLock);
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@ static void load_edge_hashtable(GRAPH_global_context *ggctx)
}

/* end the scan and close the relation */
heap_endscan(scan_desc);
table_endscan(scan_desc);
table_close(graph_edge_label, ShareLock);
}
}
Expand Down

0 comments on commit d9f6ee9

Please sign in to comment.