From 70483eb56aadb815f13f3fa44dec632210781503 Mon Sep 17 00:00:00 2001 From: zhaosiqi Date: Thu, 10 Nov 2022 16:25:01 +0800 Subject: [PATCH] =?UTF-8?q?MySQL=E5=85=BC=E5=AE=B9=E6=80=A7-set=20password?= =?UTF-8?q?-=E5=AF=86=E7=A0=81=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/error/elog.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/common/backend/utils/error/elog.cpp b/src/common/backend/utils/error/elog.cpp index 4cc9095eb..51932f661 100644 --- a/src/common/backend/utils/error/elog.cpp +++ b/src/common/backend/utils/error/elog.cpp @@ -4344,6 +4344,7 @@ static char* mask_Password_internal(const char* query_string) * 14 - create/alter text search dictionary * 15 - for funCrypt * 16 - create/alter subscription(CREATE_ALTER_SUBSCRIPTION) + * 17 - set password (b compatibility) */ int curStmtType = 0; int prevToken[5] = {0}; @@ -4618,9 +4619,14 @@ static char* mask_Password_internal(const char* query_string) /* For create/alter data source: sensitive opt is 'password' */ curStmtType = 11; currToken = IDENT; + } else if (DB_IS_CMPT(B_FORMAT) && prevToken[0] == SET) { + curStmtType = 17; + } + + if (curStmtType != 17) { + isPassword = true; + idx = 0; } - isPassword = true; - idx = 0; break; case BY: isPassword = (curStmtType > 0 && prevToken[0] == IDENTIFIED); @@ -4628,7 +4634,7 @@ static char* mask_Password_internal(const char* query_string) idx = 0; break; case REPLACE: - isPassword = (curStmtType == 3 || curStmtType == 4); + isPassword = (curStmtType == 3 || curStmtType == 4 || curStmtType == 17); if (isPassword) idx = 0; break; @@ -4809,6 +4815,12 @@ static char* mask_Password_internal(const char* query_string) isPassword = false; idx = 0; break; + case 61: /* character '=' */ + /* for mask 'set password' in b compatibility */ + isPassword = (curStmtType == 17); + if (isPassword) + idx = 0; + break; case FOREIGN: if (prevToken[0] == CREATE || prevToken[0] == ALTER) { prevToken[1] = FOREIGN;