Bug #46240 cp1250_czech_cs incompatible between 5.0.82/5.1.37 and 5.4.4
Submitted: 16 Jul 2009 19:42 Modified: 21 Mar 2011 15:13
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.4.4 OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any
Tags: cp1250_czech_cs
Triage: Triaged: D2 (Serious)

[16 Jul 2009 19:42] Shane Bester
Description:
creating a table with cp1250_czech_cs collation in 5.1.37 and copying the table to 5.4.4 (mysql-next tree), results in corruption instead of a 'Table upgrade required' message.

mysql> check table tbl_44 for upgrade;
+-------------+-------+----------+----------+
| Table       | Op    | Msg_type | Msg_text |
+-------------+-------+----------+----------+
| test.tbl_44 | check | status   | OK       |
+-------------+-------+----------+----------+
1 row in set (0.00 sec)

InnoDB complains:
Version: '5.4.4-alpha-debug'  socket: '/tmp/mysql.sock'  port: 3307  Source distribution
InnoDB: Records in wrong order on page 374 index "PRIMARY" of table "test"."tbl_44"
InnoDB: previous record PHYSICAL RECORD: n_fields 3; compact format; info bits 0
<cut>

Myisam gave this error:

mysql> check table tt extended;
+---------+-------+----------+------------------------------------+
| Table   | Op    | Msg_type | Msg_text                           |
+---------+-------+----------+------------------------------------+
| test.tt | check | error    | Key in wrong position at page 1024 |
| test.tt | check | error    | Corrupt                            |
+---------+-------+----------+------------------------------------+
2 rows in set (0.03 sec)

How to repeat:
in 5.1.37 create this table:

drop table if exists tt;
create table tt (a varchar(1) character set cp1250 collate cp1250_czech_cs,primary key(a))engine=myisam;
insert into tt values (0x07);
insert into tt values (0x20);
check table tt extended;
flush tables;

now copy the .frm, .MYI, MYD to 5.4.4 and run:

check table tt extended;
check table tt for upgrade;

Suggested fix:
check table for upgrade should detect this problem if needed.
more suitable, would be for collations to not be changed like this.
[16 Jul 2009 20:47] Miguel Solorzano
Thank you for the bug report.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.4.4-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> check table tt extended;
+-------+-------+----------+------------------------------------+
| Table | Op    | Msg_type | Msg_text                           |
+-------+-------+----------+------------------------------------+
| dy.tt | check | error    | Key in wrong position at page 1024 |
| dy.tt | check | error    | Corrupt                            |
+-------+-------+----------+------------------------------------+
2 rows in set (0.02 sec)

mysql> check table tt for upgrade;
+-------+-------+----------+----------+
| Table | Op    | Msg_type | Msg_text |
+-------+-------+----------+----------+
| dy.tt | check | status   | OK       |
+-------+-------+----------+----------+
1 row in set (0.02 sec)