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

« back to all changes in this revision

Viewing changes to mysql-test/t/lock_multi_bug38499.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:
 
1
# Bug38499 flush tables and multitable table update with derived table cause crash
 
2
# MySQL >= 5.0
 
3
#
 
4
 
 
5
# Save the initial number of concurrent sessions
 
6
--source include/count_sessions.inc
 
7
 
 
8
connect (locker,localhost,root,,);
 
9
connect (writer,localhost,root,,);
 
10
 
 
11
--connection default
 
12
--disable_warnings
 
13
DROP TABLE IF EXISTS t1;
 
14
--enable_warnings
 
15
CREATE TABLE t1( a INT, b INT );
 
16
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
 
17
 
 
18
--echo # 1. test regular tables
 
19
--echo # 1.1. test altering of columns that multiupdate doesn't use
 
20
--echo # 1.1.1. normal mode
 
21
 
 
22
--disable_query_log
 
23
let $i = 100;
 
24
while ($i) {
 
25
--dec $i
 
26
 
 
27
--connection writer
 
28
  send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
 
29
 
 
30
--connection locker
 
31
  ALTER TABLE t1 ADD COLUMN (c INT);
 
32
  ALTER TABLE t1 DROP COLUMN c;
 
33
 
 
34
--connection writer
 
35
--reap
 
36
}
 
37
 
 
38
--echo # 1.1.2. PS mode
 
39
 
 
40
--connection writer
 
41
PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
 
42
 
 
43
let $i = 100;
 
44
while ($i) {
 
45
--dec $i
 
46
 
 
47
--connection writer
 
48
--send EXECUTE stmt
 
49
 
 
50
--connection locker
 
51
  ALTER TABLE t1 ADD COLUMN (c INT);
 
52
  ALTER TABLE t1 DROP COLUMN c;
 
53
 
 
54
--connection writer
 
55
--reap
 
56
}
 
57
--enable_query_log
 
58
 
 
59
--echo # 1.2. test altering of columns that multiupdate uses
 
60
--echo # 1.2.1. normal mode
 
61
 
 
62
--connection default
 
63
 
 
64
--disable_query_log
 
65
let $i = 100;
 
66
while ($i) {
 
67
  dec $i;
 
68
 
 
69
--connection locker
 
70
--error 0,ER_DUP_FIELDNAME
 
71
  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
 
72
  UPDATE t1 SET a=b;
 
73
 
 
74
--connection writer
 
75
--send UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0;
 
76
 
 
77
--connection locker
 
78
--error 0,ER_CANT_DROP_FIELD_OR_KEY
 
79
  ALTER TABLE t1 DROP COLUMN a;
 
80
 
 
81
--connection writer
 
82
--error 0,ER_BAD_FIELD_ERROR # unknown column error
 
83
--reap
 
84
}
 
85
--enable_query_log
 
86
 
 
87
--echo # 1.2.2. PS mode
 
88
 
 
89
--disable_query_log
 
90
let $i = 100;
 
91
while ($i) {
 
92
  dec $i;
 
93
 
 
94
--connection locker
 
95
--error 0,ER_DUP_FIELDNAME
 
96
  ALTER TABLE t1 ADD COLUMN a INT;
 
97
  UPDATE t1 SET a=b;
 
98
 
 
99
--connection writer
 
100
  PREPARE stmt FROM 'UPDATE t1, (SELECT 1 FROM t1 t1i) d SET a = 0 WHERE 1=0';
 
101
--send EXECUTE stmt
 
102
 
 
103
--connection locker
 
104
--error 0,ER_CANT_DROP_FIELD_OR_KEY
 
105
  ALTER TABLE t1 DROP COLUMN a;
 
106
 
 
107
--connection writer
 
108
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
 
109
--reap
 
110
}
 
111
--enable_query_log
 
112
--connection default
 
113
ALTER TABLE t1 ADD COLUMN a INT;
 
114
 
 
115
--echo # 2. test UNIONs
 
116
--echo # 2.1. test altering of columns that multiupdate doesn't use
 
117
--echo # 2.1.1. normal mode
 
118
 
 
119
--disable_query_log
 
120
let $i = 100;
 
121
while ($i) {
 
122
--dec $i
 
123
 
 
124
--connection writer
 
125
  send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
 
126
 
 
127
--connection locker
 
128
  ALTER TABLE t1 ADD COLUMN (c INT);
 
129
  ALTER TABLE t1 DROP COLUMN c;
 
130
 
 
131
--connection writer
 
132
--reap
 
133
}
 
134
 
 
135
--echo # 2.1.2. PS mode
 
136
 
 
137
--connection writer
 
138
PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
 
139
 
 
140
let $i = 100;
 
141
while ($i) {
 
142
--dec $i
 
143
 
 
144
--connection writer
 
145
--send EXECUTE stmt
 
146
 
 
147
--connection locker
 
148
  ALTER TABLE t1 ADD COLUMN (c INT);
 
149
  ALTER TABLE t1 DROP COLUMN c;
 
150
 
 
151
--connection writer
 
152
--reap
 
153
}
 
154
--enable_query_log
 
155
 
 
156
--echo # 2.2. test altering of columns that multiupdate uses
 
157
--echo # 2.2.1. normal mode
 
158
 
 
159
--connection default
 
160
 
 
161
--disable_query_log
 
162
let $i = 100;
 
163
while ($i) {
 
164
  dec $i;
 
165
 
 
166
--connection locker
 
167
--error 0,ER_DUP_FIELDNAME
 
168
  ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
 
169
  UPDATE t1 SET a=b;
 
170
 
 
171
--connection writer
 
172
--send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
 
173
 
 
174
--connection locker
 
175
--error 0,ER_CANT_DROP_FIELD_OR_KEY
 
176
  ALTER TABLE t1 DROP COLUMN a;
 
177
 
 
178
--connection writer
 
179
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
 
180
--reap
 
181
}
 
182
--enable_query_log
 
183
 
 
184
--echo # 2.2.2. PS mode
 
185
 
 
186
--disable_query_log
 
187
let $i = 100;
 
188
while ($i) {
 
189
  dec $i;
 
190
 
 
191
--connection locker
 
192
--error 0,ER_DUP_FIELDNAME
 
193
  ALTER TABLE t1 ADD COLUMN a INT;
 
194
  UPDATE t1 SET a=b;
 
195
 
 
196
--connection writer
 
197
  PREPARE stmt FROM 'UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0';
 
198
--send EXECUTE stmt
 
199
 
 
200
--connection locker
 
201
--error 0,ER_CANT_DROP_FIELD_OR_KEY
 
202
  ALTER TABLE t1 DROP COLUMN a;
 
203
 
 
204
--connection writer
 
205
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
 
206
--reap
 
207
}
 
208
--enable_query_log
 
209
--connection default
 
210
DROP TABLE t1;
 
211
 
 
212
 
 
213
# Close connections
 
214
--disconnect locker
 
215
--disconnect writer
 
216
 
 
217
# End of 5.0 tests
 
218
 
 
219
# Wait till all disconnects are completed
 
220
--source include/wait_until_count_sessions.inc
 
221