From 3327bb6098c42e82a72bfc5f8080b2e6cf79a025 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Mon, 11 Apr 2022 19:11:59 +0530 Subject: MDEV-22266: Diagnostics_area::sql_errno() const: Assertion `m_status == DA_ERROR' failed on SELECT after setting tmp_disk_table_size. Analysis: Mismatch in number of warnings between "194 warnings" vs "64 rows in set" is because of max_error_count variable which has default value of 64. About the corrupted tables, the error that occurs because of insufficient tmp_disk_table_size variable is not reported correctly and we continue to execute the statement. But because the previous error (about table being full)is not reported correctly, this error moves up the stack and is wrongly reported as parsing error later on while parsing frm file of one of the information schema table. This parsing error gives corrupted table error. As for the innodb error, it occurs even when tmp_disk_table_size is not insufficient is default but the internal error handler takes care of it and the error doesn't show. But when tmp_disk_table_size is insufficient, the fatal error which wasn't reported correctly moves up the stack so internal error handler is not called. So it shows errors. Fix: Report the error correctly. --- .../suite/sys_vars/r/tmp_disk_table_size_basic.result | 12 ++++++++++++ .../suite/sys_vars/t/tmp_disk_table_size_basic.test | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'mysql-test/suite/sys_vars') 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 # -- cgit v1.2.1