statement_digest、statement_digest_text等处理latin1字符有乱>码,报错1064

This commit is contained in:
akaError
2024-02-08 17:14:19 +00:00
committed by ob-robot
parent 27c4a22c70
commit 30cf1c7598
3 changed files with 25 additions and 6 deletions

View File

@ -449,6 +449,8 @@ inline int64_t ObFastParserBase::is_identifier_flags(const int64_t pos)
// Most of the time, if it is not an identifier character, it maybe a space,
// comma, opening parenthesis, or closing parenthesis. This judgment logic is
// added here to avoid the next judgment whether it is utf8 char or gbk char
} else if (!is_oracle_mode_) {
idf_pos = notascii_gb_char(pos);
} else if (CHARSET_UTF8MB4 == charset_type_ || CHARSET_UTF16 == charset_type_) {
idf_pos = is_utf8_char(pos);
} else if (ObCharset::is_gb_charset(charset_type_)) {
@ -921,6 +923,17 @@ int ObFastParserBase::get_one_insert_row_str(ObRawSql &raw_sql,
return ret;
}
inline int64_t ObFastParserBase::notascii_gb_char(const int64_t pos)
{
int64_t idf_pos = -1;
if (notascii(raw_sql_.char_at(pos))) {
idf_pos = pos + 1;
} else {
idf_pos = is_gbk_char(pos);
}
return idf_pos;
}
inline int64_t ObFastParserBase::is_latin1_char(const int64_t pos)
{
int64_t idf_pos = -1;
@ -1672,6 +1685,8 @@ inline int64_t ObFastParserBase::is_first_identifier_flags(const int64_t pos)
// Most of the time, if it is not an identifier character, it maybe a space,
// comma, opening parenthesis, or closing parenthesis. This judgment logic is
// added here to avoid the next judgment whether it is utf8 char or gbk char
} else if (!is_oracle_mode_) {
idf_pos = notascii_gb_char(pos);
} else if (CHARSET_UTF8MB4 == charset_type_ || CHARSET_UTF16 == charset_type_) {
idf_pos = is_utf8_char(pos);
} else if (ObCharset::is_gb_charset(charset_type_)) {