Commit b88f1267 authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Oleksandr Byelkin

MDEV-33373 part 2: Unexpected ER_FILE_NOT_FOUND upon reading from logging...

MDEV-33373 part 2: Unexpected ER_FILE_NOT_FOUND upon reading from logging table after crash recovery

CSV engine shoud set my_errno if use it.
parent 20f57a85
#
# MDEV-33373: Unexpected ER_FILE_NOT_FOUND upon reading from logging
# table after crash recovery
#
call mtr.add_suppression("Table 'general_log' is marked as crashed and should be repaired");
SET GLOBAL log_output="TABLE";
CREATE TABLE t (a INT);
# restart
DROP TABLE t;
SELECT count(*) FROM mysql.general_log;
count(*)
5
Warnings:
Error 1194 Table 'general_log' is marked as crashed and should be repaired
#
# End of 10.5 tests
#
--source include/not_embedded.inc
--source include/have_csv.inc
--echo #
--echo # MDEV-33373: Unexpected ER_FILE_NOT_FOUND upon reading from logging
--echo # table after crash recovery
--echo #
call mtr.add_suppression("Table 'general_log' is marked as crashed and should be repaired");
--disable_ps_protocol
SET GLOBAL log_output="TABLE";
CREATE TABLE t (a INT);
--disable_ps_protocol
--let $shutdown_timeout= 0
--source include/restart_mysqld.inc
DROP TABLE t;
--disable_ps_protocol
SELECT count(*) FROM mysql.general_log;
--enable_ps_protocol
--echo #
--echo # End of 10.5 tests
--echo #
......@@ -333,7 +333,7 @@ static int read_meta_file(File meta_file, ha_rows *rows)
/* check crashed bit and magic number */
if ((meta_buffer[0] != (uchar)TINA_CHECK_HEADER) ||
((bool)(*ptr)== TRUE))
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
DBUG_RETURN(my_errno= HA_ERR_CRASHED_ON_USAGE);
mysql_file_sync(meta_file, MYF(MY_WME));
......@@ -974,7 +974,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
if (share->crashed && !(open_options & HA_OPEN_FOR_REPAIR))
{
free_share(share);
DBUG_RETURN(my_errno ? my_errno : HA_ERR_CRASHED_ON_USAGE);
DBUG_RETURN(my_errno);
}
local_data_file_version= share->data_file_version;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment