Skip to content

TODO-6441 MVI non-optimizer fixes - #6207

Open
mariadb-YuchenPei wants to merge 5 commits into
bb-serg-MDEV-25848-mvifrom
bb-main-todo-6441
Open

mariadb-YuchenPei wants to merge 5 commits into
bb-serg-MDEV-25848-mvifrom
bb-main-todo-6441

Conversation

@mariadb-YuchenPei

Copy link
Copy Markdown
Contributor

No description provided.

@CLAassistant

CLAassistant commented Nov 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mariadb-YuchenPei
mariadb-YuchenPei force-pushed the bb-serg-MDEV-25848-mvi branch 3 times, most recently from 2a5d904 to e9a56d7 Compare November 26, 2026 02:36
…range_seq_next

This fixes msan failures exposed in main.opt_trace_index_merge
testcases introduced by MDEV-25848 commit
54ea632
Before this, keyinfo_array has the same size as table->s->keys, which
does not count ARRAY key. This causes out of bounds failure when
accessing keyinfo_array.
@mariadb-YuchenPei
mariadb-YuchenPei force-pushed the bb-main-todo-6441 branch 4 times, most recently from 76ed630 to 533d69a Compare November 26, 2026 07:17
@mariadb-YuchenPei

Copy link
Copy Markdown
Contributor Author

@vuvova: finding #2 of #5841 (comment) has been fixed by

533d69a13e7 upstream/bb-main-todo-6441 MDEV-25848 Allow optimizer key hints to have an effect when the key is MVI
840300509fc MDEV-25848 Use table->s->total_keys for hint keyinfo_array

or commits of the same message if the hash changes. Would you like to take a look?

…s MVI

IGNORE INDEX, USE/FORCE INDEX of other keys, IGNORED, and
NO_RANGE_OPTIMIZATION now work
update_needed is computed by checking that the hlindex key is in
write_set. When done before mark_columns_needed_for_insert() marked
default and virtual columns, the stale write_set could result in false
negative: update is needed but update_needed is false.

This patch fixes that and closes finding #4.
@mariadb-YuchenPei
mariadb-YuchenPei force-pushed the bb-main-todo-6441 branch 5 times, most recently from 68997b1 to b7194d7 Compare December 1, 2026 04:09
MEMBER OF is JSON_CONTAINS(js, JSON_QUOTE(value)), which treats a
scalar document as a 1-element array (boxing) and looks into nested
arrays (flattening). The array index only indexed the top-level
elements of a top-level array, and returned an ignorable error
otherwise. This caused INSERT IGNORE to store a row that MEMBER OF
matches but the index does not.

In this patch we index every scalar of the document at any array
depth, a scalar document as one entry, and skip objects. SQL NULL is
not an error any more either: it has no entries.

This closes finding #5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants