| 1 |
# |
| 2 |
# Test of auto_increment; The test for BDB tables is in bdb.test |
| 3 |
# |
| 4 |
|
| 5 |
--disable_warnings |
| 6 |
drop table if exists t1; |
| 7 |
--enable_warnings |
| 8 |
|
| 9 |
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=heap auto_increment=3; |
| 10 |
insert into t1 values (1,1),(NULL,3),(NULL,4); |
| 11 |
delete from t1 where a=4; |
| 12 |
insert into t1 values (NULL,5),(NULL,6); |
| 13 |
select * from t1; |
| 14 |
delete from t1 where a=6; |
| 15 |
#show table status like "t1"; |
| 16 |
replace t1 values (3,1); |
| 17 |
ALTER TABLE t1 add c int; |
| 18 |
replace t1 values (3,3,3); |
| 19 |
insert into t1 values (NULL,7,7); |
| 20 |
update t1 set a=8,b=b+1,c=c+1 where a=7; |
| 21 |
insert into t1 values (NULL,9,9); |
| 22 |
select * from t1; |
| 23 |
drop table t1; |
| 24 |
|
| 25 |
create table t1 ( |
| 26 |
skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY, |
| 27 |
sval char(20) |
| 28 |
) engine=heap; |
| 29 |
insert into t1 values (NULL, "hello"); |
| 30 |
insert into t1 values (NULL, "hey"); |
| 31 |
select * from t1; |
| 32 |
select _rowid,t1._rowid,skey,sval from t1; |
| 33 |
drop table t1; |
| 34 |
|
| 35 |
# End of 4.1 tests |
| 36 |
|
| 37 |
--echo # |
| 38 |
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA |
| 39 |
--echo # |
| 40 |
|
| 41 |
CREATE TABLE t1 ( |
| 42 |
id TINYINT NOT NULL AUTO_INCREMENT, |
| 43 |
name CHAR(30) NOT NULL, |
| 44 |
PRIMARY KEY (id) |
| 45 |
) ENGINE=MEMORY; |
| 46 |
SHOW CREATE TABLE t1; |
| 47 |
INSERT INTO t1 (name) VALUES ('dog'); |
| 48 |
UPDATE t1 SET id=-1 WHERE id=1; |
| 49 |
INSERT INTO t1 (name) VALUES ('cat'); |
| 50 |
SELECT * FROM t1; |
| 51 |
DROP TABLE t1; |
| 52 |
|
| 53 |
--echo # |
| 54 |
--echo # End of 5.5 tests |
| 55 |
--echo # |
| 56 |
|
| 57 |
--echo # |
| 58 |
--echo # MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number |
| 59 |
--echo # |
| 60 |
|
| 61 |
SET @engine='MEMORY'; |
| 62 |
--source include/autoinc_mdev15353.inc |
| 63 |
|
| 64 |
--echo # |
| 65 |
--echo # End of 10.2 tests |
| 66 |
--echo # |
| 67 |
|