summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_bugs/t/leak172.test
blob: 9d82604e4b171c56a48a23f4619e36556972aa0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# test case simplified from RQG run that forces a lock not granted error on an update with a 
# concurrent load into the same table.

source include/have_tokudb.inc;
source include/have_debug.inc;
set default_storage_engine=tokudb;

disable_warnings;
drop table if exists t1,t2;
enable_warnings;

let $MYSQLD_DATADIR=`select @@datadir`;
copy_file $MTR_SUITE_DIR/std_data/leak172_t1.data $MYSQLD_DATADIR/test/leak172_t1.data;
copy_file $MTR_SUITE_DIR/std_data/leak172_t2.data $MYSQLD_DATADIR/test/leak172_t2.data;

CREATE TABLE `t1` (
  `c4` int(11) DEFAULT NULL,
  `c5` int(11) DEFAULT NULL,
  `c26` text,
  `c18` blob,
  `c29` text NOT NULL,
  `c3` int(10) unsigned DEFAULT NULL,
  `c25` text,
  `c17` varchar(240) NOT NULL,
  `c11` int(10) unsigned NOT NULL,
  `c0` int(11) DEFAULT NULL,
  `c22` blob NOT NULL,
  `c13` varchar(240),
  `c19` blob,
  `c20` blob,
  `c23` blob NOT NULL,
  `c27` text,
  `c28` text NOT NULL,
  `c2` int(10) unsigned DEFAULT NULL,
  `c12` varchar(240) DEFAULT NULL,
  `c34` date NOT NULL,
  `c30` date DEFAULT NULL,
  `c31` date DEFAULT NULL,
  `c24` date NOT NULL DEFAULT '0000-00-00',
  `c33` date DEFAULT NULL,
  `c21` blob,
  `c1` int(11),
  `c15` varchar(240) DEFAULT NULL,
  `c16` varchar(240) NOT NULL,
  `c9` int(11) NOT NULL,
  `c32` date DEFAULT NULL,
  `c7` int(10) unsigned DEFAULT NULL,
  `c8` int(11) NOT NULL,
  `c14` varchar(240) DEFAULT NULL,
  `c35` date NOT NULL,
  `pk` int(11) NOT NULL AUTO_INCREMENT,
  `c10` int(10) unsigned NOT NULL,
  `c6` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `c5` (`c5`),
  KEY `c29` (`c29`(255)),
  KEY `c3` (`c3`),
  KEY `c25` (`c25`(255)),
  KEY `c17` (`c17`),
  KEY `c11` (`c11`),
  KEY `c13` (`c13`),
  KEY `c19` (`c19`(255)),
  KEY `c23` (`c23`(255)),
  KEY `c27` (`c27`(255)),
  KEY `c31` (`c31`),
  KEY `c33` (`c33`),
  KEY `c21` (`c21`(255)),
  KEY `c1` (`c1`),
  KEY `c15` (`c15`),
  KEY `c9` (`c9`),
  KEY `c7` (`c7`),
  KEY `c35` (`c35`)
);

CREATE TABLE `t2` (
  `c12` varchar(240) DEFAULT NULL,
  `c15` varchar(240) DEFAULT NULL,
  `c19` blob,
  `c14` varchar(240) DEFAULT NULL,
  `c6` int(10) unsigned DEFAULT NULL,
  `c11` int(10) unsigned NOT NULL,
  `c30` date DEFAULT NULL,
  `c29` text NOT NULL,
  `c20` blob,
  `c18` blob,
  `c23` blob NOT NULL,
  `c16` varchar(240) NOT NULL,
  `c10` int(10) unsigned NOT NULL,
  `c25` text,
  `c21` blob,
  `c7` int(10) unsigned DEFAULT NULL,
  `c9` int(11) NOT NULL,
  `c5` int(11) DEFAULT NULL,
  `c35` date NOT NULL,
  `c24` text,
  `c17` varchar(240) NOT NULL,
  `c28` text NOT NULL,
  `c33` date DEFAULT NULL,
  `c26` text,
  `c0` int(11) DEFAULT NULL,
  `c13` varchar(240) DEFAULT NULL,
  `c3` int(10) unsigned DEFAULT NULL,
  `c1` int(11) DEFAULT NULL,
  `pk` int(11) NOT NULL AUTO_INCREMENT,
  `c34` date NOT NULL,
  `c2` int(10) unsigned DEFAULT NULL,
  `c4` int(11) DEFAULT NULL,
  `c32` date,
  `c27` text,
  `c8` int(11) NOT NULL,
  `c31` date DEFAULT NULL,
  `c22` blob NOT NULL,
  PRIMARY KEY (`pk`),
  KEY `c15` (`c15`),
  KEY `c19` (`c19`(255)),
  KEY `c11` (`c11`),
  KEY `c29` (`c29`(255)),
  KEY `c23` (`c23`(255)),
  KEY `c25` (`c25`(255)),
  KEY `c21` (`c21`(255)),
  KEY `c7` (`c7`),
  KEY `c9` (`c9`),
  KEY `c5` (`c5`),
  KEY `c35` (`c35`),
  KEY `c17` (`c17`),
  KEY `c33` (`c33`),
  KEY `c13` (`c13`),
  KEY `c3` (`c3`),
  KEY `c1` (`c1`),
  KEY `c27` (`c27`(255)),
  KEY `c31` (`c31`)
);

LOAD DATA INFILE 'leak172_t1.data' INTO TABLE `t1` fields terminated by ',';

connect(conn1,localhost,root,,);
set session debug_dbug="+d,tokudb_end_bulk_insert_sleep";
send LOAD DATA INFILE 'leak172_t2.data' INTO TABLE `t2` fields terminated by ',';

connection default;
let $wait_condition= select count(*)=1 from information_schema.processlist where info like 'LOAD DATA INFILE%' and state like 'DBUG sleep';
source include/wait_condition.inc;
--error 1205
UPDATE t1, t2 SET t1.`c5` = 4 WHERE t1.`c6` <= 'o';

connection conn1;
reap;

connection default;
disconnect conn1;

drop table t1,t2;