Assertion thd->transaction.stmt.is_empty() in prepared statement when MEMORY table implicitly dropped after server restart

Description

I get the following assertion when using ./mtr --ps-protocol in 5.5:

Here is a full test case, remember it only causes assertion/crash if run with
--ps-protocol in a debug build:

The situation is the following. We have a MEMORY table. We restart the server,
so this implicitly causes the table to loose its content.

We then access the table with a prepared statement. As a side effect an
explicit DROP TABLE is put in the binlog.

In this situation, we hit this assertion in sql_prepare.cc:

/* No need to commit statement transaction, it's not started. */
DBUG_ASSERT(thd->transaction.stmt.is_empty());

Environment

None

Status

Assignee

Oleksandr Byelkin

Reporter

Kristian Nielsen

Labels

None

Fix versions

Affects versions

Priority

Major
Configure