Commit aa5e7880 authored by Monty's avatar Monty Committed by Sergei Petrunia

MDEV-29677 Wrong result with join query and innodb fulltext search

InnoDB FTS scan was used by a subquery. A subquery execution may start
a table read and continue until it finds the first matching record
combination. This can happen before the table read returns EOF.

The next time the subquery is executed, it will start another table read.
InnoDB FTS table read fails to re-initialize its data structures in this
scenario and will try to continue the scan started at the first execution.

Fixed by ha_innobase::ft_init() to stop the FTS scan if there is one.

Author: Sergei Petrunia <sergey@mariadb.com>
Reviewer: Monty
parent 66d9c1b2
......@@ -9467,6 +9467,11 @@ ha_innobase::ft_init()
trx->will_lock = true;
}
/* If there is an FTS scan in progress, stop it */
fts_result_t* result = (reinterpret_cast<NEW_FT_INFO*>(ft_handler))->ft_result;
if (result)
result->current= NULL;
DBUG_RETURN(rnd_init(false));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment