| Bug #32705 | myisam corruption: Key in wrong position at page 1024 with ucs2_bin | ||
|---|---|---|---|
| Submitted: | 26 Nov 2007 6:57 | Modified: | 15 Apr 2008 4:13 |
| Reporter: | Shane Bester | ||
| Status: | Closed | ||
| Category: | Server: MyISAM | Severity: | S1 (Critical) |
| Version: | 5.1.23, 5.0.50, 6.0.3 | OS: | Any |
| Assigned to: | Ingo Strüwing | Target Version: | 5.0+,5.1.24 |
| Tags: | Contribution, ucs2_bin, ucs2, corruption, myisam | ||
[28 Nov 2007 10:42]
Lu Jingdong
I did some order tests and got wrong results. I think the order of the key is wrong.
mysql> drop table if exists t;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> create table t (c1 char(100) character set ucs2 collate ucs2_bin not
null,key(c1))
-> engine=myisam;
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t values ('marshall\'s');
Query OK, 1 row affected (0.01 sec)
mysql> insert into t values ('marsh');
Query OK, 1 row affected (0.00 sec)
mysql> select * from t;
+------------+
| c1 |
+------------+
| marshall's |
| marsh |
+------------+
2 rows in set (0.00 sec)
mysql> select * from t order by c1;
+------------+
| c1 |
+------------+
| marshall's |
| marsh |
+------------+
2 rows in set (0.00 sec)
mysql> select * from t order by c1 desc;
+------------+
| c1 |
+------------+
| marsh |
| marshall's |
+------------+
2 rows in set (0.00 sec)
[3 Dec 2007 14:48]
Sergei Golubchik
patch: http://lists.mysql.com/internals/35191
[18 Dec 2007 12:30]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/40128 ChangeSet@1.2579, 2007-12-18 12:29:50+01:00, istruewing@stella.local +3 -0 Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Inserting strings with a common prefix into a table with characterset UCS2 corrupted the table. An efficient search method was used, which compares end space with ASCII blank. This doesn't work for character sets like UCS2, which do not encode blank like ASCII does. Use the less efficient search method _mi_seq_search() for charsets with mbminlen > 1.
[11 Jan 2008 7:48]
Alexander Barkov
The patch is ok to push
[16 Jan 2008 11:48]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/41030 ChangeSet@1.2580, 2008-01-16 11:48:04+01:00, istruewing@stella.local +4 -0 Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Post-pushbuild fix. Moved test from myisam.test to ctype_ucs2_def.test. UCS2 is not always available.
[16 Jan 2008 15:38]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/41033 ChangeSet@1.2654, 2008-01-16 15:38:40+01:00, istruewing@stella.local +1 -0 Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Post merge fix
[17 Jan 2008 10:01]
Ingo Strüwing
Queued to 6.0-engines, 5.1-engines, 5.0-engines
[12 Mar 2008 15:53]
Shane Bester
why still 'patch queued' ?
[12 Mar 2008 16:15]
Ingo Strüwing
Because it is still hanging in the engines trees. We had our merge ticket twice, but lost it due to non-trivial problems in the trees.
[27 Mar 2008 12:20]
Bugs System
Pushed into 5.0.60
[27 Mar 2008 12:21]
Bugs System
Pushed into 5.1.24-rc
[27 Mar 2008 18:53]
Bugs System
Pushed into 6.0.5-alpha
[31 Mar 2008 21:24]
Jon Stephens
Pushed into 5.1.23-ndb-6.3.11.
[15 Apr 2008 4:02]
Paul DuBois
Noted in 5.0.60, 5.1.24, 6.0.5 changelogs. Inserting strings with a common prefix into a table that used the ucs2 character set corrupted the table.

Description: mysql> drop table if exists `t0`; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> create table `t0` (`c1` char(255) character set ucs2 collate ucs2_bin not null,key(`c1`)) engine=myisam; Query OK, 0 rows affected (0.05 sec) mysql> insert into `t0` values ('marshall\'s'); Query OK, 1 row affected (0.08 sec) mysql> insert into `t0` values ('marsh'); Query OK, 1 row affected (0.00 sec) mysql> check table `t0` extended; +---------+-------+----------+------------------------------------+ | Table | Op | Msg_type | Msg_text | +---------+-------+----------+------------------------------------+ | test.t0 | check | error | Key in wrong position at page 1024 | | test.t0 | check | error | Corrupt | +---------+-------+----------+------------------------------------+ 2 rows in set (0.05 sec) How to repeat: drop table if exists `t0`; create table `t0` (`c1` char(255) character set ucs2 collate ucs2_bin not null,key(`c1`)) engine=myisam; insert into `t0` values ('marshall\'s'); insert into `t0` values ('marsh'); check table `t0` extended;