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

« back to all changes in this revision

Viewing changes to mysql-test/t/trigger.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:
472
472
create trigger trg2 after insert on t1 for each row set @b:= "Fired"; 
473
473
set @b:="";
474
474
# Test triggers with file with separators
475
 
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i);
 
475
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i);
476
476
select *, @b from t1;
477
477
set @b:="";
478
478
# Test triggers with fixed size row file
479
 
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
 
479
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j);
480
480
select *, @b from t1;
481
481
# This also will drop triggers
482
482
drop table t1;
510
510
select * from t1;
511
511
# Should fail and insert only 1 row
512
512
--error ER_BAD_FIELD_ERROR
513
 
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
 
513
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
514
514
select * from t1;
515
515
--error ER_BAD_FIELD_ERROR
516
516
insert into t1 select 3, 3;
567
567
delete from t1;
568
568
select * from t1;
569
569
--error ER_BAD_FIELD_ERROR
570
 
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
 
570
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k);
571
571
select * from t1;
572
572
--error ER_BAD_FIELD_ERROR
573
573
insert into t1 select 3, 3;
1141
1141
       event_object_table, action_statement from information_schema.triggers
1142
1142
       where event_object_schema = 'test';
1143
1143
# Trick which makes update of second .TRN file impossible
1144
 
write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
 
1144
let $MYSQLD_DATADIR= `select @@datadir`;
 
1145
write_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
1145
1146
dummy
1146
1147
EOF
1147
 
chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
 
1148
chmod 0000 $MYSQLD_DATADIR/test/t1_ai.TRN~;
1148
1149
# Normalize the datadir path; the embedded server doesn't chdir to datadir
1149
 
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1150
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
1150
1151
--error 1
1151
1152
rename table t1 to t2;
1152
1153
# 't1' should be still there and triggers should work correctly
1155
1156
select trigger_schema, trigger_name, event_object_schema,
1156
1157
       event_object_table, action_statement from information_schema.triggers
1157
1158
       where event_object_schema = 'test';
1158
 
chmod 0600 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
1159
 
remove_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
 
1159
chmod 0600 $MYSQLD_DATADIR/test/t1_ai.TRN~;
 
1160
remove_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
1160
1161
# Let us check that updates to .TRN files were rolled back too
1161
1162
drop trigger t1_bi;
1162
1163
drop trigger t1_ai;
1189
1190
create trigger t2_ai after insert on t2 for each row
1190
1191
  set @a:= (select max(a) from t2);
1191
1192
insert into t2 select * from t1;
1192
 
load data infile '../std_data_ln/words.dat' into table t1 (a);
 
1193
load data infile '../../std_data/words.dat' into table t1 (a);
1193
1194
drop trigger t1_ai;
1194
1195
drop trigger t2_ai;
1195
1196
# Test that the problem for functions is fixed as well
1199
1200
  ("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
1200
1201
create function f2() returns int return (select max(b) from t2);
1201
1202
insert into t2 select a, f2() from t1;
1202
 
load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
 
1203
load data infile '../../std_data/words.dat' into table t1 (a) set b:= f1();
1203
1204
drop function f1;
1204
1205
drop function f2;
1205
1206
drop table t1, t2;