File: subselect.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (84 lines) | stat: -rw-r--r-- 2,283 bytes parent folder | download
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
# ER_STACK_OVERRUN_NEED_MORE does not currenly work well with TSan
--source include/not_tsan.inc

#
# BUG#10308: purge log with subselect
# Bug#28553: mysqld crash in "purge master log before(select time from information_schema)"
#
--disable_query_log
CALL mtr.add_suppression("file *  was not purged because it is the active log file.");
--enable_query_log
--error 1064
purge master logs before (select adddate(current_timestamp(), interval -4 day));
--disable_warnings
purge master logs before adddate(current_timestamp(), interval -4 day);
--enable_warnings

#
# Bug31048: Many nested subqueries may cause server crash.
#
create table t1(a int,b int,key(a),key(b));
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
  (6,7),(7,4),(5,3);

let $nesting= 26;
let $should_work_nesting= 5;
let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ;
let $end= )group by a ;
let $start_app= where a> ( select sum(a) from t1 ;
let $end_pre= )group by b limit 1 ;

--disable_result_log
--disable_query_log
# At least 4 level nesting should work without errors
while ($should_work_nesting)
{
--echo $should_work_nesting
  eval $start $end;
  eval explain $start $end;
  let $start= $start
  $start_app;
  let $end= $end_pre
  $end;
  dec $should_work_nesting;
}
# Other may fail with the 'stack overrun error'
while ($nesting)
{
--echo $nesting
--error 0,1436
  eval $start $end;
--error 0,1436
  eval explain $start $end;
  let $start= $start
  $start_app;
  let $end= $end_pre
  $end;
  dec $nesting;
}
--enable_result_log
--enable_query_log
drop table t1;

--echo End of 5.1 tests

#
# BUG#33245 "Crash on VIEW referencing FROM table in an IN clause"
# (this is a second copy of testcase that uses disconnect/connect commands
#  which increase probability of crash)
--disconnect default
--connect (default,localhost,root,,test)
CREATE TABLE t1 (f1 INT NOT NULL);
CREATE VIEW v1 (a) AS SELECT f1 IN (SELECT f1 FROM t1) FROM t1;
SELECT * FROM v1;
drop view v1;
drop table t1;

--echo #
--echo # Bug#33773799: recent regression: TABLE::set_keyread(bool):
--echo #               Assertion `file' failed.
--echo #

# Used to hit an assertion when run with --ps-protocol.
--error ER_GIS_INVALID_DATA
SELECT * FROM (SELECT ST_EXTERIORRING(1)) AS t1, (SELECT 1) AS t2;