Skip to content
/ server Public

Conversation

@bsrikanth-mariadb
Copy link
Contributor

@bsrikanth-mariadb bsrikanth-mariadb commented Jan 9, 2026

ft_handler isn't getting initialized for subqueries inside explain
delete/update queries. However, ft_handler is accessed inside ha_ft_read(),
and is the reason for NULL pointer exception.
However, that is not the case with non-explain queries.

Earlier, ft_handler initialization is done in the optimizer phase, that too
selectively, when the flag SELECT_DESCRIBE is not set, and for derived
tables in JOIN_TAB::preread_init().

In this PR, initialization of ft_handler is added inside
JOIN_TAB::preread_init() for non derived tables as well, by invoking
init_ftfuncs(). One thing to note is that if the ft_handler is initialized
earlier, then it doesn't get re-initialized.

ft_handler isn't getting initialized for subqueries inside explain
delete/update queries. However, ft_handler is accessed inside ha_ft_read(),
and is the reason for NULL pointer exception.
However, that is not the case with non-explain queries.

Earlier, ft_handler initialization is done in the optimizer phase, that too
selectively, when the flag SELECT_DESCRIBE is not set, and for derived
tables in JOIN_TAB::preread_init().

In this PR, initialization of ft_handler is added inside
JOIN_TAB::preread_init() for non derived tables as well, by invoking
init_ftfuncs(). One thing to note is that if the ft_handler is initialized
earlier, then it doesn't get re-initialized.
@bsrikanth-mariadb bsrikanth-mariadb force-pushed the 10.11-MDEV-31255-explain-delete-failure-with-fulltext-search-subquery branch from bd69d0f to ce070d1 Compare January 21, 2026 10:59
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.

2 participants