Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.5-m3 MySQL Community Server (GPL) Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop table if exists foo; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE TABLE foo ( -> bar MEDIUMINT NULL -> ) ENGINE = MYISAM ; Query OK, 0 rows affected (0.03 sec) mysql> mysql> INSERT INTO foo (bar) VALUES (1234567); Query OK, 1 row affected (0.06 sec) mysql> mysql> #### Outputs 123 instead of 1234567 mysql> SELECT GROUP_CONCAT(IFNULL(bar,'')) FROM foo; +------------------------------+ | GROUP_CONCAT(IFNULL(bar,'')) | +------------------------------+ | 1234567 | +------------------------------+ 1 row in set (0.03 sec) mysql> mysql> #### Switching to bigint produces different result mysql> ALTER TABLE foo CHANGE bar bar BIGINT NULL DEFAULT NULL; Query OK, 1 row affected (0.03 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> mysql> #### Outputs 123456 instead of 1234567 mysql> SELECT GROUP_CONCAT(IFNULL(bar,'')) FROM foo; +------------------------------+ | GROUP_CONCAT(IFNULL(bar,'')) | +------------------------------+ | 1234567 | +------------------------------+ 1 row in set (0.00 sec) mysql> mysql> #### Using IFNULL(bar,0) doesn't produce the error (outputs 1234567) mysql> SELECT GROUP_CONCAT(IFNULL(bar,0)) FROM foo; +-----------------------------+ | GROUP_CONCAT(IFNULL(bar,0)) | +-----------------------------+ | 1234567 | +-----------------------------+ 1 row in set (0.00 sec) mysql> mysql> #### allowing of not null values doesnt seem to change anything mysql> ALTER TABLE foo CHANGE bar bar BIGINT(20) NOT NULL; Query OK, 1 row affected (0.03 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> mysql> #### Outputs 123456 instead of 1234567 mysql> SELECT GROUP_CONCAT(IFNULL(bar,'')) FROM foo; +------------------------------+ | GROUP_CONCAT(IFNULL(bar,'')) | +------------------------------+ | 1234567 | +------------------------------+ 1 row in set (0.00 sec) mysql> mysql> #### Suggested temporaty workaround mysql> #### CASTING THE VALUE to string first does the trick mysql> SELECT GROUP_CONCAT(IFNULL(CAST(bar AS CHAR),'')) FROM foo; +--------------------------------------------+ | GROUP_CONCAT(IFNULL(CAST(bar AS CHAR),'')) | +--------------------------------------------+ | 1234567 | +--------------------------------------------+ 1 row in set (0.00 sec) mysql>