Bug #3851 Long text in MEDIUMTEXT-fields, collation latin1_german1_ci
Submitted: 21 May 2004 19:19 Modified: 28 May 2004 8:22
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:4.1.1-alpha OS:Linux (Linux i386)
Assigned to: CPU Architecture:Any

[21 May 2004 19:19] [ name withheld ]
Description:
Strings with more than 766 charactes in fields with type TINYTEXT, MEDIUMTEXT or TEXT and collation latin1_german1_ci are corrupted.

We have the following options:
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_german2_ci |
| collation_database   | latin1_german2_ci |
| collation_server     | latin1_german2_ci |
+----------------------+-------------------+

How to repeat:
create database collationtest;
use collationtest;
create table collationtest.german2 (id int auto_increment primary key, m mediumtext);
create table collationtest.german1 (id int auto_increment primary key, m mediumtext);
alter table collationtest.german1 default collate latin1_german1_ci;
insert into german2 set m=space(766);
insert into german2 set m=space(767);
insert into german1 set m=space(766);
insert into german1 set m=space(767);
select * from german2;
select * from german1;

Suggested fix:
Not known.
[28 May 2004 8:22] MySQL Verification Team
Thank you for the bug report. I tested against our latest 4.1 source
and found that the bug reported no happens anymore and the fix will
be present in the next release 4.1.2:

mysql> insert into german1 set m=space(767);
Query OK, 1 row affected (0.00 sec)

mysql> show variables like "%collation%";
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_german2_ci |
| collation_database   | latin1_german2_ci |
| collation_server     | latin1_german2_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)

mysql> check table german1;
+-----------------------+-------+----------+----------+
| Table                 | Op    | Msg_type | Msg_text |
+-----------------------+-------+----------+----------+
| collationtest.german1 | check | status   | OK       |
+-----------------------+-------+----------+----------+
1 row in set (0.00 sec)

mysql> check table german2;
+-----------------------+-------+----------+----------+
| Table                 | Op    | Msg_type | Msg_text |
+-----------------------+-------+----------+----------+
| collationtest.german2 | check | status   | OK       |
+-----------------------+-------+----------+----------+
1 row in set (0.00 sec)

mysql> select length(m) from german1;
+-----------+
| length(m) |
+-----------+
|       766 |
|       767 |
+-----------+
2 rows in set (0.00 sec)

mysql> select length(m) from german2;
+-----------+
| length(m) |
+-----------+
|       766 |
|       767 |
+-----------+
2 rows in set (0.00 sec)

mysql> select version();
+-----------------------+
| version()             |
+-----------------------+
| 4.1.2-alpha-debug-log |
+-----------------------+
1 row in set (0.00 sec)