1
by brian
clean slate |
1 |
#
|
2 |
# BUG#10308: purge log with subselect |
|
3 |
# Bug#28553: mysqld crash in "purge master log before(select time from information_schema)" |
|
4 |
#
|
|
5 |
--error 1064
|
|
6 |
purge master logs before (select adddate(current_timestamp(), interval -4 day)); |
|
7 |
purge master logs before adddate(current_timestamp(), interval -4 day); |
|
8 |
||
9 |
#
|
|
10 |
# Bug31048: Many nested subqueries may cause server crash. |
|
11 |
#
|
|
12 |
create table t1(a int,b int,key(a),key(b)); |
|
13 |
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5), |
|
14 |
(6,7),(7,4),(5,3); |
|
15 |
||
16 |
let $nesting= 26; |
|
17 |
let $should_work_nesting= 5; |
|
18 |
let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ; |
|
19 |
let $end= )group by a ; |
|
20 |
let $start_app= where a> ( select sum(a) from t1 ; |
|
21 |
let $end_pre= )group by b limit 1 ; |
|
22 |
||
23 |
--disable_result_log
|
|
24 |
--disable_query_log
|
|
25 |
# At least 4 level nesting should work without errors |
|
26 |
while ($should_work_nesting) |
|
27 |
{
|
|
28 |
--echo $should_work_nesting
|
|
29 |
eval $start $end; |
|
30 |
eval explain $start $end; |
|
31 |
let $start= $start |
|
32 |
$start_app; |
|
33 |
let $end= $end_pre |
|
34 |
$end; |
|
35 |
dec $should_work_nesting; |
|
36 |
}
|
|
37 |
# Other may fail with the 'stack overrun error' |
|
38 |
while ($nesting) |
|
39 |
{
|
|
40 |
--echo $nesting
|
|
41 |
--error 0,1436
|
|
42 |
eval $start $end; |
|
43 |
--error 0,1436
|
|
44 |
eval explain $start $end; |
|
45 |
let $start= $start |
|
46 |
$start_app; |
|
47 |
let $end= $end_pre |
|
48 |
$end; |
|
49 |
dec $nesting; |
|
50 |
}
|
|
51 |
--enable_result_log
|
|
52 |
--enable_query_log
|
|
53 |
drop table t1; |
|
54 |
||
55 |
--echo End of 5.1 tests
|