Skip to content

MDEV-36808 json_array_intersect incorrect results#5004

Merged
grooverdan merged 1 commit into
MariaDB:11.4from
grooverdan:MDEV36808
Apr 29, 2026
Merged

MDEV-36808 json_array_intersect incorrect results#5004
grooverdan merged 1 commit into
MariaDB:11.4from
grooverdan:MDEV36808

Conversation

@grooverdan

Copy link
Copy Markdown
Member

After JSON_ARRAY_INTERSECT returned a NULL result, within the table scan, all subsequent values where NULL.

The checking of null_value in Item_func_json_array_intersect::val_str meant that after the first occurance of null, all values where null.

The purpose of this check started in
Item_func_json_array_intersect::prepare_json_and_create_hash where null_value=1 was used to indicate that an object wasn't an array.

@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Apr 28, 2026

@mariadb-RuchaDeodhar mariadb-RuchaDeodhar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

look good. thank you !

@grooverdan
grooverdan enabled auto-merge (rebase) April 29, 2026 21:15
@grooverdan
grooverdan disabled auto-merge April 29, 2026 21:48
After JSON_ARRAY_INTERSECT returned a NULL result, within the
table scan, all subsequent values where NULL.

The checking of null_value in Item_func_json_array_intersect::val_str
meant that after the first occurrence  of null, all values
were null.

The purpose of this check started in
Item_func_json_array_intersect::prepare_json_and_create_hash
where null_value=1 was used to indicate that an object
wasn't an array. Replaced to use dedicated is_array boolean.

Reviewed by: Rucha Deodhar
@grooverdan
grooverdan enabled auto-merge (rebase) April 29, 2026 21:51
@grooverdan
grooverdan merged commit e1972bc into MariaDB:11.4 Apr 29, 2026
17 of 19 checks passed
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