diff --git a/src/astar/astar.c b/src/astar/astar.c index 99351de923..1bf9284269 100644 --- a/src/astar/astar.c +++ b/src/astar/astar.c @@ -181,10 +181,10 @@ _pgr_astar(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[call_cntr].node); diff --git a/src/bdAstar/bdAstar.c b/src/bdAstar/bdAstar.c index 37d4742806..03b2b34a9d 100644 --- a/src/bdAstar/bdAstar.c +++ b/src/bdAstar/bdAstar.c @@ -177,10 +177,10 @@ _pgr_bdastar(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; values[0] = Int32GetDatum(call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[call_cntr].node); diff --git a/src/bdDijkstra/bdDijkstra.c b/src/bdDijkstra/bdDijkstra.c index 3da0821d8f..56f2135b8c 100644 --- a/src/bdDijkstra/bdDijkstra.c +++ b/src/bdDijkstra/bdDijkstra.c @@ -159,10 +159,10 @@ PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; values[0] = Int32GetDatum(call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[call_cntr].node); diff --git a/src/bellman_ford/bellman_ford.c b/src/bellman_ford/bellman_ford.c index 2564a2b1c9..edea81a74d 100644 --- a/src/bellman_ford/bellman_ford.c +++ b/src/bellman_ford/bellman_ford.c @@ -163,10 +163,10 @@ _pgr_bellmanford(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum(funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); diff --git a/src/bellman_ford/bellman_ford_neg.c b/src/bellman_ford/bellman_ford_neg.c index 63ea5bb1a0..d5c9f1fe4b 100644 --- a/src/bellman_ford/bellman_ford_neg.c +++ b/src/bellman_ford/bellman_ford_neg.c @@ -166,10 +166,10 @@ _pgr_bellmanfordneg(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum(funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); diff --git a/src/bellman_ford/edwardMoore.c b/src/bellman_ford/edwardMoore.c index 3fa49a1243..929dacf36d 100644 --- a/src/bellman_ford/edwardMoore.c +++ b/src/bellman_ford/edwardMoore.c @@ -156,10 +156,10 @@ PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t) funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); diff --git a/src/breadthFirstSearch/binaryBreadthFirstSearch.c b/src/breadthFirstSearch/binaryBreadthFirstSearch.c index 7e92c73f58..e8a5734a29 100644 --- a/src/breadthFirstSearch/binaryBreadthFirstSearch.c +++ b/src/breadthFirstSearch/binaryBreadthFirstSearch.c @@ -156,10 +156,10 @@ PGDLLEXPORT Datum _pgr_binarybreadthfirstsearch(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); diff --git a/src/dagShortestPath/dagShortestPath.c b/src/dagShortestPath/dagShortestPath.c index a6bb06a9d6..74295b2a90 100644 --- a/src/dagShortestPath/dagShortestPath.c +++ b/src/dagShortestPath/dagShortestPath.c @@ -163,10 +163,10 @@ PGDLLEXPORT Datum _pgr_dagshortestpath(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].edge); values[4] = Float8GetDatum(result_tuples[funcctx->call_cntr].cost); diff --git a/src/dijkstra/dijkstra.c b/src/dijkstra/dijkstra.c index cfc57677c2..0e47f3a641 100644 --- a/src/dijkstra/dijkstra.c +++ b/src/dijkstra/dijkstra.c @@ -216,10 +216,10 @@ _pgr_dijkstra(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[call_cntr].node); diff --git a/src/ksp/ksp.c b/src/ksp/ksp.c index d10a2f8eff..be3165a5f0 100644 --- a/src/ksp/ksp.c +++ b/src/ksp/ksp.c @@ -187,7 +187,7 @@ _pgr_ksp(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t path_id = 1; + int64_t path_id = 1; if (funcctx->call_cntr != 0) { if (path[funcctx->call_cntr - 1].edge == -1) { path_id = path[funcctx->call_cntr - 1].start_id + 1; @@ -195,11 +195,11 @@ _pgr_ksp(PG_FUNCTION_ARGS) { path_id = path[funcctx->call_cntr - 1].start_id; } } - int32_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].end_id; + int64_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].end_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); values[1] = Int32GetDatum(path_id); - values[2] = Int32GetDatum(seq); + values[2] = Int32GetDatum((int32_t)seq); if (PG_NARGS() != 6) { values[3] = Int64GetDatum(path[funcctx->call_cntr].start_id); values[4] = Int64GetDatum(path[funcctx->call_cntr].end_id); diff --git a/src/ksp/turnRestrictedPath.c b/src/ksp/turnRestrictedPath.c index 51d9804295..19009a7d18 100644 --- a/src/ksp/turnRestrictedPath.c +++ b/src/ksp/turnRestrictedPath.c @@ -173,11 +173,11 @@ _pgr_turnrestrictedpath(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : path[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); values[1] = Int32GetDatum(path[funcctx->call_cntr].start_id + 1); - values[2] = Int32GetDatum(seq); + values[2] = Int32GetDatum((int32_t)seq); values[3] = Int64GetDatum(path[funcctx->call_cntr].node); values[4] = Int64GetDatum(path[funcctx->call_cntr].edge); values[5] = Float8GetDatum(path[funcctx->call_cntr].cost); diff --git a/src/ksp/withPoints_ksp.c b/src/ksp/withPoints_ksp.c index 3d65928aa3..051ac34664 100644 --- a/src/ksp/withPoints_ksp.c +++ b/src/ksp/withPoints_ksp.c @@ -247,11 +247,11 @@ PGDLLEXPORT Datum _pgr_withpointsksp(PG_FUNCTION_ARGS) { path_id = result_tuples[funcctx->call_cntr - 1].start_id; } } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].end_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].end_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); values[1] = Int32GetDatum(path_id); - values[2] = Int32GetDatum(seq); + values[2] = Int32GetDatum((int32_t)seq); if (PG_NARGS() != 9) { values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); diff --git a/src/max_flow/edge_disjoint_paths.c b/src/max_flow/edge_disjoint_paths.c index 1c8511be44..33051f2c4d 100644 --- a/src/max_flow/edge_disjoint_paths.c +++ b/src/max_flow/edge_disjoint_paths.c @@ -157,8 +157,8 @@ _pgr_edgedisjointpaths(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t path_id = 1; - int32_t seq 1; + int64_t path_id = 1; + int64_t seq = 1; if (funcctx->call_cntr != 0) { if (result_tuples[funcctx->call_cntr - 1].edge == -1) { path_id = result_tuples[funcctx->call_cntr - 1].start_id + 1; diff --git a/src/trsp/trsp_withPoints.c b/src/trsp/trsp_withPoints.c index 6fc884f44f..87052fd311 100644 --- a/src/trsp/trsp_withPoints.c +++ b/src/trsp/trsp_withPoints.c @@ -205,9 +205,9 @@ _pgr_trsp_withpoints(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[call_cntr].node); diff --git a/src/withPoints/withPoints.c b/src/withPoints/withPoints.c index bf8b1517cd..6a2036bab8 100644 --- a/src/withPoints/withPoints.c +++ b/src/withPoints/withPoints.c @@ -198,10 +198,10 @@ _pgr_withpoints(PG_FUNCTION_ARGS) { nulls[i] = false; } - int32_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); - values[1] = Int32GetDatum(seq); + values[1] = Int32GetDatum((int32_t)seq); values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);