807
807
insert into t2 values ("1");
809
809
DROP TABLE IF EXISTS t2,t1;
811
# bug 340316: Issue with bigint unsigned auto-increment field
814
DROP TABLE IF EXISTS t5;
817
c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
818
c2 BIGINT SIGNED NULL,
819
c3 BIGINT SIGNED NOT NULL,
820
c4 TINYINT, c5 SMALLINT,
824
PRIMARY KEY(c1,c2), UNIQUE INDEX(c3));
826
INSERT INTO t5 VALUES
827
(0,-9223372036854775808,1,2,3,4,5,5),
828
(255,-2147483648,6,7,8,9,10,10),
829
(65535,-8388608,11,12,13,14,15,15),
830
(16777215,-32768,16,17,18,19,20,20),
831
(4294967295,-128,21,22,23,24,25,25),
832
(18446744073709551615,9223372036854775807,26,27,28,29,30,30);
835
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
837
INSERT INTO t5(c2,c3) VALUES(33,34);
843
/* same test as above with signed bigint */
845
c1 BIGINT SIGNED NOT NULL AUTO_INCREMENT,
846
c2 BIGINT SIGNED NULL,
847
c3 BIGINT SIGNED NOT NULL,
848
c4 TINYINT, c5 SMALLINT,
852
PRIMARY KEY(c1,c2), UNIQUE INDEX(c3));
854
INSERT INTO t5 VALUES
855
(0,-9223372036854775808,1,2,3,4,5,5),
856
(255,-2147483648,6,7,8,9,10,10),
857
(65535,-8388608,11,12,13,14,15,15),
858
(16777215,-32768,16,17,18,19,20,20),
859
(4294967295,-128,21,22,23,24,25,25),
860
(9223372036854775807,9223372036854775807,26,27,28,29,30,30);
863
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;
865
INSERT INTO t5(c2,c3) VALUES(33,34);