You are here: Problem with Update, index and UTF8 (Mysql 4.1) « MySQL Databases « IT news, forums, messages
Problem with Update, index and UTF8 (Mysql 4.1)

Posted by ben on 11/11/05 19:18

Hi all,

I am experiencing a strange problem with MySQL 4.1.15-standard.

I have a table with one row in (for purposes of reproducing this issue).
The SQL is below.

When I try to run the following update, it does not work! There is no
error, just 0 affected rows.

update testupdate SET Status='Newstatus' WHERE SecondaryID='3321822951131719083090';

If I change the collation to latin1_swedish_ci, or remove the SecondaryID
index, or change the SecondaryID index to not be just the first 16
characters, it works fine.

I guess this is a bug, but if anyone could shed any light on it, it would
be appreciated.
Doing a "SELECT * WHERE SecondaryID='3321822951131719083090';" works fine.

All character sets are utf8 (client, connection, database, results, server
and system) and all collations are utf8_general_ci

Any thoughts appreciated!

Cheers,

Ben

CREATE TABLE `testupdate` (
`PrimaryID` bigint(20) NOT NULL auto_increment,
`Status` varchar(64) collate utf8_unicode_ci default NULL,
`SecondaryID` varchar(64) collate utf8_unicode_ci default NULL,
PRIMARY KEY (`PrimaryID`),
KEY `SecondaryID` (`SecondaryID`(16))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

--
-- Dumping data for table `testupdate2`
--

INSERT INTO `testupdate` VALUES (1, 'Pending', '3321822951131719083090');

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация