This is an automated email from the ASF dual-hosted git repository. yjhjstz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 2f6e6287886bfac03bbb559447a3a88e3d05e00a Author: hughcapet <[email protected]> AuthorDate: Wed Mar 23 09:18:45 2022 -0700 Remove platform specific limitation from msg type recognition logic This commit introduces fixes in the functions that work with 'firstchar' byte value received from socket.This is done for consistency across the codebase and avoidance of misreads of -1 (EOF) value in case gp is compiled with default char unsigned (it can mistakenly be treated as 255 then). An example of such platform: PowerPC. --- src/backend/tcop/postgres.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 5c1f6f56ba..91b6fbc3e8 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -256,7 +256,7 @@ static int InteractiveBackend(StringInfo inBuf); static int interactive_getc(void); static int SocketBackend(StringInfo inBuf); static int ReadCommand(StringInfo inBuf); -static void forbidden_in_wal_sender(char firstchar); +static void forbidden_in_wal_sender(int firstchar); static bool check_log_statement(List *stmt_list); static int errdetail_execute(List *raw_parsetree_list); static int errdetail_params(ParamListInfo params); @@ -4851,7 +4851,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx, * received, and is used to construct the error message. */ static void -check_forbidden_in_gpdb_handlers(char firstchar) +check_forbidden_in_gpdb_handlers(int firstchar) { if (am_ftshandler || am_faulthandler) { @@ -4871,7 +4871,7 @@ check_forbidden_in_gpdb_handlers(char firstchar) } static void -forbidden_in_retrieve_handler(char firstchar) +forbidden_in_retrieve_handler(int firstchar) { if (am_cursor_retrieve_handler) ereport(ERROR, @@ -6100,7 +6100,7 @@ PostgresMain(int argc, char *argv[], * message was received, and is used to construct the error message. */ static void -forbidden_in_wal_sender(char firstchar) +forbidden_in_wal_sender(int firstchar) { if (am_walsender) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
