I have an enum field containing lowercase and uppercase the same letter when I try to update a string and change the value that it doesn't work.
This is how the problem reproduces:
CREATE TABLE `mytable` ( `id` bigint(20) NOT NULL, `name` varchar(100) NOT NULL, `strategy` enum('g','G','r','R') NOT NULL DEFAULT 'g' ) ENGINE=InnoDB; INSERT INTO `mytable` VALUES(1,'test','g');
now when i try to change strategy from g to g , it doesn't work:
UPDATE `mytable` SET `strategy`='G' WHERE id=1;
it returns:
Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0
I am using MySQL 5.5 , help me
EDIT:
as the mention of @farshad in his comment, He uses the first match, if I change the order of enum and use 'G','g',... , he will always use g , and you cannot change it to g
source share