~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SELECT @@global.innodb_table_locks into @table_locks;
 
2
SET @@global.innodb_table_locks= OFF;
 
3
DROP TABLE IF EXISTS t1, t2;
 
4
DROP VIEW IF EXISTS v1;
 
5
SET autocommit=0;
 
6
SET autocommit=0;
 
7
connection default;
 
8
CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
 
9
INSERT INTO t1 VALUES (1,123,1,123);
 
10
INSERT INTO t1 VALUES (2,124,2,124);
 
11
INSERT INTO t1 VALUES (3,125,3,125);
 
12
INSERT INTO t1 VALUES (4,126,4,126);
 
13
CREATE INDEX ixi ON t1 (i);
 
14
CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB;
 
15
INSERT INTO t2 VALUES (1,123,1,123);
 
16
INSERT INTO t2 VALUES (2,124,2,124);
 
17
INSERT INTO t2 VALUES (3,125,3,125);
 
18
INSERT INTO t2 VALUES (4,126,4,126);
 
19
CREATE INDEX ixi ON t2 (i);
 
20
CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2;
 
21
COMMIT;
 
22
SELECT @@global.tx_isolation;
 
23
@@global.tx_isolation
 
24
REPEATABLE-READ
 
25
EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
 
26
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
27
1       SIMPLE  t1      index   ixi     ixi     5       NULL    4       Using where; Using index
 
28
1       SIMPLE  t2      ref     ixi     ixi     5       test.t1.i       2       Using where; Using index
 
29
SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE;
 
30
i       i
 
31
123     123
 
32
124     124
 
33
connection root1;
 
34
UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i;
 
35
SELECT * FROM t1 ORDER BY t1.k;
 
36
k       i       j       l
 
37
1       123     1       123
 
38
2       124     2       124
 
39
3       225     3       125
 
40
4       126     4       126
 
41
SELECT * FROM t2 ORDER BY t2.k;
 
42
k       i       j       l
 
43
1       123     1       123
 
44
2       124     2       124
 
45
3       225     3       125
 
46
4       126     4       126
 
47
connection default;
 
48
UPDATE v1 SET i=323 where i=123;