~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/t/innodb-autoinc.test

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
2
 
 
3
 
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
4
 
CREATE INDEX i1 on t1(c2);
5
 
SHOW CREATE TABLE t1;
6
 
INSERT INTO t1 (c2) values (0);
7
 
SELECT * FROM t1;
8
 
DROP TABLE t1;
9
 
 
10
 
##
11
 
# 49032: Use the correct function to read the AUTOINC column value
12
 
#
13
 
DROP TABLE IF EXISTS t1;
14
 
CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
15
 
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
16
 
# Restart the server
17
 
#-- source include/restart_mysqld.inc
18
 
INSERT INTO t1(C2) VALUES ('innodb');
19
 
SHOW CREATE TABLE t1;
20
 
DROP TABLE t1;
21
 
CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
22
 
INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
23
 
# Restart the server
24
 
#-- source include/restart_mysqld.inc
25
 
INSERT INTO t1(C2) VALUES ('innodb');
26
 
SHOW CREATE TABLE t1;
27
 
DROP TABLE t1;
28
 
 
29
 
##
30
 
# 47720: REPLACE INTO Autoincrement column with negative values
31
 
#
32
 
DROP TABLE IF EXISTS t1;
33
 
CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
34
 
INSERT INTO t1 SET c1 = 1;
35
 
SHOW CREATE TABLE t1;
36
 
INSERT INTO t1 SET c1 = 2;
37
 
INSERT INTO t1 SET c1 = -1;
38
 
SELECT * FROM t1;
39
 
--error ER_DUP_ENTRY, ER_DUP_ENTRY
40
 
INSERT INTO t1 SET c1 = -1;
41
 
SHOW CREATE TABLE t1;
42
 
REPLACE INTO t1 VALUES (-1);
43
 
SELECT * FROM t1;
44
 
SHOW CREATE TABLE t1;
45
 
DROP TABLE t1;
46
 
 
47
 
 
48
 
##
49
 
# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
50
 
#
51
 
DROP TABLE IF EXISTS t1;
52
 
CREATE TABLE t1  (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
53
 
INSERT INTO  t1 VALUES (-685113344), (1), (NULL), (NULL);
54
 
SELECT * FROM t1;
55
 
SHOW CREATE TABLE t1;
56
 
DROP TABLE t1;
57
 
CREATE TABLE t1  (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
58
 
INSERT INTO  t1 VALUES (-685113344), (2), (NULL), (NULL);
59
 
SELECT * FROM t1;
60
 
SHOW CREATE TABLE t1;
61
 
DROP TABLE t1;
62
 
CREATE TABLE t1  (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
63
 
INSERT INTO  t1 VALUES (NULL), (2), (-685113344), (NULL);
64
 
INSERT INTO  t1 VALUES (4), (5), (6), (NULL);
65
 
SELECT * FROM t1;
66
 
SHOW CREATE TABLE t1;
67
 
DROP TABLE t1;
68
 
CREATE TABLE t1  (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
69
 
INSERT INTO  t1 VALUES (NULL), (2), (-685113344), (5);
70
 
SELECT * FROM t1;
71
 
SHOW CREATE TABLE t1;
72
 
DROP TABLE t1;
73
 
CREATE TABLE t1  (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
74
 
INSERT INTO  t1 VALUES (1), (2), (-685113344), (NULL);
75
 
SELECT * FROM t1;
76
 
SHOW CREATE TABLE t1;
77
 
DROP TABLE t1;
78
 
 
79
 
###
80
 
## 55277: Failing assertion: auto_inc > 0
81
 
##
82
 
#DROP TABLE IF EXISTS t1;
83
 
#CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
84
 
#INSERT INTO t1 VALUES (NULL);
85
 
#INSERT INTO t1 VALUES (18446744073709551615);
86
 
## Restart the server
87
 
#-- source include/restart_mysqld.inc
88
 
#SHOW CREATE TABLE t1;
89
 
#DROP TABLE t1;
90
 
 
91
 
 
92
 
#
93
 
# restore environment to the state it was before this test execution
94
 
#
95
 
 
96
 
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;