diff --git a/src/backend/cdb/cdbcopy.c b/src/backend/cdb/cdbcopy.c index 31bbff1576563892a8c03e928817ea7bcdd13d3f..adda46257591b31c6f4bb60dd17e0e122cc4cecb 100644 --- a/src/backend/cdb/cdbcopy.c +++ b/src/backend/cdb/cdbcopy.c @@ -449,7 +449,7 @@ processCopyEndResults(CdbCopy *c, bool *first_error, int *failed_count, int *total_rows_rejected, - int *total_rows_completed) + int64 *total_rows_completed) { SegmentDatabaseDescriptor *q; int seg; @@ -702,7 +702,7 @@ cdbCopyEnd(CdbCopy *c) * and fetch the total number of rows completed by all QEs */ int -cdbCopyEndAndFetchRejectNum(CdbCopy *c, int *total_rows_completed) +cdbCopyEndAndFetchRejectNum(CdbCopy *c, int64 *total_rows_completed) { SegmentDatabaseDescriptor *q; SegmentDatabaseDescriptor **failedSegDBs; diff --git a/src/backend/cdb/cdbsreh.c b/src/backend/cdb/cdbsreh.c index 92eb0cf117139c3c1ac6101c93cb761bc0470ce8..68f8ee7effaa3a5b1865ea14ac32e86d00fcfa77 100644 --- a/src/backend/cdb/cdbsreh.c +++ b/src/backend/cdb/cdbsreh.c @@ -293,7 +293,7 @@ ReportSrehResults(CdbSreh *cdbsreh, int total_rejected) } static void -sendnumrows_internal(int numrejected, int numcompleted) +sendnumrows_internal(int numrejected, int64 numcompleted) { StringInfoData buf; @@ -304,7 +304,7 @@ sendnumrows_internal(int numrejected, int numcompleted) pq_sendint(&buf, numrejected, 4); if (numcompleted > 0) /* optional send completed num for COPY FROM * ON SEGMENT */ - pq_sendint(&buf, numcompleted, 4); + pq_sendint64(&buf, numcompleted); pq_endmessage(&buf); } @@ -327,7 +327,7 @@ SendNumRowsRejected(int numrejected) * of rows that were rejected and completed in this last data load */ void -SendNumRows(int numrejected, int numcompleted) +SendNumRows(int numrejected, int64 numcompleted) { sendnumrows_internal(numrejected, numcompleted); } @@ -471,7 +471,6 @@ GetNextSegid(CdbSreh *cdbsreh) return (cdbsreh->lastsegid++ % total_segs); } - /* * This function is called when we are preparing to insert a bad row that * includes an encoding error into the bytea field of the error log file diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 3e1e3527ebad75671e8cdbc51aaf59f8ed25324c..2ddf088d1e38753797f188098d249bb29349d6d7 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -3254,7 +3254,7 @@ CopyFromDispatch(CopyState cstate) bool *nulls; int *attr_offsets; int total_rejected_from_qes = 0; - int total_completed_from_qes = 0; + int64 total_completed_from_qes = 0; bool isnull; bool *isvarlena; ResultRelInfo *resultRelInfo; diff --git a/src/include/cdb/cdbcopy.h b/src/include/cdb/cdbcopy.h index 909d8a2d8d5860705e6f54b81576448e57f5cc3e..a96a1bd4838aec8ef2e7366963e3de4b17d97bbd 100644 --- a/src/include/cdb/cdbcopy.h +++ b/src/include/cdb/cdbcopy.h @@ -70,6 +70,6 @@ void cdbCopySendDataToAll(CdbCopy *c, const char *buffer, int nbytes); void cdbCopySendData(CdbCopy *c, int target_seg, const char *buffer, int nbytes); bool cdbCopyGetData(CdbCopy *c, bool cancel, uint64 *rows_processed); int cdbCopyEnd(CdbCopy *c); -int cdbCopyEndAndFetchRejectNum(CdbCopy *c, int *total_rows_completed); +int cdbCopyEndAndFetchRejectNum(CdbCopy *c, int64 *total_rows_completed); #endif /* CDBCOPY_H */ diff --git a/src/include/cdb/cdbsreh.h b/src/include/cdb/cdbsreh.h index 2c5c12e56d9b3b0adb58d8c63acd9f16bc22a0c3..756713518017d211c3beab4222dbdeab50654ac3 100644 --- a/src/include/cdb/cdbsreh.h +++ b/src/include/cdb/cdbsreh.h @@ -93,7 +93,7 @@ extern CdbSreh *makeCdbSreh(int rejectlimit, bool is_limit_in_rows, extern void destroyCdbSreh(CdbSreh *cdbsreh); extern void HandleSingleRowError(CdbSreh *cdbsreh); extern void ReportSrehResults(CdbSreh *cdbsreh, int total_rejected); -extern void SendNumRows(int numrejected, int numcompleted); +extern void SendNumRows(int numrejected, int64 numcompleted); extern void SendNumRowsRejected(int numrejected); extern bool IsErrorTable(Relation rel); extern void ErrorIfRejectLimitReached(CdbSreh *cdbsreh, CdbCopy *cdbCopy); diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index c400b3241968c9f54bb9cdf4c10d8bd023a084c2..97f0fd395056e2d8b9d4be707fce85da33551b26 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -85,7 +85,7 @@ pqParseInput3(PGconn *conn) int avail; #ifndef FRONTEND int numRejected = 0; - int numCompleted = 0; + int64 numCompleted = 0; #endif @@ -458,7 +458,7 @@ pqParseInput3(PGconn *conn) conn->result->numRejected += numRejected; /* Optionally receive completed number when COPY FROM ON SEGMENT */ - if (msgLength >= 8 && !pqGetInt(&numCompleted, 4, conn)) + if (msgLength >= 8 && !pqGetInt64(&numCompleted, conn)) { conn->result->numCompleted += numCompleted; } diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 1a686f6a4c2a04658734becd3ae44168dedef85d..f8840e0c6945a44c61ab9c3faa7b0deba835845e 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -243,7 +243,7 @@ struct pg_result /* GPDB: number of rows rejected in SREH (protocol message 'j') */ int numRejected; /* GPDB: number of rows completed when COPY FROM ON SEGMENT */ - int numCompleted; + int64 numCompleted; /* GPDB: number of processed tuples for each AO partition */ int naotupcounts; PQaoRelTupCount *aotupcounts;