From cc86a0bd11a436dfe4df0622481c571f83b1680a Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 11 Jul 2019 14:50:50 +0200 Subject: MDEV-15572: view.test, server crash with --big-tables=1 Check that table is really opened before cleanup using handler. --- sql/sql_insert.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8f5ef0b531c..ddf9bd155a9 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3743,8 +3743,12 @@ void select_insert::abort_result_set() { example), no table will have been opened and therefore 'table' will be NULL. In that case, we still need to execute the rollback and the end of the function. + + If it fail due to inability to insert in multi-table view for example, + table will be assigned with view table structure, but that table will + not be opened really (it is dummy to check fields types & Co). */ - if (table) + if (table && table->file->get_table()) { bool changed, transactional_table; /* -- cgit v1.2.1