[MDEV-11691] CSV: Table marked as crashed and should be repaired Created: 2016-12-30  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 5.5, 10.0, 10.1, 10.2.3, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Nirbhay Choubey (Inactive) Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: corruption, crash, upstream

Issue Links:
Relates
relates to MDEV-26581 Table 't' is marked as crashed and sh... Confirmed
relates to MDEV-7635 update defaults and simplify mysqld c... Closed

 Description   

MariaDB [test]> SET sql_mode='NO_ZERO_DATE';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.02 sec)
 
MariaDB [test]> CREATE TABLE t1 (c1 DATE NOT NULL) ENGINE=CSV;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> INSERT IGNORE INTO t1 VALUES();
Query OK, 1 row affected, 1 warning (0.01 sec)
 
MariaDB [test]> SHOW WARNINGS;
+---------+------+-----------------------------------------+
| Level   | Code | Message                                 |
+---------+------+-----------------------------------------+
| Warning | 1364 | Field 'c1' doesn't have a default value |
+---------+------+-----------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> SELECT * FROM t1;
ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired



 Comments   
Comment by Elena Stepanova [ 2017-01-03 ]

Also reproducible with MySQL-5.7.
nirbhay_c, do you think it makes sense to file an upstream bug report? If it does, can you do it?

Comment by Elena Stepanova [ 2017-01-24 ]

After fixing, please remember not only update the test/results (it will be hard to forget as they'll start failing), but also remove extra MTR suppressions for the error.

Comment by Elena Stepanova [ 2017-04-23 ]

Removed 10.2-ga label since NO_ZERO_DATE has not become a part of the default sql_mode.

Comment by Roel Van de Paar [ 2021-08-15 ]

I saw this one also in testing

SET sql_mode='no_zero_date';
CREATE TABLE t (a DATETIME NOT NULL) ENGINE=CSV;
CREATE TEMPORARY TABLE t (b INT) ENGINE=InnoDB;
DROP TABLE t;
INSERT INTO t VALUES (1);
SELECT * FROM t;

Leads to:

MD160821-mariadb-10.7.0-linux-x86_64-dbg/log/master.err:2021-08-16  9:14:50 4 [ERROR] mysqld: Table 't' is marked as crashed and should be repaired

MD160821-mariadb-10.7.0-linux-x86_64-opt/log/master.err:2021-08-16  9:14:50 4 [ERROR] mysqld: Table 't' is marked as crashed and should be repaired

Bug confirmed present in:
MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (dbg), 10.4.22 (opt), 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 5.7.35 (dbg), 8.0.24 (dbg), 8.0.24 (opt)

Comment by Roel Van de Paar [ 2021-08-15 ]

Logged upstream as https://bugs.mysql.com/bug.php?id=104627

Comment by Roel Van de Paar [ 2022-11-01 ]

SET sql_mode='';
CREATE TABLE t1 (a DATE NOT NULL) ENGINE=CSV;
INSERT INTO t1 VALUES();
SET sql_mode=TRADITIONAL;
SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2));

Leads to:

10.11.1 50c5743adc87e1cdec1431a02558f6540fe5a6d5 (Debug)

10.11.1-dbg>SELECT 1 FROM t1 WHERE ROW(a,a) NOT IN ((1,1),(2,2));
ERROR 1194 (HY000): Table 't1' is marked as crashed and should be repaired

Generated at Thu Feb 08 07:51:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.