~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/auto_increment.result

  • Committer: Monty Taylor
  • Date: 2009-12-25 08:50:15 UTC
  • mto: This revision was merged to the branch mainline in revision 1255.
  • Revision ID: mordred@inaugust.com-20091225085015-83sux5qsvy312gew
MEM_ROOT == memory::Root

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
5       5
13
13
6       6
14
14
delete from t1 where a=6;
15
 
show table status like "t1";
16
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
17
 
#       test    t1      TEMPORARY       MyISAM  #       #       #       #       #
18
15
replace t1 values (3,1);
19
16
ALTER TABLE t1 add c int;
20
17
replace t1 values (3,3,3);
169
166
201     4
170
167
203     6
171
168
300     7
172
 
301     8
 
169
205     8
173
170
400     9
174
171
0       10
175
172
401     11
185
182
201     4
186
183
203     6
187
184
300     7
188
 
301     8
 
185
205     8
189
186
400     9
190
187
401     11
191
188
0       12
202
199
201     4
203
200
203     6
204
201
300     7
205
 
301     8
 
202
205     8
206
203
400     9
207
204
401     11
208
205
403     13
222
219
create table t1 (a bigint);
223
220
insert into t1 values (1), (2), (3), (0), (0);
224
221
alter table t1 modify a bigint not null auto_increment primary key;
225
 
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
 
222
ERROR 23000: ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '0' for key 'PRIMARY'
226
223
select * from t1;
227
224
a
228
225
1
277
274
KEY (t1_name),
278
275
PRIMARY KEY (t1_id)
279
276
) AUTO_INCREMENT = 1000;
 
277
Warnings:
 
278
Warning 1071    Specified key was too long; max key length is 767 bytes
280
279
INSERT INTO t1 (t1_name) VALUES('MySQL');
281
280
INSERT INTO t1 (t1_name) VALUES('MySQL');
282
281
INSERT INTO t1 (t1_name) VALUES('MySQL');
288
287
SHOW CREATE TABLE `t1`;
289
288
Table   Create Table
290
289
t1      CREATE TABLE `t1` (
291
 
  `t1_name` VARCHAR(255) COLLATE utf8_general_ci DEFAULT NULL,
292
 
  `t1_id` INT NOT NULL AUTO_INCREMENT,
 
290
  `t1_name` varchar(255) DEFAULT NULL,
 
291
  `t1_id` int NOT NULL AUTO_INCREMENT,
293
292
  PRIMARY KEY (`t1_id`),
294
 
  KEY `t1_name` (`t1_name`)
295
 
) ENGINE=InnoDB COLLATE = utf8_general_ci AUTO_INCREMENT=1000
 
293
  KEY `t1_name` (`t1_name`(191))
 
294
) ENGINE=InnoDB
296
295
DROP TABLE `t1`;
297
296
create table t1(a int not null auto_increment primary key);
298
297
create table t2(a int not null auto_increment primary key, t1a int);