~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/inc/partition_auto_increment.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
if (!$mysql_errno)
30
30
{
31
31
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
32
  echo # mysql_errno: $mysql_errno;
32
33
}
33
34
INSERT INTO t1 VALUES (17);
34
35
INSERT INTO t1 VALUES (19), (NULL);
 
36
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
35
37
INSERT INTO t1 VALUES (NULL), (10), (NULL);
36
38
if ($mysql_errno)
37
39
{
50
51
  UPDATE t1 SET c1 = 40 WHERE c1 = 50;
51
52
  SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
52
53
  AND TABLE_NAME='t1';
53
 
  -- error 0, ER_BAD_NULL_ERROR
54
54
  UPDATE t1 SET c1 = NULL WHERE c1 = 4;
55
 
if (!$mysql_errno)
56
 
{
57
 
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
58
 
}
59
55
  INSERT INTO t1 VALUES (NULL);
60
56
  INSERT INTO t1 VALUES (NULL);
61
57
}
121
117
PARTITION BY HASH(c2)
122
118
PARTITIONS 2;
123
119
INSERT INTO t1 VALUES (1, NULL);
 
120
-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
124
121
INSERT INTO t1 VALUES (1, 1), (99, 99);
125
122
if (!$mysql_errno)
126
123
{
127
124
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
125
  echo # mysql_errno: $mysql_errno;
128
126
}
129
127
INSERT INTO t1 VALUES (1, NULL);
130
128
let $old_sql_mode = `select @@session.sql_mode`;
131
129
SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
 
130
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
132
131
INSERT INTO t1 VALUES (1, 0);
133
132
if ($mysql_errno)
134
133
{
145
142
ENGINE=$engine
146
143
PARTITION BY HASH(c2)
147
144
PARTITIONS 2;
 
145
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
148
146
INSERT INTO t1 VALUES (1, 0);
149
147
if ($mysql_errno)
150
148
{
168
165
PARTITIONS 2;
169
166
INSERT INTO t1 VALUES (2), (4), (NULL);
170
167
INSERT INTO t1 VALUES (0);
 
168
-- error 0, ER_DUP_KEY, ER_DUP_ENTRY
171
169
INSERT INTO t1 VALUES (5), (16);
172
170
if (!$mysql_errno)
173
171
{
174
172
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
173
  echo # mysql_errno: $mysql_errno;
175
174
}
176
175
INSERT INTO t1 VALUES (17), (19), (NULL);
 
176
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
177
177
INSERT INTO t1 VALUES (NULL), (10), (NULL);
178
178
if ($mysql_errno)
179
179
{
180
180
  echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
181
181
}
 
182
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
182
183
INSERT INTO t1 VALUES (NULL), (9);
183
184
if ($mysql_errno)
184
185
{
185
186
  echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
186
187
}
 
188
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
187
189
INSERT INTO t1 VALUES (59), (55);
188
190
if ($mysql_errno)
189
191
{
203
201
  UPDATE t1 SET c1 = 140 WHERE c1 = 150;
204
202
  SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
205
203
  AND TABLE_NAME='t1';
206
 
  -- error 0, ER_BAD_NULL_ERROR
207
204
  UPDATE t1 SET c1 = NULL WHERE c1 = 4;
208
 
if (!$mysql_errno)
209
 
{
210
 
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
211
 
}
212
205
  INSERT INTO t1 VALUES (NULL);
213
206
  INSERT INTO t1 VALUES (NULL);
214
207
}
280
273
AND TABLE_NAME='t1';
281
274
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
282
275
AND TABLE_NAME='t1';
 
276
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
283
277
INSERT INTO t1 VALUES (10);
284
278
if ($mysql_errno)
285
279
{
291
284
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
292
285
AND TABLE_NAME='t1';
293
286
INSERT INTO t1 VALUES (NULL);
 
287
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
294
288
INSERT INTO t1 VALUES (15);
295
289
if ($mysql_errno)
296
290
{
350
343
INSERT INTO t1 (c1) VALUES (NULL);
351
344
connection default;
352
345
-- echo # con default
 
346
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
353
347
INSERT INTO t1 (c1) VALUES (16);
354
348
if ($mysql_errno)
355
349
{
436
429
INSERT INTO t1 (c1) VALUES (NULL);
437
430
connection default;
438
431
-- echo # con default
 
432
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
439
433
INSERT INTO t1 (c1) VALUES (16);
440
434
if ($mysql_errno)
441
435
{
493
486
if (!$mysql_errno)
494
487
{
495
488
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
489
  echo # mysql_errno: $mysql_errno;
496
490
}
497
491
INSERT INTO t1 VALUES (1, NULL);
498
492
INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
502
496
if (!$mysql_errno)
503
497
{
504
498
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
499
  echo # mysql_errno: $mysql_errno;
505
500
}
506
501
INSERT INTO t1 VALUES (2, 22);
507
502
INSERT INTO t1 VALUES (2, NULL);
537
532
if (!$mysql_errno)
538
533
{
539
534
  echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
535
  echo # mysql_errno: $mysql_errno;
540
536
}
541
537
INSERT INTO t1 VALUES (1, NULL);
542
538
INSERT INTO t1 VALUES (2, NULL);
543
539
INSERT INTO t1 VALUES (3, NULL);
544
540
INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
 
541
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
545
542
INSERT INTO t1 VALUES (2, 2);
546
543
if (!$mysql_errno)
547
544
{
548
 
echo # ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
545
  echo # ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY;
 
546
  echo # mysql_errno: $mysql_errno;
549
547
}
550
548
INSERT INTO t1 VALUES (2, 22), (2, NULL);
551
549
SELECT * FROM t1 ORDER BY c1,c2;
560
557
  PARTITION BY HASH(c1)
561
558
  PARTITIONS 2;
562
559
SHOW CREATE TABLE t1;
 
560
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
563
561
INSERT INTO t1 (c1) VALUES (4);
564
562
if ($mysql_errno)
565
563
{
578
575
SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
579
576
INSERT INTO t1 (c1) VALUES (300);
580
577
SHOW CREATE TABLE t1;
 
578
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
581
579
INSERT INTO t1 (c1) VALUES (0);
582
580
if ($mysql_errno)
583
581
{