summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test16
-rw-r--r--sql/sql_show.cc5
3 files changed, 32 insertions, 1 deletions
diff --git a/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result
index 0acf8428100..81453d72274 100644
--- a/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result
@@ -142,5 +142,17 @@ SELECT global.tmp_disk_table_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT tmp_disk_table_size = @@session.tmp_disk_table_size;
ERROR 42S22: Unknown column 'tmp_disk_table_size' in 'field list'
+#
+# Beginning of 10.4 test
+#
+# Diagnostics_area::sql_errno() const: Assertion `m_status == DA_ERROR'
+# failed on SELECT after setting tmp_disk_table_size.
+#
+SET @@tmp_disk_table_size=16384;
+CREATE VIEW v AS SELECT 'a';
+SELECT table_name FROM INFORMATION_SCHEMA.views;
+ERROR HY000: The table '(temporary)' is full
+DROP VIEW v;
+# End of 10.4 test
SET @@global.tmp_disk_table_size = @start_global_value;
SET @@session.tmp_disk_table_size = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test
index 123f522a3a4..099be354486 100644
--- a/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test
@@ -193,6 +193,22 @@ SELECT global.tmp_disk_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT tmp_disk_table_size = @@session.tmp_disk_table_size;
+--echo #
+--echo # Beginning of 10.4 test
+--echo #
+--echo # Diagnostics_area::sql_errno() const: Assertion `m_status == DA_ERROR'
+--echo # failed on SELECT after setting tmp_disk_table_size.
+--echo #
+
+SET @@tmp_disk_table_size=16384;
+CREATE VIEW v AS SELECT 'a';
+
+--error ER_RECORD_FILE_FULL
+SELECT table_name FROM INFORMATION_SCHEMA.views;
+
+DROP VIEW v;
+
+--echo # End of 10.4 test
####################################
# Restore initial value #
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 00a06a6e404..76970676c3b 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5129,7 +5129,8 @@ end:
*/
DBUG_ASSERT(thd->open_tables == NULL);
thd->mdl_context.rollback_to_savepoint(open_tables_state_backup->mdl_system_tables_svp);
- thd->clear_error();
+ if (!thd->is_fatal_error)
+ thd->clear_error();
return res;
}
@@ -5345,6 +5346,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
error= 0;
goto err;
}
+ if (thd->is_fatal_error)
+ goto err;
DEBUG_SYNC(thd, "before_open_in_get_all_tables");
if (fill_schema_table_by_open(thd, &tmp_mem_root, FALSE,