Details
Description
An update fails after update statistics on the table with error :
ERROR 1406 (22001): Data too long for column 'fldgapfl' at row 1
An update fails after update statistics on the table with error :
ERROR 1406 (22001): Data too long for column 'fldgapfl' at row 1
Thanks a lot for the report!
Reproducible on the current 10.4:
10.4 c3394870303090e3e58
MariaDB [test]> create table t1 (a1 varchar(30) collate utf8_bin, a2 varchar(30) collate utf8_bin);
Query OK, 0 rows affected (0.036 sec)
MariaDB [test]> insert into t1 values('1','1'),('1','1'),('1','1'),('1','1');
Query OK, 4 rows affected (0.006 sec)
Records: 4 Duplicates: 0 Warnings: 0
MariaDB [test]> analyze table t1 persistent for all;
+---------+---------+----------+-----------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------+---------+----------+-----------------------------------------+
| test.t1 | analyze | status | Engine-independent statistics collected |
| test.t1 | analyze | status | OK |
+---------+---------+----------+-----------------------------------------+
2 rows in set (0.031 sec)
MariaDB [test]> update t1 set a2 = 2 where a1 like 'xx%' and exists (select 1 from t1);
ERROR 1406 (22001): Data too long for column 'a1' at row 2
MariaDB [test]> update t1 set a2 = 2 where a1 like 'x%' and exists (select 1 from t1);
Query OK, 0 rows affected, 1 warning (0.001 sec)
Rows matched: 0 Changed: 0 Warnings: 1
Note (Code 1265): Data truncated for column 'a1' at row 2