提交 888a8b0a 编写于 作者: O obdev 提交者: OB-robot

[CP] fix core at pl parser vsnprintf

上级 87819bfd
......@@ -206,4 +206,23 @@ extern const NonReservedKeyword *mysql_pl_non_reserved_keyword_lookup(const char
// e.g., (int64_t)3.00000000000000001 == 3.00000000000000001 is true;
// oracle supports up to 40 decimal place precision.
#define ESCAPE_PERCENT_CHARACTER(result, src, dst)\
do {\
if (OB_NOT_NULL(result) && OB_NOT_NULL(src)) {\
int64_t src_len = strlen(src);\
int64_t dst_len = 2 * src_len + 1;\
int64_t pos = 0;\
dst = (char *)parse_malloc(dst_len, result->mem_pool_);\
if (OB_LIKELY(NULL != dst)) {\
for (int64_t i = 0; i < src_len; i++) {\
if (src[i] == '%') {\
dst[pos++] = '%';\
}\
dst[pos++] = src[i];\
}\
dst[pos] = 0;\
}\
}\
} while (0)
#endif /* OCEANBASE_SRC_PL_PARSER_PL_PARSER_BASE_H_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册