summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2008-05-05 15:04:26 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2008-05-05 15:04:26 +0300
commitcd865e657d16b8bc156e6341f1a280eee6c19a96 (patch)
treeabf659f1b97fe897ad06ffd82541140d3bd894de /mysql-test
parent8bce58d6b78ba79f2e37003ae6a91b191bc782d7 (diff)
parent369e58ff62df115d7fad11cb8bd7c002422b4741 (diff)
downloadmariadb-git-cd865e657d16b8bc156e6341f1a280eee6c19a96.tar.gz
Merge bk-internal:/home/bk/mysql-5.0
into magare.gmz:/home/kgeorge/mysql/work/merge-5.0-bugteam mysql-test/mysql-test-run.pl: Auto merged
Diffstat (limited to 'mysql-test')
-rwxr-xr-xmysql-test/mysql-test-run.pl13
-rw-r--r--mysql-test/r/ctype_gbk.result7
-rw-r--r--mysql-test/r/func_gconcat.result26
-rw-r--r--mysql-test/r/subselect.result7
-rw-r--r--mysql-test/r/subselect3.result9
-rw-r--r--mysql-test/r/type_decimal.result7
-rw-r--r--mysql-test/t/ctype_gbk.test14
-rw-r--r--mysql-test/t/func_gconcat.test36
-rw-r--r--mysql-test/t/subselect.test12
-rw-r--r--mysql-test/t/subselect3.test13
-rw-r--r--mysql-test/t/type_decimal.test8
11 files changed, 150 insertions, 2 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 86e41c19284..9b16471cda1 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1367,7 +1367,15 @@ sub datadir_list_setup () {
sub collect_mysqld_features () {
my $found_variable_list_start= 0;
- my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
+ my $tmpdir;
+ if ( $opt_tmpdir ) {
+ # Use the requested tmpdir
+ mkpath($opt_tmpdir) if (! -d $opt_tmpdir);
+ $tmpdir= $opt_tmpdir;
+ }
+ else {
+ $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
+ }
#
# Execute "mysqld --no-defaults --help --verbose" to get a
@@ -1428,7 +1436,7 @@ sub collect_mysqld_features () {
}
}
}
- rmtree($tmpdir);
+ rmtree($tmpdir) if (!$opt_tmpdir);
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find variabes list") unless $found_variable_list_start;
@@ -1737,6 +1745,7 @@ sub mysql_upgrade_arguments()
mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
mtr_add_arg($args, "--basedir=$glob_basedir");
+ mtr_add_arg($args, "--tmpdir=$opt_tmpdir");
if ( $opt_debug )
{
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index 6066246a2ef..1b425134095 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -247,4 +247,11 @@ t1 CREATE TABLE `t1` (
`c2` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=gbk
drop table t1;
+CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gbk,
+b MEDIUMTEXT CHARACTER SET big5);
+INSERT INTO t1 VALUES
+(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
+SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
+SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
+DROP TABLES t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 77d11831842..4dddc35e8a8 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -946,4 +946,30 @@ GROUP BY 1
d1
NULL
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES(1);
+SELECT GROUP_CONCAT(DISTINCT t2.a) FROM t1 LEFT JOIN t2 ON t2.a = t1.a GROUP BY t1.a;
+GROUP_CONCAT(DISTINCT t2.a)
+NULL
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, KEY(a));
+CREATE TABLE t2 (b INT);
+INSERT INTO t1 VALUES (NULL), (8), (2);
+INSERT INTO t2 VALUES (4), (10);
+SELECT 1 FROM t1 WHERE t1.a NOT IN
+(
+SELECT GROUP_CONCAT(DISTINCT t1.a)
+FROM t1 WHERE t1.a IN
+(
+SELECT b FROM t2
+)
+AND NOT t1.a >= (SELECT t1.a FROM t1 LIMIT 1)
+GROUP BY t1.a
+);
+1
+1
+1
+1
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 2de2589fc92..e56c2f07d80 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4374,4 +4374,11 @@ a4 f3 a6
1 NULL NULL
2 NULL NULL
DROP TABLE t1, t2, t3, t4;
+create table t1 (a float(5,4) zerofill);
+create table t2 (a float(5,4),b float(2,0));
+select t1.a from t1 where
+t1.a= (select b from t2 limit 1) and not
+t1.a= (select a from t2 limit 1) ;
+a
+drop table t1, t2;
End of 5.0 tests.
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index c194ba33756..5221fa09744 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -770,4 +770,13 @@ SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
1
DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
+1
+1
+1
+1
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 2afd42f702e..03fbc898cc5 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -946,4 +946,11 @@ SELECT ROUND(20061108085411.000002);
ROUND(20061108085411.000002)
20061108085411
DROP TABLE t1, t2, t3, t4, t5, t6;
+create table t1(`c` decimal(9,2));
+insert into t1 values (300),(201.11);
+select max(case 1 when 1 then c else null end) from t1 group by c;
+max(case 1 when 1 then c else null end)
+201.11
+300.00
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/t/ctype_gbk.test b/mysql-test/t/ctype_gbk.test
index 3ea696338dc..91fe50d89b9 100644
--- a/mysql-test/t/ctype_gbk.test
+++ b/mysql-test/t/ctype_gbk.test
@@ -53,4 +53,18 @@ alter table t1 change c1 c1 mediumtext character set gbk not null;
show create table t1;
drop table t1;
+#
+# Bug#35993: severe memory corruption and crash with multibyte conversion
+#
+
+CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gbk,
+ b MEDIUMTEXT CHARACTER SET big5);
+INSERT INTO t1 VALUES
+ (REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
+
+SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
+SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
+
+DROP TABLES t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 87632fbdbb8..816ac9c2959 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -657,4 +657,40 @@ SELECT s1.d1 FROM
) AS s1;
DROP TABLE t1;
+#
+# Bug #35298: GROUP_CONCAT with DISTINCT can crash the server
+#
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+
+INSERT INTO t1 VALUES(1);
+
+SELECT GROUP_CONCAT(DISTINCT t2.a) FROM t1 LEFT JOIN t2 ON t2.a = t1.a GROUP BY t1.a;
+
+DROP TABLE t1, t2;
+
+#
+# Bug #36024: group_concat distinct in subquery crash
+#
+
+CREATE TABLE t1 (a INT, KEY(a));
+CREATE TABLE t2 (b INT);
+
+INSERT INTO t1 VALUES (NULL), (8), (2);
+INSERT INTO t2 VALUES (4), (10);
+
+SELECT 1 FROM t1 WHERE t1.a NOT IN
+(
+ SELECT GROUP_CONCAT(DISTINCT t1.a)
+ FROM t1 WHERE t1.a IN
+ (
+ SELECT b FROM t2
+ )
+ AND NOT t1.a >= (SELECT t1.a FROM t1 LIMIT 1)
+ GROUP BY t1.a
+);
+
+DROP TABLE t1, t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index c5edd5414e3..527bd528f79 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3259,5 +3259,17 @@ GROUP BY a4;
DROP TABLE t1, t2, t3, t4;
+#
+# BUG#36139 "float, zerofill, crash with subquery"
+#
+create table t1 (a float(5,4) zerofill);
+create table t2 (a float(5,4),b float(2,0));
+
+select t1.a from t1 where
+ t1.a= (select b from t2 limit 1) and not
+ t1.a= (select a from t2 limit 1) ;
+
+drop table t1, t2;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index cfbde8c29cd..d7bb1f7186a 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -605,4 +605,17 @@ SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
DROP TABLE t1, t2;
+#
+# Bug #36005: crash in subselect with single row
+# (subselect_single_select_engine::exec)
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 SELECT * FROM t1;
+
+SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
+
+DROP TABLE t1, t2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 6841b3cdd68..8a81908296f 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -521,4 +521,12 @@ SELECT ROUND(20061108085411.000002);
DROP TABLE t1, t2, t3, t4, t5, t6;
+#
+# Bug#36023: Incorrect handling of zero length caused an assertion to fail.
+#
+create table t1(`c` decimal(9,2));
+insert into t1 values (300),(201.11);
+select max(case 1 when 1 then c else null end) from t1 group by c;
+drop table t1;
+
--echo End of 5.0 tests