~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/r/partition_debug_sync_innodb.result

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Bug#49907: ALTER TABLE ... TRUNCATE PARTITION
 
3
#            does not wait for locks on the table
 
4
#
 
5
CREATE TABLE t1 (a INT)
 
6
ENGINE = InnoDB
 
7
PARTITION BY RANGE (a)
 
8
(PARTITION p0 VALUES LESS THAN (15),
 
9
PARTITION pMax VALUES LESS THAN MAXVALUE);
 
10
INSERT INTO t1 VALUES (1), (11), (21), (33);
 
11
BEGIN;
 
12
DELETE FROM t1 WHERE a = 11;
 
13
SELECT * FROM t1;
 
14
a
 
15
1
 
16
21
 
17
33
 
18
# con1 (send)
 
19
ALTER TABLE t1 TRUNCATE PARTITION pMax;
 
20
# con default
 
21
SELECT * FROM t1;
 
22
a
 
23
1
 
24
21
 
25
33
 
26
# Commit will allow the TRUNCATE to finish
 
27
COMMIT;
 
28
# con1 (reap)
 
29
# con1 (disconnect)
 
30
# default connection
 
31
SELECT * FROM t1;
 
32
a
 
33
1
 
34
DROP TABLE t1;
 
35
#
 
36
# Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
 
37
#            concurrent I_S query
 
38
create table t1 (a int)
 
39
engine = innodb stats_persistent=0
 
40
partition by range (a)
 
41
(partition p0 values less than MAXVALUE);
 
42
insert into t1 values (1), (11), (21), (33);
 
43
SELECT * FROM t1;
 
44
a
 
45
1
 
46
11
 
47
21
 
48
33
 
49
SHOW CREATE TABLE t1;
 
50
Table   Create Table
 
51
t1      CREATE TABLE `t1` (
 
52
  `a` int(11) DEFAULT NULL
 
53
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
 
54
/*!50100 PARTITION BY RANGE (a)
 
55
(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
 
56
t1#P#p0.ibd
 
57
t1.frm
 
58
t1.par
 
59
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
 
60
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
 
61
SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
 
62
PARTITION_DESCRIPTION, TABLE_ROWS
 
63
FROM INFORMATION_SCHEMA.PARTITIONS
 
64
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
 
65
SET DEBUG_SYNC = 'now WAIT_FOR parked';
 
66
# When waiting for the name lock in get_all_tables in sql_show.cc
 
67
# this will not be concurrent any more, thus the TIMEOUT
 
68
SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1';
 
69
# Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...'
 
70
SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2';
 
71
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
 
72
(PARTITION p0 VALUES LESS THAN (10),
 
73
PARTITION p10 VALUES LESS THAN MAXVALUE);
 
74
Warnings:
 
75
Warning 1639    debug sync point wait timed out
 
76
TABLE_SCHEMA    TABLE_NAME      PARTITION_NAME  PARTITION_ORDINAL_POSITION      PARTITION_DESCRIPTION   TABLE_ROWS
 
77
test    t1      p0      1       10      1
 
78
test    t1      p10     2       MAXVALUE        3
 
79
t1#P#p0.ibd
 
80
t1#P#p10.ibd
 
81
t1.frm
 
82
t1.par
 
83
SHOW CREATE TABLE t1;
 
84
Table   Create Table
 
85
t1      CREATE TABLE `t1` (
 
86
  `a` int(11) DEFAULT NULL
 
87
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0
 
88
/*!50100 PARTITION BY RANGE (a)
 
89
(PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB,
 
90
 PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
 
91
SELECT * FROM t1;
 
92
a
 
93
1
 
94
11
 
95
21
 
96
33
 
97
drop table t1;
 
98
SET DEBUG_SYNC = 'RESET';