[MDEV-29763] ER_EVENT_STORE_FAILED upon creating event under some uca140_xxx_nopad_xx_xx collations Created: 2022-10-11  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Character Sets, Events
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.11

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-27009 Add UCA-14.0.0 collations Closed
Relates
relates to MDEV-29776 collation_connection and db_collation... Closed

 Description   

SET NAMES 'utf8mb3' COLLATE 'uca1400_swedish_nopad_ai_ci';
 
CREATE TABLE t (a CHAR(8));
INSERT INTO t VALUES ('foo');
--error ER_TRUNCATED_WRONG_VALUE
ALTER TABLE t MODIFY a INT;
CREATE EVENT ev ON SCHEDULE EVERY 1 HOUR DO BEGIN END;
 
# Cleanup
DROP EVENT ev;
DROP TABLE t;

10.10 bb76dcbe

query 'CREATE EVENT ev ON SCHEDULE EVERY 1 HOUR DO BEGIN END' failed: ER_EVENT_STORE_FAILED (1538): Failed to store event body. Error code 2 "No such file or directory" from storage engine

I tried a few uca1400_xxxx_nopad_xx_xx collations, it was reproducible with each of them. Couldn't reproduce with non-nopad, non-uca1400, and non-language-specific (without xxxx) which I tried.

Reproducible on 10.10/10.11.
The test case isn't applicable to earlier versions due to the use of UCA1400 collations.
On some reason the failing ALTER TABLE is important here, although I can't figure why.



 Comments   
Comment by Alexander Barkov [ 2022-10-11 ]

There are two problems here:

  • The column mysql.event.collation_connection is too short. The collation name utf8mb3_uca1400_swedish_nopad_ai_ci does not fit into it. This problem is now reported in a separate issue: MDEV-29776
  • mysql_alter_table() does not restore THD::count_cuted_field properly on failure.
    The second problem is also repeatable with a too long COMMENT. This script works without errors on CREATE EVENT:

DROP EVENT IF EXISTS ev;
DROP TABLE IF EXISTS t;
 
SET sql_mode=DEFAULT;
SET NAMES 'utf8mb3' COLLATE 'uca1400_swedish_nopad_ai_ci';
CREATE TABLE t (a CHAR(8)) ENGINE=MyISAM;
INSERT INTO t VALUES ('foo');
#ALTER TABLE t MODIFY a INT;
CREATE EVENT ev ON SCHEDULE EVERY 1 HOUR COMMENT 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' DO BEGIN END;

Now if uncomment the ALTER TABLE, the script fails of CREATE EVENT:

CREATE EVENT ev ON SCHEDULE EVERY 1 HOUR COMMENT 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' DO BEGIN END;

ERROR 1552 (HY000): Data for column 'comment' too long

Comment by Alexander Barkov [ 2022-10-24 ]

Now with the first problem (MDEV-29776) fixed, this issue is not a Blocker any more.

The problem with COMMENT is repeatable in all versions 10.3 .. 10.11.

Changing priority to `Major` and fixing `Affect Versions` accordingly.

Generated at Thu Feb 08 10:11:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.