[MDEV-24972] ER_CRASHED_ON_USAGE (Table is marked as crashed and should be repaired) upon insert with unique blobs Created: 2021-02-24  Updated: 2022-02-22

Status: Open
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 1
Labels: not-10.5, not-10.6


 Description   

CREATE TABLE t1 (b TEXT, UNIQUE(b)) ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES ('a'),('a'),('c'),('d'),('e'),('f'),('g'),('h'),('i'),('j'),('k');
 
# Cleanup
DROP TABLE t1;

Reproducible on 10.4.
Not applicable to 10.3.
On 10.5+ it was fixed by this commit:

Author: Sergei Golubchik <serg@mariadb.org>
Date:   Sun Apr 12 18:09:09 2020 +0200
 
    MDEV-22218 InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON upon LOAD DATA with NO_BACKSLASH_ESCAPES in SQL_MODE and unique blob in table
    
    `inited == NONE` at the initialization time does not always mean
    that it'll be `NONE` later, at the execution time. Use a more complex
    caller-specific logic to decide whether to create a cloned lookup handler.
    
    Besides LOAD (as in the original bug report) make sure that all
    prepare_for_insert() invocations are covered by tests. Add tests for
    CREATE ... SELECT, multi-UPDATE, and multi-DELETE.
    
    Don't enable write cache with long uniques.

The problem could be considered minor, as it only affects not-the-latest-major 10.4, but it causes lots of unavoidable test failures and can easily mask real corruption issues.



 Comments   
Comment by Andrei Elkin [ 2022-02-22 ]

serg: Your commit is mentioned in the context of how-to-fix, so I've reassigned.

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