summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-08-22 16:13:54 +0200
committerSergei Golubchik <sergii@pisem.net>2012-08-22 16:13:54 +0200
commit1fd8150a5b5e3f56aa3c253225929a07ee9a4026 (patch)
tree6fb814b28d2a0b8227b7a9f835f2b888c2a2596f /mysql-test/t
parent60561ae6133cf40f4fc445e1d6e8f395a20b2573 (diff)
parent115a2967563d3ac734ce371260098710ba42cdf0 (diff)
downloadmariadb-git-1fd8150a5b5e3f56aa3c253225929a07ee9a4026.tar.gz
5.1 merge
increase xtradb verson from 13.0 to 13.01
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_group_innodb.test43
-rw-r--r--mysql-test/t/mysqldump.test29
-rw-r--r--mysql-test/t/ps.test89
-rw-r--r--mysql-test/t/sp.test37
-rw-r--r--mysql-test/t/type_year.test8
5 files changed, 203 insertions, 3 deletions
diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test
index 9e88894de58..b6752556a0a 100644
--- a/mysql-test/t/func_group_innodb.test
+++ b/mysql-test/t/func_group_innodb.test
@@ -84,6 +84,49 @@ select count(*), min(7), max(7) from t2m, t1i;
drop table t1m, t1i, t2m, t2i;
+--echo #
+--echo # Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY
+--echo # COUNT(*) LIMIT.
+--echo #
+
+CREATE TABLE t1 (
+id BIGINT(20) ,
+member_id_to INT(11) ,
+r_date DATE ,
+PRIMARY KEY (id,r_date),
+KEY r_date_idx (r_date),
+KEY t1_idx01 (member_id_to)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+(107924526,518491,'2011-05-01'),
+(107924527,518491,'2011-05-01'),
+(107924528,518491,'2011-05-01'),
+(107924529,518491,'2011-05-01'),
+(107924530,518491,'2011-05-01'),
+(107924531,518491,'2011-05-01'),
+(107924532,518491,'2011-05-01'),
+(107924534,518491,'2011-06-21'),
+(107924535,518491,'2011-06-21'),
+(107924536,518491,'2011-06-21'),
+(107924537,518491,'2011-06-21'),
+(107924538,518491,'2011-06-21'),
+(107924542,1601319,'2011-06-21'),
+(107924543,1601319,'2011-06-21'),
+(107924544,1601319,'2011-06-21'),
+(107924545,1601319,'2011-06-21'),
+(107924546,1601319,'2011-06-21'),
+(107924547,1601319,'2011-06-21'),
+(107924548,1601319,'2011-06-21'),
+(107924549,1601319,'2011-06-21'),
+(107924550,1601319,'2011-06-21');
+
+SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
+ '2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1;
+
+DROP TABLE t1;
+
+--echo # End of test BUG#12713907
--echo #
--echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index cb713218d61..76a17987fb6 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2319,9 +2319,32 @@ DROP DATABASE BUG52792;
USE test;
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
+
--echo #
---echo # End of 5.1 tests
+--echo # Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
--echo #
+SET @old_log_output_state= @@global.log_output;
+SET @old_general_log_state= @@global.general_log;
+SET @old_slow_query_log_state= @@global.slow_query_log;
-# Wait till we reached the initial number of concurrent sessions
---source include/wait_until_count_sessions.inc
+call mtr.add_suppression("Failed to write to mysql.general_log");
+--exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug45740.sql
+# Make log_output as table and enable general_log and slow_log
+SET @@global.log_output="TABLE";
+SET @@global.general_log='ON';
+SET @@global.slow_query_log='ON';
+DROP DATABASE mysql;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug45740.sql
+SHOW CREATE TABLE mysql.general_log;
+SHOW CREATE TABLE mysql.slow_log;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug45740.sql
+
+SET @@global.log_output= @old_log_output_state;
+SET @@global.slow_query_log= @old_slow_query_log_state;
+SET @@global.general_log= @old_general_log_state;
+
+--echo #
+--echo # End of 5.1 tests
+--echo #
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index e3f2a5c87d1..f31d2aea89f 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3103,6 +3103,95 @@ DROP TABLE t1;
--echo End of 5.1 tests.
+--echo
+--echo # Bug#13805127: Stored program cache produces wrong result in same THD
+--echo
+
+PREPARE s1 FROM
+"
+SELECT c1, t2.c2, count(c3)
+FROM
+ (
+ SELECT 3 as c2 FROM dual WHERE @x = 1
+ UNION
+ SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
+ ) AS t1,
+ (
+ SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
+ UNION
+ SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
+ UNION
+ SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
+ ) AS t2
+WHERE t2.c2 = t1.c2
+GROUP BY c1, c2
+";
+
+--echo
+SET @x = 1;
+SELECT c1, t2.c2, count(c3)
+FROM
+ (
+ SELECT 3 as c2 FROM dual WHERE @x = 1
+ UNION
+ SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
+ ) AS t1,
+ (
+ SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
+ UNION
+ SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
+ UNION
+ SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
+ ) AS t2
+WHERE t2.c2 = t1.c2
+GROUP BY c1, c2;
+--echo
+EXECUTE s1;
+
+--echo
+SET @x = 2;
+SELECT c1, t2.c2, count(c3)
+FROM
+ (
+ SELECT 3 as c2 FROM dual WHERE @x = 1
+ UNION
+ SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
+ ) AS t1,
+ (
+ SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
+ UNION
+ SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
+ UNION
+ SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
+ ) AS t2
+WHERE t2.c2 = t1.c2
+GROUP BY c1, c2;
+--echo
+EXECUTE s1;
+
+--echo
+SET @x = 1;
+SELECT c1, t2.c2, count(c3)
+FROM
+ (
+ SELECT 3 as c2 FROM dual WHERE @x = 1
+ UNION
+ SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
+ ) AS t1,
+ (
+ SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
+ UNION
+ SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
+ UNION
+ SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
+ ) AS t2
+WHERE t2.c2 = t1.c2
+GROUP BY c1, c2;
+--echo
+EXECUTE s1;
+
+DEALLOCATE PREPARE s1;
+
--echo #
--echo # LP bug#1001500 Crash on the second execution of the PS for
--echo # a query with degenerated conjunctive condition
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index badfe853dec..7dff5f3034d 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8428,3 +8428,40 @@ DROP FUNCTION f1;
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
+
+--echo
+--echo # Bug#13805127: Stored program cache produces wrong result in same THD
+--echo
+
+delimiter |;
+
+CREATE PROCEDURE p1(x INT UNSIGNED)
+BEGIN
+ SELECT c1, t2.c2, count(c3)
+ FROM
+ (
+ SELECT 3 as c2 FROM dual WHERE x = 1
+ UNION
+ SELECT 2 FROM dual WHERE x = 1 OR x = 2
+ ) AS t1,
+ (
+ SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
+ UNION
+ SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
+ UNION
+ SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
+ ) AS t2
+ WHERE t2.c2 = t1.c2
+ GROUP BY c1, c2
+ ;
+END|
+
+delimiter ;|
+
+--echo
+CALL p1(1);
+CALL p1(2);
+CALL p1(1);
+
+DROP PROCEDURE p1;
+
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index 1a9e66478e1..8ba8260cfc4 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -160,5 +160,13 @@ SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
DROP TABLE t1;
--echo #
+--echo # WL#6219: Deprecate and remove YEAR(2) type
+--echo #
+
+CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
+ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
+DROP TABLE t1;
+
+--echo #
--echo End of 5.1 tests