fix auth_delay\auto_explain\passwordcheck _PG_init not found bug

This commit is contained in:
chenxiaobin19
2022-09-07 11:45:49 +08:00
parent 34bfd16927
commit 9c924ef565
4 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@
PG_MODULE_MAGIC;
void _PG_init(void);
extern "C" void _PG_init(void);
/* GUC Variables */
static int auth_delay_milliseconds;

View File

@ -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);

View File

@ -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

View File

@ -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;
}