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

« back to all changes in this revision

Viewing changes to mysql-test/t/multi_update.test

  • 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:
25
25
while ($1)
26
26
 {
27
27
  let $2 = 5;
28
 
  eval insert into t1(t) values ('$1'); 
 
28
  eval insert into t1(t) values ('$1');
29
29
  while ($2)
30
30
   {
31
 
     eval insert into t2(id2,t) values ($1,'$2'); 
 
31
     eval insert into t2(id2,t) values ($1,'$2');
32
32
     let $3 = 10;
33
33
     while ($3)
34
34
     {
35
 
       eval insert into t3(id3,t) values ($1,'$2'); 
 
35
       eval insert into t3(id3,t) values ($1,'$2');
36
36
       dec $3;
37
37
     }
38
 
     dec $2; 
 
38
     dec $2;
39
39
   }
40
40
  dec $1;
41
41
 }
80
80
while ($1)
81
81
 {
82
82
  let $2 = 5;
83
 
  eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa'); 
 
83
  eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
84
84
  while ($2)
85
85
   {
86
 
     eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb'); 
87
 
     dec $2; 
 
86
     eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
 
87
     dec $2;
88
88
   }
89
89
  dec $1;
90
90
 }
318
318
 
319
319
delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
320
320
  where 0=1;
321
 
delete t1, t2 from t2,t1 
 
321
delete t1, t2 from t2,t1
322
322
  where t1.id1=t2.id2 and 0=1;
323
323
 
324
324
drop table t1,t2;
352
352
insert into t1 values (0,'A01-Comp',1);
353
353
insert into t1 values (0,'B01-Comp',1);
354
354
insert into t2 values (0,1,'A Note',1);
355
 
update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; 
 
355
update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
356
356
select * from t1;
357
357
select * from t2;
358
358
drop table t1, t2;
380
380
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
381
381
delete from mysql.user where user=_binary'mysqltest_1';
382
382
drop database mysqltest;
 
383
connection default;
 
384
disconnect user1;
 
385
disconnect root;
383
386
 
384
387
#
385
388
# multi delete wrong table check
394
397
#
395
398
# multi* unique updating table check
396
399
#
397
 
create table t1 (col1 int); 
 
400
create table t1 (col1 int);
398
401
create table t2 (col1 int);
399
402
-- error ER_UPDATE_TABLE_USED
400
403
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
402
405
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
403
406
drop table t1,t2;
404
407
 
405
 
# Test for BUG#5837 - delete with outer join and const tables
 
408
# Test for Bug#5837 delete with outer join and const tables
406
409
--disable_warnings
407
410
create table t1 (
408
 
  aclid bigint not null primary key, 
409
 
  status tinyint(1) not null 
 
411
  aclid bigint not null primary key,
 
412
  status tinyint(1) not null
410
413
) engine = innodb;
411
414
 
412
415
create table t2 (
413
 
  refid bigint not null primary key, 
414
 
  aclid bigint, index idx_acl(aclid) 
 
416
  refid bigint not null primary key,
 
417
  aclid bigint, index idx_acl(aclid)
415
418
) engine = innodb;
416
419
--enable_warnings
417
420
insert into t2 values(1,null);
419
422
drop table t1, t2;
420
423
 
421
424
#
422
 
# Bug#19225: unchecked error leads to server crash
 
425
# Bug#19225 unchecked error leads to server crash
423
426
#
424
427
create table t1(a int);
425
428
create table t2(a int);
429
432
# End of 4.1 tests
430
433
 
431
434
#
432
 
# Test for bug #1980.
 
435
# Test for Bug#1980.
433
436
#
434
437
--disable_warnings
435
438
create table t1 ( c char(8) not null ) engine=innodb;
490
493
 
491
494
connect (updater,localhost,root,,test);
492
495
connection updater;
493
 
sleep 2;
 
496
# Wait till "alter table t1 ..." of session changer is in work.
 
497
# = There is one session is in state "Locked".
 
498
let $wait_condition= select count(*)= 1 from information_schema.processlist
 
499
                     where state= 'Locked';
 
500
--source include/wait_condition.inc
494
501
send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
495
502
 
496
503
connection locker;
497
 
sleep 2;
 
504
# Wait till
 
505
# - "alter table t1 ..." of session changer and
 
506
# - "update t1, v1 ..." of session updater
 
507
# are in work.
 
508
# = There are two session is in state "Locked".
 
509
let $wait_condition= select count(*)= 2 from information_schema.processlist
 
510
                     where state= 'Locked';
 
511
--source include/wait_condition.inc
498
512
unlock tables;
499
513
 
500
514
connection changer;
507
521
drop view v1;
508
522
drop table t1, t2;
509
523
 
 
524
connection default;
 
525
disconnect locker;
 
526
disconnect changer;
 
527
disconnect updater;
 
528
 
510
529
#
511
530
# Test multi updates and deletes using primary key and without.
512
531
#
538
557
drop table t1, t2;
539
558
 
540
559
#
541
 
# Bug#27716     multi-update did partially and has not binlogged
 
560
# Bug#27716 multi-update did partially and has not binlogged
542
561
#
 
562
 
543
563
CREATE TABLE `t1` (
544
564
  `a` int(11) NOT NULL auto_increment,
545
565
  `b` int(11) default NULL,
561
581
insert into t1 values (1,1),(2,2);
562
582
insert into t2 values (1,1),(4,4);
563
583
reset master;
564
 
error ER_DUP_ENTRY;
 
584
--error ER_DUP_ENTRY
565
585
UPDATE t2,t1 SET t2.a=t1.a+2;
566
586
# check
567
587
select * from t2 /* must be (3,1), (4,4) */;
568
588
show master status /* there must be the UPDATE query event */;
569
589
 
570
 
# B. testing multi_update::send_error() ineffective update 
571
 
# (as there is a policy described at mysql_update() still go to binlog) 
 
590
# B. testing multi_update::send_error() ineffective update
 
591
# (as there is a policy described at mysql_update() still go to binlog)
572
592
delete from t1;
573
593
delete from t2;
574
594
insert into t1 values (1,2),(3,4),(4,4);
575
595
insert into t2 values (1,2),(3,4),(4,4);
576
596
reset master;
577
 
error ER_DUP_ENTRY;
 
597
--error ER_DUP_ENTRY
578
598
UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a;
579
599
show master status /* there must be the UPDATE query event */;
580
600
 
581
 
# cleanup bug#27716
 
601
# cleanup
582
602
drop table t1, t2;
583
603
set @@session.binlog_format= @sav_binlog_format;
584
604
 
585
605
#
586
 
# Bug #29136    erred multi-delete on trans table does not rollback 
 
606
# Bug#29136 erred multi-delete on trans table does not rollback
587
607
#
588
608
 
589
609
# prepare
610
630
select count(*) from t1 /* must be 1 */;
611
631
select count(*) from t3 /* must be 1 */;
612
632
 
613
 
# cleanup bug#29136
 
633
# cleanup
614
634
drop table t1, t2, t3;
615
635
 
616
636
#