~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/myisam_debug.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--source include/have_debug.inc
 
2
 
 
3
# We disable this test in embedded mode because of BUG#43733
 
4
--source include/not_embedded.inc
 
5
 
 
6
--echo #
 
7
--echo # BUG#40827 - Killing insert-select to MyISAM can cause table corruption
 
8
--echo #
 
9
 
 
10
CONNECT (insertConn, localhost, root,,);
 
11
 
 
12
CREATE TABLE `t1` (
 
13
`id` BIGINT(20) ,
 
14
`id1` BIGINT(20) AUTO_INCREMENT,
 
15
 KEY(id1), KEY(id)
 
16
) ENGINE=MyISAM;
 
17
 
 
18
CREATE TABLE `t2` (
 
19
`id` BIGINT(20) ,
 
20
`id1` BIGINT(20) AUTO_INCREMENT,
 
21
 KEY (id1), KEY(id)
 
22
) ENGINE=MyISAM;
 
23
 
 
24
INSERT INTO t2 (id) VALUES (123);
 
25
 
 
26
let $i = 10; 
 
27
while ($i)
 
28
{
 
29
  INSERT INTO t2 (id) SELECT id  FROM t2; 
 
30
  dec $i; 
 
31
}
 
32
 
 
33
--echo # Switch to insert Connection
 
34
CONNECTION insertConn;
 
35
SET SESSION debug='+d,wait_in_enable_indexes';
 
36
--echo # Send insert data
 
37
SEND INSERT INTO t1(id) SELECT id  FROM t2; 
 
38
 
 
39
--echo # Switch to default Connection
 
40
CONNECTION default;
 
41
--echo # Wait for insert data to reach the debug point
 
42
 
 
43
let $wait_condition=
 
44
  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
 
45
  WHERE STATE = "wait_in_enable_indexes" AND 
 
46
  INFO = "INSERT INTO t1(id) SELECT id  FROM t2";
 
47
--source include/wait_condition.inc
 
48
 
 
49
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
 
50
WHERE STATE = 'wait_in_enable_indexes' AND 
 
51
INFO = "INSERT INTO t1(id) SELECT id  FROM t2" 
 
52
INTO @thread_id;
 
53
 
 
54
KILL QUERY @thread_id;
 
55
CHECK TABLE t1; 
 
56
DROP TABLE t1,t2;
 
57
DISCONNECT insertConn;