~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb_plugin/t/innodb-autoinc.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# embedded server ignores 'delayed', so skip this
3
3
-- source include/not_embedded.inc
4
4
 
5
 
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
6
 
 
7
5
--disable_warnings
8
6
drop table if exists t1;
9
7
--enable_warnings
293
291
SELECT * FROM t1;
294
292
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
295
293
SHOW VARIABLES LIKE "%auto_inc%";
296
 
# This should fail because of overflow but it doesn't, it seems to be
297
 
# a MySQL server bug. It wraps around to 0 for the last value.
298
 
# See MySQL Bug# 39828
299
 
#
300
 
# Instead of wrapping around, it asserts when MySQL is compiled --with-debug
301
 
# (see sql/handler.cc:handler::update_auto_increment()).  Don't test for
302
 
# overflow until Bug #39828 is fixed.
303
 
#
304
 
# Since this asserts when compiled --with-debug, we can't properly test this
305
 
# until Bug #39828 is fixed.  For now, this test is meaningless.
306
 
#if Bug #39828 is fixed
307
 
#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
308
 
#else
309
 
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
310
 
#endif
 
294
--error ER_AUTOINC_READ_FAILED
 
295
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
311
296
SELECT * FROM t1;
312
297
DROP TABLE t1;
313
298
 
325
310
SELECT * FROM t1;
326
311
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
327
312
SHOW VARIABLES LIKE "%auto_inc%";
328
 
# This should fail because of overflow but it doesn't. It fails with
329
 
# a duplicate entry message because of a MySQL server bug, it wraps
330
 
# around.  See MySQL Bug# 39828, once MySQL fix the bug we can replace
331
 
# the ER_DUP_ENTRY, 1062 below with the appropriate error message
332
 
#
333
 
# Since this asserts when compiled --with-debug, we can't properly test this
334
 
# until Bug #39828 is fixed.  For now, this test is meaningless.
335
 
#if Bug #39828 is fixed
336
 
# Still need to fix this error code, error should mention overflow
337
 
#-- error ER_DUP_ENTRY,1062
338
 
#INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
339
 
#else
340
 
INSERT INTO t1 VALUES (NULL),(NULL);
341
 
#endif
 
313
--error ER_AUTOINC_READ_FAILED
 
314
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
342
315
SELECT * FROM t1;
343
316
DROP TABLE t1;
344
317
 
376
349
SELECT * FROM t1;
377
350
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
378
351
SHOW VARIABLES LIKE "%auto_inc%";
379
 
# This should fail because of overflow but it doesn't. It wraps around
380
 
# and the autoinc values look bogus too.
381
 
# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
382
 
# code expected test.
383
 
# -- error ER_AUTOINC_READ_FAILED,1467
384
 
#
385
 
# Since this asserts when compiled --with-debug, we can't properly test this
386
 
# until Bug #39828 is fixed.  For now, this test is meaningless.
387
 
#if Bug #39828 is fixed
388
 
#-- error ER_AUTOINC_READ_FAILED,1467
389
 
#INSERT INTO t1 VALUES (NULL),(NULL);
390
 
#else
391
 
INSERT INTO t1 VALUES (NULL);
392
 
#endif
 
352
--error ER_WARN_DATA_OUT_OF_RANGE
 
353
INSERT INTO t1 VALUES (NULL),(NULL);
393
354
SELECT * FROM t1;
394
355
DROP TABLE t1;
395
356
 
665
626
SHOW CREATE TABLE t1;
666
627
DROP TABLE t1;
667
628
 
668
 
#
669
 
# restore environment to the state it was before this test execution
670
 
#
671
 
 
672
 
eval set global innodb_file_format_check=$innodb_file_format_check_orig;
 
629
##
 
630
# 55277: Failing assertion: auto_inc > 0
 
631
#
 
632
DROP TABLE IF EXISTS t1;
 
633
CREATE TABLE t1(c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
 
634
INSERT INTO t1 VALUES (NULL);
 
635
INSERT INTO t1 VALUES (18446744073709551615);
 
636
# Restart the server
 
637
-- source include/restart_mysqld.inc
 
638
SHOW CREATE TABLE t1;
 
639
DROP TABLE t1;