summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-07 19:40:59 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-07 19:40:59 +0300
commitd2452095a5526d219056ba623960bf3a39c3f566 (patch)
tree395144ff597d9d1ea027cb0f57f50c5a6e6ab90c /mysql-test
parent0c01d8d86c681d57373bf4dd41d555a5f643cec8 (diff)
parent897863813e458d2b6acdaa4dee8619a7e11a8968 (diff)
downloadmariadb-git-d2452095a5526d219056ba623960bf3a39c3f566.tar.gz
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts: Text conflict in .bzr-mysql/default.conf Text conflict in mysql-test/r/explain.result Text conflict in mysql-test/r/having.result Text conflict in mysql-test/suite/rpl/t/disabled.def Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in storage/federated/ha_federated.cc
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/collections/default.daily6
-rw-r--r--mysql-test/collections/default.push10
-rw-r--r--mysql-test/r/explain.result44
-rw-r--r--mysql-test/r/func_str.result4
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/innodb_mysql.result22
-rw-r--r--mysql-test/r/log_tables_upgrade.result47
-rw-r--r--mysql-test/r/myisam.result17
-rw-r--r--mysql-test/r/select.result10
-rw-r--r--mysql-test/r/subselect.result8
-rw-r--r--mysql-test/r/union.result2
-rw-r--r--mysql-test/std_data/bug49823.CSMbin0 -> 35 bytes
-rw-r--r--mysql-test/std_data/bug49823.CSV1
-rw-r--r--mysql-test/std_data/bug49823.frmbin0 -> 8776 bytes
-rw-r--r--mysql-test/suite/federated/federated.result23
-rw-r--r--mysql-test/suite/federated/federated.test22
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_running.result42
-rw-r--r--mysql-test/suite/rpl/t/disabled.def1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_running.test76
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test4
-rw-r--r--mysql-test/t/explain.test45
-rw-r--r--mysql-test/t/innodb_mysql.test18
-rw-r--r--mysql-test/t/log_tables_upgrade.test32
-rw-r--r--mysql-test/t/myisam.test17
-rw-r--r--mysql-test/t/mysql_upgrade.test2
27 files changed, 411 insertions, 90 deletions
diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily
index 56714662b8f..c71297878f7 100644
--- a/mysql-test/collections/default.daily
+++ b/mysql-test/collections/default.daily
@@ -1 +1,7 @@
perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental
+
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
diff --git a/mysql-test/collections/default.push b/mysql-test/collections/default.push
index 0503bd49f73..77dc9a586db 100644
--- a/mysql-test/collections/default.push
+++ b/mysql-test/collections/default.push
@@ -1,5 +1,5 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 3c449cf11a1..4ca4a8dde9d 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -168,6 +168,23 @@ WHERE t1.a = d1.a;
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
DROP TABLE t1;
#
+# Bug#48295:
+# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+#
+CREATE TABLE t1 (f1 INT);
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+EXPLAIN EXTENDED SELECT 1 FROM t1
+WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SHOW WARNINGS;
+Level Code Message
+Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
+SET SESSION sql_mode=@old_sql_mode;
+DROP TABLE t1;
+End of 5.0 tests.
+#
# Bug#37870: Usage of uninitialized value caused failed assertion.
#
create table t1 (dt datetime not null, t time not null);
@@ -195,21 +212,20 @@ dt
2001-01-01 01:01:01
drop tables t1, t2;
#
-# Bug#48295:
-# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+# Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
#
-CREATE TABLE t1 (f1 INT);
-SELECT @@session.sql_mode INTO @old_sql_mode;
-SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-EXPLAIN EXTENDED SELECT 1 FROM t1
-WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-SHOW WARNINGS;
-Level Code Message
-Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
-SET SESSION sql_mode=@old_sql_mode;
-DROP TABLE t1;
+CREATE TABLE t1 (c int);
+INSERT INTO t1 VALUES (NULL);
+CREATE TABLE t2 (d int);
+INSERT INTO t2 VALUES (NULL), (0);
+EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 AS `1` from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from dual
+DROP TABLE t1, t2;
#
# Bug#30302: Tables that were optimized away are printed in the
# EXPLAIN EXTENDED warning.
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 64988f9de50..6bb628ed355 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1310,12 +1310,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select encode('','zxcv') AS `enc` from `test`.`t1`
+Note 1003 select encode(NULL,'zxcv') AS `enc` from `test`.`t1`
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1`
+Note 1003 select decode(NULL,'zxcv') AS `enc` from `test`.`t1`
drop table t1;
create table t1 (a bigint not null)engine=myisam;
insert into t1 set a = 1024*1024*1024*4;
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 28e798f5475..9e89dab28d0 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select count('0') AS `b` from dual where 0 having (`b` >= 0)
+Note 1003 select count(NULL) AS `b` from dual where 0 having (`b` >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 81cbfa0d94f..228ee24b086 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2295,6 +2295,28 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 1 Using index
drop table t1,t2;
#
+#
+# Bug #39653: find_shortest_key in sql_select.cc does not consider
+# clustered primary keys
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, d INT, e INT, f INT,
+KEY (b,c)) ENGINE=INNODB;
+INSERT INTO t1 VALUES (1,1,1,1,1,1), (2,2,2,2,2,2), (3,3,3,3,3,3),
+(4,4,4,4,4,4), (5,5,5,5,5,5), (6,6,6,6,6,6),
+(7,7,7,7,7,7), (8,8,8,8,8,8), (9,9,9,9,9,9),
+(11,11,11,11,11,11);
+EXPLAIN SELECT COUNT(*) FROM t1;
+id 1
+select_type SIMPLE
+table t1
+type index
+possible_keys NULL
+key b
+key_len 10
+ref NULL
+rows 10
+Extra Using index
+DROP TABLE t1;
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
new file mode 100644
index 00000000000..5d9be85a48a
--- /dev/null
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -0,0 +1,47 @@
+#
+# Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL
+#
+USE test;
+SET @saved_general_log = @@GLOBAL.general_log;
+SET GLOBAL general_log = OFF;
+USE mysql;
+FLUSH TABLES;
+REPAIR TABLE test.bug49823;
+Table Op Msg_type Msg_text
+test.bug49823 repair status OK
+RENAME TABLE general_log TO renamed_general_log;
+RENAME TABLE test.bug49823 TO general_log;
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.ndb_binlog_index OK
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.renamed_general_log OK
+mysql.servers OK
+mysql.slow_log
+Error : You can't use locks with log tables.
+status : OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+DROP TABLE general_log;
+RENAME TABLE renamed_general_log TO general_log;
+SET GLOBAL general_log = @saved_general_log;
+USE test;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 82655dd46ec..b08435cb1a7 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -2339,4 +2339,21 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+#
+# Bug#51304: checksum table gives different results
+# for same data when using bit fields
+#
+CREATE TABLE t1(a INT, b BIT(1));
+INSERT INTO t1 VALUES(1, 0), (2, 1);
+CREATE TABLE t2 SELECT * FROM t1;
+CHECKSUM TABLE t1 EXTENDED;
+Table Checksum
+test.t1 3775188275
+CHECKSUM TABLE t2 EXTENDED;
+Table Checksum
+test.t2 3775188275
+CHECKSUM TABLE t3 EXTENDED;
+Table Checksum
+test.t3 3775188275
+DROP TABLE t1, t2, t3;
End of 5.1 tests
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index a65360d83bb..8a676c30229 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4050,10 +4050,10 @@ join_0.c1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
+Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
SHOW WARNINGS;
Level Code Message
-Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
+Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
DROP TABLE t1;
SELECT 1 AS ` `;
@@ -4648,17 +4648,17 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select '0' AS `a`,'0' AS `b`,'0' AS `c` from `test`.`t1` where 1
+Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1
DROP TABLE t1;
#
# Bug#45266: Uninitialized variable lead to an empty result.
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 5825b984758..a567d30d203 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1496,7 +1496,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max('0') from `test`.`t2`)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(NULL) from `test`.`t2`)))
select * from t3 where a >= some (select b from t2);
a
explain extended select * from t3 where a >= some (select b from t2);
@@ -1504,7 +1504,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min('0') from `test`.`t2`)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(NULL) from `test`.`t2`)))
select * from t3 where a >= all (select b from t2 group by 1);
a
6
@@ -1515,7 +1515,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select '0' AS `b` from `test`.`t2` group by 1)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select NULL AS `b` from `test`.`t2` group by 1)))
select * from t3 where a >= some (select b from t2 group by 1);
a
explain extended select * from t3 where a >= some (select b from t2 group by 1);
@@ -1523,7 +1523,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
-Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select '0' AS `b` from `test`.`t2` group by 1)))
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select NULL AS `b` from `test`.`t2` group by 1)))
select * from t3 where NULL >= any (select b from t2);
a
explain extended select * from t3 where NULL >= any (select b from t2);
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 43d7cade227..98d177a5448 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1585,7 +1585,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 UNION t1 system NULL NULL NULL NULL 0 0.00 const row not found
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
Warnings:
-Note 1003 select '0' AS `a` from `test`.`t1` union select '0' AS `a` from `test`.`t1` order by `a`
+Note 1003 select NULL AS `a` from `test`.`t1` union select NULL AS `a` from `test`.`t1` order by `a`
DROP TABLE t1;
End of 5.0 tests
#
diff --git a/mysql-test/std_data/bug49823.CSM b/mysql-test/std_data/bug49823.CSM
new file mode 100644
index 00000000000..ee345049d99
--- /dev/null
+++ b/mysql-test/std_data/bug49823.CSM
Binary files differ
diff --git a/mysql-test/std_data/bug49823.CSV b/mysql-test/std_data/bug49823.CSV
new file mode 100644
index 00000000000..ffc319e2446
--- /dev/null
+++ b/mysql-test/std_data/bug49823.CSV
@@ -0,0 +1 @@
+"2010-02-26 13:32:26","root[root] @ localhost []",2,1,"Query","SELECT 1"
diff --git a/mysql-test/std_data/bug49823.frm b/mysql-test/std_data/bug49823.frm
new file mode 100644
index 00000000000..527807da1c9
--- /dev/null
+++ b/mysql-test/std_data/bug49823.frm
Binary files differ
diff --git a/mysql-test/suite/federated/federated.result b/mysql-test/suite/federated/federated.result
index 57f665995a1..db4ffc38213 100644
--- a/mysql-test/suite/federated/federated.result
+++ b/mysql-test/suite/federated/federated.result
@@ -2153,6 +2153,29 @@ DROP TABLE t1;
End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
+#
+# Bug #32426: FEDERATED query returns corrupt results for ORDER BY on a TEXT
+#
+CREATE TABLE federated.t1(a TEXT);
+INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
+CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+SELECT * FROM federated.t1 ORDER BY A;
+a
+abc
+de
+f
+gh
+ijk
+SELECT * FROM federated.t1 ORDER BY A DESC;
+a
+ijk
+gh
+f
+de
+abc
+DROP TABLE federated.t1;
+DROP TABLE federated.t1;
End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
diff --git a/mysql-test/suite/federated/federated.test b/mysql-test/suite/federated/federated.test
index 870bbcb8f71..a1d86462c11 100644
--- a/mysql-test/suite/federated/federated.test
+++ b/mysql-test/suite/federated/federated.test
@@ -1971,6 +1971,28 @@ connection default;
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
+
+--echo #
+--echo # Bug #32426: FEDERATED query returns corrupt results for ORDER BY on a TEXT
+--echo #
+connection slave;
+CREATE TABLE federated.t1(a TEXT);
+INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+SELECT * FROM federated.t1 ORDER BY A;
+SELECT * FROM federated.t1 ORDER BY A DESC;
+DROP TABLE federated.t1;
+
+connection slave;
+DROP TABLE federated.t1;
+
+connection default;
+
+
--echo End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
connection slave;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index 9fc48e32645..949baac58cc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -241,10 +241,12 @@ STOP SLAVE;
SET GLOBAL storage_engine=@storage_engine;
START SLAVE;
================ BUG#22864 ================
-STOP SLAVE;
-RESET SLAVE;
-RESET MASTER;
-START SLAVE;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
SET AUTOCOMMIT=0;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -264,15 +266,6 @@ t1
t2
t3
t4
-SELECT TABLE_NAME,ENGINE
-FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-TABLE_NAME ENGINE
-t1 MyISAM
-t2 InnoDB
-t3 InnoDB
-t4 InnoDB
SELECT * FROM t1 ORDER BY a;
a
1
@@ -334,15 +327,6 @@ t1
t2
t3
t4
-SELECT TABLE_NAME,ENGINE
-FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
-TABLE_NAME ENGINE
-t1 MyISAM
-t2 InnoDB
-t3 InnoDB
-t4 InnoDB
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
new file mode 100644
index 00000000000..da26190e76d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
@@ -0,0 +1,42 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+include/stop_slave.inc
+SELECT GET_LOCK("debug_lock.before_get_running_status_yes", 1000);
+GET_LOCK("debug_lock.before_get_running_status_yes", 1000)
+1
+set global debug= 'd,debug_lock.before_get_running_status_yes';
+Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running OFF
+Slave_IO_Running= No
+Slave_SQL_Running= No
+start slave io_thread;
+Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF NO NO in three following queries
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running OFF
+Slave_IO_Running= No
+Slave_SQL_Running= No
+SELECT RELEASE_LOCK("debug_lock.before_get_running_status_yes");
+RELEASE_LOCK("debug_lock.before_get_running_status_yes")
+1
+Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running OFF
+Slave_IO_Running= Yes
+Slave_SQL_Running= No
+start slave sql_thread;
+Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
+SHOW STATUS LIKE 'Slave_running';
+Variable_name Value
+Slave_running ON
+Slave_IO_Running= Yes
+Slave_SQL_Running= Yes
+set global debug= '';
+End of tests
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index a0c57b205ec..accbceff9f8 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -12,4 +12,5 @@
rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails
rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
+rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576
rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 7e3cb4a7a05..962c491353e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -136,13 +136,9 @@ START SLAVE;
# BUG#22864 (Rollback following CREATE ... SELECT discards 'CREATE
# table' from log):
--echo ================ BUG#22864 ================
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-connection master;
-RESET MASTER;
-connection slave;
-START SLAVE;
+
+--source include/master-slave-reset.inc
+
connection master;
SET AUTOCOMMIT=0;
CREATE TABLE t1 (a INT);
@@ -160,10 +156,6 @@ INSERT INTO t1 VALUES (4),(5),(6);
ROLLBACK;
SHOW TABLES;
-SELECT TABLE_NAME,ENGINE
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
@@ -173,10 +165,6 @@ SELECT * FROM t4 ORDER BY a;
SHOW BINLOG EVENTS FROM 107;
sync_slave_with_master;
SHOW TABLES;
-SELECT TABLE_NAME,ENGINE
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_NAME LIKE 't_'
-ORDER BY TABLE_NAME;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_running.test b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
new file mode 100644
index 00000000000..62cc311e6b2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
@@ -0,0 +1,76 @@
+#
+# Bug #30703 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS'
+# The test verifies that SHOW STATUS LIKE 'Slave_running' displays ON
+# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and Slave_SQL_Running
+#
+source include/master-slave.inc;
+source include/have_debug.inc;
+
+connection slave;
+
+source include/stop_slave.inc;
+let $debug_saved= `select @@global.debug`;
+let $debug_lock= "debug_lock.before_get_running_status_yes";
+eval SELECT GET_LOCK($debug_lock, 1000);
+set global debug= 'd,debug_lock.before_get_running_status_yes';
+
+# Test 1. Slave is stopped
+
+--echo Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
+
+SHOW STATUS LIKE 'Slave_running';
+let $status= query_get_value("show slave status", Slave_IO_Running, 1);
+echo Slave_IO_Running= $status;
+let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
+echo Slave_SQL_Running= $status;
+
+# Test 2. The slave IO thread is started but not yet got connected to master
+# and SQL thread is not started
+
+start slave io_thread;
+
+--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF NO NO in three following queries
+
+SHOW STATUS LIKE 'Slave_running';
+let $status= query_get_value("show slave status", Slave_IO_Running, 1);
+echo Slave_IO_Running= $status;
+let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
+echo Slave_SQL_Running= $status;
+
+# Test 3. The slave IO thread is started and got connected to master
+# and SQL thread is still not started
+
+eval SELECT RELEASE_LOCK($debug_lock);
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= YES;
+source include/wait_for_slave_param.inc;
+
+--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
+
+SHOW STATUS LIKE 'Slave_running';
+let $status= query_get_value("show slave status", Slave_IO_Running, 1);
+echo Slave_IO_Running= $status;
+let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
+echo Slave_SQL_Running= $status;
+
+# Test 4. The slave IO thread is started and got connected to master
+# and SQL thread is started
+
+start slave sql_thread;
+source include/wait_for_slave_sql_to_start.inc;
+
+--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
+
+SHOW STATUS LIKE 'Slave_running';
+let $status= query_get_value("show slave status", Slave_IO_Running, 1);
+echo Slave_IO_Running= $status;
+let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
+echo Slave_SQL_Running= $status;
+
+# cleanup
+
+connection slave;
+
+eval set global debug= '$debug_saved';
+
+--echo End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 6336e775af1..c5ee6793277 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -27,7 +27,7 @@ connection slave;
# Stop when reaching the the first table map event.
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762;
--- source include/wait_for_slave_sql_to_stop.inc
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
@@ -59,7 +59,7 @@ source include/show_binlog_events.inc;
connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
--- source include/wait_for_slave_sql_to_stop.inc
+source include/wait_for_slave_sql_to_stop.inc;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
sync_with_master;
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 7e2a9bdc811..30366f6f67e 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -147,7 +147,27 @@ EXPLAIN SELECT DISTINCT 1 FROM t1,
WHERE t1.a = d1.a;
DROP TABLE t1;
-# End of 5.0 tests.
+--echo #
+--echo # Bug#48295:
+--echo # explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+
+# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+EXPLAIN EXTENDED SELECT 1 FROM t1
+ WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
+SHOW WARNINGS;
+
+SET SESSION sql_mode=@old_sql_mode;
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests.
--echo #
--echo # Bug#37870: Usage of uninitialized value caused failed assertion.
@@ -168,24 +188,15 @@ SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR
drop tables t1, t2;
--echo #
---echo # Bug#48295:
---echo # explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+--echo # Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
--echo #
-CREATE TABLE t1 (f1 INT);
-
-SELECT @@session.sql_mode INTO @old_sql_mode;
-SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-
-# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
---error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
-EXPLAIN EXTENDED SELECT 1 FROM t1
- WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-SHOW WARNINGS;
-
-SET SESSION sql_mode=@old_sql_mode;
-
-DROP TABLE t1;
+CREATE TABLE t1 (c int);
+INSERT INTO t1 VALUES (NULL);
+CREATE TABLE t2 (d int);
+INSERT INTO t2 VALUES (NULL), (0);
+EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
+DROP TABLE t1, t2;
--echo #
--echo # Bug#30302: Tables that were optimized away are printed in the
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index 8432a209154..af1d7c577cc 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -558,6 +558,24 @@ drop table t1,t2;
--echo #
+--echo #
+--echo # Bug #39653: find_shortest_key in sql_select.cc does not consider
+--echo # clustered primary keys
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, d INT, e INT, f INT,
+ KEY (b,c)) ENGINE=INNODB;
+
+INSERT INTO t1 VALUES (1,1,1,1,1,1), (2,2,2,2,2,2), (3,3,3,3,3,3),
+ (4,4,4,4,4,4), (5,5,5,5,5,5), (6,6,6,6,6,6),
+ (7,7,7,7,7,7), (8,8,8,8,8,8), (9,9,9,9,9,9),
+ (11,11,11,11,11,11);
+
+--query_vertical EXPLAIN SELECT COUNT(*) FROM t1
+
+DROP TABLE t1;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/log_tables_upgrade.test b/mysql-test/t/log_tables_upgrade.test
new file mode 100644
index 00000000000..5d1b2b5aed6
--- /dev/null
+++ b/mysql-test/t/log_tables_upgrade.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_csv.inc
+
+# Only run test if "mysql_upgrade" is found
+--require r/have_mysql_upgrade.result
+--disable_query_log
+select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
+--enable_query_log
+
+--echo #
+--echo # Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL
+--echo #
+
+USE test;
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug49823.frm $MYSQLD_DATADIR/test/bug49823.frm;
+copy_file std_data/bug49823.CSM $MYSQLD_DATADIR/test/bug49823.CSM;
+copy_file std_data/bug49823.CSV $MYSQLD_DATADIR/test/bug49823.CSV;
+
+SET @saved_general_log = @@GLOBAL.general_log;
+SET GLOBAL general_log = OFF;
+USE mysql;
+FLUSH TABLES;
+REPAIR TABLE test.bug49823;
+RENAME TABLE general_log TO renamed_general_log;
+RENAME TABLE test.bug49823 TO general_log;
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+DROP TABLE general_log;
+RENAME TABLE renamed_general_log TO general_log;
+SET GLOBAL general_log = @saved_general_log;
+USE test;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index d12dbce1cc1..ea7ddc88b77 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1587,5 +1587,20 @@ REPLACE INTO t1 VALUES
CHECK TABLE t1;
DROP TABLE t1;
---echo End of 5.1 tests
+--echo #
+--echo # Bug#51304: checksum table gives different results
+--echo # for same data when using bit fields
+--echo #
+CREATE TABLE t1(a INT, b BIT(1));
+INSERT INTO t1 VALUES(1, 0), (2, 1);
+CREATE TABLE t2 SELECT * FROM t1;
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t3.frm
+--copy_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/t3.MYD
+--copy_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/t3.MYI
+CHECKSUM TABLE t1 EXTENDED;
+CHECKSUM TABLE t2 EXTENDED;
+CHECKSUM TABLE t3 EXTENDED;
+DROP TABLE t1, t2, t3;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 3ed1526f7ca..83d97954222 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -32,7 +32,7 @@ if (`SELECT $VALGRIND_TEST`)
# expected binaries it uses.
#
--echo Run mysql_upgrade once
---exec $MYSQL_UPGRADE --skip-verbose 2>&1
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
# It should have created a file in the MySQL Servers datadir
let $MYSQLD_DATADIR= `select @@datadir`;