Skip to content

MDEV-32331: json path crashes without a character set#5433

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

MDEV-32331: json path crashes without a character set#5433
grooverdan wants to merge 1 commit into
MariaDB:10.11from
grooverdan:MDEV-32331

Conversation

@grooverdan

Copy link
Copy Markdown
Member

Across a range of JSON functions taking a path argument there are SQL expressions that dont' have a character set. If these expressions don't have a character set fall back to the character set of the argument of the json function that represent the document being operated on. If this doesn't have a character set fall back to my_charset_utf8mb4_bin.

This covers the 11.4 JSON_KEY_VALUE function also as it reuses the Json_path_extractor::extract method.

Add nonnull and warn_unused_result to the json path functions to facilitate compiler and UBSAN catching of the problem early.

As null values of s_p are incompatible with report_path_error, jump directly to a null return which is consistent with the defination of the JSON sql funciton.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Jul 22, 2026
Across a range of JSON functions taking a path argument
there are SQL expressions that dont' have a character
set. If these expressions don't have a character set
fall back to the character set of the argument of the
json function that represent the document being operated
on. If this doesn't have a character set fall back to
my_charset_utf8mb4_bin.

This covers the 11.4 JSON_KEY_VALUE function also as it
reuses the Json_path_extractor::extract method.

Add nonnull and warn_unused_result to the json path
functions to facilitate compiler and UBSAN catching of the
problem early.

As null values of s_p are incompatible with report_path_error,
jump directly to a null return which is consistent with
the defination of the JSON sql funciton.
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