1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-08 00:28:29 +03:00

Merge branch '11.4' into 11.8

This commit is contained in:
Sergei Golubchik
2025-07-28 20:16:25 +02:00
380 changed files with 11138 additions and 2776 deletions

View File

@@ -52,10 +52,17 @@ static bool json_unescape_to_string(const char *val, int val_len, String* out)
out->length(res);
return false; // Ok
}
if (res == JSON_ERROR_ILLEGAL_SYMBOL)
return true; // Invalid character
// We get here if the unescaped string didn't fit into memory.
if (out->alloc(out->alloced_length()*2))
return true;
if (res == JSON_ERROR_OUT_OF_SPACE)
{
if (out->alloc(out->alloced_length()*2))
return true;
}
else
return true; // unknown error
}
}
@@ -492,7 +499,7 @@ bool read_bucket_endpoint(json_engine_t *je, Field *field, String *out,
const char* je_value= (const char*)je->value;
if (je->value_type == JSON_VALUE_STRING && je->value_escaped)
{
StringBuffer<128> unescape_buf;
StringBuffer<128> unescape_buf(field->charset() ? field->charset() : &my_charset_bin);
if (json_unescape_to_string(je_value, je->value_len, &unescape_buf))
{
*err= "Un-escape error";
@@ -599,10 +606,14 @@ int Histogram_json_hb::parse_bucket(json_engine_t *je, Field *field,
bool have_start= false;
bool have_size= false;
bool have_ndv= false;
CHARSET_INFO *cs;
if (!(cs= field->charset()))
cs= &my_charset_bin;
double size_d;
longlong ndv_ll= 0;
StringBuffer<128> value_buf;
StringBuffer<128> value_buf(cs);
int rc;
while (!(rc= json_scan_next(je)) && je->state != JST_OBJ_END)