mysql> select version(); +-----------+ | version() | +-----------+ | 5.0.51b | +-----------+ 1 row in set (0.00 sec) mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> drop table if exists foo; Query OK, 0 rows affected (0.00 sec) mysql> create table foo(i decimal(23,0) primary key); Query OK, 0 rows affected (0.02 sec) mysql> insert into foo values(6700000000000000498); Query OK, 1 row affected (0.00 sec) mysql> insert into foo values(6700000000000000499); Query OK, 1 row affected (0.00 sec) mysql> insert into foo values(6700000000000000500); Query OK, 1 row affected (0.00 sec) mysql> insert into foo values(6700000000000000501); Query OK, 1 row affected (0.00 sec) mysql> insert into foo values(6700000000000000502); Query OK, 1 row affected (0.00 sec) mysql> select i from foo where i=6700000000000000498; +---------------------+ | i | +---------------------+ | 6700000000000000498 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i='6700000000000000498'; +---------------------+ | i | +---------------------+ | 6700000000000000498 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i=6700000000000000499; +---------------------+ | i | +---------------------+ | 6700000000000000499 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i='6700000000000000499'; +---------------------+ | i | +---------------------+ | 6700000000000000499 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i=6700000000000000500; +---------------------+ | i | +---------------------+ | 6700000000000000500 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i='6700000000000000500'; Empty set (0.00 sec) mysql> select i from foo where i=6700000000000000501; +---------------------+ | i | +---------------------+ | 6700000000000000501 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i='6700000000000000501'; Empty set (0.00 sec) mysql> select i from foo where i=6700000000000000502; +---------------------+ | i | +---------------------+ | 6700000000000000502 | +---------------------+ 1 row in set (0.00 sec) mysql> select i from foo where i='6700000000000000502'; Empty set (0.00 sec)