mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
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.
This commit is contained in:
parent
20f57a8529
commit
b88f1267e4
3 changed files with 44 additions and 2 deletions
17
mysql-test/main/log_crash.result
Normal file
17
mysql-test/main/log_crash.result
Normal file
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# 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
|
||||
#
|
25
mysql-test/main/log_crash.test
Normal file
25
mysql-test/main/log_crash.test
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
--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;
|
||||
|
|
Loading…
Add table
Reference in a new issue