[fix](json) fix json int128 overflow (#22917)
* support int128 in jsonb * fix jsonb int128 write * fix jsonb to json int128 * fix json functions for int128 * add nereids function jsonb_extract_largeint * add testcase for json int128 * change docs for json int128 * add nereids function jsonb_extract_largeint * clang format * fix check style * using int128_t = __int128_t for all int128 * use fmt::format_to instead of snprintf digit by digit for int128 * clang format * delete useless check * add warn log * clang format
This commit is contained in:
@ -17,6 +17,8 @@
|
||||
|
||||
#include "runtime/jsonb_value.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "util/jsonb_error.h"
|
||||
@ -30,8 +32,10 @@ Status JsonBinaryValue::from_json_string(const char* s, int length) {
|
||||
JsonbErrType error = JsonbErrType::E_NONE;
|
||||
if (!parser.parse(s, length)) {
|
||||
error = parser.getErrorCode();
|
||||
return Status::InvalidArgument("json parse error: {} for value: {}",
|
||||
JsonbErrMsg::getErrMsg(error), std::string_view(s, length));
|
||||
auto msg = fmt::format("json parse error: {} for value: {}", JsonbErrMsg::getErrMsg(error),
|
||||
std::string_view(s, length));
|
||||
LOG(WARNING) << msg;
|
||||
return Status::InvalidArgument(msg);
|
||||
}
|
||||
|
||||
ptr = parser.getWriter().getOutput()->getBuffer();
|
||||
|
||||
Reference in New Issue
Block a user