add -Wshorten-64-to-32 for share

This commit is contained in:
xuhuleon
2023-02-07 00:40:01 +08:00
committed by ob-robot
parent 822aaaf7f2
commit c157309bc6
168 changed files with 502 additions and 636 deletions

View File

@ -52,14 +52,15 @@ int parse_terminate(ParseResult *p)
return ret;
}
int parse_sql(ParseResult *p, const char *buf, size_t len)
int parse_sql(ParseResult *p, const char *buf, size_t input_len)
{
int ret = OB_PARSER_ERR_PARSE_SQL;
if (OB_UNLIKELY(NULL == p)) {
} else if (OB_UNLIKELY(NULL == buf || len <= 0)) {
} else if (OB_UNLIKELY(NULL == buf || input_len <= 0 || input_len > INT32_MAX)) {
snprintf(p->error_msg_, MAX_ERROR_MSG, "Input SQL can not be empty");
ret = OB_PARSER_ERR_EMPTY_QUERY;
} else {
const int32_t len = (int32_t)input_len;
p->input_sql_ = buf;
p->input_sql_len_ = len;
p->start_col_ = 1;