fix invalid str off in ps mode

This commit is contained in:
obdev
2023-05-16 12:41:24 +00:00
committed by ob-robot
parent d79ccfaa6e
commit c559d98ab7
2 changed files with 6 additions and 0 deletions

View File

@ -1379,6 +1379,7 @@ BEGIN(in_c_comment);
}
if (IS_FAST_PARAMETERIZE) {
yylval->node->raw_text_ = parse_strdup(yytext, p->malloc_pool_, &(yylval->node->text_len_));
yylval->node->sql_str_off_ = yylloc->first_column - 1;
check_malloc(yylval->node->raw_text_);
STORE_PARAM_NODE();
} else {
@ -1399,6 +1400,7 @@ BEGIN(in_c_comment);
yylval->node->value_ = get_question_mark(&p->question_mark_ctx_, p->malloc_pool_, yytext);
if (IS_FAST_PARAMETERIZE) {
yylval->node->raw_text_ = parse_strdup(yytext, p->malloc_pool_, &(yylval->node->text_len_));
yylval->node->sql_str_off_ = yylloc->first_column - 1;
check_malloc(yylval->node->raw_text_);
STORE_PARAM_NODE();
} else {
@ -1424,6 +1426,7 @@ BEGIN(in_c_comment);
}
if (IS_FAST_PARAMETERIZE) {
yylval->node->raw_text_ = parse_strdup(yytext, p->malloc_pool_, &(yylval->node->text_len_));
yylval->node->sql_str_off_ = yylloc->first_column - 1;
check_malloc(yylval->node->raw_text_);
STORE_PARAM_NODE();
} else {
@ -1443,6 +1446,7 @@ BEGIN(in_c_comment);
yylval->node->value_ = get_question_mark(&p->question_mark_ctx_, p->malloc_pool_, yytext);
if (IS_FAST_PARAMETERIZE) {
yylval->node->raw_text_ = parse_strdup(yytext, p->malloc_pool_, &(yylval->node->text_len_));
yylval->node->sql_str_off_ = yylloc->first_column - 1;
check_malloc(yylval->node->raw_text_);
STORE_PARAM_NODE();
} else {

View File

@ -2669,6 +2669,7 @@ MOD '(' expr ',' expr ')'
malloc_terminal_node(param_node, result->malloc_pool_, T_SFU_DOUBLE);
int64_t len = strlen("2.718281828459045");
param_node->str_value_ = parse_strndup("2.718281828459045", len, result->malloc_pool_);
param_node->is_hidden_const_ = 1;
if (OB_UNLIKELY(NULL == param_node->str_value_)) {
yyerror(NULL, result, "No more space for mallocing string\n");
YYABORT_NO_MEMORY;
@ -2686,6 +2687,7 @@ MOD '(' expr ',' expr ')'
malloc_terminal_node(param_node, result->malloc_pool_, T_SFU_DOUBLE);
int64_t len = strlen("2.718281828459045");
param_node->str_value_ = parse_strndup("2.718281828459045", len, result->malloc_pool_);
param_node->is_hidden_const_ = 1;
if (OB_UNLIKELY(NULL == param_node->str_value_)) {
yyerror(NULL, result, "No more space for mallocing string\n");
YYABORT_NO_MEMORY;