Server version: 5.0.97-Win X64 Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.0 > use test Database changed mysql 5.0 > drop table if exists t1; Query OK, 0 rows affected (0.00 sec) mysql 5.0 > create table t1(a bigint); Query OK, 0 rows affected (0.02 sec) mysql 5.0 > insert into t1 values (-9223372036854775808), (-9223372036854775807), (9223372036854775806), (9223372036854775807); Query OK, 4 rows affected (0.00 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql 5.0 > select ceil(a) from t1 order by 1; +----------------------+ | ceil(a) | +----------------------+ | -9223372036854775808 | | -9223372036854775807 | | 9223372036854775806 | | 9223372036854775807 | +----------------------+ 4 rows in set, 4 warnings (0.00 sec) mysql 5.0 > select distinct ceil(a) from t1 order by 1; +-------------------+ | ceil(a) | +-------------------+ | -9999999999999999 | | 9999999999999999 | +-------------------+ 2 rows in set (0.00 sec) mysql 5.0 > C:\dbs>c:\dbs\5.5\bin\mysql -uroot --port=3550 --prompt="mysql 5.5 > " Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.5.48 Source distribution PULL: 2015-DEC-05 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.5 > use test Database changed mysql 5.5 > drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql 5.5 > create table t1(a bigint); Query OK, 0 rows affected (0.01 sec) mysql 5.5 > insert into t1 values (-9223372036854775808), (-9223372036854775807), (9223372036854775806), (9223372036854775807); Query OK, 4 rows affected (0.02 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql 5.5 > select ceil(a) from t1 order by 1; +----------------------+ | ceil(a) | +----------------------+ | -9223372036854775808 | | -9223372036854775807 | | 9223372036854775806 | | 9223372036854775807 | +----------------------+ 4 rows in set, 4 warnings (0.00 sec) mysql 5.5 > select distinct ceil(a) from t1 order by 1; +-------------------+ | ceil(a) | +-------------------+ | -9999999999999999 | | 9999999999999999 | +-------------------+ 2 rows in set (0.00 sec) C:\dbs>c:\dbs\5.6\bin\mysql -uroot --port=3560 -p --prompt="mysql 5.6 > " Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.6.29 Source distribution PULL: 2015-DEC-05 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.6 > use test Database changed mysql 5.6 > drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql 5.6 > create table t1(a bigint); Query OK, 0 rows affected (0.03 sec) mysql 5.6 > insert into t1 values (-9223372036854775808), (-9223372036854775807), (9223372036854775806), (9223372036854775807); Query OK, 4 rows affected (0.00 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql 5.6 > select ceil(a) from t1 order by 1; +----------------------+ | ceil(a) | +----------------------+ | -9223372036854775808 | | -9223372036854775807 | | 9223372036854775806 | | 9223372036854775807 | +----------------------+ 4 rows in set, 4 warnings (0.00 sec) mysql 5.6 > select distinct ceil(a) from t1 order by 1; +-------------------+ | ceil(a) | +-------------------+ | -9999999999999999 | | 9999999999999999 | +-------------------+ 2 rows in set (0.00 sec) mysql 5.6 > C:\dbs>c:\dbs\5.7\bin\mysql -uroot -p --port=3570 --prompt="mysql 5.7 > " Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.11 Source distribution PULL: 2015-DEC-05 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.7 > use test Database changed mysql 5.7 > drop table if exists t1; Query OK, 0 rows affected (0.03 sec) mysql 5.7 > create table t1(a bigint); Query OK, 0 rows affected (0.03 sec) mysql 5.7 > insert into t1 values (-9223372036854775808), (-9223372036854775807), (9223372036854775806), (9223372036854775807); Query OK, 4 rows affected (0.02 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql 5.7 > select ceil(a) from t1 order by 1; +----------------------+ | ceil(a) | +----------------------+ | -9223372036854775808 | | -9223372036854775807 | | 9223372036854775806 | | 9223372036854775807 | +----------------------+ 4 rows in set, 4 warnings (0.00 sec) mysql 5.7 > select distinct ceil(a) from t1 order by 1; +-------------------+ | ceil(a) | +-------------------+ | -9999999999999999 | | 9999999999999999 | +-------------------+ 2 rows in set (0.00 sec)