mirror of
https://github.com/MariaDB/server.git
synced 2025-11-08 00:28:29 +03:00
Merge branch '11.8' into 12.0
main/statistics_json.result is updated forf8ba5ced55(MDEV-36099) The test uses 'delete from t1' in many places and then populates the table again. The natural order of rows in a MyISAM table is well defined and the test was implicitly relying on that. beforef8ba5ced55delete was deleting rows one by one, using ha_myisam::delete_row() because the connection was stuck in rbr mode. This caused rows to be shown in the reverse insertion order (because of the delete link list). MDEV-36099 fixes this bug and the server now correctly uses ha_myisam::delete_all_rows(). This makes rows to be shown in the insertion order as expected.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user