Skip to content

MDEV-30518: JSON functions cannot be killed on big-endian#5047

Open
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-30518
Open

MDEV-30518: JSON functions cannot be killed on big-endian#5047
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-30518

Conversation

@grooverdan
Copy link
Copy Markdown
Member

MDEV-24909 added a json_pause_execution syncpoint however the test case used debug_max_statement_time, which doesn't exist.

Fix the sync point name in the test.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 6, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the debug flag in the func_json_notembedded test and its corresponding result file, replacing debug_max_statement_time exceeded with json_pause_execution. These changes modify how query interruptions are simulated during JSON function testing. I have no feedback to provide.

@grooverdan grooverdan changed the title MDEV-30518: main.func_json_notembedded fails on s390x MDEV-30518: MDEV-30518: JSON functions cannot be killed on big-endian May 12, 2026
@grooverdan grooverdan changed the title MDEV-30518: MDEV-30518: JSON functions cannot be killed on big-endian MDEV-30518: JSON functions cannot be killed on big-endian May 12, 2026
The json_engine killed_ptr was of type uchar however the enum
in the server is dependant on the architecture. On big-endian
architectures like IBM Z, retreiving a uchar* retreived the
unmodifed part of the THD->kill enum location and was always 0.

As C++11 allows enums to inherit a type, used uint32_t as the base
class of killed_state type in the server and used uint32_t in the
json library.

reload_acl_and_cache required an expression change to avoid
the compile error:
sql/sql_reload.cc:472:24: error: enumerated and non-enumerated
type in conditional expression [-Werror=enum-conversion]
  472 |  return result || (thd ? thd->killed : 0);

Added the kill_ptr assignment the following functions can be
killed:
* Item_func_json_depth::val_int
* Item_func_json_type::val_str
* Item_func_json_length::val_int

Item_func_json_array_append::val_str, check_killed() only applied
to json_error: label and not return_null.

Item_func_json_overlaps::val_bool ensure check_killed() is called.

Item_func_json_format::val_str(), corresponding to the SQL,
json_compact, json_detailed, json_loose - add debug instrumentation
for the func_json_notembedded test.

MDEV-26726 (fcd345d) added a json_pause_execution sync point
however the test case used debug_max_statement_time, which doesn't
exist. Fix the sync point name in the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants