Created
February 11, 2009 15:47
-
-
Save jqr/62077 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Demonstration of MySQL bug and a work-around. | |
-- See http://bugs.mysql.com/bug.php?id=36772 | |
-- It is fixed in MySQL 5.0.74 | |
DROP TABLE `test`; | |
CREATE TABLE `test` ( | |
`id` INT | |
); | |
INSERT INTO `test` VALUES | |
(123456789), | |
(123456789); | |
SET NAMES utf8; | |
SELECT CAST(id AS CHAR) AS id FROM test GROUP BY id; | |
-- +------+ | |
-- | id | | |
-- +------+ | |
-- | 123 | | |
-- +------+ | |
SELECT CAST(id AS CHAR(20)) AS id FROM test GROUP BY id; | |
-- +-----------+ | |
-- | id | | |
-- +-----------+ | |
-- | 123456789 | | |
-- +-----------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment