~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_insert_id.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
insert into t1 values (10);
78
78
insert into t1 values (null),(null),(null);
79
79
insert into t2 values (5,0);
 
80
--disable_warnings ONCE
80
81
insert into t2 (c) select * from t1 ORDER BY a;
81
82
select * from t2 ORDER BY b;
82
83
sync_slave_with_master;
113
114
eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
114
115
eval create table t2(a int) engine=$engine_type;
115
116
insert into t1 (a) values (null);
116
 
insert into t2 (a) select a from t1 where a is null;
117
 
insert into t2 (a) select a from t1 where a is null;
 
117
--disable_warnings
 
118
insert into t2 (a) select a from t1 where a is null;
 
119
insert into t2 (a) select a from t1 where a is null;
 
120
--enable_warnings
118
121
select * from t2;
119
122
sync_slave_with_master;
120
123
connection slave;
172
175
end|
173
176
delimiter ;|
174
177
 
175
 
--disable_warnings
 
178
--disable_warnings ONCE
176
179
insert into t1 (last_id) values (0);
177
 
--enable_warnings
178
180
 
179
181
drop trigger t1_bi;
180
182
 
181
183
# Check that nested call doesn't affect outer context.
182
184
select last_insert_id();
183
 
--disable_warnings
 
185
--disable_warnings ONCE
184
186
select bug15728_insert();
185
 
--enable_warnings
186
187
select last_insert_id();
187
188
insert into t1 (last_id) values (bug15728());
188
189
# This should be exactly one greater than in the previous call.
190
191
 
191
192
# BUG#20339 - stored procedure using LAST_INSERT_ID() does not
192
193
# replicate statement-based
193
 
--disable_warnings
 
194
--disable_warnings ONCE
194
195
drop procedure if exists foo;
195
 
--enable_warnings
196
196
delimiter |;
197
197
create procedure foo()
198
198
begin
252
252
# table's counter, the counter for next row is bigger than the
253
253
# after-value of the updated row.
254
254
connection master;
 
255
--disable_warnings ONCE
255
256
insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000;
256
257
select * from t1 order by n;
257
258
sync_slave_with_master;
270
271
select * from t1 order by n;
271
272
 
272
273
connection master;
 
274
--disable_warnings ONCE
273
275
insert into t1 values(null,100),(null,350) on duplicate key update n=2;
274
276
select * from t1 order by n;
275
277
sync_slave_with_master;
287
289
# testcase with INSERT VALUES
288
290
eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
289
291
                      UNIQUE(b)) ENGINE=$engine_type;
 
292
--disable_warnings ONCE
290
293
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
291
294
SELECT * FROM t1 ORDER BY a;
292
295
sync_slave_with_master;
314
317
INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
315
318
INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
316
319
# Updating table t1 based on values from table t2
 
320
--disable_warnings
317
321
INSERT INTO t1 (field_1, field_2, field_3)
318
322
SELECT t2.field_a, t2.field_b, t2.field_c
319
323
FROM t2
320
324
ON DUPLICATE KEY UPDATE
321
325
t1.field_3 = t2.field_c;
 
326
--enable_warnings
322
327
# Inserting new record into t2
323
328
INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
324
329
# Updating t1 again
 
330
--disable_warnings
325
331
INSERT INTO t1 (field_1, field_2, field_3)
326
332
SELECT t2.field_a, t2.field_b, t2.field_c
327
333
FROM t2
328
334
ON DUPLICATE KEY UPDATE
329
335
t1.field_3 = t2.field_c;
 
336
--enable_warnings
330
337
SELECT * FROM t1 ORDER BY id;
331
338
sync_slave_with_master;
332
339
SELECT * FROM t1 ORDER BY id;
433
440
 
434
441
INSERT INTO t1 VALUES (NULL, -1);
435
442
CALL p1();
436
 
--disable_warnings
 
443
--disable_warnings ONCE
437
444
SELECT f1();
438
 
--enable_warnings
439
445
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
440
446
                      (NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
441
447
INSERT INTO t1 VALUES (NULL, f2());
504
510
delete from t2;
505
511
set sql_log_bin=1;
506
512
#inside SELECT, then inside INSERT
507
 
--disable_warnings
 
513
--disable_warnings ONCE
508
514
select insid();
509
 
--enable_warnings
510
515
set sql_log_bin=0;
511
516
insert into t2 (id) values(5),(6),(7);
512
517
delete from t2 where id>=5;
513
518
set sql_log_bin=1;
514
 
--disable_warnings
 
519
--disable_warnings ONCE
515
520
insert into t1 select insid();
516
 
--enable_warnings
517
521
select * from t1 order by id;
518
522
select * from t2 order by id;
519
523
 
537
541
  insert into t2 values(null,3);
538
542
end|
539
543
delimiter ;|
 
544
--disable_warnings ONCE
540
545
call foo();
541
546
select * from t1 order by n;
542
547
select * from t2 order by id;