Bug #4594 column index make = failed for gbk, but like works
Submitted: 18 Jul 2004 4:28 Modified: 23 Aug 2004 16:45
Reporter: xuefer tinys Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S1 (Critical)
Version:MySQL 4.1.3b-beta-nt-log OS:Windows (winxp)
Assigned to: Assigned Account CPU Architecture:Any

[18 Jul 2004 4:28] xuefer tinys
Description:
-- phpMyAdmin SQL Dump
-- version 2.6.0-beta3
-- http://www.phpmyadmin.net
-- 

-- --------------------------------------------------------

-- 
-- 

DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
  `str` varchar(255) NOT NULL default '',
  KEY `str` (`str`(2)) // column index
) ENGINE=MyISAM DEFAULT CHARSET=gbk;

-- 
-- 

INSERT INTO `test` VALUES ('str');
INSERT INTO `test` VALUES ('str2'); // at least 2 rows

How to repeat:
now do:
select * from test where str='str'; // 0 results
select * from test where str LIKE 'str'; // 1 results
[22 Jul 2004 15:31] Alexander Keremidarski
Verified with 4.1 from bk tree
ChangeSet@1.1965, 2004-07-17 02:13:02+03:00, bell@sanja.is.com.ua
[20 Aug 2004 16:21] Alexander Barkov
The same happens for HEAP, BDB, INNODB.
[23 Aug 2004 16:01] Alexander Barkov
MyISAM and HEAP tables have been fixed.
[23 Aug 2004 16:45] Alexander Barkov
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

This is a part of the problem explained in http://bugs.mysql.com/bug.php?id=4521