summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/subselect.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/subselect.test')
-rw-r--r--mysql-test/main/subselect.test59
1 files changed, 55 insertions, 4 deletions
diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test
index 97869a70..002d5ced 100644
--- a/mysql-test/main/subselect.test
+++ b/mysql-test/main/subselect.test
@@ -1180,8 +1180,10 @@ create table t1 (a int, b decimal(13, 3));
insert into t1 values (1, 0.123);
let $outfile_abs= $MYSQLTEST_VARDIR/tmp/subselect.out.file.1;
let $outfile_rel= ../../tmp/subselect.out.file.1;
+--disable_warnings
--error 0,1
--remove_file $outfile_abs
+--enable_warnings
eval select a, (select max(b) from t1) into outfile "$outfile_rel" from t1;
delete from t1;
eval load data infile "$outfile_rel" into table t1;
@@ -6000,24 +6002,28 @@ drop table t1;
--echo #
--echo # MDEV-7565: Server crash with Signal 6 (part 2)
--echo #
+
+create table t1 (id int not null primary key);
Select
- (Select Sum(`TestCase`.Revenue) From mysql.slow_log E
- Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+ (Select Sum(`TestCase`.Revenue) From t1 E
+ Where TestCase.TemplateID not in (Select 1 from t1 where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
+drop table t1;
--echo #
--echo # MDEV-7445:Server crash with Signal 6
--echo #
+create table t1 (id int not null primary key);
--delimiter |
CREATE PROCEDURE procedure2()
BEGIN
Select
- (Select Sum(`TestCase`.Revenue) From mysql.slow_log E
- Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
+ (Select Sum(`TestCase`.Revenue) From t1 E
+ Where TestCase.TemplateID not in (Select 1 from t1 where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
@@ -6029,6 +6035,7 @@ call procedure2();
call procedure2();
drop procedure procedure2;
+drop table t1;
--echo #
@@ -6351,6 +6358,50 @@ SELECT ROW(1,2) = 1 IN (SELECT 1 UNION SELECT 2);
SELECT ROW(1,2) = (1 = ANY (SELECT 1 UNION SELECT 2));
--echo #
+--echo # MDEV-29070 SIGSEGV in my_decimal::operator= and Assertion `0' failed
+--echo # in Item_type_holder::val_decimal on SELECT
+--echo #
+
+CREATE TABLE t1(a INT UNIQUE);
+INSERT INTO t1(a) VALUES (1);
+
+SELECT a FROM t1 WHERE (SELECT a, a UNION SELECT 1, a FROM t1) IN (SELECT 1, 1);
+
+SELECT a FROM t1 WHERE (SELECT a, a UNION SELECT 1, a FROM t1) IN (SELECT a, a);
+
+UPDATE t1 SET a = 0
+ WHERE (SELECT a, a WHERE a < 0 INTERSECT
+ SELECT +1 / +1, a FROM t1 WHERE a > -0+1) IN (SELECT a, a);
+
+SELECT a FROM t1 WHERE (SELECT a, a WHERE a < 0 INTERSECT
+ SELECT + 1 / + 1, a FROM t1
+ WHERE a > -0 + 1) IN (SELECT a, a);
+
+CREATE TABLE x (x INT);
+INSERT INTO x (x) VALUES (1);
+UPDATE x SET x = 1 WHERE x = 1;
+INSERT INTO x (x) VALUES (1), (1);
+let $q= WITH RECURSIVE x (x) AS (
+ SELECT 1 INTERSECT
+ SELECT -(SELECT 1.000000 AS x
+ UNION
+ SELECT 1.000000 ORDER BY NOT x < 'x',
+ -(SELECT 1 + x/1.000000 IN (1, 1) FROM x
+ WHERE x ORDER BY 1 - x) DESC LIMIT 1 OFFSET 1
+ ) + 1 FROM x
+ )
+ SELECT DISTINCT x, 1, NULL, 1.000000
+ FROM x
+ WHERE (SELECT (SELECT x WHERE x IN (SELECT x FROM x))) >
+ (SELECT (SELECT x ORDER BY x = x OR (x = 1 AND x = 1) DESC))
+ ORDER BY x ASC, x DESC, x;
+
+--error ER_NOT_STANDARD_COMPLIANT_RECURSIVE
+eval $q;
+
+DROP TABLE t1, x;
+
+--echo #
--echo # End of 10.4 tests
--echo #