Debian Codegraph @

mysql-test/suite/innodb/r/sp_temp_table.result

raw
1 #
2 # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
3 # CALLED FROM A FUNCTION
4 #
5 call mtr.add_suppression("MySQL is trying to drop table");
6 CREATE PROCEDURE cachedata(
7 IN obj_id BIGINT UNSIGNED,
8 IN start DATETIME,
9 IN end DATETIME
10 )
11 cachedata:BEGIN
12 DECLARE cache_count BIGINT;
13 SET @timestamp := NOW();
14 CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
15 timestamp DATETIME,
16 object_id BIGINT UNSIGNED NOT NULL,
17 start DATETIME,
18 end DATETIME,
19 seqno BIGINT AUTO_INCREMENT,
20 value FLOAT,
21 PRIMARY KEY (seqno),
22 INDEX (timestamp),
23 INDEX (object_id, start, end)
24 ) ENGINE=INNODB;
25 DELETE FROM cachedata WHERE
26 timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
27 SELECT count(*) INTO cache_count FROM cachedata WHERE
28 object_id = obj_id
29 AND start = start
30 AND end = end;
31 IF cache_count > 0 THEN LEAVE cachedata;
32 END IF;
33 INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
34 (@timestamp, obj_id, start, end, 1234),
35 (@timestamp, obj_id, start, end, 4567),
36 (@timestamp, obj_id, start, end, 8901),
37 (@timestamp, obj_id, start, end, 1234),
38 (@timestamp, obj_id, start, end, 4567),
39 (@timestamp, obj_id, start, end, 8901),
40 (@timestamp, obj_id, start, end, 1234),
41 (@timestamp, obj_id, start, end, 4567),
42 (@timestamp, obj_id, start, end, 8901),
43 (@timestamp, obj_id, start, end, 1234),
44 (@timestamp, obj_id, start, end, 4567),
45 (@timestamp, obj_id, start, end, 8901),
46 (@timestamp, obj_id, start, end, 2345),
47 (@timestamp, obj_id, start, end, 1234),
48 (@timestamp, obj_id, start, end, 4567),
49 (@timestamp, obj_id, start, end, 8901),
50 (@timestamp, obj_id, start, end, 2345),
51 (@timestamp, obj_id, start, end, 1234),
52 (@timestamp, obj_id, start, end, 4567),
53 (@timestamp, obj_id, start, end, 8901),
54 (@timestamp, obj_id, start, end, 2345);
55 END$$
56 CREATE FUNCTION get_cache(
57 obj_id BIGINT UNSIGNED,
58 start DATETIME,
59 end DATETIME
60 )
61 RETURNS FLOAT
62 READS SQL DATA
63 BEGIN
64 DECLARE result FLOAT;
65 CALL cachedata(obj_id, start, end);
66 SELECT SUM(value) INTO result FROM cachedata WHERE
67 object_id = obj_id
68 AND start = start
69 AND end = end;
70 RETURN result;
71 END$$
72 SELECT get_cache(1, '2014-01-01', '2014-02-01');
73 get_cache(1, '2014-01-01', '2014-02-01')
74 95247
75 select sleep(1);
76 sleep(1)
77 0
78 SELECT get_cache(1, '2014-01-01', '2014-02-01');
79 get_cache(1, '2014-01-01', '2014-02-01')
80 95247
81 select sleep(1);
82 sleep(1)
83 0
84 SELECT get_cache(1, '2014-01-01', '2014-02-01');
85 get_cache(1, '2014-01-01', '2014-02-01')
86 95247
87 select sleep(1);
88 sleep(1)
89 0
90 SELECT get_cache(1, '2014-01-01', '2014-02-01');
91 get_cache(1, '2014-01-01', '2014-02-01')
92 95247
93 select sleep(1);
94 sleep(1)
95 0
96 SELECT get_cache(1, '2014-01-01', '2014-02-01');
97 get_cache(1, '2014-01-01', '2014-02-01')
98 95247
99 select sleep(1);
100 sleep(1)
101 0
102 SELECT get_cache(1, '2014-01-01', '2014-02-01');
103 get_cache(1, '2014-01-01', '2014-02-01')
104 95247
105 select sleep(1);
106 sleep(1)
107 0
108 SELECT get_cache(1, '2014-01-01', '2014-02-01');
109 get_cache(1, '2014-01-01', '2014-02-01')
110 95247
111 select sleep(1);
112 sleep(1)
113 0
114 SELECT get_cache(1, '2014-01-01', '2014-02-01');
115 get_cache(1, '2014-01-01', '2014-02-01')
116 95247
117 select sleep(1);
118 sleep(1)
119 0
120 SELECT get_cache(1, '2014-01-01', '2014-02-01');
121 get_cache(1, '2014-01-01', '2014-02-01')
122 95247
123 select sleep(1);
124 sleep(1)
125 0
126 SELECT get_cache(1, '2014-01-01', '2014-02-01');
127 get_cache(1, '2014-01-01', '2014-02-01')
128 95247
129 select sleep(1);
130 sleep(1)
131 0
132 SELECT get_cache(1, '2014-01-01', '2014-02-01');
133 get_cache(1, '2014-01-01', '2014-02-01')
134 95247
135 select sleep(1);
136 sleep(1)
137 0
138 SELECT get_cache(1, '2014-01-01', '2014-02-01');
139 get_cache(1, '2014-01-01', '2014-02-01')
140 95247
141 select sleep(1);
142 sleep(1)
143 0
144 SELECT get_cache(1, '2014-01-01', '2014-02-01');
145 get_cache(1, '2014-01-01', '2014-02-01')
146 95247
147 select sleep(1);
148 sleep(1)
149 0
150 SELECT get_cache(1, '2014-01-01', '2014-02-01');
151 get_cache(1, '2014-01-01', '2014-02-01')
152 95247
153 select sleep(1);
154 sleep(1)
155 0
156 SELECT get_cache(1, '2014-01-01', '2014-02-01');
157 get_cache(1, '2014-01-01', '2014-02-01')
158 95247
159 select sleep(1);
160 sleep(1)
161 0
162 SELECT get_cache(1, '2014-01-01', '2014-02-01');
163 get_cache(1, '2014-01-01', '2014-02-01')
164 95247
165 select sleep(1);
166 sleep(1)
167 0
168 SELECT get_cache(1, '2014-01-01', '2014-02-01');
169 get_cache(1, '2014-01-01', '2014-02-01')
170 95247
171 select sleep(1);
172 sleep(1)
173 0
174 SELECT get_cache(1, '2014-01-01', '2014-02-01');
175 get_cache(1, '2014-01-01', '2014-02-01')
176 95247
177 select sleep(1);
178 sleep(1)
179 0
180 SELECT get_cache(1, '2014-01-01', '2014-02-01');
181 get_cache(1, '2014-01-01', '2014-02-01')
182 95247
183 select sleep(1);
184 sleep(1)
185 0
186 SELECT get_cache(1, '2014-01-01', '2014-02-01');
187 get_cache(1, '2014-01-01', '2014-02-01')
188 95247
189 select sleep(1);
190 sleep(1)
191 0
192 SELECT get_cache(1, '2014-01-01', '2014-02-01');
193 get_cache(1, '2014-01-01', '2014-02-01')
194 95247
195 select sleep(1);
196 sleep(1)
197 0
198 SELECT get_cache(1, '2014-01-01', '2014-02-01');
199 get_cache(1, '2014-01-01', '2014-02-01')
200 95247
201 select sleep(1);
202 sleep(1)
203 0
204 SELECT get_cache(1, '2014-01-01', '2014-02-01');
205 get_cache(1, '2014-01-01', '2014-02-01')
206 95247
207 select sleep(1);
208 sleep(1)
209 0
210 SELECT get_cache(1, '2014-01-01', '2014-02-01');
211 get_cache(1, '2014-01-01', '2014-02-01')
212 95247
213 select sleep(1);
214 sleep(1)
215 0
216 SELECT get_cache(1, '2014-01-01', '2014-02-01');
217 get_cache(1, '2014-01-01', '2014-02-01')
218 95247
219 select sleep(1);
220 sleep(1)
221 0
222 SELECT get_cache(1, '2014-01-01', '2014-02-01');
223 get_cache(1, '2014-01-01', '2014-02-01')
224 95247
225 select sleep(1);
226 sleep(1)
227 0
228 SELECT get_cache(1, '2014-01-01', '2014-02-01');
229 get_cache(1, '2014-01-01', '2014-02-01')
230 95247
231 select sleep(1);
232 sleep(1)
233 0
234 SELECT get_cache(1, '2014-01-01', '2014-02-01');
235 get_cache(1, '2014-01-01', '2014-02-01')
236 95247
237 select sleep(1);
238 sleep(1)
239 0
240 SELECT get_cache(1, '2014-01-01', '2014-02-01');
241 get_cache(1, '2014-01-01', '2014-02-01')
242 95247
243 select sleep(1);
244 sleep(1)
245 0
246 SELECT get_cache(1, '2014-01-01', '2014-02-01');
247 get_cache(1, '2014-01-01', '2014-02-01')
248 95247
249 select sleep(1);
250 sleep(1)
251 0
252 DROP FUNCTION get_cache;
253 DROP PROCEDURE cachedata;