mysql> DROP TABLE IF EXISTS `privatesubscribeinfo`;
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> CREATE TABLE `privatesubscribeinfo` (
-> `channelsubscribeid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
-> `channelid` bigint(20) unsigned NOT NULL,
-> `usertype` char(1) NOT NULL,
-> `username` varchar(32) DEFAULT NULL,
-> `customerid` bigint(20) DEFAULT NULL,
-> `loginid` bigint(20) DEFAULT NULL,
-> `createdate` datetime DEFAULT NULL,
-> PRIMARY KEY (`channelsubscribeid`),
-> UNIQUE KEY `UI_private_channel` (`channelid`,`username`,`loginid`) USING BTREE
-> ) ENGINE=InnoDB AUTO_INCREMENT=1000000000000030 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)mysql>
mysql>
mysql> insert into privatesubscribeinfo(channelid,usertype) select 1,'a';
Query OK, 1 row affected (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 0mysql> select * from privatesubscribeinfo;
+--------------------+-----------+----------+----------+------------+---------+------------+
| channelsubscribeid | channelid | usertype | username | customerid | loginid | createdate |
+--------------------+-----------+----------+----------+------------+---------+------------+
| 1000000000000030 | 1 | a | NULL | NULL | NULL | NULL |
+--------------------+-----------+----------+----------+------------+---------+------------+
1 row in set (0.00 sec)mysql>
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> CREATE TABLE `privatesubscribeinfo` (
-> `channelsubscribeid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
-> `channelid` bigint(20) unsigned NOT NULL,
-> `usertype` char(1) NOT NULL,
-> `username` varchar(32) DEFAULT NULL,
-> `customerid` bigint(20) DEFAULT NULL,
-> `loginid` bigint(20) DEFAULT NULL,
-> `createdate` datetime DEFAULT NULL,
-> PRIMARY KEY (`channelsubscribeid`),
-> UNIQUE KEY `UI_private_channel` (`channelid`,`username`,`loginid`) USING BTREE
-> ) ENGINE=InnoDB AUTO_INCREMENT=1000000000000030 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)mysql>
mysql>
mysql> insert into privatesubscribeinfo(channelid,usertype) select 1,'a';
Query OK, 1 row affected (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 0mysql> select * from privatesubscribeinfo;
+--------------------+-----------+----------+----------+------------+---------+------------+
| channelsubscribeid | channelid | usertype | username | customerid | loginid | createdate |
+--------------------+-----------+----------+----------+------------+---------+------------+
| 1000000000000030 | 1 | a | NULL | NULL | NULL | NULL |
+--------------------+-----------+----------+----------+------------+---------+------------+
1 row in set (0.00 sec)mysql>
bigint的最大值是
9223372036854775807
而你的初始值是
1000000000000030
所以应该不会有问题的。