From 2e9b55f763441b1879c4d9980d25f73a43949115 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 1 Jul 2017 12:00:02 +0300 Subject: MDEV-13226 Server crashes when tmpdir runs out of space There was a missing test in CTE handling if creating a temporary table failed (in this case as a result of out of space). This caused a table handler to be used even if it was not allocated. --- sql/sql_select.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 540271bc961..2c7ccbf3e2b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -26304,7 +26304,8 @@ AGGR_OP::put_record(bool end_of_records) { // Lasy tmp table creation/initialization if (!join_tab->table->file->inited) - prepare_tmp_table(); + if (prepare_tmp_table()) + return NESTED_LOOP_ERROR; enum_nested_loop_state rc= (*write_func)(join_tab->join, join_tab, end_of_records); return rc; -- cgit v1.2.1