I'm creating a function for Apache AGE, and I need to iterate over a List
of graphids
, how should I do it properly?
- The
List
I'm referring to is the PostgreSQL defined struct in this file -> Postgres' GitHub repository Link graphid
is just anint64
.
What I'm essentially trying to do is this:
graphid new_graphid = 0;
graphid vertex_to_connect = 0;
List* graphids_array = NIL;
(...)
for (int64 i=(int64)1;i<graph.graph_size;i++)
{
new_graphid = create_vertex(&graph);
graphids_array = lappend_int(graphids_array, new_graphid);
for(int64 j = 0; j<graphids_array->length-1; j++)
{
vertex_to_connect = list_nth_int(graphids_array, j);
connect_vertexes_by_graphid(&graph,
new_graphid,
vertex_to_connect);
}
}
(...)
The problem happening is that the vertex_to_connect
variable is not receiving the proper graphid
(which should be a big number like 844424930131970), instead, it's getting small values that seems to be from the j
variable.
Any help on showing where I could be mistaken is appreciated.