From 748ef3ec91d35aa6cd5b230c71084f6c83c1c92e Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 16 May 2018 18:11:30 +0300 Subject: MDEV-15991 Server crashes in setup_on_expr upon calling SP or function executing DML on versioned tables Do not try to set versioning conditions on every SP call. It may work incorrectly, but it's a general bug described in MDEV-774. This patch makes system versioning stuff consistent with other code and also fixes a use-after-free bug. Closes #756 --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_select.cc') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 99437e52c13..215803c2637 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -725,7 +725,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables) TABLE_LIST *table; if (!thd->stmt_arena->is_conventional() && - !thd->stmt_arena->is_stmt_prepare() && !thd->stmt_arena->is_sp_execute()) + !thd->stmt_arena->is_stmt_prepare_or_first_sp_execute()) { // statement is already prepared DBUG_RETURN(0); -- cgit v1.2.1