diff --git a/contrib/auth_delay/auth_delay.cpp b/contrib/auth_delay/auth_delay.cpp index 94bedc1b3..2d0d11114 100644 --- a/contrib/auth_delay/auth_delay.cpp +++ b/contrib/auth_delay/auth_delay.cpp @@ -19,7 +19,7 @@ PG_MODULE_MAGIC; -void _PG_init(void); +extern "C" void _PG_init(void); /* GUC Variables */ static int auth_delay_milliseconds; diff --git a/contrib/auto_explain/auto_explain.cpp b/contrib/auto_explain/auto_explain.cpp index 2eaf18bed..28d6949f7 100644 --- a/contrib/auto_explain/auto_explain.cpp +++ b/contrib/auto_explain/auto_explain.cpp @@ -46,8 +46,8 @@ static ExecutorEnd_hook_type prev_ExecutorEnd = NULL; #define auto_explain_enabled() \ (auto_explain_log_min_duration >= 0 && (nesting_level == 0 || auto_explain_log_nested_statements)) -void _PG_init(void); -void _PG_fini(void); +extern "C" void _PG_init(void); +extern "C" void _PG_fini(void); static void explain_ExecutorStart(QueryDesc* queryDesc, int eflags); static void explain_ExecutorRun(QueryDesc* queryDesc, ScanDirection direction, long count); diff --git a/contrib/passwordcheck/passwordcheck.cpp b/contrib/passwordcheck/passwordcheck.cpp index 717a40a58..8a760cda1 100644 --- a/contrib/passwordcheck/passwordcheck.cpp +++ b/contrib/passwordcheck/passwordcheck.cpp @@ -30,7 +30,7 @@ PG_MODULE_MAGIC; /* passwords shorter than this will be rejected */ #define MIN_PWD_LENGTH 8 -extern void _PG_init(void); +extern "C" void _PG_init(void); /* * check_password diff --git a/src/gausskernel/optimizer/commands/user.cpp b/src/gausskernel/optimizer/commands/user.cpp index cb6e619eb..9c2af46f0 100755 --- a/src/gausskernel/optimizer/commands/user.cpp +++ b/src/gausskernel/optimizer/commands/user.cpp @@ -1233,7 +1233,7 @@ void CreateRole(CreateRoleStmt* stmt) int pwd_type = PASSWORD_TYPE_PLAINTEXT; if (isMD5(password)) { pwd_type = PASSWORD_TYPE_MD5; - } else if (!isSHA256(password)) { + } else if (isSHA256(password)) { pwd_type = PASSWORD_TYPE_SHA256; } @@ -2521,7 +2521,7 @@ void AlterRole(AlterRoleStmt* stmt) int pwd_type = PASSWORD_TYPE_PLAINTEXT; if (isMD5(password)) { pwd_type = PASSWORD_TYPE_MD5; - } else if (!isSHA256(password)) { + } else if (isSHA256(password)) { pwd_type = PASSWORD_TYPE_SHA256; }