~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/transaction_log/tests/t/select_for_update.inc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# Test to verify updates from SELECT FOR UPDATE are handled 
 
3
# properly, an update is not put in the log for a update that
 
4
# times out. 
 
5
 
6
 
 
7
--disable_warnings
 
8
DROP TABLE IF EXISTS t1;
 
9
--enable_warnings
 
10
 
 
11
CREATE TABLE t1 (
 
12
  id INT NOT NULL
 
13
, padding VARCHAR(200) NOT NULL
 
14
, PRIMARY KEY (id)
 
15
);
 
16
 
 
17
INSERT INTO t1 VALUES (1, "I love testing.");
 
18
INSERT INTO t1 VALUES (3, "I hate testing.");
 
19
INSERT INTO t1 VALUES (5, "I still hate testing.");
 
20
 
 
21
connect (conn1, localhost, root,,);
 
22
connect (conn2, localhost, root,,);
 
23
 
 
24
connection conn1;
 
25
START TRANSACTION;
 
26
SELECT id FROM t1 FOR UPDATE;
 
27
 
 
28
connection conn2;
 
29
# This should timeout and not appear in the transaction log
 
30
--error ER_LOCK_WAIT_TIMEOUT
 
31
UPDATE t1 SET id=1000 WHERE padding='I love testing.';
 
32
 
 
33
connection conn1;
 
34
UPDATE t1 SET id=id + 1;
 
35
COMMIT;
 
36
 
 
37
DROP TABLE t1;