Skip to content

Commit 03f4730

Browse files
committed
Bug#17746721 ASSERT IN THD::RESTORE_SUB_STATEMENT_STATE
The patch for bug#16041903 introduced a DBUG_ASSERT in "THD::restore_sub_statement_state" just after "in_sub_stmt" was reset to the value it had before executing the sub statement. The assert incorrectly assumed that "is_fatal_sub_stmt_error" could be true only if we were not in sub statement mode. However, since a sub statement can call a new sub statement, there will be a sub statement "execution stack", meaning that so the assert is wrong. The fix is to remove the incorrect assert. A new test is added and put under the original bug number 16041903 since it naturally belongs with the other test cases.
1 parent f2fad1f commit 03f4730

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

sql/sql_class.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4238,9 +4238,6 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
42384238
sub-statement mode.
42394239
*/
42404240

4241-
DBUG_ASSERT((is_fatal_sub_stmt_error && !in_sub_stmt) ||
4242-
!is_fatal_sub_stmt_error);
4243-
42444241
if (!in_sub_stmt)
42454242
is_fatal_sub_stmt_error= false;
42464243

0 commit comments

Comments
 (0)