Fix tests that were temporary disabled in PS mode
(MDEV-25973)
|
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.40, 10.3.31, 10.4.21, 10.5.12, 10.6.4 |
| Type: | Technical task | Priority: | Critical |
| Reporter: | Dmitry Shulga | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Running of the following test case
leads to firing of assert in the function reinit_stmt_before_use()
and server crash. The data member SELECT_LEX::join points to a JOIN object created by the following calling sequence:
By some unknown reason the SELECT_LEX object that is owner of this JOIN object is not added to a list which head addressed by lex->unit.first_select() In result, when later the method Prepared_statement::prepare() calls lex->unit.cleanup() to clean up objects created on preparing the statement, the method JOIN::destroy() is not called for the JOIN object created on handling the statement
As a consequence, the data member SELECT_LEX::join is not reset and the assert (sl->join == 0) fired later on attempt to run the statement
|
| Comments |
| Comment by Igor Babaev [ 2021-07-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
If we execute a PS created for a select query containing a WITH clause with a recursive CTE and this CTE is used in the query as a joined table then execution of the PS works fine and returns a result set. Here's a test case demonstrating how it works
However if the main query does not use the recursive CTE and the CTE remains hanging
execution of PS comes to an assertion failure.
At the same time direct execution of the above query works fine
| |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Shulga [ 2021-07-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
OK to push | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-07-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
A fix for this bug was pushed into 10.2. |