~vkolesnikov/pbxt/pbxt-preload-test-bug

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/t/pbxt_transactions.test

  • Committer: paul-mccullagh
  • Date: 2008-03-10 11:36:34 UTC
  • Revision ID: paul-mccullagh-417ebf175a9c8ee6e5b3777d9e2398e1fb197391
Implemented full durability

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
select * from t2;
44
44
 
45
45
--This statement is returns an error calls ha_autocommit_or_rollback():
46
 
--error 1582
 
46
--error ER_DUP_ENTRY
47
47
update t1 set t1.id=1 where t1.id=2;
48
48
 
49
49
select * from t1;
56
56
select * from t2;
57
57
 
58
58
--But this statement returns an error and does not call ha_autocommit_or_rollback():
59
 
--error 1582
 
59
--error ER_DUP_ENTRY
60
60
update t1,t2 set t1.id=1, t2.id=1 where t1.id=3 and t2.id = t1.id;
61
61
 
62
62
select * from t1;
63
63
select * from t2;
64
64
 
65
 
--error 1582
 
65
--error ER_DUP_ENTRY
66
66
update t1 set t1.id=1 where t1.id=3;
67
67
 
68
68
select * from t1;
81
81
rename table t1 to t2;
82
82
 
83
83
# The select below will not include the data if the INSERT statement
84
 
# is not committed on time
 
84
# is not committed on time. By doing a SELECT FOR UPDATE, we
 
85
# make sure the SELECT transaction waits (I think)!
85
86
 
86
87
create table t1 (a text character set utf8, b text character set latin1);
87
88
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
89
90
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
90
91
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
91
92
--exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
92
 
select * from t1;
 
93
select * from t1 for update;
93
94
 
94
95
# Test nested start_stmt() calls
95
96
 
135
136
 
136
137
delimiter ;|
137
138
 
 
139
drop function getcount;
 
140
 
138
141
# This test forces a begin transaction in start_stmt()
139
142
 
140
143
drop tables if exists t1;
153
156
insert t1 values (100);
154
157
LOCK TABLES t1 WRITE;
155
158
insert t1 values (98);
156
 
--error 1582
 
159
--error ER_DUP_ENTRY
157
160
insert into t1 values (99),(100);
158
161
select id from t1;
159
162
UNLOCK TABLES;
166
169
insert t1 values (100);
167
170
begin;
168
171
insert t1 values (98);
169
 
--error 1582
 
172
--error ER_DUP_ENTRY
170
173
insert into t1 values (99),(100);
171
174
select id from t1;
172
175
rollback;
179
182
create table t1 (id int primary key);
180
183
insert t1 values (100);
181
184
insert t1 values (98);
182
 
--error 1582
 
185
--error ER_DUP_ENTRY
183
186
insert into t1 values (99),(100);
184
187
select id from t1;
185
188
 
196
199
insert t1 values (98);
197
200
select * from t1, t2 where t1.id = t2.id;
198
201
insert t1 values (97);
199
 
--error 1582
 
202
--error ER_DUP_ENTRY
200
203
insert into t1 values (99),(100);
201
204
select id from t1;
202
205
UNLOCK TABLES;
460
463
create procedure t3_update()
461
464
    deterministic
462
465
begin
463
 
  declare continue handler for 1582 -- ER_DUP_ENTRY
 
466
  declare continue handler for 1062 -- ER_DUP_ENTRY
464
467
    select 'Outer (bad)' as 't3_update';
465
468
 
466
469
  begin
467
 
    declare continue handler for 1582 -- ER_DUP_ENTRY
 
470
    declare continue handler for 1062 -- ER_DUP_ENTRY
468
471
        select 'Inner (good)' as 't3_update';
469
472
 
470
473
    insert into t3 values (1);
514
517
rollback|
515
518
 
516
519
connection conn2|
 
520
-- error 1062
517
521
reap|
518
522
select * from t3|
519
523