Binary file (standard input) matches
This commit is contained in:
@ -739,4 +739,17 @@ extern int setup_token_pos_info_and_dup_string(ParseNode* node, ParseResult* p,
|
||||
int add_comment_list(ParseResult* p, const TokenPosInfo* info);
|
||||
#endif
|
||||
|
||||
// avoid '\0' in the middle of a str.
|
||||
#define CHECK_STR_LEN_MATCH(src_str, str_len) \
|
||||
do { \
|
||||
if (OB_UNLIKELY(src_str == NULL)) { \
|
||||
} else { \
|
||||
for (int64_t i = 0; i < str_len; i++) { \
|
||||
if (OB_UNLIKELY(src_str[i] == '\0')) { \
|
||||
yyerror(yylloc, yyextra, "mismatch strlen, may cased by '\0' in str"); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#endif /* OCEANBASE_SRC_SQL_PARSER_SQL_PARSER_BASE_H_ */
|
||||
|
||||
@ -865,6 +865,7 @@ FALSE {
|
||||
yylloc->first_column = p->start_col_;
|
||||
char *tmp_literal = p->tmp_literal_;
|
||||
tmp_literal[yylval->node->str_len_] = '\0';
|
||||
CHECK_STR_LEN_MATCH(tmp_literal, yylval->node->str_len_);
|
||||
|
||||
char *dup_value = NULL;
|
||||
if (p->is_not_utf8_connection_) {
|
||||
|
||||
Reference in New Issue
Block a user