Re: [cxserver-interest] 回复: 回复: [SPAM] 下午看了一下CX的数据库,有一点问题
Brought to you by:
zhmsong
From: Zhimin S. <csz...@gm...> - 2010-07-11 02:18:41
|
Ja: 很早啊,我实验了一下,你看实验过程是否正确,如果正确的话,那就是有符号的 int 支持到了 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 理论值。 在 2010年7月11日 上午9:57,Ja <ja...@vi...>写道: > 这个想法也很不错:) > 不过 int 的最大值是三万多吧。 > > mysql> select p_id, pl_id from project order by p_id desc limit 5; +-----------+---------+ | p_id | pl_id | +-----------+---------+ | 300000000 | 2005004 | | 768 | 0725039 | | 767 | 0725039 | | 766 | 0826034 | | 765 | 0925028 | +-----------+---------+ 5 rows in set (0.00 sec) mysql> update project set p_id=300000000000 where pl_id=2005004; Query OK, 1 row affected, 1 warning (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> select p_id, pl_id from project order by p_id desc limit 5; +------------+---------+ | p_id | pl_id | +------------+---------+ | 2147483647 | 2005004 | | 768 | 0725039 | | 767 | 0725039 | | 766 | 0826034 | | 765 | 0925028 | +------------+---------+ 5 rows in set (0.00 sec) mysql> update project set p_id=30000000000 where pl_id=2005004; Query OK, 0 rows affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 1 mysql> update project set p_id=3000000000 where pl_id=2005004; Query OK, 0 rows affected, 1 warning (0.01 sec) Rows matched: 1 Changed: 0 Warnings: 1 mysql> update project set p_id=300000000 where pl_id=2005004; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select p_id, pl_id from project order by p_id desc limit 5; +-----------+---------+ | p_id | pl_id | +-----------+---------+ | 300000000 | 2005004 | | 768 | 0725039 | | 767 | 0725039 | | 766 | 0826034 | | 765 | 0925028 | +-----------+---------+ 5 rows in set (0.00 sec) mysql> update project set p_id=900000000 where pl_id=2005004; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update project set p_id=2000000000 where pl_id=2005004; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update project set p_id=2100000000 where pl_id=2005004; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update project set p_id=2147000000 where pl_id=2005004; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select p_id, pl_id from project order by p_id desc limit 5; +------------+---------+ | p_id | pl_id | +------------+---------+ | 2147000000 | 2005004 | | 768 | 0725039 | | 767 | 0725039 | | 766 | 0826034 | | 765 | 0925028 | +------------+---------+ 5 rows in set (0.00 sec) |