From a8dacae6f65d87d620e4af17ea210349f9e25cba Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 12 Jan 2011 23:07:20 +0100 Subject: [PATCH 001/152] bumping version for 5.5.9 build --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f85cac84d7e..17335ff3fc5 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=9 +MYSQL_VERSION_PATCH=10 MYSQL_VERSION_EXTRA= From 246edcd2799036cb307d4557990fd6912952989f Mon Sep 17 00:00:00 2001 From: "sunanda.menon@oracle.com" <> Date: Thu, 13 Jan 2011 10:00:03 +0100 Subject: [PATCH 002/152] Raise version number after cloning 5.0.92 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 21386494bda..fda56554879 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.92) +AM_INIT_AUTOMAKE(mysql, 5.0.93) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=92 +NDB_VERSION_BUILD=93 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 1e749dbb4b1a1c5958f235d8d35f8462bf04ccd1 Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Thu, 13 Jan 2011 14:58:22 +0100 Subject: [PATCH 003/152] Raise version number after cloning 5.1.55 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7a35e8587d4..3849c362eec 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.55], [], [mysql]) +AC_INIT([MySQL Server], [5.1.56], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From fd5782dca76e7c6e2bfa64884d705d59f9aa848e Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 24 Jan 2011 13:41:44 +0100 Subject: [PATCH 004/152] Bug#59297: Can't find record in 'tablename' on update inner join Regression introduced in bug#52455. Problem was that the fixed function did not set the last used partition variable, resulting in wrong partition used when storing the position of the newly retrieved row. Fixed by setting the last used partition in ha_partition::index_read_idx_map. --- mysql-test/r/partition.result | 38 +++++++++++++++++++++++++++++++ mysql-test/t/partition.test | 43 +++++++++++++++++++++++++++++++++++ sql/ha_partition.cc | 1 + 3 files changed, 82 insertions(+) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 27ada9d1129..138264fd4e1 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,43 @@ drop table if exists t1, t2; # +# Bug#59297: Can't find record in 'tablename' on update inner join +# +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; +DROP TABLE t1; +# # Bug#57113: ha_partition::extra(ha_extra_function): # Assertion `m_extra_cache' failed CREATE TABLE t1 diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 0151820cef9..7a0a5558d32 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -14,6 +14,49 @@ drop table if exists t1, t2; --enable_warnings +--echo # +--echo # Bug#59297: Can't find record in 'tablename' on update inner join +--echo # + +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; + +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; + +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; + +DROP TABLE t1; + --echo # --echo # Bug#57113: ha_partition::extra(ha_extra_function): --echo # Assertion `m_extra_cache' failed diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 7bcbd241541..f55c48189fe 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4317,6 +4317,7 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index, break; } } + m_last_part= part; } else { From 3571aa4f71f61124df2cd6aaf8455071b9d5d61f Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 2 Feb 2011 10:38:50 +0300 Subject: [PATCH 005/152] Bug #59148 - made tests experimental --- mysql-test/collections/default.experimental | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index ea2f63314dd..0366bc7b949 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -30,6 +30,8 @@ sys_vars.rpl_semi_sync_master_enabled_basic # Bug #59148 2011-01-10 joro 'INSTAL sys_vars.rpl_semi_sync_master_timeout_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries sys_vars.rpl_semi_sync_master_trace_level_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries sys_vars.rpl_semi_sync_master_wait_no_slave_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries +rpl.rpl_semi_sync_event # Bug #59148 2011-02-02 svoj 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries +rpl.rpl_semi_sync # Bug #59148 2011-02-02 svoj 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries # BUG #59055 : All ndb tests should be removed from the repository # Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests From e960abc7cfd4823926f46a09768301902e497cd5 Mon Sep 17 00:00:00 2001 From: Dmitry Lenev Date: Mon, 7 Feb 2011 14:01:19 +0300 Subject: [PATCH 006/152] Fix for bug#36544 "DROP USER does not remove stored function privileges". The first problem was that DROP USER didn't properly remove privileges on stored functions from in-memory structures. So the dropped user could have called stored functions on which he had privileges before being dropped while his connection was still around. Even worse if a new user with the same name was created he would inherit privileges on stored functions from the dropped user. Similar thing happened with old user name and function privileges during RENAME USER. This problem stemmed from the fact that the handle_grant_data() function which handled DROP/RENAME USER didn't take any measures to update in-memory hash with information about function privileges after updating them on disk. This patch solves this problem by adding code doing just that. The second problem was that RENAME USER didn't properly update in-memory structures describing table-level privileges and privileges on stored procedures. As result such privileges could have been lost after a rename (i.e. not associated with the new name of user) and inherited by a new user with the same name as the old name of the original user. This problem was caused by code handling RENAME USER in handle_grant_struct() which [sic!]: a) tried to update wrong (tables) hash when updating stored procedure privileges for new user name. b) passed wrong arguments to function performing the hash update and didn't take into account the way in which such update could have changed the order of the hash elements. This patch solves this problem by ensuring that a) the correct hash is updated, b) correct arguments are used for the hash_update() function and c) we take into account possible changes in the order of hash elements. --- mysql-test/r/grant.result | 193 ++++++++++++++++++ .../funcs_1/r/innodb_storedproc_06.result | 4 - .../funcs_1/r/memory_storedproc_06.result | 4 - .../funcs_1/r/myisam_storedproc_06.result | 4 - mysql-test/t/grant.test | 177 ++++++++++++++++ sql/sql_acl.cc | 122 +++++++---- 6 files changed, 451 insertions(+), 53 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index e7ae6612746..bce330d380f 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1230,4 +1230,197 @@ DROP DATABASE mysqltest2; DROP USER testuser@localhost; use test; +# +# Test for bug #36544 "DROP USER does not remove stored function +# privileges". +# +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +# +# 1) Check that DROP USER properly removes privileges on both +# stored procedures and functions. +# +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +# +# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +# +# Switch to connection 'default'. +drop user mysqluser1@localhost; +# +# Test that dropping of user is properly reflected in +# both privilege tables and in in-memory structures. +# +# Switch to connection 'bug36544_con1'. +# The connection cold be alive but should not be able to +# access to any of the stored routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# Now create user with the same name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +# +# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +# Newly created user should not be able to access any of the routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# 2) Check that RENAME USER properly updates privileges on both +# stored procedures and functions. +# +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# +# Create one more user to make in-memory hashes non-trivial. +# User names 'mysqluser11' and 'mysqluser10' were selected +# to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +# Also create a couple of tables to test for another bug +# discovered during code inspection (again table names were +# chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Switch to connection 'bug36544_con2'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +rename user mysqluser1@localhost to mysqluser10@localhost; +# +# Test that there are no privileges left for mysqluser1. +# +# Switch to connection 'bug36544_con2'. +# The connection cold be alive but should not be able to +# access to any of the stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now create user with the old name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +# +# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +# Newly created user should not be able to access to any of the +# stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now check that privileges became associated with a new user +# name - mysqluser10. +# +show grants for mysqluser10@localhost; +Grants for mysqluser10@localhost +GRANT USAGE ON *.* TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +# +# Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; End of 5.0 tests diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result index 88bddf68e24..41d9fb0a1c7 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result @@ -131,10 +131,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Error 1133 Can't find any matching row in the user table -Error 1269 Can't revoke all privileges for one or more of the requested users -Warning 1405 Failed to revoke all privileges to dropped routine Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result index 88bddf68e24..41d9fb0a1c7 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result @@ -131,10 +131,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Error 1133 Can't find any matching row in the user table -Error 1269 Can't revoke all privileges for one or more of the requested users -Warning 1405 Failed to revoke all privileges to dropped routine Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result index 88bddf68e24..41d9fb0a1c7 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result @@ -131,10 +131,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Error 1133 Can't find any matching row in the user table -Error 1269 Can't revoke all privileges for one or more of the requested users -Warning 1405 Failed to revoke all privileges to dropped routine Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 21e3bbf5842..bf7b7ba4bb8 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1267,6 +1267,183 @@ DROP USER testuser@localhost; use test; --echo + +--echo # +--echo # Test for bug #36544 "DROP USER does not remove stored function +--echo # privileges". +--echo # +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +--echo # +--echo # 1) Check that DROP USER properly removes privileges on both +--echo # stored procedures and functions. +--echo # +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +--connect (bug36544_con1,localhost,mysqluser1,,) +call mysqltest1.p1(); +select mysqltest1.f1(); + +--echo # +--echo # Switch to connection 'default'. +--connection default +drop user mysqluser1@localhost; + +--echo # +--echo # Test that dropping of user is properly reflected in +--echo # both privilege tables and in in-memory structures. +--echo # +--echo # Switch to connection 'bug36544_con1'. +--connection bug36544_con1 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--disconnect bug36544_con1 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the same name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +--connect (bug36544_con2,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access any of the routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--echo # +--echo # Switch to connection 'default'. +--connection default + +--echo # +--echo # 2) Check that RENAME USER properly updates privileges on both +--echo # stored procedures and functions. +--echo # +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +--echo # +--echo # Create one more user to make in-memory hashes non-trivial. +--echo # User names 'mysqluser11' and 'mysqluser10' were selected +--echo # to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +--echo # Also create a couple of tables to test for another bug +--echo # discovered during code inspection (again table names were +--echo # chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; + +--echo # +--echo # Switch to connection 'default'. +--connection default +rename user mysqluser1@localhost to mysqluser10@localhost; + +--echo # +--echo # Test that there are no privileges left for mysqluser1. +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con2 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the old name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +--connect (bug36544_con3,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access to any of the +--echo # stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con3 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now check that privileges became associated with a new user +--echo # name - mysqluser10. +--echo # +show grants for mysqluser10@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +--connect (bug36544_con4,localhost,mysqluser10,,) +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; +--disconnect bug36544_con4 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; + + --echo End of 5.0 tests disconnect master; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index bf117874552..2484ad8edf4 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -5048,18 +5048,15 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, } -/* +/** Handle an in-memory privilege structure. - SYNOPSIS - handle_grant_struct() - struct_no The number of the structure to handle (0..3). - drop If user_from is to be dropped. - user_from The the user to be searched/dropped/renamed. - user_to The new name for the user if to be renamed, - NULL otherwise. + @param struct_no The number of the structure to handle (0..4). + @param drop If user_from is to be dropped. + @param user_from The the user to be searched/dropped/renamed. + @param user_to The new name for the user if to be renamed, NULL otherwise. - DESCRIPTION + @note Scan through all elements in an in-memory grant structure and apply the requested operation. Delete from grant structure if drop is true. @@ -5069,12 +5066,12 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, 0 acl_users 1 acl_dbs 2 column_priv_hash - 3 procs_priv_hash + 3 proc_priv_hash + 4 func_priv_hash - RETURN - > 0 At least one element matched. - 0 OK, but no element matched. - -1 Wrong arguments to function + @retval > 0 At least one element matched. + @retval 0 OK, but no element matched. + @retval -1 Wrong arguments to function. */ static int handle_grant_struct(uint struct_no, bool drop, @@ -5088,6 +5085,7 @@ static int handle_grant_struct(uint struct_no, bool drop, ACL_USER *UNINIT_VAR(acl_user); ACL_DB *UNINIT_VAR(acl_db); GRANT_NAME *UNINIT_VAR(grant_name); + HASH *UNINIT_VAR(grant_name_hash); DBUG_ENTER("handle_grant_struct"); DBUG_PRINT("info",("scan struct: %u search: '%s'@'%s'", struct_no, user_from->user.str, user_from->host.str)); @@ -5104,9 +5102,15 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: elements= column_priv_hash.records; + grant_name_hash= &column_priv_hash; break; case 3: elements= proc_priv_hash.records; + grant_name_hash= &proc_priv_hash; + break; + case 4: + elements= func_priv_hash.records; + grant_name_hash= &func_priv_hash; break; default: return -1; @@ -5136,16 +5140,13 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: - grant_name= (GRANT_NAME*) hash_element(&column_priv_hash, idx); + case 3: + case 4: + grant_name= (GRANT_NAME*) hash_element(grant_name_hash, idx); user= grant_name->user; host= grant_name->host.hostname; break; - case 3: - grant_name= (GRANT_NAME*) hash_element(&proc_priv_hash, idx); - user= grant_name->user; - host= grant_name->host.hostname; - break; default: assert(0); } @@ -5176,14 +5177,25 @@ static int handle_grant_struct(uint struct_no, bool drop, break; case 2: - hash_delete(&column_priv_hash, (byte*) grant_name); - break; - case 3: - hash_delete(&proc_priv_hash, (byte*) grant_name); + case 4: + hash_delete(grant_name_hash, (byte*) grant_name); break; } elements--; + /* + - If we are iterating through an array then we just have moved all + elements after the current element one position closer to its head. + This means that we have to take another look at the element at + current position as it is a new element from the array's tail. + - If we are iterating through a hash the current element was replaced + with one of elements from the tail. So we also have to take a look + at the new element in current position. + Note that in our HASH implementation hash_delete() won't move any + elements with position after current one to position before the + current (i.e. from the tail to the head), so it is safe to continue + iteration without re-starting. + */ idx--; } else if ( user_to ) @@ -5201,22 +5213,41 @@ static int handle_grant_struct(uint struct_no, bool drop, case 2: case 3: - /* - Update the grant structure with the new user name and - host name - */ - grant_name->set_user_details(user_to->host.str, grant_name->db, - user_to->user.str, grant_name->tname, - TRUE); + case 4: + { + /* + Save old hash key and its length to be able properly update + element position in hash. + */ + char *old_key= grant_name->hash_key; + size_t old_key_length= grant_name->key_length; - /* - Since username is part of the hash key, when the user name - is renamed, the hash key is changed. Update the hash to - ensure that the position matches the new hash key value - */ - hash_update(&column_priv_hash, (byte*) grant_name, - (byte *) grant_name->hash_key, grant_name->key_length); - break; + /* + Update the grant structure with the new user name and host name. + */ + grant_name->set_user_details(user_to->host.str, grant_name->db, + user_to->user.str, grant_name->tname, + TRUE); + + /* + Since username is part of the hash key, when the user name + is renamed, the hash key is changed. Update the hash to + ensure that the position matches the new hash key value + */ + hash_update(grant_name_hash, (byte*) grant_name, (byte*) old_key, + old_key_length); + /* + hash_update() operation could have moved element from the tail + of the hash to the current position. So we need to take a look + at the element in current position once again. + Thanks to the fact that hash_update() for our HASH implementation + won't move any elements from the tail of the hash to the positions + before the current one (a.k.a. head) it is safe to continue + iteration without restarting. + */ + idx--; + break; + } } } else @@ -5302,7 +5333,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop, } } - /* Handle procedures table. */ + /* Handle stored routines table. */ if ((found= handle_grant_table(tables, 4, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch in-memory array. */ @@ -5319,6 +5350,15 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop, if (! drop && ! user_to) goto end; } + /* Handle funcs array. */ + if (((handle_grant_struct(4, drop, user_from, user_to) && ! result) || + found) && ! result) + { + result= 1; /* At least one record/element found. */ + /* If search is requested, we do not need to search further. */ + if (! drop && ! user_to) + goto end; + } } /* Handle tables table. */ From e9fc441a525de89be0295ef1766c72a7e39c9b1d Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Fri, 11 Feb 2011 12:54:16 +0300 Subject: [PATCH 007/152] Bug#59685 crash in String::length with date types The crash happens because Item_cache which is result holder for Item_subselect can't correctly convert a DATETIME value from string to int representation. The fix is to disable constant item convertion for subselect(partial rollback of bug52157 fix). --- mysql-test/r/type_date.result | 12 ++++++++++++ mysql-test/t/type_date.test | 12 ++++++++++++ sql/item_cmpfunc.cc | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 41345be5b8d..17e617758b4 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -296,6 +296,18 @@ the_date the_time the_date the_time 2010-01-01 01:01:01 2010-01-01 01:01:01 DROP TABLE t1; DROP VIEW v1; +# +# Bug#59685 crash in String::length with date types +# +CREATE TABLE t1(a DATE, b YEAR, KEY(a)); +INSERT INTO t1 VALUES ('2011-01-01',2011); +SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1; +b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) +0 +SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1; +b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) +0 +DROP TABLE t1; End of 5.1 tests # # Bug #33629: last_day function can return null, but has 'not null' diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 6dec86dacab..9a21d8b370d 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -266,6 +266,18 @@ SELECT * FROM t1 JOIN v1 ON addtime( t1.the_date, t1.the_time ) = DROP TABLE t1; DROP VIEW v1; +--echo # +--echo # Bug#59685 crash in String::length with date types +--echo # + +CREATE TABLE t1(a DATE, b YEAR, KEY(a)); +INSERT INTO t1 VALUES ('2011-01-01',2011); + +SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1; +SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1; + +DROP TABLE t1; + --echo End of 5.1 tests --echo # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 67635c73b43..6be1d09323d 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -403,7 +403,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item, Field *field= field_item->field; int result= 0; - if ((*item)->const_item()) + if (!(*item)->with_subselect && (*item)->const_item()) { TABLE *table= field->table; ulonglong orig_sql_mode= thd->variables.sql_mode; From 77c0f33ee2b2ad46088364630275735f9d744ed2 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Fri, 11 Feb 2011 15:00:09 +0100 Subject: [PATCH 008/152] Fix for BUG#59894 "set optimizer_switch to e or d causes invalid memory writes/valgrind warnings": due to prefix support, the argument "e" was overwritten with its full value "engine_condition_pushdown", which caused a buffer overrun. This was wrong usage of find_type(); other wrong usages are fixed here too. Please start reading with the comment of typelib.c. --- client/mysqladmin.cc | 7 +-- client/mysqldump.c | 4 +- client/mysqltest.cc | 2 +- include/mysql.h.pp | 2 +- include/typelib.h | 14 +++++- mysql-test/r/mysqldump.result | 32 ++++++++++++ .../sys_vars/r/optimizer_switch_basic.result | 7 +++ .../sys_vars/t/optimizer_switch_basic.test | 8 +++ mysql-test/t/mysqldump.test | 10 ++++ mysys/default.c | 4 +- mysys/my_getopt.c | 4 +- mysys/typelib.c | 49 +++++++++---------- sql-common/client.c | 13 +++-- sql/sql_db.cc | 6 +-- sql/sql_handler.cc | 5 +- sql/sql_help.cc | 12 +++-- sql/strfunc.cc | 4 +- sql/table.cc | 4 +- storage/myisam/myisamchk.c | 5 +- storage/myisammrg/myrg_open.c | 6 +-- 20 files changed, 136 insertions(+), 62 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 580caa38c0d..82cea8e78c9 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -369,7 +369,8 @@ int main(int argc,char *argv[]) /* Return 0 if all commands are PING */ for (; argc > 0; argv++, argc--) { - if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING) + if (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) != + ADMIN_PING) { error= 1; break; @@ -592,7 +593,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) for (; argc > 0 ; argv++,argc--) { - switch (find_type(argv[0],&command_typelib,2)) { + switch (find_type(argv[0],&command_typelib, FIND_TYPE_BASIC)) { case ADMIN_CREATE: { char buff[FN_REFLEN+20]; @@ -931,7 +932,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (typed_password[0]) { - bool old= (find_type(argv[0], &command_typelib, 2) == + bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) == ADMIN_OLD_PASSWORD); #ifdef __WIN__ size_t pw_len= strlen(typed_password); diff --git a/client/mysqldump.c b/client/mysqldump.c index 66f0c2801f5..2dba7d7cfe8 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4644,7 +4644,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, for (; pos != end && *pos != ','; pos++) ; var_len= (uint) (pos - start); strmake(buff, start, min(sizeof(buff) - 1, var_len)); - find= find_type(buff, lib, var_len); + find= find_type(buff, lib, FIND_TYPE_BASIC); if (!find) { *err_pos= (char*) start; diff --git a/client/mysqltest.cc b/client/mysqltest.cc index ffc99a3dffd..dc1bba588f0 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8017,7 +8017,7 @@ void get_command_type(struct st_command* command) save= command->query[command->first_word_len]; command->query[command->first_word_len]= 0; - type= find_type(command->query, &command_typelib, 1+2); + type= find_type(command->query, &command_typelib, FIND_TYPE_NO_PREFIX); command->query[command->first_word_len]= save; if (type > 0) { diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0a5c3d83148..169a8b30e2b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -227,7 +227,7 @@ typedef struct st_typelib { extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/include/typelib.h b/include/typelib.h index 3badb14c96e..00dbafea34e 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,17 @@ typedef struct st_typelib { /* Different types saved here */ extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +#define FIND_TYPE_BASIC 0 +/** makes @c find_type() require the whole name, no prefix */ +#define FIND_TYPE_NO_PREFIX (1 << 0) +/** always implicitely on, so unused, but old code may pass it */ +#define FIND_TYPE_NO_OVERWRITE (1 << 1) +/** makes @c find_type() accept a number */ +#define FIND_TYPE_ALLOW_NUMBER (1 << 2) +/** makes @c find_type() treat ',' as terminator */ +#define FIND_TYPE_COMMA_TERM (1 << 3) + +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index dd3ea5e9716..7f480ac06df 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4593,3 +4593,35 @@ DROP TABLE `comment_table`; # # End of 5.1 tests # +# +# Verify that two modes can be given in --compatible; +# and are reflected in SET SQL_MODE in the mysqldump output. +# Also verify that a prefix of the mode's name is enough. +# +CREATE TABLE t1 (a INT); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +); +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index acc8cd699f8..dfd776c9970 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -60,6 +60,13 @@ set session optimizer_switch="index_merge"; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge' set session optimizer_switch="foobar"; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' +# +# Bug#59894 set optimizer_switch to e or d causes invalid +# memory writes/valgrind warnings + +set global optimizer_switch = 'd'; +set global optimizer_switch = 'e'; +ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'e' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test index 4267b3726aa..df1a3511fa1 100644 --- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test +++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test @@ -46,5 +46,13 @@ set session optimizer_switch="index_merge"; --error ER_WRONG_VALUE_FOR_VAR set session optimizer_switch="foobar"; +--echo # +--echo # Bug#59894 set optimizer_switch to e or d causes invalid +--echo # memory writes/valgrind warnings +--echo +set global optimizer_switch = 'd'; # means default +--error ER_WRONG_VALUE_FOR_VAR +set global optimizer_switch = 'e'; + SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 8ffa2e164cd..9e74023030e 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2182,5 +2182,15 @@ DROP TABLE `comment_table`; --echo # End of 5.1 tests --echo # +--echo # +--echo # Verify that two modes can be given in --compatible; +--echo # and are reflected in SET SQL_MODE in the mysqldump output. +--echo # Also verify that a prefix of the mode's name is enough. +--echo # +CREATE TABLE t1 (a INT); +# no_t = no_table_options; no_f = no_field_options +--exec $MYSQL_DUMP --compatible=no_t,no_f --skip-comments test +DROP TABLE t1; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysys/default.c b/mysys/default.c index 9a4b990f003..25cef2a3a7f 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -376,7 +376,7 @@ static int handle_default_option(void *in_ctx, const char *group_name, if (!option) return 0; - if (find_type((char *)group_name, ctx->group, 3)) + if (find_type((char *)group_name, ctx->group, FIND_TYPE_NO_PREFIX)) { if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1))) return 1; diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 6f7ed070ccf..ac4ae46eab5 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -695,7 +695,7 @@ static int setval(const struct my_option *opts, void *value, char *argument, break; case GET_ENUM: { - int type= find_type(argument, opts->typelib, 2); + int type= find_type(argument, opts->typelib, FIND_TYPE_BASIC); if (type == 0) { /* diff --git a/mysys/typelib.c b/mysys/typelib.c index 7681ff581ac..c0d37e26ecf 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) int res; const char **ptr; - if ((res= find_type((char *) x, typelib, 2)) <= 0) + if ((res= find_type((char *) x, typelib, FIND_TYPE_BASIC)) <= 0) { ptr= typelib->type_names; if (!*x) @@ -48,16 +48,13 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) Search after a string in a list of strings. Endspace in x is not compared. @param x String to find - @param lib TYPELIB (struct of pointer to values + count) - @param full_name bitmap of what to do - If & 1 accept only whole names - If & 2 don't expand if half field - If & 4 allow #number# as type - If & 8 use ',' as string terminator - - @note - If part, uniq field is found and full_name == 0 then x is expanded - to full field. + @param typelib TYPELIB (struct of pointer to values + count) + @param flags flags to tune behaviour: a combination of + FIND_TYPE_NO_PREFIX + FIND_TYPE_ALLOW_NUMBER + FIND_TYPE_COMMA_TERM. + FIND_TYPE_NO_OVERWRITE can be passed but is + superfluous (is always implicitely on). @retval -1 Too many matching values @@ -68,15 +65,17 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) */ -int find_type(char *x, const TYPELIB *typelib, uint full_name) +int find_type(const char *x, const TYPELIB *typelib, uint flags) { int find,pos; int UNINIT_VAR(findpos); /* guarded by find */ - reg1 char * i; - reg2 const char *j; + const char *i; + const char *j; DBUG_ENTER("find_type"); DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib)); + DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_ALLOW_NUMBER | + FIND_TYPE_NO_OVERWRITE | FIND_TYPE_COMMA_TERM))); if (!typelib->count) { DBUG_PRINT("exit",("no count")); @@ -86,24 +85,26 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) { for (i=x ; - *i && (!(full_name & 8) || !is_field_separator(*i)) && + *i && (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i)) && my_toupper(&my_charset_latin1,*i) == my_toupper(&my_charset_latin1,*j) ; i++, j++) ; if (! *j) { while (*i == ' ') i++; /* skip_end_space */ - if (! *i || ((full_name & 8) && is_field_separator(*i))) + if (! *i || ((flags & FIND_TYPE_COMMA_TERM) && is_field_separator(*i))) DBUG_RETURN(pos+1); } - if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) && - (!*j || !(full_name & 1))) + if ((!*i && + (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i))) && + (!*j || !(flags & FIND_TYPE_NO_PREFIX))) { find++; findpos=pos; } } - if (find == 0 && (full_name & 4) && x[0] == '#' && strend(x)[-1] == '#' && + if (find == 0 && (flags & FIND_TYPE_ALLOW_NUMBER) && x[0] == '#' && + strend(x)[-1] == '#' && (findpos=atoi(x+1)-1) >= 0 && (uint) findpos < typelib->count) find=1; else if (find == 0 || ! x[0]) @@ -111,13 +112,11 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) DBUG_PRINT("exit",("Couldn't find type")); DBUG_RETURN(0); } - else if (find != 1 || (full_name & 1)) + else if (find != 1 || (flags & FIND_TYPE_NO_PREFIX)) { DBUG_PRINT("exit",("Too many possybilities")); DBUG_RETURN(-1); } - if (!(full_name & 2)) - (void) strmov(x,typelib->type_names[findpos]); DBUG_RETURN(findpos+1); } /* find_type */ @@ -192,7 +191,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) x++; if (x[0] && x[1]) /* skip separator if found */ x++; - if ((find= find_type(i, lib, 2 | 8) - 1) < 0) + if ((find= find_type(i, lib, FIND_TYPE_COMMA_TERM) - 1) < 0) DBUG_RETURN(0); result|= (ULL(1) << find); } @@ -276,7 +275,7 @@ static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1, static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end) { const char *pos= *strpos; - uint find= find_type((char*)pos, lib, 8); + uint find= find_type(pos, lib, FIND_TYPE_COMMA_TERM); for (; pos != end && *pos != '=' && *pos !=',' ; pos++); *strpos= pos; return find; diff --git a/sql-common/client.c b/sql-common/client.c index 0ff03f6609b..90d07f3e409 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1145,10 +1145,10 @@ enum option_id { OPT_ssl_key, OPT_ssl_cert, OPT_ssl_ca, OPT_ssl_capath, OPT_character_sets_dir, OPT_default_character_set, OPT_interactive_timeout, OPT_connect_timeout, OPT_local_infile, OPT_disable_local_infile, - OPT_replication_probe, OPT_enable_reads_from_master, OPT_repl_parse_query, OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name, OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth, OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth, + OPT_keep_this_one_last }; static TYPELIB option_types={array_elements(default_options)-1, @@ -1198,6 +1198,9 @@ void mysql_read_default_options(struct st_mysql_options *options, DBUG_ENTER("mysql_read_default_options"); DBUG_PRINT("enter",("file: %s group: %s",filename,group ? group :"NULL")); + compile_time_assert(OPT_keep_this_one_last == + array_elements(default_options)); + argc=1; argv=argv_buff; argv_buff[0]= (char*) "client"; groups[0]= (char*) "client"; groups[1]= (char*) group; groups[2]=0; @@ -1222,7 +1225,7 @@ void mysql_read_default_options(struct st_mysql_options *options, /* Change all '_' in variable name to '-' */ for (end= *option ; *(end= strcend(end,'_')) ; ) *end= '-'; - switch (find_type(*option+2,&option_types,2)) { + switch (find_type(*option + 2, &option_types, FIND_TYPE_BASIC)) { case OPT_port: if (opt_arg) options->port=atoi(opt_arg); @@ -1338,8 +1341,8 @@ void mysql_read_default_options(struct st_mysql_options *options, options->max_allowed_packet= atoi(opt_arg); break; case OPT_protocol: - if ((options->protocol= find_type(opt_arg, - &sql_protocol_typelib,0)) <= 0) + if ((options->protocol= find_type(opt_arg, &sql_protocol_typelib, + FIND_TYPE_BASIC)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg); exit(1); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 38f39ec0be7..6c3024d16df 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1038,9 +1038,9 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, } if (!(extension= strrchr(file->name, '.'))) extension= strend(file->name); - if (find_type(extension, &deletable_extentions,1+2) <= 0) + if (find_type(extension, &deletable_extentions, FIND_TYPE_NO_PREFIX) <= 0) { - if (find_type(extension, ha_known_exts(),1+2) <= 0) + if (find_type(extension, ha_known_exts(), FIND_TYPE_NO_PREFIX) <= 0) *found_other_files= true; continue; } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index b5cd3ac9e9a..cd40af5a46d 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -613,7 +613,8 @@ retry: if (keyname) { - if ((keyno=find_type(keyname, &table->s->keynames, 1+2)-1)<0) + if ((keyno= find_type(keyname, &table->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0) { my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias); goto err; diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 7d106fbe936..858205f8da6 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -284,10 +284,12 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, Field *rtopic_id, *rkey_id; DBUG_ENTER("get_topics_for_keyword"); - if ((iindex_topic= find_type((char*) primary_key_name, - &topics->s->keynames, 1+2)-1)<0 || - (iindex_relations= find_type((char*) primary_key_name, - &relations->s->keynames, 1+2)-1)<0) + if ((iindex_topic= + find_type(primary_key_name, &topics->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0 || + (iindex_relations= + find_type(primary_key_name, &relations->s->keynames, + FIND_TYPE_NO_PREFIX) - 1) < 0) { my_message(ER_CORRUPT_HELP_DB, ER(ER_CORRUPT_HELP_DB), MYF(0)); DBUG_RETURN(-1); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index a0e2f39f8dc..0c0742b3805 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -96,7 +96,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, /* Function to find a string in a TYPELIB - (Same format as mysys/typelib.c) + (similar to find_type() of mysys/typelib.c) SYNOPSIS find_type() diff --git a/sql/table.cc b/sql/table.cc index 0ce7d7427d3..84aea77bc76 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1444,8 +1444,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, /* Fix key->name and key_part->field */ if (key_parts) { - uint primary_key=(uint) (find_type((char*) primary_key_name, - &share->keynames, 3) - 1); + uint primary_key=(uint) (find_type(primary_key_name, &share->keynames, + FIND_TYPE_NO_PREFIX) - 1); longlong ha_option= handler_file->ha_table_flags(); keyinfo= share->key_info; key_part= keyinfo->key_part; diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 35b68fe00df..d56f1e18930 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -673,7 +673,8 @@ get_one_option(int optid, int method; enum_mi_stats_method UNINIT_VAR(method_conv); myisam_stats_method_str= argument; - if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + if ((method= find_type(argument, &myisam_stats_method_typelib, + FIND_TYPE_BASIC)) <= 0) { fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index c545aff912f..533e5d13cdd 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { if (!strncmp(buff+1,"INSERT_METHOD=",14)) { /* Lookup insert method */ - int tmp=find_type(buff+15,&merge_insert_method,2); + int tmp= find_type(buff + 15, &merge_insert_method, FIND_TYPE_BASIC); found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); } continue; /* Skip comments */ @@ -271,7 +271,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, { /* Compare buffer with global methods list: merge_insert_method. */ insert_method= find_type(child_name_buff + 15, - &merge_insert_method, 2); + &merge_insert_method, FIND_TYPE_BASIC); } continue; } From 32e6d14728673debf6b005a4418248ae017d7ac3 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 11 Feb 2011 16:20:27 +0100 Subject: [PATCH 009/152] Bug #59686 crash in String::copy() with time data type The problem was that Item_sum_hybrid::val_xxx() did not propagate null values up the expression tree. --- mysql-test/r/func_time.result | 12 ++++++++++++ mysql-test/t/func_time.test | 8 ++++++++ sql/item_sum.cc | 20 ++++++++++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 2a95b234548..0ffc988519c 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1368,3 +1368,15 @@ SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR); SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR) NULL # +# Bug #59686 crash in String::copy() with time data type +# +SELECT min(timestampadd(month, 1>'', from_days('%Z'))); +min(timestampadd(month, 1>'', from_days('%Z'))) +NULL +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '%Z' +create table t1(a time); +insert into t1 values ('00:00:00'),('00:01:00'); +select 1 from t1 where 1 < some (select cast(a as datetime) from t1); +1 +drop table t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index eaa592c2ad5..0afc882ea6c 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -880,5 +880,13 @@ DROP TABLE t1; SELECT WEEK(STR_TO_DATE(NULL,0)); SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR); +--echo # +--echo # Bug #59686 crash in String::copy() with time data type --echo # +SELECT min(timestampadd(month, 1>'', from_days('%Z'))); + +create table t1(a time); +insert into t1 values ('00:00:00'),('00:01:00'); +select 1 from t1 where 1 < some (select cast(a as datetime) from t1); +drop table t1; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index adfa1ea66f0..8855ef05c84 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1903,7 +1903,10 @@ double Item_sum_hybrid::val_real() DBUG_ASSERT(fixed == 1); if (null_value) return 0.0; - return value->val_real(); + double retval= value->val_real(); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == 0.0); + return retval; } longlong Item_sum_hybrid::val_int() @@ -1911,7 +1914,10 @@ longlong Item_sum_hybrid::val_int() DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_int(); + longlong retval= value->val_int(); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == 0); + return retval; } @@ -1920,7 +1926,10 @@ my_decimal *Item_sum_hybrid::val_decimal(my_decimal *val) DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_decimal(val); + my_decimal *retval= value->val_decimal(val); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == NULL); + return retval; } @@ -1930,7 +1939,10 @@ Item_sum_hybrid::val_str(String *str) DBUG_ASSERT(fixed == 1); if (null_value) return 0; - return value->val_str(str); + String *retval= value->val_str(str); + if ((null_value= value->null_value)) + DBUG_ASSERT(retval == NULL); + return retval; } From 19fc30a6d7900b7725b6fe6f5ef248c40cce4143 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 17 Feb 2011 13:41:25 +0100 Subject: [PATCH 010/152] Bug #11766860 - 60085: CRASH IN ITEM::SAVE_IN_FIELD() WITH TIME DATA TYPE This assumption in Item_cache_datetime::cache_value_int was wrong: - /* Assume here that the underlying item will do correct conversion.*/ - int_value= example->val_int_result(); --- mysql-test/r/subselect_innodb.result | 9 ++++++ mysql-test/t/subselect_innodb.test | 9 ++++++ sql/item.cc | 41 ++++++++++++++++++++++++---- sql/item.h | 2 +- sql/item_cmpfunc.cc | 1 + sql/item_subselect.cc | 13 +++++---- 6 files changed, 62 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 6c6d563e284..ab623ad6a28 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -245,3 +245,12 @@ x NULL drop procedure p1; drop tables t1,t2,t3; +# +# Bug#60085 crash in Item::save_in_field() with time data type +# +CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; +INSERT INTO t1 VALUES ('2011-05-13', 0); +SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a); +a b +2011-05-13 0 +DROP TABLE t1; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 573fe0c1810..73491417e0c 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -238,3 +238,12 @@ call p1(); call p1(); drop procedure p1; drop tables t1,t2,t3; + +--echo # +--echo # Bug#60085 crash in Item::save_in_field() with time data type +--echo # + +CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; +INSERT INTO t1 VALUES ('2011-05-13', 0); +SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a); +DROP TABLE t1; diff --git a/sql/item.cc b/sql/item.cc index c7787d65c22..c15ef624a08 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1059,7 +1059,9 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions) ulonglong sql_mode= thd->variables.sql_mode; thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE); thd->count_cuted_fields= CHECK_FIELD_IGNORE; + res= save_in_field(field, no_conversions); + thd->count_cuted_fields= tmp; dbug_tmp_restore_column_map(table->write_set, old_map); thd->variables.sql_mode= sql_mode; @@ -7462,16 +7464,43 @@ longlong Item_cache_int::val_int() bool Item_cache_datetime::cache_value_int() { if (!example) - return FALSE; + return false; - value_cached= TRUE; + value_cached= true; // Mark cached string value obsolete - str_value_cached= FALSE; - /* Assume here that the underlying item will do correct conversion.*/ - int_value= example->val_int_result(); + str_value_cached= false; + + MYSQL_TIME ltime; + const bool eval_error= + (field_type() == MYSQL_TYPE_TIME) ? + example->get_time(<ime) : + example->get_date(<ime, TIME_FUZZY_DATE); + + if (eval_error) + int_value= 0; + else + { + switch(field_type()) + { + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + int_value= TIME_to_ulonglong_datetime(<ime); + break; + case MYSQL_TYPE_TIME: + int_value= TIME_to_ulonglong_time(<ime); + break; + default: + int_value= TIME_to_ulonglong_date(<ime); + break; + } + if (ltime.neg) + int_value= -int_value; + } + null_value= example->null_value; unsigned_flag= example->unsigned_flag; - return TRUE; + + return true; } diff --git a/sql/item.h b/sql/item.h index fc203f03e79..6cd91f03604 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3449,7 +3449,7 @@ class Item_cache_datetime: public Item_cache { protected: String str_value; - ulonglong int_value; + longlong int_value; bool str_value_cached; public: Item_cache_datetime(enum_field_types field_type_arg): diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 6be1d09323d..9586004c630 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -403,6 +403,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item, Field *field= field_item->field; int result= 0; + // TODO: revert Bug#59685 here, as we now cache datetimes correctly. if (!(*item)->with_subselect && (*item)->const_item()) { TABLE *table= field->table; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 6b54a088112..118bae7342f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -256,30 +256,31 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery, bool Item_subselect::exec() { - int res; + DBUG_ENTER("Item_subselect::exec"); /* Do not execute subselect in case of a fatal error or if the query has been killed. */ if (thd->is_error() || thd->killed) - return 1; + DBUG_RETURN(true); DBUG_ASSERT(!thd->lex->context_analysis_only); /* Simulate a failure in sub-query execution. Used to test e.g. out of memory or query being killed conditions. */ - DBUG_EXECUTE_IF("subselect_exec_fail", return 1;); + DBUG_EXECUTE_IF("subselect_exec_fail", DBUG_RETURN(true);); - res= engine->exec(); + bool res= engine->exec(); if (engine_changed) { engine_changed= 0; - return exec(); + res= exec(); + DBUG_RETURN(res); } - return (res); + DBUG_RETURN(res); } Item::Type Item_subselect::type() const From 8576d2a118f13842892d774383579e94cd02d6fb Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 17 Feb 2011 13:57:42 +0100 Subject: [PATCH 011/152] Revert 59685, as we now cache datetimes correctly. See also bug 11775312, all queries listed there now have the same results here, as they have in 5.1 --- mysql-test/r/type_date.result | 4 ++-- sql/item_cmpfunc.cc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 17e617758b4..96bd025aaed 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -303,10 +303,10 @@ CREATE TABLE t1(a DATE, b YEAR, KEY(a)); INSERT INTO t1 VALUES ('2011-01-01',2011); SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1; b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) -0 +1 SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1; b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) -0 +1 DROP TABLE t1; End of 5.1 tests # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9586004c630..67635c73b43 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -403,8 +403,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item, Field *field= field_item->field; int result= 0; - // TODO: revert Bug#59685 here, as we now cache datetimes correctly. - if (!(*item)->with_subselect && (*item)->const_item()) + if ((*item)->const_item()) { TABLE *table= field->table; ulonglong orig_sql_mode= thd->variables.sql_mode; From e73cd9b6c2a92a5132b59b9cc9c14b54e6739f3b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 17 Feb 2011 10:10:37 -0800 Subject: [PATCH 012/152] Merge README update into the 5.5.10 release clone. --- README | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README b/README index 48948352e12..2e18fb55a22 100644 --- a/README +++ b/README @@ -3,18 +3,29 @@ MySQL Server This is a release of MySQL, a dual-license SQL database server. For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. -MySQL is brought to you by the MySQL team at Oracle. +MySQL is brought to you by Oracle. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. +MySQL FOSS License Exception +We want free and open source software applications under certain +licenses to be able to use specified GPL-licensed MySQL client +libraries despite the fact that not all such FOSS licenses are +compatible with version 2 of the GNU General Public License. +Therefore there are special exceptions to the terms and conditions +of the GPLv2 as applied to these client libraries, which are +identified and described in more detail in the FOSS License +Exception at +. + This distribution may include materials developed by third parties. For license and attribution notices for these materials, please refer to the documentation that accompanies -this distribution (see the Licenses for Third-Party Components -appendix). A copy of the license/notices is also reproduced -below. +this distribution (see the "Licenses for Third-Party Components" +appendix) or view the online documentation at +. GPLv2 Disclaimer For the avoidance of doubt, except that if any license choice @@ -38,8 +49,6 @@ Some Reference Manual sections of special interest: chapter. - For the new features/bugfix history, see the MySQL Change History appendix. -- For currently known bugs, see the Errors and Common Problems - appendix. You can browse the MySQL Reference Manual online or download it in any of several formats at the URL given earlier in this file. From eea75513c22f074c6d7e46f14acf693bcbb0da56 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Thu, 17 Feb 2011 19:36:19 +0100 Subject: [PATCH 013/152] The client shared library major version was changed to 18, to reflect ABI changes (Bug#60061) Bumping the version from 16 to 18, instead of 17, was done to avoid a library conflict on Mac OS X between MySQL 5.1 and MySQL 5.5. In MySQL 5.1 GNU libtool was used, that made the ABI version used in the file name to be 16, and the one stored inside the binary to be 17. MySQL 5.5 uses CMake as a build tool, that will store the same ABI number in the file name as inside the binary in Mac OS X, and then bumping the ABI number two steps avoids a conflict on Mac OS X. --- cmake/mysql_version.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 3ed93020e8a..5aca3c825a6 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -17,7 +17,7 @@ # Global constants, only to be changed between major releases. # -SET(SHARED_LIB_MAJOR_VERSION "16") +SET(SHARED_LIB_MAJOR_VERSION "18") SET(PROTOCOL_VERSION "10") SET(DOT_FRM_VERSION "6") From 562978e1abaa7f2b073e6192173f009c358e8ac4 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Mon, 21 Feb 2011 13:56:43 +0100 Subject: [PATCH 014/152] Bug #11766640 (59789) Hook the invocation of unit tests in MTR. Added code to call 'ctest' if the needed cmake file is present Will do so unless tests/suited named on mtr command line Also add option to turn on/off Will be made to look like a test 'unit-test' which counts towards total Extracts summary report and any test failures from ctest output Addendum: added override to turn off in PB, add back in selected invocations --- mysql-test/collections/default.daily | 2 +- mysql-test/collections/default.push | 2 +- mysql-test/collections/test-bt | 2 +- mysql-test/collections/test-bt-debug | 2 +- mysql-test/collections/test-bt-fast | 2 +- mysql-test/lib/mtr_report.pm | 2 +- mysql-test/mysql-test-run.pl | 89 ++++++++++++++++++++++++++++ 7 files changed, 95 insertions(+), 6 deletions(-) diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily index 75c03d4d47b..b1f3b97ae20 100644 --- a/mysql-test/collections/default.daily +++ b/mysql-test/collections/default.daily @@ -1,5 +1,5 @@ -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol diff --git a/mysql-test/collections/default.push b/mysql-test/collections/default.push index a213706498e..c8402aecd75 100644 --- a/mysql-test/collections/default.push +++ b/mysql-test/collections/default.push @@ -1,4 +1,4 @@ -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 --skip-test-list=collections/disabled-per-push.list +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 --skip-test-list=collections/disabled-per-push.list --unit-tests 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 --skip-test-list=collections/disabled-per-push.list 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 --skip-test-list=collections/disabled-per-push.list diff --git a/mysql-test/collections/test-bt b/mysql-test/collections/test-bt index 58f0c2c3cde..f35d2213769 100644 --- a/mysql-test/collections/test-bt +++ b/mysql-test/collections/test-bt @@ -1,4 +1,4 @@ -perl mysql-test-run.pl --force --timer --parallel=auto --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental --unit-tests perl mysql-test-run.pl --force --timer --parallel=auto --comment=ps --skip-ndbcluster --ps-protocol --experimental=collections/default.experimental perl mysql-test-run.pl --force --timer --parallel=auto --comment=funcs1+ps --suite=funcs_1 --ps-protocol --experimental=collections/default.experimental perl mysql-test-run.pl --force --timer --parallel=auto --comment=funcs2 --suite=funcs_2 --experimental=collections/default.experimental diff --git a/mysql-test/collections/test-bt-debug b/mysql-test/collections/test-bt-debug index 5fc1e15e0d2..ffb9f07b69f 100644 --- a/mysql-test/collections/test-bt-debug +++ b/mysql-test/collections/test-bt-debug @@ -1 +1 @@ -perl mysql-test-run.pl --force --timer --parallel=auto --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental --unit-tests diff --git a/mysql-test/collections/test-bt-fast b/mysql-test/collections/test-bt-fast index 7978c8082f0..de1bdc687cb 100644 --- a/mysql-test/collections/test-bt-fast +++ b/mysql-test/collections/test-bt-fast @@ -1,2 +1,2 @@ -perl mysql-test-run.pl --force --timer --parallel=auto --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental --unit-tests perl mysql-test-run.pl --force --timer --parallel=auto --comment=stress --suite=stress --experimental=collections/default.experimental diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index f86be0d4c68..dcf83260720 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -72,7 +72,7 @@ sub _mtr_report_test_name ($) { print _name(). _timestamp(); printf "%-40s ", $tname; my $worker = $tinfo->{worker}; - printf "w$worker " if $worker; + print "w$worker " if defined $worker; return $tname; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a1e02a56164..05bfd4eae02 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -194,6 +194,10 @@ my $opt_debug_common; our $opt_debug_server; our @opt_cases; # The test cases names in argv our $opt_embedded_server; +# -1 indicates use default, override with env.var. +my $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1); +# Unit test report stored here for delayed printing +my $ctest_report; # Options used when connecting to an already running server my %opts_extern; @@ -493,6 +497,10 @@ sub main { mtr_error("Not all tests completed"); } + mark_time_used('init'); + + push @$completed, run_ctest() if $opt_ctest; + mtr_print_line(); if ( $opt_gcov ) { @@ -500,6 +508,8 @@ sub main { $opt_gcov_msg, $opt_gcov_err); } + print "$ctest_report\n" if $ctest_report; + print_total_times($opt_parallel) if $opt_report_times; mtr_report_stats("Completed", $completed); @@ -1055,6 +1065,7 @@ sub command_line_setup { 'max-connections=i' => \$opt_max_connections, 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, + 'unit-tests!' => \$opt_ctest, 'help|h' => \$opt_usage, # list-options is internal, not listed in help @@ -1484,6 +1495,14 @@ sub command_line_setup { if $opt_suites || @opt_cases; } + # -------------------------------------------------------------------------- + # Don't run ctest if tests or suites named + # -------------------------------------------------------------------------- + + $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases); + # Override: disable if running in the PB test environment + $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR}; + # -------------------------------------------------------------------------- # Check use of wait-all # -------------------------------------------------------------------------- @@ -5653,6 +5672,73 @@ sub valgrind_exit_reports() { return $found_err; } +sub run_ctest() { + my $olddir= getcwd(); + chdir ($bindir) or die ("Could not chdir to $bindir"); + my $tinfo; + my $no_ctest= (IS_WINDOWS) ? 256 : -1; + + # Just ignore if not configured/built to run ctest + if (! -f "CTestTestfile.cmake") { + chdir($olddir); + return; + } + + # Also silently ignore if we don't have ctest and didn't insist + # Now, run ctest and collect output + my $ctest_out= `ctest 2>&1`; + if ($? == $no_ctest && $opt_ctest == -1) { + chdir($olddir); + return; + } + + # Create minimalistic "test" for the reporting + $tinfo = My::Test->new + ( + name => 'unit_tests', + ); + # Set dummy worker id to align report with normal tests + $tinfo->{worker} = 0 if $opt_parallel > 1; + + my $ctfail= 0; # Did ctest fail? + if ($?) { + $ctfail= 1; + $tinfo->{result}= 'MTR_RES_FAILED'; + $tinfo->{comment}= "ctest failed with exit code $?, see result below"; + $ctest_out= "" unless $ctest_out; + } + my $ctfile= "$opt_vardir/ctest.log"; + my $ctres= 0; # Did ctest produce report summary? + + open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile"); + + # Put ctest output in log file, while analyzing results + for (split ('\n', $ctest_out)) { + print CTEST "$_\n"; + if (/tests passed/) { + $ctres= 1; + $ctest_report .= "\nUnit tests: $_\n"; + } + if ( /FAILED/ or /\(Failed\)/ ) { + $ctfail= 1; + $ctest_report .= " $_\n"; + } + } + close CTEST; + + # Set needed 'attributes' for test reporting + $tinfo->{comment}.= "\nctest did not pruduce report summary" if ! $ctres; + $tinfo->{result}= ($ctres && !$ctfail) + ? 'MTR_RES_PASSED' : 'MTR_RES_FAILED'; + $ctest_report .= "Report from unit tests in $ctfile\n"; + $tinfo->{failures}= ($tinfo->{result} eq 'MTR_RES_FAILED'); + + mark_time_used('test'); + mtr_report_test($tinfo); + chdir($olddir); + return $tinfo; +} + # # Usage # @@ -5871,6 +5957,9 @@ Misc options engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. + nounit-tests Do not run unit tests. Normally run if configured + and if not running named tests/suites + unit-tests Run unit tests even if they would otherwise not be run Some options that control enabling a feature for normal test runs, can be turned off by prepending 'no' to the option, e.g. --notimer. From 1f9d8cd862a5a4599ebc141c2334b4661841d280 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 23 Feb 2011 10:31:37 +0100 Subject: [PATCH 015/152] Bug #11762407 54999: MTR GLOBAL SUPPRESSION HIDES SQL THREAD EXECUTION UNEXPECTED ERRORS Removed the global suppression, added lots of local ones to affected tests Re-commit, now kept "Slave SQL" at start of patterns. --- mysql-test/extra/binlog_tests/binlog.test | 1 + mysql-test/extra/rpl_tests/rpl_conflicts.test | 2 ++ mysql-test/extra/rpl_tests/rpl_extra_col_master.test | 6 ++++++ mysql-test/extra/rpl_tests/rpl_extra_col_slave.test | 4 ++++ mysql-test/extra/rpl_tests/rpl_loaddata.test | 2 ++ mysql-test/extra/rpl_tests/rpl_row_basic.test | 4 +++- mysql-test/extra/rpl_tests/rpl_row_tabledefs.test | 1 + mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test | 1 + mysql-test/include/mtr_warnings.sql | 1 - mysql-test/suite/binlog/r/binlog_base64_flag.result | 2 ++ mysql-test/suite/binlog/r/binlog_row_binlog.result | 1 + mysql-test/suite/binlog/r/binlog_stm_binlog.result | 1 + mysql-test/suite/binlog/t/binlog_base64_flag.test | 2 ++ mysql-test/suite/rpl/r/rpl_binlog_corruption.result | 1 + .../suite/rpl/r/rpl_binlog_max_cache_size.result | 1 + mysql-test/suite/rpl/r/rpl_bug33931.result | 1 + .../suite/rpl/r/rpl_circular_for_4_hosts.result | 1 + .../suite/rpl/r/rpl_extra_col_master_innodb.result | 12 ++++++++++++ .../suite/rpl/r/rpl_extra_col_master_myisam.result | 12 ++++++++++++ .../suite/rpl/r/rpl_extra_col_slave_innodb.result | 3 +++ .../suite/rpl/r/rpl_extra_col_slave_myisam.result | 3 +++ .../suite/rpl/r/rpl_filter_tables_not_exist.result | 1 + mysql-test/suite/rpl/r/rpl_idempotency.result | 7 ++++--- mysql-test/suite/rpl/r/rpl_ignore_table.result | 1 + mysql-test/suite/rpl/r/rpl_incident.result | 1 + mysql-test/suite/rpl/r/rpl_init_slave_errors.result | 2 +- .../suite/rpl/r/rpl_known_bugs_detection.result | 1 + mysql-test/suite/rpl/r/rpl_loaddata.result | 2 ++ .../suite/rpl/r/rpl_loaddata_concurrent.result | 2 ++ mysql-test/suite/rpl/r/rpl_loaddata_fatal.result | 1 + mysql-test/suite/rpl/r/rpl_rotate_logs.result | 1 + mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result | 1 + mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result | 2 ++ mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result | 2 ++ mysql-test/suite/rpl/r/rpl_row_colSize.result | 1 + mysql-test/suite/rpl/r/rpl_row_conflicts.result | 2 ++ mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result | 1 + .../suite/rpl/r/rpl_row_tabledefs_2myisam.result | 1 + .../suite/rpl/r/rpl_row_tabledefs_3innodb.result | 1 + mysql-test/suite/rpl/r/rpl_skip_error.result | 1 + mysql-test/suite/rpl/r/rpl_slave_grp_exec.result | 1 + .../suite/rpl/r/rpl_slave_load_remove_tmpfile.result | 1 + .../rpl/r/rpl_slave_load_tmpdir_not_exist.result | 1 + mysql-test/suite/rpl/r/rpl_stm_EE_err2.result | 1 + mysql-test/suite/rpl/r/rpl_stm_conflicts.result | 1 + mysql-test/suite/rpl/r/rpl_temporary_errors.result | 1 + mysql-test/suite/rpl/t/rpl_binlog_corruption.test | 2 +- .../suite/rpl/t/rpl_binlog_max_cache_size.test | 1 + mysql-test/suite/rpl/t/rpl_bug33931.test | 1 + mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test | 1 + .../suite/rpl/t/rpl_filter_tables_not_exist.test | 2 ++ mysql-test/suite/rpl/t/rpl_idempotency.test | 7 ++++--- mysql-test/suite/rpl/t/rpl_ignore_table.test | 1 + mysql-test/suite/rpl/t/rpl_incident.test | 1 + mysql-test/suite/rpl/t/rpl_init_slave_errors.test | 2 +- mysql-test/suite/rpl/t/rpl_known_bugs_detection.test | 1 + mysql-test/suite/rpl/t/rpl_loaddata_fatal.test | 1 + mysql-test/suite/rpl/t/rpl_rotate_logs.test | 1 + mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test | 1 + mysql-test/suite/rpl/t/rpl_row_colSize.test | 3 +++ mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test | 1 + mysql-test/suite/rpl/t/rpl_skip_error.test | 2 ++ mysql-test/suite/rpl/t/rpl_slave_grp_exec.test | 1 + .../suite/rpl/t/rpl_slave_load_remove_tmpfile.test | 1 + .../suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test | 1 + mysql-test/suite/rpl/t/rpl_temporary_errors.test | 3 +++ 66 files changed, 122 insertions(+), 11 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index fd6ba1c17fa..a776ba5eaf6 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -343,6 +343,7 @@ SHOW SESSION VARIABLES LIKE "%_checks"; --echo # INSERT INTO t1 VALUES(2) --echo # foreign_key_checks=1 and unique_checks=1 --echo # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); --error 1062 BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test index 943d254736d..866a31e92b0 100644 --- a/mysql-test/extra/rpl_tests/rpl_conflicts.test +++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test @@ -93,6 +93,7 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC source include/wait_for_slave_sql_error.inc; let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); --echo Last_SQL_Error = $err (expected "duplicate key" error) + call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; --echo ---- Resolve the conflict on the slave and restart SQL thread ---- @@ -137,6 +138,7 @@ connection slave; # replication continues. if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) { --echo ---- Wait until slave stops with an error ---- + call mtr.add_suppression("Can.t find record in .t1., Error_code: 1032"); let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index eb50149655e..6dba4202260 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -121,6 +121,12 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; #connection slave; + +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); + sync_slave_with_master; --echo --echo * Select count and 20 rows from Slave * diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test index 882ef2c4e63..cb2421d5d74 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test @@ -766,6 +766,10 @@ RESET MASTER; connection slave; START SLAVE; +call mtr.add_suppression("Slave SQL.*Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); + --echo *** Master Data Insert *** connection master; set @b1 = 'b1b1b1b1'; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index 4a21123e8a1..ae04c1b4aaa 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -63,6 +63,8 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index c8de853a297..70b4edceb27 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -371,7 +371,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); connection slave; -# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); --let $slave_sql_errno= 1535 --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index ee6205c79d8..4e15a5a98ff 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -147,6 +147,7 @@ sync_slave_with_master; connection master; INSERT INTO t4 VALUES (4); connection slave; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); --let $slave_skip_counter= 2 --let $slave_sql_errno= 1535 --let $show_slave_sql_error= 1 diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test index d4140785878..cc69c08fe7c 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test @@ -25,6 +25,7 @@ drop table t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); --echo Error: "$error" (expected different error codes on master and slave) diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 9dc64952979..30919dd10dc 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -107,7 +107,6 @@ INSERT INTO global_suppressions VALUES ("Slave: The incident LOST_EVENTS occured on the master"), ("Slave: Unknown error.* 1105"), ("Slave: Can't drop database.* database doesn't exist"), - ("Slave SQL:.*(Error_code: \[\[:digit:\]\]+|Query:.*)"), ("Sort aborted"), ("Time-out in NDB"), ("Warning:\s+One can only use the --user.*root"), diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 7fb5e50a219..a4c610c845a 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -91,6 +91,8 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== '; ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info drop table t1, char63_utf8, char128_utf8; +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); # # Bug #54393: crash and/or valgrind errors in # mysql_client_binlog_statement diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 1678f8add58..e726d236323 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1374,6 +1374,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 872a93bef43..5a06bb72b90 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -845,6 +845,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index 3f1e4e98bec..296c4bf05aa 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -151,6 +151,8 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== drop table t1, char63_utf8, char128_utf8; +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); --echo # --echo # Bug #54393: crash and/or valgrind errors in diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result index 4f1eca42e1a..a2a065e0a4f 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression('Found invalid event in binary log'); +call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); ==== Initialize ==== include/stop_slave.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result index a7e8b86ac79..2d5676a82d6 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result @@ -125,6 +125,7 @@ include/stop_slave.inc include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result index d27308db1d5..ce8b6b169c7 100644 --- a/mysql-test/suite/rpl/r/rpl_bug33931.result +++ b/mysql-test/suite/rpl/r/rpl_bug33931.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593"); include/stop_slave.inc reset slave; SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 6981e549918..412021d6446 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -46,6 +46,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; include/start_slave.inc INSERT INTO t1 VALUES(6,'C',2); INSERT INTO t1(b,c) VALUES('B',2); +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); include/wait_for_slave_sql_error.inc [errno=1062] INSERT INTO t1(b,c) VALUES('A',2); INSERT INTO t1(b,c) VALUES('D',2); diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index affb179d50e..f235c68cc95 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -58,6 +58,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * @@ -929,6 +933,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * @@ -1800,6 +1808,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index 8aeb5bdc1c9..52f4a7a8453 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -58,6 +58,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * @@ -929,6 +933,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * @@ -1800,6 +1808,10 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); +call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); +call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); +call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); * Select count and 20 rows from Slave * diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index 9ea319379c0..e71f408ae85 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -460,6 +460,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB'; RESET MASTER; *** Start Slave *** START SLAVE; +call mtr.add_suppression("Slave SQL.*Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 716a35b3464..51ca555b545 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -460,6 +460,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM'; RESET MASTER; *** Start Slave *** START SLAVE; +call mtr.add_suppression("Slave SQL.*Error .Unknown table .t6.. on query.* Error_code: 1051"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate column name .c6.. on query.* Error_code: 1060"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index 4eaf61e5f9e..c88dcee9dbc 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -42,6 +42,7 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1; UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1; +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; include/wait_for_slave_sql_error_and_skip.inc [errno=1146] Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'' diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index 1ae2d0b9ee5..8ccef65a192 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -1,8 +1,9 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SET @old_slave_exec_mode= @@global.slave_exec_mode; CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index 2e3fd62fbec..b92f97e24ee 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -112,6 +112,7 @@ show grants for mysqltest4@localhost; Grants for mysqltest4@localhost GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' set global slave_exec_mode='IDEMPOTENT'; +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); drop table t1, mysqltest2.t2; drop table t4; drop database mysqltest2; diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result index b54d7d400f7..d528fb3297a 100644 --- a/mysql-test/suite/rpl/r/rpl_incident.result +++ b/mysql-test/suite/rpl/r/rpl_incident.result @@ -15,6 +15,7 @@ a 2 3 4 +call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590"); include/wait_for_slave_sql_error.inc [errno=1590] Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: ' **** On Slave **** diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result index 46bc66cbb65..a185afc5af2 100644 --- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result +++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result @@ -6,7 +6,7 @@ SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on start slave; include/wait_for_slave_sql_error.inc [errno=1593] Last_SQL_Error = 'Failed during slave thread initialization' -call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Failed during slave.* thread initialization"); SET GLOBAL debug= ""; reset slave; SET GLOBAL init_slave= "garbage"; diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 52980e81523..972e877bf18 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -7,6 +7,7 @@ SELECT * FROM t1; a b 1 10 2 2 +call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); include/wait_for_slave_sql_error.inc [errno=1105] Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'' SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index bd8bc5093aa..c4bcb692133 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -27,6 +27,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result index bc40f32842d..d1c7bf65624 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result @@ -38,6 +38,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index a81813de19f..b13e2ced183 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -3,6 +3,7 @@ include/master-slave.inc CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); include/wait_for_slave_sql_error_and_skip.inc [errno=1593] Last_SQL_Error = 'Fatal error: Not enough memory' DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index e41f56c0a71..1166b0d18a9 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -36,6 +36,7 @@ drop table temp_table, t3; insert into t2 values(1234); set insert_id=1234; insert into t2 values(NULL); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] purge master logs to 'master-bin.000002'; show master logs; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index d769b0b0881..0f2db9cbf1d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -63,6 +63,7 @@ DROP TABLE t1; include/rpl_reset.inc **** On Slave **** SET GLOBAL QUERY_CACHE_SIZE=0; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); **** On Master **** CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 7afc70bfa5c..4f051d19e4b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -478,6 +478,8 @@ include/diff_tables.inc [master:t2, slave:t2] [expecting slave to stop] INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); include/wait_for_slave_sql_error.inc [errno=1535] Last_SQL_Error = 'Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.' include/rpl_reset.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index b8620894bd1..1ae1cd84579 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -478,6 +478,8 @@ include/diff_tables.inc [master:t2, slave:t2] [expecting slave to stop] INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); include/wait_for_slave_sql_error.inc [errno=1535] Last_SQL_Error = 'Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.' include/rpl_reset.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 49753d2b25c..d31f6d1c54e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -265,6 +265,7 @@ STOP SLAVE; RESET SLAVE; RESET MASTER; START SLAVE; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); *** Cleanup *** DROP TABLE IF EXISTS t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result index d8fbab98191..25bc9cfe5b3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result @@ -22,6 +22,7 @@ a ---- Wait until slave stops with an error ---- include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error) +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; a 1 @@ -48,6 +49,7 @@ SELECT * FROM t1; a [on slave] ---- Wait until slave stops with an error ---- +call mtr.add_suppression("Can.t find record in .t1., Error_code: 1032"); include/wait_for_slave_sql_error.inc [errno=1032] Last_SQL_Error (expected "duplicate key" error) Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos END_LOG_POS diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result index 148840cc8c5..20fbcbb7763 100644 --- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result +++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result @@ -10,6 +10,7 @@ DROP TABLE t1; INSERT INTO t1 VALUES (1); ==== Verify error on slave ==== [on slave] +call mtr.add_suppression("Slave SQL.*Error .Table .test.t1. doesn.t exist. on opening tables, Error_code: 1146"); include/wait_for_slave_sql_error.inc [errno=1146] ==== Clean up ==== include/stop_slave_io.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 5a29acfda1d..593aaa7ae51 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -117,6 +117,7 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); include/wait_for_slave_sql_error_and_skip.inc [errno=1535] Last_SQL_Error = 'Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index f6620ecf05f..e89118ac0a7 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -117,6 +117,7 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); include/wait_for_slave_sql_error_and_skip.inc [errno=1535] Last_SQL_Error = 'Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index d46338fd5b0..f5675b5e25f 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -56,6 +56,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SET SQL_LOG_BIN=1; +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result index 25deb65fa0f..a90c3c7b68f 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result +++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result @@ -29,6 +29,7 @@ a b SELECT * FROM t3 ORDER BY a; a b 1 ZZ +call mtr.add_suppression("Slave SQL.*Error .Table .test.t3. doesn.t exist. on.* Error_code: 1146"); include/wait_for_slave_sql_error.inc [errno=1146] SHOW TABLES LIKE 't%'; Tables_in_test (t%) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index 213ab06f0c1..425611e2175 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -13,4 +13,5 @@ include/stop_slave_io.inc RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3"); +call mtr.add_suppression("Slave SQL.*Error in Begin_load_query event: write to.* failed, Error_code: 9"); include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result index 8cd6218dcdc..262404ff6f9 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] START SLAVE; +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); include/wait_for_slave_sql_error.inc [errno=12] include/stop_slave_io.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result index 0e83f1dfb67..d4a14adc6b8 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result +++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result @@ -8,6 +8,7 @@ insert into t1 values(1),(2); ERROR 23000: Duplicate entry '2' for key 'a' drop table t1; include/wait_for_slave_sql_to_stop.inc +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Errno: "0" (expected 0) drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result index b56297a5487..ee137c34fd0 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result @@ -17,6 +17,7 @@ a ---- Wait until slave stops with an error ---- include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error = Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' (expected "duplicate key" error) +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SELECT * FROM t1; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index 27843e1dcda..f667ea98907 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -37,6 +37,7 @@ a b 3 3 4 4 include/check_slave_is_running.inc +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1"); **** On Master **** DROP TABLE t1; SET SESSION BINLOG_FORMAT=MIXED; diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test index 2c9ec02764c..6717bda0fa7 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test @@ -22,7 +22,7 @@ source include/have_debug.inc; --connection slave call mtr.add_suppression('Found invalid event in binary log'); - +call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594'); # # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event diff --git a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test index 265bde2ccf6..06ba1fdc38e 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test @@ -398,6 +398,7 @@ source include/stop_slave.inc; source include/start_slave.inc; CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log"); connection master; TRUNCATE t1; diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test index c2cf5811938..7ee6da94357 100644 --- a/mysql-test/suite/rpl/t/rpl_bug33931.test +++ b/mysql-test/suite/rpl/t/rpl_bug33931.test @@ -9,6 +9,7 @@ connection slave; # Add suppression for expected warnings in slaves error log call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593"); --source include/stop_slave.inc reset slave; diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 820ffc42933..1380b3d97cf 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -82,6 +82,7 @@ INSERT INTO t1(b,c) VALUES('B',2); # Wait while C will stop. --connection server_3 # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error.inc --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index 8e1c9eb98b2..13c66f9f64b 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -122,6 +122,8 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id # if any of the above statement are not ignored, it would cause error # and stop slave sql thread. sync_slave_with_master; +connection slave; +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); connection master; # Parameters for include/wait_for_slave_sql_error_and_skip.inc: diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index 141f3699b14..c72f19dec56 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -8,9 +8,10 @@ connection slave; source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log -call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); -call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); SET @old_slave_exec_mode= @@global.slave_exec_mode; diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index 1ab7393d8fc..53a772aea8f 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -125,6 +125,7 @@ show grants for mysqltest4@localhost; # where mysqltest1 does not exist on slave, # to succeed on slave the mode is temporarily changed set global slave_exec_mode='IDEMPOTENT'; +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); connection master; drop table t1, mysqltest2.t2; diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index b65441c7d50..d6034009f4f 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -15,6 +15,7 @@ SELECT * FROM t1; connection slave; # Wait until SQL thread stops with error LOST_EVENT on master +call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590"); let $slave_sql_errno= 1590; let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test index cf72de18e13..4dab13856d4 100644 --- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test +++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test @@ -58,7 +58,7 @@ start slave; --let $show_slave_sql_error= 1 --source include/wait_for_slave_sql_error.inc -call mtr.add_suppression("Failed during slave I/O thread initialization"); +call mtr.add_suppression("Failed during slave.* thread initialization"); SET GLOBAL debug= ""; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index a8c7c2c1f5b..09bc715f9a5 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -30,6 +30,7 @@ connection slave; #1105 = ER_UNKNOWN_ERROR --let $slave_sql_errno= 1105 --let $show_slave_sql_error= 1 +call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); --source include/wait_for_slave_sql_error.inc # show that it was not replicated SELECT * FROM t1; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index ecbaddb6995..be099c1b6c4 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -15,6 +15,7 @@ connection master; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); let $slave_sql_errno= 1593; let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error_and_skip.inc; diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 6ed690f91bf..4d48190cdf2 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -93,6 +93,7 @@ set insert_id=1234; insert into t2 values(NULL); connection slave; # 1062 = ER_DUP_ENTRY +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 915e747dd45..a78a6e8b8d1 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -62,6 +62,7 @@ DROP TABLE t1; --echo **** On Slave **** connection slave; SET GLOBAL QUERY_CACHE_SIZE=0; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); --echo **** On Master **** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test index 04434517518..be7d72e858e 100644 --- a/mysql-test/suite/rpl/t/rpl_row_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test @@ -160,6 +160,9 @@ let $test_table_slave = CREATE TABLE t1 (a TINYBLOB); let $test_insert = INSERT INTO t1 VALUES ('This is a test.'); source include/test_fieldsize.inc; +connection slave; +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); + --echo *** Cleanup *** connection master; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test index b695428dd38..4c8e56d626f 100644 --- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test +++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test @@ -30,6 +30,7 @@ INSERT INTO t1 VALUES (1); connection slave; # slave should have stopped because can't find table t1 # 1146 = ER_NO_SUCH_TABLE +call mtr.add_suppression("Slave SQL.*Error .Table .test.t1. doesn.t exist. on opening tables, Error_code: 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index 2853c95b212..82d6e61a2cd 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -102,6 +102,8 @@ SET SQL_LOG_BIN=1; connection slave; +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); + CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test index 70ebba0047b..8525718283e 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test +++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test @@ -63,6 +63,7 @@ SELECT * FROM t3 ORDER BY a; --connection slave # 1146 = ER_NO_SUCH_TABLE +call mtr.add_suppression("Slave SQL.*Error .Table .test.t3. doesn.t exist. on.* Error_code: 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc SHOW TABLES LIKE 't%'; diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index d80a2ed9e25..c718f072e11 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -49,5 +49,6 @@ RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3"); +call mtr.add_suppression("Slave SQL.*Error in Begin_load_query event: write to.* failed, Error_code: 9"); --let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test index 0481581998c..b99c71b1ca0 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test @@ -11,6 +11,7 @@ --connection slave START SLAVE; # Why 12??? +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); --let $slave_sql_errno= 12 source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 7ebaa10e9db..e85bf6ab753 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -28,6 +28,9 @@ SHOW STATUS LIKE 'Slave_retried_transactions'; SELECT * FROM t1; source include/check_slave_is_running.inc; +connection slave; +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1"); + --echo **** On Master **** connection master; DROP TABLE t1; From 7ede6ce344ad7d4accacd5a04dad3e1fbe019e5a Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 24 Feb 2011 15:11:05 +0100 Subject: [PATCH 016/152] 11766640 follow-up: fix for VS_CONFIG on Windows --- mysql-test/lib/My/Find.pm | 5 ++--- mysql-test/mysql-test-run.pl | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index a44c9a7508c..521adecfd13 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -28,8 +28,6 @@ use My::Platform; use base qw(Exporter); our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED); -our $vs_config_dir; - my $bin_extension= ".exe" if IS_WINDOWS; # Helper function to be used for fourth parameter to find functions @@ -158,7 +156,8 @@ sub my_find_paths { # User can select to look in a special build dir # which is a subdirectory of any of the paths my @extra_dirs; - my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR}; + my $build_dir= $::opt_config_dir || $ENV{MTR_VS_CONFIG} + || $ENV{MTR_BUILD_DIR}; push(@extra_dirs, $build_dir) if defined $build_dir; if (defined $extension){ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 05bfd4eae02..87f22ac7e45 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5677,6 +5677,7 @@ sub run_ctest() { chdir ($bindir) or die ("Could not chdir to $bindir"); my $tinfo; my $no_ctest= (IS_WINDOWS) ? 256 : -1; + my $ctest_vs= ""; # Just ignore if not configured/built to run ctest if (! -f "CTestTestfile.cmake") { @@ -5684,9 +5685,12 @@ sub run_ctest() { return; } + # Add vs-config option on Windows if needed + $ctest_vs= "-C $opt_vs_config" if IS_WINDOWS && $opt_vs_config; + # Also silently ignore if we don't have ctest and didn't insist # Now, run ctest and collect output - my $ctest_out= `ctest 2>&1`; + my $ctest_out= `ctest $ctest_vs 2>&1`; if ($? == $no_ctest && $opt_ctest == -1) { chdir($olddir); return; From 1b64e04b6d46f247f4e82dc9f7aae50a24b993c1 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 24 Feb 2011 15:48:35 +0100 Subject: [PATCH 017/152] 11762407 follow-up fixes to a few tests --- mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result | 1 + mysql-test/suite/rpl/r/rpl_slow_query_log.result | 1 + mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test | 1 + mysql-test/suite/rpl/t/rpl_slow_query_log.test | 1 + 4 files changed, 4 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index a7d745251d1..55aef7676f1 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -13,5 +13,6 @@ include/stop_slave_io.inc RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result index 668a99ffe1b..5bb1ba050a8 100644 --- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result +++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); include/stop_slave.inc SET @old_log_output= @@log_output; SET GLOBAL log_output= 'TABLE'; diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 41709c87f40..2791bab0bcc 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -60,6 +60,7 @@ RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); --let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test index e980aab7787..35df117e5a2 100644 --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -29,6 +29,7 @@ source include/master-slave.inc; source include/have_binlog_format_statement.inc; CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); # Prepare slave for different long_query_time we need to stop the slave From 416e92e3bbc1b8baa7c944eb868620c1aa5b7d15 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 24 Feb 2011 16:28:33 +0100 Subject: [PATCH 018/152] vs-config option to ctest made not dependent on Windows --- mysql-test/mysql-test-run.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 41178190589..da5e6a81b32 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5680,8 +5680,8 @@ sub run_ctest() { return; } - # Add vs-config option on Windows if needed - $ctest_vs= "-C $opt_vs_config" if IS_WINDOWS && $opt_vs_config; + # Add vs-config option if needed + $ctest_vs= "-C $opt_vs_config" if $opt_vs_config; # Also silently ignore if we don't have ctest and didn't insist # Now, run ctest and collect output From afe4b605a366e587327f3da2ae3e625f2471e666 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Fri, 25 Feb 2011 00:33:13 -0800 Subject: [PATCH 019/152] Fix Bug #11765975 __FILE__ macros expanded to full path instead of relative in CMake builds rb://600 approved by Sunny Bains --- storage/innobase/handler/ha_innodb.cc | 30 ++++++++++++++++++++---- storage/innobase/include/ha_prototypes.h | 9 +++++++ storage/innobase/mem/mem0dbg.c | 13 ++++++---- storage/innobase/sync/sync0arr.c | 12 ++++++---- storage/innobase/sync/sync0rw.c | 12 ++++++---- storage/innobase/sync/sync0sync.c | 9 ++++--- storage/innobase/ut/ut0dbg.c | 9 ++++--- 7 files changed, 69 insertions(+), 25 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 34c4500a723..725efe33e65 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -51,6 +51,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include +#include /** @file ha_innodb.cc */ @@ -1146,6 +1147,20 @@ innobase_strcasecmp( return(my_strcasecmp(system_charset_info, a, b)); } +/******************************************************************//** +Strip dir name from a full path name and return only the file name +@return file name or "null" if no file name */ +extern "C" UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name) /*!< in: full path name */ +{ + const char* name = base_name(path_name); + + return((name) ? name : "null"); +} + /******************************************************************//** Makes all characters in a NUL-terminated UTF-8 string lower case. */ extern "C" UNIV_INTERN @@ -9251,7 +9266,8 @@ innodb_mutex_show_status( if (mutex->count_using > 0) { buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%s", - mutex->cmutex_name, mutex->cfile_name); + mutex->cmutex_name, + innobase_basename(mutex->cfile_name)); buf2len= my_snprintf(buf2, sizeof(buf2), "count=%lu, spin_waits=%lu," " spin_rounds=%lu, " @@ -9281,7 +9297,8 @@ innodb_mutex_show_status( } #else /* UNIV_DEBUG */ buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", (ulong) mutex->count_os_wait); @@ -9297,7 +9314,8 @@ innodb_mutex_show_status( if (block_mutex) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_mutex->cfile_name, + innobase_basename( + block_mutex->cfile_name), (ulong) block_mutex->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", @@ -9328,7 +9346,8 @@ innodb_mutex_show_status( } buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu", - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu", (ulong) lock->count_os_wait); @@ -9343,7 +9362,8 @@ innodb_mutex_show_status( if (block_lock) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_lock->cfile_name, + innobase_basename( + block_lock->cfile_name), (ulong) block_lock->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index b75002944bd..dd9e8db82ee 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -173,6 +173,15 @@ innobase_strcasecmp( const char* a, /*!< in: first string to compare */ const char* b); /*!< in: second string to compare */ +/******************************************************************//** +Strip dir name from a full path name and return only its file name. +@return file name or "null" if no file name */ +UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name); /*!< in: full path name */ + /******************************************************************//** Returns true if the thread is executing a SELECT statement. @return true if thd is executing SELECT */ diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index d91e610a08a..e36a372b087 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -400,7 +400,7 @@ mem_hash_remove( fprintf(stderr, "Memory heap or buffer freed in %s line %lu" " did not exist.\n", - file_name, (ulong) line); + innobase_basename(file_name), (ulong) line); ut_error; } @@ -419,8 +419,9 @@ mem_hash_remove( "in %s line %lu and tried to free in %s line %lu.\n" "Hex dump of 400 bytes around memory heap" " first block start:\n", - node->nth_heap, node->file_name, (ulong) node->line, - file_name, (ulong) line); + node->nth_heap, + innobase_basename(node->file_name), (ulong) node->line, + innobase_basename(file_name), (ulong) line); ut_print_buf(stderr, (byte*)node->heap - 200, 400); fputs("\nDump of the mem heap:\n", stderr); mem_heap_validate_or_print(node->heap, NULL, TRUE, &error, @@ -763,7 +764,8 @@ mem_validate_no_assert(void) "Inconsistency in memory heap" " or buffer created\n" "in %s line %lu.\n", - node->file_name, node->line); + innobase_basename(node->file_name), + node->line); mutex_exit(&mem_hash_mutex); @@ -989,7 +991,8 @@ mem_print_info_low( fprintf(outfile, "%lu: file %s line %lu of size %lu phys.size %lu" " with %lu blocks, type %lu\n", - node->nth_heap, node->file_name, node->line, + node->nth_heap, + innobase_basename(node->file_name), node->line, allocated_mem, ph_size, n_blocks, (node->heap)->type); next_heap: diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index 3ecbce72ebd..0d1581b41b4 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -40,6 +40,7 @@ Created 9/5/1995 Heikki Tuuri #include "os0sync.h" #include "os0file.h" #include "srv0srv.h" +#include "ha_prototypes.h" /* WAIT ARRAY @@ -478,8 +479,8 @@ sync_array_cell_print( fprintf(file, "--Thread %lu has waited at %s line %lu" " for %.2f seconds the semaphore:\n", - (ulong) os_thread_pf(cell->thread), cell->file, - (ulong) cell->line, + (ulong) os_thread_pf(cell->thread), + innobase_basename(cell->file), (ulong) cell->line, difftime(time(NULL), cell->reservation_time)); if (type == SYNC_MUTEX) { @@ -493,7 +494,8 @@ sync_array_cell_print( "Last time reserved in file %s line %lu, " #endif /* UNIV_SYNC_DEBUG */ "waiters flag %lu\n", - (void*) mutex, mutex->cfile_name, (ulong) mutex->cline, + (void*) mutex, innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) mutex->lock_word, #ifdef UNIV_SYNC_DEBUG mutex->file_name, (ulong) mutex->line, @@ -512,7 +514,7 @@ sync_array_cell_print( fprintf(file, " RW-latch at %p created in file %s line %lu\n", - (void*) rwlock, rwlock->cfile_name, + (void*) rwlock, innobase_basename(rwlock->cfile_name), (ulong) rwlock->cline); writer = rw_lock_get_writer(rwlock); if (writer != RW_LOCK_NOT_LOCKED) { @@ -533,7 +535,7 @@ sync_array_cell_print( (ulong) rw_lock_get_reader_count(rwlock), (ulong) rwlock->waiters, rwlock->lock_word, - rwlock->last_s_file_name, + innobase_basename(rwlock->last_s_file_name), (ulong) rwlock->last_s_line, rwlock->last_x_file_name, (ulong) rwlock->last_x_line); diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 73d1e3aa46e..9010e4fcec1 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -407,7 +407,8 @@ lock_loop: " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } /* We try once again to obtain the lock */ @@ -442,7 +443,8 @@ lock_loop: "Thread %lu OS wait rw-s-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), - (void*) lock, lock->cfile_name, + (void*) lock, + innobase_basename(lock->cfile_name), (ulong) lock->cline); } @@ -664,7 +666,8 @@ lock_loop: "Thread %lu spin wait rw-x-lock at %p" " cfile %s cline %lu rnds %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } sync_array_reserve_cell(sync_primary_wait_array, @@ -687,7 +690,8 @@ lock_loop: "Thread %lu OS wait for rw-x-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); } /* these stats may not be accurate */ diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index 0f6a60ca260..b66920a0784 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -543,7 +543,8 @@ spin_loop: "Thread %lu spin wait mutex at %p" " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_spin_round_count += i; @@ -620,7 +621,8 @@ spin_loop: fprintf(stderr, "Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_os_wait_count++; @@ -869,7 +871,8 @@ sync_print_warning( if (mutex->magic_n == MUTEX_MAGIC_N) { fprintf(stderr, "Mutex created at %s %lu\n", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); if (mutex_get_lock_word(mutex) != 0) { ulint line; diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c index 42ad8c03762..64fadd76d1c 100644 --- a/storage/innobase/ut/ut0dbg.c +++ b/storage/innobase/ut/ut0dbg.c @@ -25,6 +25,7 @@ Created 1/30/1994 Heikki Tuuri #include "univ.i" #include "ut0dbg.h" +#include "ha_prototypes.h" #if defined(__GNUC__) && (__GNUC__ > 2) #else @@ -55,12 +56,13 @@ ut_dbg_assertion_failed( ut_print_timestamp(stderr); #ifdef UNIV_HOTBACKUP fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", - file, line); + innobase_basename(file), line); #else /* UNIV_HOTBACKUP */ fprintf(stderr, " InnoDB: Assertion failure in thread %lu" " in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); #endif /* UNIV_HOTBACKUP */ if (expr) { fprintf(stderr, @@ -93,7 +95,8 @@ ut_dbg_stop_thread( { #ifndef UNIV_HOTBACKUP fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); os_thread_sleep(1000000000); #endif /* !UNIV_HOTBACKUP */ } From 05c4a3518e26c8acd9cd8e2436da7e11ddbc6474 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Fri, 25 Feb 2011 11:50:18 +0200 Subject: [PATCH 020/152] Fix BUG#11798085 - INCORRECT INTEGER TYPES USED IN CALCULATION RESULT IN OVERFLOW Do not assign the result of the difference to a signed variable and checking whether it is negative afterwards because this limits the max diff to 2G on 32 bit systems. E.g. "signed = 3.5G - 1G" would be negative and the code would assume that 3.5G < 1G. Instead compare the two variables directly and assign to unsigned only if we know that the result of the subtraction will be positive. Discussed with: Jimmy and Sunny (via IRC) --- storage/innodb_plugin/buf/buf0buf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 6bbd5565c58..51a3a393d36 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -1893,16 +1893,19 @@ buf_block_align( /* TODO: protect buf_pool->chunks with a mutex (it will currently remain constant after buf_pool_init()) */ for (chunk = buf_pool->chunks, i = buf_pool->n_chunks; i--; chunk++) { - lint offs = ptr - chunk->blocks->frame; + ulint offs; - if (UNIV_UNLIKELY(offs < 0)) { + if (UNIV_UNLIKELY(ptr < chunk->blocks->frame)) { continue; } + /* else */ + + offs = ptr - chunk->blocks->frame; offs >>= UNIV_PAGE_SIZE_SHIFT; - if (UNIV_LIKELY((ulint) offs < chunk->size)) { + if (UNIV_LIKELY(offs < chunk->size)) { buf_block_t* block = &chunk->blocks[offs]; /* The function buf_chunk_init() invokes From 1e2607318492a7e2532934ccc3cccaacf0e113f3 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Fri, 25 Feb 2011 03:21:02 -0800 Subject: [PATCH 021/152] Include "ha_prototypes.h" to sync/sync0rw.c for innobase_basename(). --- storage/innobase/mem/mem0dbg.c | 2 ++ storage/innobase/sync/sync0rw.c | 1 + storage/innobase/sync/sync0sync.c | 1 + 3 files changed, 4 insertions(+) diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index e36a372b087..ae43d6097a6 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -24,6 +24,8 @@ but is included in mem0mem.* ! Created 6/9/1994 Heikki Tuuri *************************************************************************/ +#include "ha_prototypes.h" + #ifdef UNIV_MEM_DEBUG # ifndef UNIV_HOTBACKUP /* The mutex which protects in the debug version the hash table diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 9010e4fcec1..397d505df50 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -39,6 +39,7 @@ Created 9/11/1995 Heikki Tuuri #include "mem0mem.h" #include "srv0srv.h" #include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */ +#include "ha_prototypes.h" /* IMPLEMENTATION OF THE RW_LOCK diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index b66920a0784..23fd64cc5ed 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -43,6 +43,7 @@ Created 9/5/1995 Heikki Tuuri #ifdef UNIV_SYNC_DEBUG # include "srv0start.h" /* srv_is_being_started */ #endif /* UNIV_SYNC_DEBUG */ +#include "ha_prototypes.h" /* REASONS FOR IMPLEMENTING THE SPIN LOCK MUTEX From 0bd4c22236819dc3f45fea146a48b4167a8ed901 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Fri, 25 Feb 2011 14:51:25 +0100 Subject: [PATCH 022/152] mtr: ignore not finding ctest if in PB2 --- mysql-test/mysql-test-run.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index da5e6a81b32..97737443e1c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5684,9 +5684,10 @@ sub run_ctest() { $ctest_vs= "-C $opt_vs_config" if $opt_vs_config; # Also silently ignore if we don't have ctest and didn't insist + # Special override: also ignore in Pushbuild, some platforms may not have it # Now, run ctest and collect output my $ctest_out= `ctest $ctest_vs 2>&1`; - if ($? == $no_ctest && $opt_ctest == -1) { + if ($? == $no_ctest && $opt_ctest == -1 && ! defined $ENV{PB2WORKDIR}) { chdir($olddir); return; } From 47741182d623f27b2f91d0e0c408dd06f9dab8e0 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 10:39:48 +0200 Subject: [PATCH 023/152] Non-functional change: use plugin_author instead of hardcoded string. plugin_author is currently defined as "Innobase Oy" so this change is a no-op. --- storage/innobase/handler/i_s.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 709274bab16..91acbf579da 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -1068,7 +1068,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits = /* plugin author (for SHOW PLUGINS) */ /* const char* */ - STRUCT_FLD(author, "Innobase Oy"), + STRUCT_FLD(author, plugin_author), /* general descriptive text (for SHOW PLUGINS) */ /* const char* */ From e4e154e92be8eef60a36d5efebcfd40178b2ac90 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 11:02:24 +0200 Subject: [PATCH 024/152] Change InnoDB plugins author to Oracle Corporation --- storage/innobase/handler/i_s.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 91acbf579da..3d195f8c47b 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -47,7 +47,7 @@ extern "C" { #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ } -static const char plugin_author[] = "Innobase Oy"; +static const char plugin_author[] = "Oracle Corporation"; #define OK(expr) \ if ((expr) != 0) { \ From 7bb633e7c9890fc0c66b2d501fc4be245ecebd07 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 11:07:22 +0200 Subject: [PATCH 025/152] Use plugin_author also for the InnoDB SE plugin Move the const variable plugin_author to a common header file that is being included by both ha_innodb.cc and i_s.cc --- storage/innobase/handler/ha_innodb.cc | 2 +- storage/innobase/handler/i_s.cc | 2 -- storage/innobase/handler/i_s.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 725efe33e65..2d02dd0e770 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11367,7 +11367,7 @@ mysql_declare_plugin(innobase) MYSQL_STORAGE_ENGINE_PLUGIN, &innobase_storage_engine, innobase_hton_name, - "Innobase Oy", + plugin_author, "Supports transactions, row-level locking, and foreign keys", PLUGIN_LICENSE_GPL, innobase_init, /* Plugin Init */ diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 3d195f8c47b..f7fe8a01517 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -47,8 +47,6 @@ extern "C" { #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ } -static const char plugin_author[] = "Oracle Corporation"; - #define OK(expr) \ if ((expr) != 0) { \ DBUG_RETURN(1); \ diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h index 402c88bbedb..dc0deef119b 100644 --- a/storage/innobase/handler/i_s.h +++ b/storage/innobase/handler/i_s.h @@ -26,6 +26,8 @@ Created July 18, 2007 Vasil Dimov #ifndef i_s_h #define i_s_h +const char plugin_author[] = "Oracle Corporation"; + extern struct st_mysql_plugin i_s_innodb_trx; extern struct st_mysql_plugin i_s_innodb_locks; extern struct st_mysql_plugin i_s_innodb_lock_waits; From 8da1dfa9cb607a824c1e23c8dec44bb2c70095ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 28 Feb 2011 13:51:18 +0200 Subject: [PATCH 026/152] Bug #58549 Race condition in buf_LRU_drop_page_hash_for_tablespace() and compressed tables buf_LRU_drop_page_hash_for_tablespace(): after releasing and reacquiring the buffer pool mutex, do not dereference any block descriptor pointer that is not known to be a pointer to an uncompressed page frame (type buf_block_t; state == BUF_BLOCK_FILE_PAGE). Also, defer the acquisition of the block_mutex until it is needed. buf_page_get_gen(): Add mode == BUF_GET_IF_IN_POOL_PEEK for buffer-fixing a block without making it young in the LRU list. buf_page_get_gen(), buf_page_init(), buf_LRU_block_remove_hashed_page(): Set bpage->state = BUF_BLOCK_ZIP_FREE before buf_buddy_free(bpage), so that similar race conditions might be detected a little easier. btr_search_drop_page_hash_when_freed(): Use BUF_GET_IF_IN_POOL_PEEK when dropping the hash indexes. rb://528 approved by Jimmy Yang --- storage/innodb_plugin/ChangeLog | 6 ++ storage/innodb_plugin/btr/btr0sea.c | 4 +- storage/innodb_plugin/buf/buf0buf.c | 32 ++++++--- storage/innodb_plugin/buf/buf0lru.c | 87 +++++++++++++------------ storage/innodb_plugin/include/buf0buf.h | 4 +- 5 files changed, 81 insertions(+), 52 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 1b2747ab012..1ece3ad1825 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2011-02-28 The InnoDB Team + + * btr/btr0sea.c, buf/buf0buf.c, buf/buf0lru.c: + Fix Bug#58549 Race condition in buf_LRU_drop_page_hash_for_tablespace() + and compressed tables + 2011-02-15 The InnoDB Team * sync/sync0rw.c, innodb_bug59307.test: diff --git a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c index 9835efcf712..cd0eadbb1b8 100644 --- a/storage/innodb_plugin/btr/btr0sea.c +++ b/storage/innodb_plugin/btr/btr0sea.c @@ -1201,8 +1201,8 @@ btr_search_drop_page_hash_when_freed( having to fear a deadlock. */ block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL, - BUF_GET_IF_IN_POOL, __FILE__, __LINE__, - &mtr); + BUF_PEEK_IF_IN_POOL, __FILE__, __LINE__, + &mtr); /* Because the buffer pool mutex was released by buf_page_peek_if_search_hashed(), it is possible that the block was removed from the buffer pool by another thread diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 51a3a393d36..14ec7b75911 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -2031,7 +2031,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH */ + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr) /*!< in: mini-transaction */ @@ -2047,9 +2047,19 @@ buf_page_get_gen( ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad((mode != BUF_GET_NO_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL) - || (mode == BUF_GET_NO_LATCH)); +#ifdef UNIV_DEBUG + switch (mode) { + case BUF_GET_NO_LATCH: + ut_ad(rw_latch == RW_NO_LATCH); + break; + case BUF_GET: + case BUF_GET_IF_IN_POOL: + case BUF_PEEK_IF_IN_POOL: + break; + default: + ut_error; + } +#endif /* UNIV_DEBUG */ ut_ad(zip_size == fil_space_get_zip_size(space)); ut_ad(ut_is_2pow(zip_size)); #ifndef UNIV_LOG_DEBUG @@ -2091,7 +2101,8 @@ loop2: buf_pool_mutex_exit(); - if (mode == BUF_GET_IF_IN_POOL) { + if (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL) { return(NULL); } @@ -2130,7 +2141,8 @@ loop2: must_read = buf_block_get_io_fix(block) == BUF_IO_READ; - if (must_read && mode == BUF_GET_IF_IN_POOL) { + if (must_read && (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL)) { /* The page is only being read to buffer */ buf_pool_mutex_exit(); @@ -2248,6 +2260,7 @@ wait_until_unfixed: mutex_exit(&buf_pool_zip_mutex); buf_pool->n_pend_unzip++; + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof *bpage); buf_pool_mutex_exit(); @@ -2324,7 +2337,9 @@ wait_until_unfixed: buf_pool_mutex_exit(); - buf_page_set_accessed_make_young(&block->page, access_time); + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { + buf_page_set_accessed_make_young(&block->page, access_time); + } #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(!block->page.file_page_was_freed); @@ -2377,7 +2392,7 @@ wait_until_unfixed: mtr_memo_push(mtr, block, fix_type); - if (!access_time) { + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL) && !access_time) { /* In the case of a first access, try to apply linear read-ahead */ @@ -2926,6 +2941,7 @@ err_exit: && UNIV_LIKELY_NULL(buf_page_hash_get(space, offset))) { /* The block was added by some other thread. */ + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof *bpage); buf_buddy_free(data, zip_size); diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c index 39feb06ff23..a69b2658c51 100644 --- a/storage/innodb_plugin/buf/buf0lru.c +++ b/storage/innodb_plugin/buf/buf0lru.c @@ -246,71 +246,75 @@ buf_LRU_drop_page_hash_for_tablespace( page_arr = ut_malloc(sizeof(ulint) * BUF_LRU_DROP_SEARCH_HASH_SIZE); buf_pool_mutex_enter(); + num_entries = 0; scan_again: - num_entries = 0; bpage = UT_LIST_GET_LAST(buf_pool->LRU); while (bpage != NULL) { - mutex_t* block_mutex = buf_page_get_mutex(bpage); buf_page_t* prev_bpage; + ibool is_fixed; - mutex_enter(block_mutex); prev_bpage = UT_LIST_GET_PREV(LRU, bpage); ut_a(buf_page_in_file(bpage)); if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE || bpage->space != id - || bpage->buf_fix_count > 0 || bpage->io_fix != BUF_IO_NONE) { - /* We leave the fixed pages as is in this scan. - To be dealt with later in the final scan. */ - mutex_exit(block_mutex); + /* Compressed pages are never hashed. + Skip blocks of other tablespaces. + Skip I/O-fixed blocks (to be dealt with later). */ +next_page: + bpage = prev_bpage; + continue; + } + + mutex_enter(&((buf_block_t*) bpage)->mutex); + is_fixed = bpage->buf_fix_count > 0 + || !((buf_block_t*) bpage)->is_hashed; + mutex_exit(&((buf_block_t*) bpage)->mutex); + + if (is_fixed) { goto next_page; } - if (((buf_block_t*) bpage)->is_hashed) { + /* Store the page number so that we can drop the hash + index in a batch later. */ + page_arr[num_entries] = bpage->offset; + ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); + ++num_entries; - /* Store the offset(i.e.: page_no) in the array - so that we can drop hash index in a batch - later. */ - page_arr[num_entries] = bpage->offset; - mutex_exit(block_mutex); - ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); - ++num_entries; - - if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { - goto next_page; - } - /* Array full. We release the buf_pool_mutex to - obey the latching order. */ - buf_pool_mutex_exit(); - - buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, - num_entries); - num_entries = 0; - buf_pool_mutex_enter(); - } else { - mutex_exit(block_mutex); + if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { + goto next_page; } -next_page: - /* Note that we may have released the buf_pool mutex - above after reading the prev_bpage during processing - of a page_hash_batch (i.e.: when the array was full). - This means that prev_bpage can change in LRU list. - This is OK because this function is a 'best effort' - to drop as many search hash entries as possible and - it does not guarantee that ALL such entries will be - dropped. */ - bpage = prev_bpage; + /* Array full. We release the buf_pool_mutex to + obey the latching order. */ + buf_pool_mutex_exit(); + buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, + num_entries); + buf_pool_mutex_enter(); + num_entries = 0; + + /* Note that we released the buf_pool mutex above + after reading the prev_bpage during processing of a + page_hash_batch (i.e.: when the array was full). + Because prev_bpage could belong to a compressed-only + block, it may have been relocated, and thus the + pointer cannot be trusted. Because bpage is of type + buf_block_t, it is safe to dereference. + + bpage can change in the LRU list. This is OK because + this function is a 'best effort' to drop as many + search hash entries as possible and it does not + guarantee that ALL such entries will be dropped. */ /* If, however, bpage has been removed from LRU list to the free list then we should restart the scan. bpage->state is protected by buf_pool mutex. */ - if (bpage && !buf_page_in_file(bpage)) { - ut_a(num_entries == 0); + if (bpage + && buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) { goto scan_again; } } @@ -1799,6 +1803,7 @@ buf_LRU_block_remove_hashed_page( buf_pool_mutex_exit_forbid(); buf_buddy_free(bpage->zip.data, page_zip_get_size(&bpage->zip)); + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof(*bpage)); buf_pool_mutex_exit_allow(); UNIV_MEM_UNDESC(bpage); diff --git a/storage/innodb_plugin/include/buf0buf.h b/storage/innodb_plugin/include/buf0buf.h index a16de67aa3a..05dead5ac9e 100644 --- a/storage/innodb_plugin/include/buf0buf.h +++ b/storage/innodb_plugin/include/buf0buf.h @@ -41,6 +41,8 @@ Created 11/5/1995 Heikki Tuuri /* @{ */ #define BUF_GET 10 /*!< get always */ #define BUF_GET_IF_IN_POOL 11 /*!< get if in pool */ +#define BUF_PEEK_IF_IN_POOL 12 /*!< get if in pool, do not make + the block young in the LRU list */ #define BUF_GET_NO_LATCH 14 /*!< get and bufferfix, but set no latch; we have separated this case, because @@ -284,7 +286,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH */ + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr); /*!< in: mini-transaction */ From 3fceb5b6995fd0251ca1a8fae74773f85a116ed7 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Mon, 28 Feb 2011 16:10:35 +0100 Subject: [PATCH 027/152] Attempt at solving missing end of mtr output on Windows --- mysql-test/lib/mtr_report.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 0090316cf7b..bbf1002c123 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -32,6 +32,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line use mtr_match; use My::Platform; use POSIX qw[ _exit ]; +use IO::Handle qw[ flush ]; require "mtr_io.pl"; my $tot_real_time= 0; @@ -477,6 +478,7 @@ sub mtr_warning (@) { # Print error to screen and then exit sub mtr_error (@) { + IO::Handle::flush(\*STDOUT) if IS_WINDOWS; print STDERR _name(). _timestamp(). "mysql-test-run: *** ERROR: ". join(" ", @_). "\n"; if (IS_WINDOWS) From f0577e551edb010d96ababa1281769b38e203adb Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 1 Mar 2011 17:39:28 +0100 Subject: [PATCH 028/152] Bug#11766528 PERFORMANCE_SCHEMA TRACKS BOTH BINARY AND RELAY LOGS IN THE SAME EVENTS Before this fix, all the performance schema instrumentation for both the binary log and the relay log would use the following instruments: - wait/io/file/sql/binlog - wait/io/file/sql/binlog_index - wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index - wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond This instrumentation is too general and can be more specific. With this fix, the binlog instrumentation is identical, and the relay log instrumentation is changed to: - wait/io/file/sql/relaylog - wait/io/file/sql/relaylog_index - wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index - wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond With this change, the performance instrumentation for the binary log and the relay log, which share the same structure but have different uses, is more detailed. This is especially important for hosts in the middle of a replication chain, that are both masters (binlog) and slaves (relaylog). --- mysql-test/suite/perfschema/r/relaylog.result | 98 +++++++++++++++ mysql-test/suite/perfschema/t/relaylog.test | 112 ++++++++++++++++++ sql/log.cc | 16 ++- sql/log.h | 23 ++++ sql/mysqld.cc | 19 +++ sql/mysqld.h | 3 + sql/rpl_rli.cc | 9 +- 7 files changed, 270 insertions(+), 10 deletions(-) create mode 100644 mysql-test/suite/perfschema/r/relaylog.result create mode 100644 mysql-test/suite/perfschema/t/relaylog.test diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result new file mode 100644 index 00000000000..0cd346b62a1 --- /dev/null +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -0,0 +1,98 @@ +include/master-slave.inc +[connection master] +drop table if exists test.t1; +reset master; +create table test.t1(a int); +drop table test.t1; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; create table test.t1(a int) +slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +"============ Performance schema on master ============" +select * from performance_schema.file_summary_by_instance +where file_name like "%master-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +[DATADIR]master-bin.000001 wait/io/file/sql/binlog 6 4 221 329 +[DATADIR]master-bin.index wait/io/file/sql/binlog_index 0 2 0 40 +select * from performance_schema.file_summary_by_instance +where file_name like "%slave-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.file_summary_by_instance +where event_name like "%binlog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +[DATADIR]master-bin.000001 wait/io/file/sql/binlog 6 4 221 329 +[DATADIR]master-bin.index wait/io/file/sql/binlog_index 0 2 0 40 +select * from performance_schema.file_summary_by_event_name +where event_name like "%binlog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/binlog 6 4 221 329 +wait/io/file/sql/binlog_index 0 2 0 40 +select event_name, count_star +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_BIN_LOG%" order by event_name; +event_name count_star +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 1 +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 3 +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +select * from performance_schema.file_summary_by_instance +where event_name like "%relaylog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.file_summary_by_event_name +where event_name like "%relaylog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/relaylog 0 0 0 0 +wait/io/file/sql/relaylog_index 0 0 0 0 +select * from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_RELAY_LOG%" order by event_name; +EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0 +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0 +"============ Performance schema on slave ============" +select * from performance_schema.file_summary_by_instance +where file_name like "%master-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.file_summary_by_instance +where file_name like "%slave-%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +[DATADIR]slave-bin.000001 wait/io/file/sql/binlog 3 8 602 631 +[DATADIR]slave-bin.index wait/io/file/sql/binlog_index 0 3 0 57 +[DATADIR]slave-relay-bin.000001 wait/io/file/sql/relaylog 4 3 370 263 +[DATADIR]slave-relay-bin.000002 wait/io/file/sql/relaylog 2 4 368 368 +[DATADIR]slave-relay-bin.index wait/io/file/sql/relaylog_index 2 4 50 125 +select * from performance_schema.file_summary_by_instance +where event_name like "%binlog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +[DATADIR]slave-bin.000001 wait/io/file/sql/binlog 3 8 602 631 +[DATADIR]slave-bin.index wait/io/file/sql/binlog_index 0 3 0 57 +select * from performance_schema.file_summary_by_event_name +where event_name like "%binlog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/binlog 3 8 602 631 +wait/io/file/sql/binlog_index 0 3 0 57 +select event_name, count_star +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_BIN_LOG%" order by event_name; +event_name count_star +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 0 +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 5 +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +select * from performance_schema.file_summary_by_instance +where event_name like "%relaylog%" order by file_name; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +[DATADIR]slave-relay-bin.000001 wait/io/file/sql/relaylog 4 3 370 263 +[DATADIR]slave-relay-bin.000002 wait/io/file/sql/relaylog 2 4 368 368 +[DATADIR]slave-relay-bin.index wait/io/file/sql/relaylog_index 2 4 50 125 +select * from performance_schema.file_summary_by_event_name +where event_name like "%relaylog%" order by event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +wait/io/file/sql/relaylog 6 7 738 631 +wait/io/file/sql/relaylog_index 2 4 50 125 +select event_name, count_star +from performance_schema.events_waits_summary_global_by_event_name +where event_name like "%MYSQL_RELAY_LOG%" order by event_name; +event_name count_star +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 2 +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 12 +include/stop_slave.inc diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test new file mode 100644 index 00000000000..43822e30f0e --- /dev/null +++ b/mysql-test/suite/perfschema/t/relaylog.test @@ -0,0 +1,112 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/master-slave.inc + +--disable_warnings +drop table if exists test.t1; +--sync_slave_with_master +reset master; +--enable_warnings + +create table test.t1(a int); +drop table test.t1; + +--source include/show_binlog_events.inc + +connection master; +-- echo "============ Performance schema on master ============" + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where file_name like "%master-%" order by file_name; + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where file_name like "%slave-%" order by file_name; + +# Expect a master binlog + binlog_index + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where event_name like "%binlog%" order by file_name; + +select * from performance_schema.file_summary_by_event_name + where event_name like "%binlog%" order by event_name; + +select event_name, count_star + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_BIN_LOG%" order by event_name; + +# Expect no slave relay log. + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where event_name like "%relaylog%" order by file_name; + +select * from performance_schema.file_summary_by_event_name + where event_name like "%relaylog%" order by event_name; + +select * from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_RELAY_LOG%" order by event_name; + +sync_slave_with_master; +-- echo "============ Performance schema on slave ============" + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where file_name like "%master-%" order by file_name; + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where file_name like "%slave-%" order by file_name; + +# Expect a slave binlog + binlog_index + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where event_name like "%binlog%" order by file_name; + +select * from performance_schema.file_summary_by_event_name + where event_name like "%binlog%" order by event_name; + +select event_name, count_star + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_BIN_LOG%" order by event_name; + +# Expect a slave relay log. + +--replace_result $MYSQLD_DATADIR [DATADIR] +select * from performance_schema.file_summary_by_instance + where event_name like "%relaylog%" order by file_name; + +select * from performance_schema.file_summary_by_event_name + where event_name like "%relaylog%" order by event_name; + +select event_name, count_star + from performance_schema.events_waits_summary_global_by_event_name + where event_name like "%MYSQL_RELAY_LOG%" order by event_name; + +--source include/stop_slave.inc + diff --git a/sql/log.cc b/sql/log.cc index 9a7a1699b62..fe782c5d621 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2861,11 +2861,9 @@ void MYSQL_BIN_LOG::init(bool no_auto_events_arg, ulong max_size_arg) void MYSQL_BIN_LOG::init_pthread_objects() { - DBUG_ASSERT(inited == 0); - inited= 1; - mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW); - mysql_mutex_init(key_BINLOG_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); - mysql_cond_init(key_BINLOG_update_cond, &update_cond, 0); + MYSQL_LOG::init_pthread_objects(); + mysql_mutex_init(m_key_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); + mysql_cond_init(m_key_update_cond, &update_cond, 0); } @@ -2888,7 +2886,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg, } fn_format(index_file_name, index_file_name_arg, mysql_data_home, ".index", opt); - if ((index_file_nr= mysql_file_open(key_file_binlog_index, + if ((index_file_nr= mysql_file_open(m_key_file_log_index, index_file_name, O_RDWR | O_CREAT | O_BINARY, MYF(MY_WME))) < 0 || @@ -3004,7 +3002,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, /* open the main log file */ if (MYSQL_LOG::open( #ifdef HAVE_PSI_INTERFACE - key_file_binlog, + m_key_file_log, #endif log_name, log_type_arg, new_name, io_cache_type_arg)) { @@ -3874,7 +3872,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, /* Get rid of the trailing '\n' */ log_info.log_file_name[length-1]= 0; - if (!mysql_file_stat(key_file_binlog, log_info.log_file_name, &s, MYF(0))) + if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &s, MYF(0))) { if (my_errno == ENOENT) { @@ -4049,7 +4047,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) !is_active(log_info.log_file_name) && !log_in_use(log_info.log_file_name)) { - if (!mysql_file_stat(key_file_binlog, + if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &stat_area, MYF(0))) { if (my_errno == ENOENT) diff --git a/sql/log.h b/sql/log.h index 05f8a4ce286..7f7d1a1cf3a 100644 --- a/sql/log.h +++ b/sql/log.h @@ -274,6 +274,16 @@ private: class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG { private: +#ifdef HAVE_PSI_INTERFACE + /** The instrumentation key to use for @ LOCK_index. */ + PSI_mutex_key m_key_LOCK_index; + /** The instrumentation key to use for @ update_cond. */ + PSI_cond_key m_key_update_cond; + /** The instrumentation key to use for opening the log file. */ + PSI_file_key m_key_file_log; + /** The instrumentation key to use for opening the log index file. */ + PSI_file_key m_key_file_log_index; +#endif /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ mysql_mutex_t LOCK_index; mysql_mutex_t LOCK_prep_xids; @@ -362,6 +372,19 @@ public: on exit() - but only during the correct shutdown process */ +#ifdef HAVE_PSI_INTERFACE + void set_psi_keys(PSI_mutex_key key_LOCK_index, + PSI_cond_key key_update_cond, + PSI_file_key key_file_log, + PSI_file_key key_file_log_index) + { + m_key_LOCK_index= key_LOCK_index; + m_key_update_cond= key_update_cond; + m_key_file_log= key_file_log; + m_key_file_log_index= key_file_log_index; + } +#endif + int open(const char *opt_name); void close(); int log_xid(THD *thd, my_xid xid); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c1bad398f80..d6bcc18d254 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3122,6 +3122,18 @@ static int init_common_variables() */ global_system_variables.time_zone= my_tz_SYSTEM; +#ifdef HAVE_PSI_INTERFACE + /* + Complete the mysql_bin_log initialization. + Instrumentation keys are known only after the performance schema initialization, + and can not be set in the MYSQL_BIN_LOG constructor (called before main()). + */ + mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index, + key_BINLOG_update_cond, + key_file_binlog, + key_file_binlog_index); +#endif + /* Init mutexes for the global MYSQL_BIN_LOG objects. As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of @@ -7690,6 +7702,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; +PSI_mutex_key key_RELAYLOG_LOCK_index; static PSI_mutex_info all_server_mutexes[]= { @@ -7706,6 +7719,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0}, { &key_BINLOG_LOCK_prep_xids, "MYSQL_BIN_LOG::LOCK_prep_xids", 0}, + { &key_RELAYLOG_LOCK_index, "MYSQL_RELAY_LOG::LOCK_index", 0}, { &key_delayed_insert_mutex, "Delayed_insert::mutex", 0}, { &key_hash_filo_lock, "hash_filo::lock", 0}, { &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL}, @@ -7773,6 +7787,7 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; +PSI_cond_key key_RELAYLOG_update_cond; static PSI_cond_info all_server_conds[]= { @@ -7786,6 +7801,7 @@ static PSI_cond_info all_server_conds[]= #endif /* HAVE_MMAP */ { &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0}, { &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0}, + { &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0}, { &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0}, { &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL}, { &key_COND_rpl_status, "COND_rpl_status", PSI_FLAG_GLOBAL}, @@ -7849,6 +7865,7 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, key_file_trg, key_file_trn, key_file_init; PSI_file_key key_file_query_log, key_file_slow_log; +PSI_file_key key_file_relaylog, key_file_relaylog_index; static PSI_file_info all_server_files[]= { @@ -7857,6 +7874,8 @@ static PSI_file_info all_server_files[]= #endif /* HAVE_MMAP */ { &key_file_binlog, "binlog", 0}, { &key_file_binlog_index, "binlog_index", 0}, + { &key_file_relaylog, "relaylog", 0}, + { &key_file_relaylog_index, "relaylog_index", 0}, { &key_file_casetest, "casetest", 0}, { &key_file_dbopt, "dbopt", 0}, { &key_file_des_key_file, "des_key_file", 0}, diff --git a/sql/mysqld.h b/sql/mysqld.h index 2099e57e96d..08c83257e67 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -241,6 +241,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc; +extern PSI_mutex_key key_RELAYLOG_LOCK_index; extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, @@ -260,6 +261,7 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, key_TABLE_SHARE_cond, key_user_level_lock_cond, key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; +extern PSI_cond_key key_RELAYLOG_update_cond; extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, key_thread_handle_manager, key_thread_kill_server, key_thread_main, @@ -277,6 +279,7 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, key_file_trg, key_file_trn, key_file_init; extern PSI_file_key key_file_query_log, key_file_slow_log; +extern PSI_file_key key_file_relaylog, key_file_relaylog_index; void init_server_psi_keys(); #endif /* HAVE_PSI_INTERFACE */ diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index a35e7bb1612..f2653894ea7 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -54,6 +54,13 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) { DBUG_ENTER("Relay_log_info::Relay_log_info"); +#ifdef HAVE_PSI_INTERFACE + relay_log.set_psi_keys(key_RELAYLOG_LOCK_index, + key_RELAYLOG_update_cond, + key_file_relaylog, + key_file_relaylog_index); +#endif + group_relay_log_name[0]= event_relay_log_name[0]= group_master_log_name[0]= 0; until_log_name[0]= ign_master_log_name_end[0]= 0; @@ -356,7 +363,7 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo) { MY_STAT s; DBUG_ENTER("add_relay_log"); - if (!mysql_file_stat(key_file_binlog, + if (!mysql_file_stat(key_file_relaylog, linfo->log_file_name, &s, MYF(0))) { sql_print_error("log %s listed in the index, but failed to stat", From c9dda80130c9b00e8df6275da38c3276b0ebf55d Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 2 Mar 2011 10:16:34 +0100 Subject: [PATCH 029/152] Fix non-portable test of %p in unit test my_vsnprintf --- unittest/mysys/my_vsnprintf-t.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c index e7f37774f85..7f93f5bb195 100644 --- a/unittest/mysys/my_vsnprintf-t.c +++ b/unittest/mysys/my_vsnprintf-t.c @@ -110,8 +110,11 @@ int main(void) test1("Positional arguments octal: <7777>", "Positional arguments octal: <%1$o>", 07777); + /* Can't use int arguments, as they may be different size from pointers */ + test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>", - "Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd); + "Padding and %%p <%04p> <%05p> <%08p> <%8p>", + (void*) 0x12, (void*) 0x34, (void*) 0xab, (void*) 0xcd); test1("F with a width (ignored) and precision: <12.34568>", "F with a width (ignored) and precision: <%10.5f>", 12.3456789); From 4148b03910b5642cd77c9d4512d56e6d04d578b7 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 3 Mar 2011 15:25:41 +0100 Subject: [PATCH 030/152] Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS This was a buffer overrun in do_div_mod(), overwriting the internal buffer of auto variable 'tmp' in Item_func_int_div::val_int. Result on windows: 'this' is set to zero, and crash. Ran fine on other platforms (no valgrind warnings), but this is undefined behaviour on any platform of course. --- include/decimal.h | 22 +++++++++--------- mysql-test/r/func_math.result | 8 +++++++ mysql-test/t/func_math.test | 5 ++++ sql/my_decimal.h | 43 +++++++++++++++++++---------------- strings/decimal.c | 40 +++++++++++++++++--------------- 5 files changed, 69 insertions(+), 49 deletions(-) diff --git a/include/decimal.h b/include/decimal.h index 530ed9e1757..90946f65ac6 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -29,14 +29,14 @@ typedef struct st_decimal_t { int internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed); -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler); int decimal2ulonglong(decimal_t *from, ulonglong *to); int ulonglong2decimal(ulonglong from, decimal_t *to); int decimal2longlong(decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); -int decimal2double(decimal_t *from, double *to); +int decimal2double(const decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); int decimal_actual_fraction(decimal_t *from); int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); @@ -47,17 +47,17 @@ int decimal_bin_size(int precision, int scale); int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param); -int decimal_intg(decimal_t *from); -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_cmp(decimal_t *from1, decimal_t *from2); -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, +int decimal_intg(const decimal_t *from); +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_cmp(const decimal_t *from1, const decimal_t *from2); +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, int scale_incr); -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_round(decimal_t *from, decimal_t *to, int new_scale, +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, decimal_round_mode mode); -int decimal_is_zero(decimal_t *from); +int decimal_is_zero(const decimal_t *from); void max_decimal(int precision, int frac, decimal_t *to); #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 3149a2a3344..57ec0cc0aca 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -656,3 +656,11 @@ Warning 1366 Incorrect decimal value: '' for column '' at row -1 SELECT 1 div null; 1 div null NULL +# +# Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +# +select (1.175494351E-37 div 1.7976931348623157E+308); +(1.175494351E-37 div 1.7976931348623157E+308) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e56b9c7d20d..daa338a8424 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -500,3 +500,8 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))); --echo # Bug #59498 div function broken in mysql-trunk --echo # SELECT 1 div null; + +--echo # +--echo # Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +--echo # +select (1.175494351E-37 div 1.7976931348623157E+308); diff --git a/sql/my_decimal.h b/sql/my_decimal.h index e2f5c95dac2..f3fd39f5721 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -178,7 +178,7 @@ void max_my_decimal(my_decimal *to, int precision, int frac) { DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& (frac <= DECIMAL_MAX_SCALE)); - max_decimal(precision, frac, (decimal_t*) to); + max_decimal(precision, frac, to); } inline void max_internal_decimal(my_decimal *to) @@ -277,14 +277,19 @@ inline int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec, int scale) { - return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale)); + return check_result(mask, bin2decimal(bin, d, prec, scale)); } inline int my_decimal_set_zero(my_decimal *d) { - decimal_make_zero(((decimal_t*) d)); + /* + We need the up-cast here, since my_decimal has sign() member functions, + which conflicts with decimal_t::size + (and decimal_make_zero is a macro, rather than a funcion). + */ + decimal_make_zero(static_cast(d)); return 0; } @@ -292,7 +297,7 @@ int my_decimal_set_zero(my_decimal *d) inline bool my_decimal_is_zero(const my_decimal *decimal_value) { - return decimal_is_zero((decimal_t*) decimal_value); + return decimal_is_zero(decimal_value); } @@ -300,7 +305,7 @@ inline int my_decimal_round(uint mask, const my_decimal *from, int scale, bool truncate, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, scale, + return check_result(mask, decimal_round(from, to, scale, (truncate ? TRUNCATE : HALF_UP))); } @@ -308,14 +313,14 @@ int my_decimal_round(uint mask, const my_decimal *from, int scale, inline int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR)); + return check_result(mask, decimal_round(from, to, 0, FLOOR)); } inline int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING)); + return check_result(mask, decimal_round(from, to, 0, CEILING)); } @@ -337,7 +342,7 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag, { my_decimal rounded; /* decimal_round can return only E_DEC_TRUNCATED */ - decimal_round((decimal_t*)d, &rounded, 0, HALF_UP); + decimal_round(d, &rounded, 0, HALF_UP); return check_result(mask, (unsigned_flag ? decimal2ulonglong(&rounded, (ulonglong *)l) : decimal2longlong(&rounded, l))); @@ -348,15 +353,14 @@ inline int my_decimal2double(uint, const my_decimal *d, double *result) { /* No need to call check_result as this will always succeed */ - return decimal2double((decimal_t*) d, result); + return decimal2double(d, result); } inline int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) { - return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), - d); + return check_result_and_overflow(mask, string2decimal(str, d, end), d); } @@ -379,7 +383,7 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec); inline int double2my_decimal(uint mask, double val, my_decimal *d) { - return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); + return check_result_and_overflow(mask, double2decimal(val, d), d); } @@ -409,7 +413,7 @@ int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_add((decimal_t*)a,(decimal_t*)b,res), + decimal_add(a, b, res), res); } @@ -419,7 +423,7 @@ int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_sub((decimal_t*)a,(decimal_t*)b,res), + decimal_sub(a, b, res), res); } @@ -429,7 +433,7 @@ int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mul((decimal_t*)a,(decimal_t*)b,res), + decimal_mul(a, b, res), res); } @@ -439,8 +443,7 @@ int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc) { return check_result_and_overflow(mask, - decimal_div((decimal_t*)a,(decimal_t*)b,res, - div_scale_inc), + decimal_div(a, b, res, div_scale_inc), res); } @@ -450,7 +453,7 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mod((decimal_t*)a,(decimal_t*)b,res), + decimal_mod(a, b, res), res); } @@ -462,14 +465,14 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, inline int my_decimal_cmp(const my_decimal *a, const my_decimal *b) { - return decimal_cmp((decimal_t*) a, (decimal_t*) b); + return decimal_cmp(a, b); } inline int my_decimal_intg(const my_decimal *a) { - return decimal_intg((decimal_t*) a); + return decimal_intg(a); } diff --git a/strings/decimal.c b/strings/decimal.c index e081c063033..4766c3b2d00 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -248,7 +248,7 @@ void max_decimal(int precision, int frac, decimal_t *to) } -static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result) +static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) { int intg= from->intg, i; dec1 *buf0= from->buf; @@ -326,7 +326,7 @@ int decimal_actual_fraction(decimal_t *from) E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW */ -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { @@ -942,7 +942,7 @@ fatal_error: E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED */ -int decimal2double(decimal_t *from, double *to) +int decimal2double(const decimal_t *from, double *to) { char strbuf[FLOATING_POINT_BUFFER], *end; int len= sizeof(strbuf); @@ -1461,7 +1461,7 @@ int decimal_bin_size(int precision, int scale) */ int -decimal_round(decimal_t *from, decimal_t *to, int scale, +decimal_round(const decimal_t *from, decimal_t *to, int scale, decimal_round_mode mode) { int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, @@ -1695,7 +1695,7 @@ int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param) return -1; /* shut up the warning */ } -static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -1777,7 +1777,7 @@ static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) /* to=from1-from2. if to==0, return -1/0/+1 - the result of the comparison */ -static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); @@ -1846,7 +1846,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) /* ensure that always from1 > from2 (and intg1 >= intg2) */ if (carry) { - swap_variables(decimal_t *,from1,from1); + swap_variables(const decimal_t *, from1, from2); swap_variables(dec1 *,start1, start2); swap_variables(int,intg1,intg2); swap_variables(int,frac1,frac2); @@ -1912,35 +1912,35 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) return error; } -int decimal_intg(decimal_t *from) +int decimal_intg(const decimal_t *from) { int res; remove_leading_zeroes(from, &res); return res; } -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_add(from1, from2, to); return do_sub(from1, from2, to); } -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, to); return do_add(from1, from2, to); } -int decimal_cmp(decimal_t *from1, decimal_t *from2) +int decimal_cmp(const decimal_t *from1, const decimal_t *from2) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, 0); return from1->sign > from2->sign ? -1 : 1; } -int decimal_is_zero(decimal_t *from) +int decimal_is_zero(const decimal_t *from) { dec1 *buf1=from->buf, *end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac); @@ -1971,7 +1971,7 @@ int decimal_is_zero(decimal_t *from) XXX if this library is to be used with huge numbers of thousands of digits, fast multiplication must be implemented. */ -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -2095,8 +2095,8 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) changed to malloc (or at least fallback to malloc if alloca() fails) but then, decimal_mul() should be rewritten too :( */ -static int do_div_mod(decimal_t *from1, decimal_t *from2, - decimal_t *to, decimal_t *mod, int scale_incr) +static int do_div_mod(const decimal_t *from1, const decimal_t *from2, + decimal_t *to, decimal_t *mod, int scale_incr) { int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1, frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2, @@ -2181,9 +2181,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2, } buf0=to->buf; stop0=buf0+intg0+frac0; + DBUG_ASSERT(stop0 <= &to->buf[to->len]); if (likely(div_mod)) - while (dintg++ < 0) + while (dintg++ < 0 && buf0 < &to->buf[to->len]) + { *buf0++=0; + } len1=(i=ROUND_UP(prec1))+ROUND_UP(2*frac2+scale_incr+1) + 1; set_if_bigger(len1, 3); @@ -2355,7 +2358,8 @@ done: */ int -decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) +decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, + int scale_incr) { return do_div_mod(from1, from2, to, 0, scale_incr); } @@ -2387,7 +2391,7 @@ decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) thus, there's no requirement for M or N to be integers */ -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { return do_div_mod(from1, from2, 0, to, 0); } From 6c85d6535781870e9d35a0f00ace9ef42edf3e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Bl=C3=A5udd?= Date: Fri, 4 Mar 2011 09:41:29 +0100 Subject: [PATCH 031/152] Bug#60111 storage type for table not saved in .frm - Add new "format section" in extra data segment with additional table and column properties. This was originally introduced in 5.1.20 based MySQL Cluster - Remove hardcoded STORAGE DISK for table and instead output the real storage format used. Keep both TABLESPACE and STORAGE inside same version guard. - Implement default version of handler::get_tablespace_name() since tablespace is now available in share and it's unnecessary for each handler to implement. (the function could actually be removed totally now). - Add test for combinations of TABLESPACE and STORAGE with CREATE TABLE and ALTER TABLE - Add test to show that 5.5 now can read a .frm file created by MySQL Cluster 7.0.22. Although it does not yet show the column level attributes, they are read. --- include/mysql_com.h | 4 + mysql-test/r/tablespace.result | 112 +++++++++++++++++++ mysql-test/std_data/cluster_7022_table.MYD | 0 mysql-test/std_data/cluster_7022_table.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/cluster_7022_table.frm | Bin 0 -> 8794 bytes mysql-test/t/tablespace.test | 122 +++++++++++++++++++++ sql/handler.cc | 16 +++ sql/handler.h | 3 +- sql/sql_show.cc | 25 +++-- sql/sql_table.cc | 17 +-- sql/table.cc | 95 +++++++++++++--- sql/table.h | 2 + sql/unireg.cc | 64 +++++++++++ 13 files changed, 421 insertions(+), 39 deletions(-) create mode 100644 mysql-test/r/tablespace.result create mode 100644 mysql-test/std_data/cluster_7022_table.MYD create mode 100644 mysql-test/std_data/cluster_7022_table.MYI create mode 100644 mysql-test/std_data/cluster_7022_table.frm create mode 100644 mysql-test/t/tablespace.test diff --git a/include/mysql_com.h b/include/mysql_com.h index f4c023721de..c35a604781d 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -114,6 +114,10 @@ enum enum_server_command #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ #define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ +#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, + reserved by MySQL Cluster */ +#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, + reserved by MySQL Cluster */ #define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_LOG 2 /* Start on new log file */ diff --git a/mysql-test/r/tablespace.result b/mysql-test/r/tablespace.result new file mode 100644 index 00000000000..38d450ae430 --- /dev/null +++ b/mysql-test/r/tablespace.result @@ -0,0 +1,112 @@ +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` int(11) NOT NULL, + `e` int(11) DEFAULT NULL, + `f` int(11) DEFAULT NULL, + `g` int(11) DEFAULT NULL, + `h` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + `k` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) /*!50100 TABLESPACE the_tablespacename STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/std_data/cluster_7022_table.MYD b/mysql-test/std_data/cluster_7022_table.MYD new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/std_data/cluster_7022_table.MYI b/mysql-test/std_data/cluster_7022_table.MYI new file mode 100644 index 0000000000000000000000000000000000000000..332b0e647970cd3e9079334b890ee5c597eb23c8 GIT binary patch literal 1024 zcmezOkDZZ$fpHeY28I-dBMcxm0|$@hD xE196GpfuDKED$aWgbNeo0IOwz7|x;q;X(AXI6!y}5DI7;m@!I>h5$`N001OsBdY)a literal 0 HcmV?d00001 diff --git a/mysql-test/std_data/cluster_7022_table.frm b/mysql-test/std_data/cluster_7022_table.frm new file mode 100644 index 0000000000000000000000000000000000000000..84714a1721a401b1209aa59ee118a0e9405bc39e GIT binary patch literal 8794 zcmeI2Jx>Bb5Qg6y5I7DHKcXfSVoWr~1gxy3q#z+!X=4sJjsrC&($MkW{4xFu#~Hq| z1%-APXPUizGTEJdwz|oFdA^?l${uh7Bwh{cpfluv9i7X#h(z)}KY-g6sMmq&YGR`q zFau`54445kU zqWG68GiXhl_l?%#tQYg^0Vc!fX%cpyqxZM47rllrk=`1WbJ*MW^&TzEfEh3YX21-X z0W)9*%zzm%17^SsY%=gjC~xBbg?R`NV=Bk3;beX2Hjb8W9%2*%I=rg>Fr<${p}d)( zE;67VvY@`KL=k+@KsqfH%Z4;W0hFK!8leOlBTYeodGAGPNa?c+1zBmv%$6XdAaFod z!LGJzmKiw(2Tq2s;Mf6q1r-Mb3QnCh3JT7hjG}@|2b2_CJAgy(a*z8Q@ql964X GGrj@C&O3s->tablespace; + if (!ts) + return NULL; + + if (!buff) + { + buff= my_strdup(ts, MYF(0)); + return buff; + } + + strnmov(buff, ts, buff_len); + return buff; +} + /**************************************************************************** ** Some general functions that isn't in the handler class ****************************************************************************/ diff --git a/sql/handler.h b/sql/handler.h index 3cd4acee80d..8ff6a9f8f03 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1646,8 +1646,7 @@ public: { return FALSE; } virtual char* get_foreign_key_create_info() { return(NULL);} /* gets foreign key create string from InnoDB */ - virtual char* get_tablespace_name(THD *thd, char *name, uint name_len) - { return(NULL);} /* gets tablespace name from handler */ + virtual char* get_tablespace_name(THD *thd, char *name, uint name_len); /** used in ALTER TABLE; 1 if changing storage engine is allowed */ virtual bool can_switch_engines() { return 1; } /** diff --git a/sql/sql_show.cc b/sql/sql_show.cc index abef175ab55..c3dda3072f2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1379,17 +1379,24 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { show_table_options= TRUE; - /* - Get possible table space definitions and append them - to the CREATE TABLE statement - */ - if ((for_str= file->get_tablespace_name(thd,0,0))) + /* TABLESPACE and STORAGE */ + if (share->tablespace || + share->default_storage_media != HA_SM_DEFAULT) { - packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE ")); - packet->append(for_str, strlen(for_str)); - packet->append(STRING_WITH_LEN(" STORAGE DISK */")); - my_free(for_str); + packet->append(STRING_WITH_LEN(" /*!50100")); + if (share->tablespace) + { + packet->append(STRING_WITH_LEN(" TABLESPACE ")); + packet->append(share->tablespace, strlen(share->tablespace)); + } + + if (share->default_storage_media == HA_SM_DISK) + packet->append(STRING_WITH_LEN(" STORAGE DISK")); + if (share->default_storage_media == HA_SM_MEMORY) + packet->append(STRING_WITH_LEN(" STORAGE MEMORY")); + + packet->append(STRING_WITH_LEN(" */")); } /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2855bb0ec4a..21b8b5bf0a0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5281,17 +5281,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) create_info->key_block_size= table->s->key_block_size; - if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY) - { - char *tablespace= static_cast(thd->alloc(FN_LEN + 1)); - /* - Regular alter table of disk stored table (no tablespace/storage change) - Copy tablespace name - */ - if (tablespace && - (table->file->get_tablespace_name(thd, tablespace, FN_LEN))) - create_info->tablespace= tablespace; - } + if (!create_info->tablespace) + create_info->tablespace= table->s->tablespace; + + if (create_info->storage_media == HA_SM_DEFAULT) + create_info->storage_media= table->s->default_storage_media; + restore_record(table, s->default_values); // Empty record for DEFAULT Create_field *def; diff --git a/sql/table.cc b/sql/table.cc index 0ce7d7427d3..7bdfa65d94b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -750,6 +750,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, const char **interval_array; enum legacy_db_type legacy_db_type; my_bitmap_map *bitmaps; + uchar *extra_segment_buff= 0; + const uint format_section_header_size= 8; + uchar *format_section_fields= 0; DBUG_ENTER("open_binary_frm"); new_field_pack_flag= head[27]; @@ -942,27 +945,27 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((n_length= uint4korr(head+55))) { /* Read extra data segment */ - uchar *buff, *next_chunk, *buff_end; + uchar *next_chunk, *buff_end; DBUG_PRINT("info", ("extra segment size is %u bytes", n_length)); - if (!(next_chunk= buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) + if (!(extra_segment_buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) goto err; - if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength, + next_chunk= extra_segment_buff; + if (mysql_file_pread(file, extra_segment_buff, + n_length, record_offset + share->reclength, MYF(MY_NABP))) { - my_free(buff); goto err; } - share->connect_string.length= uint2korr(buff); + share->connect_string.length= uint2korr(next_chunk); if (!(share->connect_string.str= strmake_root(&share->mem_root, (char*) next_chunk + 2, share->connect_string. length))) { - my_free(buff); goto err; } next_chunk+= share->connect_string.length + 2; - buff_end= buff + n_length; + buff_end= extra_segment_buff + n_length; if (next_chunk + 2 < buff_end) { uint str_db_type_length= uint2korr(next_chunk); @@ -979,7 +982,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, plugin_data(tmp_plugin, handlerton *))) { /* bad file, legacy_db_type did not match the name */ - my_free(buff); goto err; } /* @@ -1009,7 +1011,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-partition"); - my_free(buff); goto err; } plugin_unlock(NULL, share->db_plugin); @@ -1025,7 +1026,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; name.str[name.length]=0; my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); - my_free(buff); goto err; /* purecov: end */ } @@ -1042,7 +1042,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, memdup_root(&share->mem_root, next_chunk + 4, partition_info_str_len + 1))) { - my_free(buff); goto err; } } @@ -1050,7 +1049,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (partition_info_str_len) { DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined")); - my_free(buff); goto err; } #endif @@ -1088,7 +1086,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("fulltext key uses parser that is not defined in .frm")); - my_free(buff); goto err; } parser_name.str= (char*) next_chunk; @@ -1099,7 +1096,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (! keyinfo->parser) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str); - my_free(buff); goto err; } } @@ -1111,19 +1107,68 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("long table comment is not defined in .frm")); - my_free(buff); goto err; } share->comment.length = uint2korr(next_chunk); if (! (share->comment.str= strmake_root(&share->mem_root, (char*)next_chunk + 2, share->comment.length))) { - my_free(buff); goto err; } next_chunk+= 2 + share->comment.length; } - my_free(buff); + + if (next_chunk + format_section_header_size < buff_end) + { + /* + New extra data segment called "format section" with additional + table and column properties introduced by MySQL Cluster + based on 5.1.20 + + Table properties: + TABLESPACE and STORAGE [DISK|MEMORY] + + Column properties: + COLUMN_FORMAT [DYNAMIC|FIXED] and STORAGE [DISK|MEMORY] + */ + DBUG_PRINT("info", ("Found format section")); + + /* header */ + const uint format_section_length= uint2korr(next_chunk); + const uint format_section_flags= uint4korr(next_chunk+2); + /* 2 bytes unused */ + + if (next_chunk + format_section_length > buff_end) + { + DBUG_PRINT("error", ("format section length too long: %u", + format_section_length)); + goto err; + } + DBUG_PRINT("info", ("format_section_length: %u, format_section_flags: %u", + format_section_length, format_section_flags)); + + share->default_storage_media= + (enum ha_storage_media) (format_section_flags & 0x7); + + /* tablespace */ + const char *tablespace= + (const char*)next_chunk + format_section_header_size; + const uint tablespace_length= strlen(tablespace); + if (tablespace_length && + !(share->tablespace= strmake_root(&share->mem_root, + tablespace, tablespace_length+1))) + { + goto err; + } + DBUG_PRINT("info", ("tablespace: '%s'", + share->tablespace ? share->tablespace : "")); + + /* pointer to format section for fields */ + format_section_fields= + next_chunk + format_section_header_size + tablespace_length + 1; + + next_chunk+= format_section_length; + } } share->key_block_size= uint2korr(head+62); @@ -1438,6 +1483,18 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; goto err; } + + if (format_section_fields) + { + const uchar field_flags= format_section_fields[i]; + const uchar field_storage= (field_flags & STORAGE_TYPE_MASK); + const uchar field_column_format= + ((field_flags >> COLUMN_FORMAT_SHIFT)& STORAGE_TYPE_MASK); + DBUG_PRINT("debug", ("field flags: %u, storage: %u, column_format: %u", + field_flags, field_storage, field_column_format)); + (void)field_storage; /* Reserved by and used in MySQL Cluster */ + (void)field_column_format; /* Reserved by and used in MySQL Cluster */ + } } *field_ptr=0; // End marker @@ -1705,6 +1762,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (use_hash) (void) my_hash_check(&share->name_hash); #endif + my_free(extra_segment_buff); DBUG_RETURN (0); err: @@ -1712,6 +1770,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->open_errno= my_errno; share->errarg= errarg; my_free(disk_buff); + my_free(extra_segment_buff); delete crypted; delete handler_file; my_hash_free(&share->name_hash); @@ -2687,6 +2746,8 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table) create_info->default_table_charset= share->table_charset; create_info->table_charset= 0; create_info->comment= share->comment; + create_info->storage_media= share->default_storage_media; + create_info->tablespace= share->tablespace; DBUG_VOID_RETURN; } diff --git a/sql/table.h b/sql/table.h index 39e9ef2e0dd..bd8c66173f4 100644 --- a/sql/table.h +++ b/sql/table.h @@ -609,6 +609,8 @@ struct TABLE_SHARE } enum row_type row_type; /* How rows are stored */ enum tmp_table_type tmp_table; + enum ha_storage_media default_storage_media; + char *tablespace; uint ref_count; /* How many TABLE objects uses this */ uint blob_ptr_size; /* 4 or 8 */ diff --git a/sql/unireg.cc b/sql/unireg.cc index 6433b8bc7c2..5a44c5e68f5 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -124,6 +124,9 @@ bool mysql_create_frm(THD *thd, const char *file_name, #endif Pack_header_error_handler pack_header_error_handler; int error; + const uint format_section_header_size= 8; + uint format_section_length; + uint tablespace_length= 0; DBUG_ENTER("mysql_create_frm"); DBUG_ASSERT(*fn_rext((char*)file_name)); // Check .frm extension @@ -256,6 +259,18 @@ bool mysql_create_frm(THD *thd, const char *file_name, forminfo[46]=(uchar) create_info->comment.length; } + /* + Add room in extra segment for "format section" with additional + table and column properties + */ + if (create_info->tablespace) + tablespace_length= strlen(create_info->tablespace); + format_section_length= + format_section_header_size + + tablespace_length + 1 + + create_fields.elements; + create_info->extra_size+= format_section_length; + if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys, key_info)) < 0) { @@ -353,6 +368,55 @@ bool mysql_create_frm(THD *thd, const char *file_name, goto err; } + /* "Format section" with additional table and column properties */ + { + uchar *ptr, *format_section_buff; + if (!(format_section_buff=(uchar*) my_malloc(format_section_length, + MYF(MY_WME)))) + goto err; + ptr= format_section_buff; + + /* header */ + const uint format_section_flags= + create_info->storage_media; // 3 bits + const uint format_section_unused= 0; + int2store(ptr+0, format_section_length); + int4store(ptr+2, format_section_flags); + int2store(ptr+6, format_section_unused); + ptr+= format_section_header_size; + + /* tablespace name */ + if (tablespace_length > 0) + memcpy(ptr, create_info->tablespace, tablespace_length); + ptr+= tablespace_length; + *ptr= 0; /* tablespace string terminating zero */ + ptr++; + + /* column properties */ + Create_field *field; + List_iterator it(create_fields); + while ((field=it++)) + { + const uchar field_storage= 0; /* Used in MySQL Cluster */ + const uchar field_column_format= 0; /* Used in MySQL Cluster */ + const uchar field_flags= + field_storage + (field_column_format << COLUMN_FORMAT_SHIFT); + *ptr= field_flags; + ptr++; + } + DBUG_ASSERT(format_section_buff + format_section_length == ptr); + + if (mysql_file_write(file, format_section_buff, + format_section_length, MYF_RW)) + { + my_free(format_section_buff); + goto err; + } + DBUG_PRINT("info", ("wrote format section, length: %u", + format_section_length)); + my_free(format_section_buff); + } + mysql_file_seek(file, filepos, MY_SEEK_SET, MYF(0)); if (mysql_file_write(file, forminfo, 288, MYF_RW) || mysql_file_write(file, screen_buff, info_length, MYF_RW) || From 40d72add32c94a4e891966ee46deb58f19c609d1 Mon Sep 17 00:00:00 2001 From: Jorgen Loland Date: Fri, 4 Mar 2011 15:46:17 +0100 Subject: [PATCH 032/152] BUG#11766317: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 (Former 59405) In this bug, args[0] in an Item_func_find_in_set stored an Item_func_weekday that was constant. In Item_func_find_in_set::fix_length_and_dec(), args[0]->val_str() was called. Later, when Item_func_find_in_set::val_int() was called, args[0]->null_value was checked. However, the Item_func_weekday in args[0] had now been replaced with an Item_cache. No val_*() calls had been made to this Item_cache, thus null_value was incorrectly 'true', resulting in missing rows in the result set. enum_value gets a value in fix_length_and_dec() iff args[0] is both constant and non-null. It is therefore unnecessary to check the null_value of args[0] in val_int(). An alternative fix would be to call args[0]->val_int() inside Item_func_find_in_set::val_int(). This would ensure args[0]->null_value was set correctly (always false in this case), but that would have to be done for every record this const value is checked against. --- mysql-test/r/func_set.result | 42 ++++++++++++++++++++++++++++++++++++ mysql-test/t/func_set.test | 22 +++++++++++++++++++ sql/item_func.cc | 19 +++++++++++++--- 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 14ebc8203ec..ba9500bff46 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -159,3 +159,45 @@ SELECT CONVERT( a USING latin1 ) FROM t2; CONVERT( a USING latin1 ) DROP TABLE t1, t2; +# +# BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +# +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +days +NULL +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 + +DROP TABLE t1; diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 294efa8caf1..3531864c860 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -97,3 +97,25 @@ SELECT CONVERT( a USING latin1 ) FROM t1; SELECT CONVERT( a USING latin1 ) FROM t2; DROP TABLE t1, t2; + +--echo # +--echo # BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +--echo # + +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +--echo +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; + +--echo +DROP TABLE t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 9b8ba6968b3..1908eda7d99 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3003,6 +3003,8 @@ void Item_func_find_in_set::fix_length_and_dec() String *find=args[0]->val_str(&value); if (find) { + // find is not NULL pointer so args[0] is not a null-value + DBUG_ASSERT(!args[0]->null_value); enum_value= find_type(((Field_enum*) field)->typelib,find->ptr(), find->length(), 0); enum_bit=0; @@ -3021,11 +3023,22 @@ longlong Item_func_find_in_set::val_int() DBUG_ASSERT(fixed == 1); if (enum_value) { - ulonglong tmp=(ulonglong) args[1]->val_int(); - if (!(null_value=args[1]->null_value || args[0]->null_value)) + // enum_value is set iff args[0]->const_item() in fix_length_and_dec(). + DBUG_ASSERT(args[0]->const_item()); + + ulonglong tmp= (ulonglong) args[1]->val_int(); + null_value= args[1]->null_value; + /* + No need to check args[0]->null_value since enum_value is set iff + args[0] is a non-null const item. Note: no DBUG_ASSERT on + args[0]->null_value here because args[0] may have been replaced + by an Item_cache on which val_int() has not been called. See + BUG#11766317 + */ + if (!null_value) { if (tmp & enum_bit) - return enum_value; + return enum_value; } return 0L; } From c614ff3a42cb1169c6a676205def6c9fb81197f2 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 4 Mar 2011 21:03:39 +0530 Subject: [PATCH 033/152] BUG#11766219 : 59280: $MYSQL_HOME IS NOT USED FOR THE CLIENT CONFIGURATION. At startup, MySQL server/client programs do not read configuration file pointed by MYSQL_HOME environment variable. This happened as, this environment variable was handled by a different variable (DEFAULT_HOME_ENV) in the code, which was ne'er initialized. Fixed by changing it to MYSQL_HOME. --- mysys/default.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index 9a4b990f003..805dc5f3f58 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -140,7 +140,7 @@ static int search_default_file_with_ext(Process_option_func func, - Unix: /etc/ - Unix: /etc/mysql/ - Unix: --sysconfdir= (compile-time option) - - ALL: getenv(DEFAULT_HOME_ENV) + - ALL: getenv("MYSQL_HOME") - ALL: --defaults-extra-file= (run-time option) - Unix: ~/ @@ -1232,7 +1232,7 @@ static const char **init_default_directories(MEM_ROOT *alloc) #endif - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) + if ((env= getenv("MYSQL_HOME"))) errors += add_directory(alloc, env, dirs); /* Placeholder for --defaults-extra-file= */ From e5fdeac0f67f392ac5e800b9591c8422af8b951b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 4 Mar 2011 18:43:28 +0300 Subject: [PATCH 034/152] Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters @ mysql-test/r/ctype_latin1.result @ mysql-test/r/ctype_utf8.result @ mysql-test/t/ctype_latin1.test @ mysql-test/t/ctype_utf8.test Adding tests @ sql/mysqld.h @ sql/item.cc @ sql/sql_parse.cc @ sql/sql_view.cc Refactoring (thanks to Guilhem for the idea): Item_string::print() was hard to understand because of the different QT_ constants: in "query_type==QT_x", QT_x is explicitely included but the other two QT_ are implicitely excluded. The combinations with '||' and '&&' make this even harder. - logic is now more "explicit" by changing QT_ constants to a bitmap of flags: QT_ORDINARY: no change, QT_IS -> QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS, QT_EXPLAIN -> QT_TO_SYSTEM_CHARSET (QT_EXPLAIN was introduced in the first version of the Bug#57341 patch) - Item_string::print() is rewritten using those flags Bugfix itself: When QT_TO_SYSTEM_CHARSET is used alone (with no QT_WITHOUT_INTRODUCERS), we print string literals as follows: - display introducers if they were in the original query - print ASCII characters as is - print non-ASCII characters using hex-escape Note: as "EXPLAIN" output is only for human readability purposes and does not need to be a pasrable SQL, so using hex-escape is Ok. ErrConvString class perfectly suites for hex escaping purposes. --- mysql-test/r/ctype_latin1.result | 15 ++++++++ mysql-test/r/ctype_utf8.result | 15 ++++++++ mysql-test/t/ctype_latin1.test | 15 ++++++++ mysql-test/t/ctype_utf8.test | 10 +++++ sql/item.cc | 63 +++++++++++++++++++++++--------- sql/mysqld.h | 14 +++---- sql/sql_parse.cc | 6 ++- sql/sql_view.cc | 3 +- 8 files changed, 114 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 6f773270dff..7a8f07e912b 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3246,5 +3246,20 @@ maketime(`a`,`a`,`a`) DROP TABLE t1; SET sql_mode=default; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó` +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó` +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index ababfe51621..ea6f00e2581 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4969,5 +4969,20 @@ GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key' DROP TABLE t1; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ` +# # End of 5.5 tests # diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index b8aae2eae40..5d1acf107d7 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -143,6 +143,21 @@ SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, ''); --source include/ctype_numconv.inc +--echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Test latin1 client erroneously started with --default-character-set=utf8 +# EXPLAIN output should still be pretty readable. +# We're using 'ó' (\xC3\xB3) as a magic sequence: +# - it's "LATIN CAPITAL LETTER A WITH TILDE ABOVE + SUPERSCRIPT 3" in latin1 +# - it's "LATIN SMALL LETTER O WITH ACUTE ABOVE" in utf8. +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +# Test normal latin1 +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; + + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 2aea21afe68..a519a417192 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1550,6 +1550,16 @@ SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); DROP TABLE t1; +--echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Emulate utf8 client erroneously started with --default-character-set=latin1, +# as in the bug report. EXPLAIN output should still be pretty readable +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u; +# Test normal utf8 +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ'; --echo # --echo # End of 5.5 tests diff --git a/sql/item.cc b/sql/item.cc index c7787d65c22..2090a1e4eda 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2514,7 +2514,9 @@ my_decimal *Item_float::val_decimal(my_decimal *decimal_value) void Item_string::print(String *str, enum_query_type query_type) { - if (query_type == QT_ORDINARY && is_cs_specified()) + const bool print_introducer= + !(query_type & QT_WITHOUT_INTRODUCERS) && is_cs_specified(); + if (print_introducer) { str->append('_'); str->append(collation.collation->csname); @@ -2522,27 +2524,52 @@ void Item_string::print(String *str, enum_query_type query_type) str->append('\''); - if (query_type == QT_ORDINARY || - my_charset_same(str_value.charset(), system_charset_info)) + if (query_type & QT_TO_SYSTEM_CHARSET) { - str_value.print(str); + if (print_introducer) + { + /* + Because we wrote an introducer, we must print str_value in its + charset, and the resulting bytes must not be changed until they + reach the end client. + But the caller is asking for system_charset_info, and may later + convert into character_set_results. That means two conversions: we + must ensure that they don't change our printed bytes. + So we print str_value in the least common denominator of the three + charsets involved: ASCII. Non-ASCII characters are printed as \xFF + sequences (which is ASCII too). This way, our bytes will not be + changed. + */ + ErrConvString tmp(str_value.ptr(), str_value.length(), &my_charset_bin); + str->append(tmp.ptr()); + } + else + { + if (my_charset_same(str_value.charset(), system_charset_info)) + str_value.print(str); // already in system_charset_info + else // need to convert + { + THD *thd= current_thd; + LEX_STRING utf8_lex_str; + + thd->convert_string(&utf8_lex_str, + system_charset_info, + str_value.c_ptr_safe(), + str_value.length(), + str_value.charset()); + + String utf8_str(utf8_lex_str.str, + utf8_lex_str.length, + system_charset_info); + + utf8_str.print(str); + } + } } else { - THD *thd= current_thd; - LEX_STRING utf8_lex_str; - - thd->convert_string(&utf8_lex_str, - system_charset_info, - str_value.c_ptr_safe(), - str_value.length(), - str_value.charset()); - - String utf8_str(utf8_lex_str.str, - utf8_lex_str.length, - system_charset_info); - - utf8_str.print(str); + // Caller wants a result in the charset of str_value. + str_value.print(str); } str->append('\''); diff --git a/sql/mysqld.h b/sql/mysqld.h index 2099e57e96d..5af1260ecbc 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -399,16 +399,16 @@ enum options_mysqld /** - Query type constants. - - QT_ORDINARY -- ordinary SQL query. - QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without - character set introducers). + Query type constants (usable as bitmap flags). */ enum enum_query_type { - QT_ORDINARY, - QT_IS + /// Nothing specific, ordinary SQL query. + QT_ORDINARY= 0, + /// In utf8. + QT_TO_SYSTEM_CHARSET= (1 << 0), + /// Without character set introducers. + QT_WITHOUT_INTRODUCERS= (1 << 1) }; /* query_id */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d9e1245bf66..367699ea6cb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4439,7 +4439,11 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) char buff[1024]; String str(buff,(uint32) sizeof(buff), system_charset_info); str.length(0); - thd->lex->unit.print(&str, QT_ORDINARY); + /* + The warnings system requires input in utf8, @see + mysqld_show_warnings(). + */ + thd->lex->unit.print(&str, QT_TO_SYSTEM_CHARSET); str.append('\0'); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_YES, str.ptr()); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 17b8056a165..6051aa028c7 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -841,7 +841,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, thd->variables.sql_mode&= ~MODE_ANSI_QUOTES; lex->unit.print(&view_query, QT_ORDINARY); - lex->unit.print(&is_query, QT_IS); + lex->unit.print(&is_query, + enum_query_type(QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS)); thd->variables.sql_mode|= sql_mode; } From c2dc4b022a8550d6d7167b29ad1ac78677867a09 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 7 Mar 2011 10:08:10 +0100 Subject: [PATCH 035/152] Bug #11764779 (former 57649) FLUSH TABLES under FLUSH TABLES WITH READ LOCK leads to assert failure. This assert was triggered if a statement tried up upgrade a metadata lock with an active FLUSH TABLE WITH READ LOCK. The assert checks that the connection already holds a global intention exclusive metadata lock. However, FLUSH TABLE WITH READ LOCK does not acquire this lock in order to be compatible with FLUSH TABLES WITH READ LOCK. Therefore any metadata lock upgrade caused the assert to be triggered. This patch fixes the problem by preventing metadata lock upgrade if the connection has an active FLUSH TABLE WITH READ LOCK. ER_TABLE_NOT_LOCKED_FOR_WRITE will instead be reported to the client. Test case added to flush.test. --- mysql-test/r/flush.result | 15 ++++++++++++ mysql-test/t/flush.test | 24 ++++++++++++++++++ sql/sql_base.cc | 51 ++++++++++++++++++++++++--------------- sql/sql_base.h | 4 +-- sql/sql_reload.cc | 20 ++++++++++++--- sql/sql_table.cc | 2 +- sql/sql_trigger.cc | 5 ++-- sql/sql_truncate.cc | 4 +-- 8 files changed, 95 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index b1e2e48eca8..bbfea2dade8 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -451,3 +451,18 @@ unlock tables; handler t1 close; # Cleanup. drop tables t1, t2; +# +# Bug#57649 FLUSH TABLES under FLUSH TABLES WITH READ LOCK leads +# to assert failure. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; +FLUSH TABLES; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +ALTER TABLE t1 COMMENT 'test'; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 944c9c43019..52ee6d2cf87 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -644,3 +644,27 @@ disconnect con2; --source include/wait_until_disconnected.inc connection default; drop tables t1, t2; + + +--echo # +--echo # Bug#57649 FLUSH TABLES under FLUSH TABLES WITH READ LOCK leads +--echo # to assert failure. +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; + +# All these triggered the assertion +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLES; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +ALTER TABLE t1 COMMENT 'test'; + +UNLOCK TABLES; +DROP TABLE t1; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8b6cc2caf10..7c020515f87 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1026,7 +1026,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, table_list= table_list->next_global) { /* A check that the table was locked for write is done by the caller. */ - TABLE *table= find_table_for_mdl_upgrade(thd->open_tables, table_list->db, + TABLE *table= find_table_for_mdl_upgrade(thd, table_list->db, table_list->table_name, TRUE); /* May return NULL if this table has already been closed via an alias. */ @@ -3120,22 +3120,26 @@ TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name) lock from the list of open tables, emit error if no such table found. - @param list List of TABLE objects to be searched + @param thd Thread context @param db Database name. @param table_name Name of table. @param no_error Don't emit error if no suitable TABLE instance were found. + @note This function checks if the connection holds a global IX + metadata lock. If no such lock is found, it is not safe to + upgrade the lock and ER_TABLE_NOT_LOCKED_FOR_WRITE will be + reported. + @return Pointer to TABLE instance with MDL_SHARED_NO_WRITE, MDL_SHARED_NO_READ_WRITE, or MDL_EXCLUSIVE metadata lock, NULL otherwise. */ -TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, - const char *table_name, - bool no_error) +TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, + const char *table_name, bool no_error) { - TABLE *tab= find_locked_table(list, db, table_name); + TABLE *tab= find_locked_table(thd->open_tables, db, table_name); if (!tab) { @@ -3143,19 +3147,29 @@ TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, my_error(ER_TABLE_NOT_LOCKED, MYF(0), table_name); return NULL; } - else + + /* + It is not safe to upgrade the metadata lock without a global IX lock. + This can happen with FLUSH TABLES WITH READ LOCK as we in these + cases don't take a global IX lock in order to be compatible with + global read lock. + */ + if (!thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "", + MDL_INTENTION_EXCLUSIVE)) { - while (tab->mdl_ticket != NULL && - !tab->mdl_ticket->is_upgradable_or_exclusive() && - (tab= find_locked_table(tab->next, db, table_name))) - continue; - if (!tab) - { - if (!no_error) - my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); - return 0; - } + if (!no_error) + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); + return NULL; } + + while (tab->mdl_ticket != NULL && + !tab->mdl_ticket->is_upgradable_or_exclusive() && + (tab= find_locked_table(tab->next, db, table_name))) + continue; + + if (!tab && !no_error) + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name); + return tab; } @@ -4653,8 +4667,7 @@ open_tables_check_upgradable_mdl(THD *thd, TABLE_LIST *tables_start, Note that find_table_for_mdl_upgrade() will report an error if no suitable ticket is found. */ - if (!find_table_for_mdl_upgrade(thd->open_tables, table->db, - table->table_name, FALSE)) + if (!find_table_for_mdl_upgrade(thd, table->db, table->table_name, false)) return TRUE; } } diff --git a/sql/sql_base.h b/sql/sql_base.h index 35fa04b3674..dc8320687fc 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -1,4 +1,4 @@ -/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. +/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -290,7 +290,7 @@ bool tdc_open_view(THD *thd, TABLE_LIST *table_list, const char *alias, char *cache_key, uint cache_key_length, MEM_ROOT *mem_root, uint flags); void tdc_flush_unused_tables(); -TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db, +TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, const char *table_name, bool no_error); void mark_tmp_table_for_reuse(TABLE *table); diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 0810459cb49..a09aa5511bd 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -220,12 +220,26 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, if (tables) { for (TABLE_LIST *t= tables; t; t= t->next_local) - if (!find_table_for_mdl_upgrade(thd->open_tables, t->db, - t->table_name, FALSE)) + if (!find_table_for_mdl_upgrade(thd, t->db, t->table_name, false)) return 1; } else { + /* + It is not safe to upgrade the metadata lock without GLOBAL IX lock. + This can happen with FLUSH TABLES WITH READ LOCK as we in these + cases don't take a GLOBAL IX lock in order to be compatible with + global read lock. + */ + if (thd->open_tables && + !thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "", + MDL_INTENTION_EXCLUSIVE)) + { + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), + thd->open_tables->s->table_name.str); + return true; + } + for (TABLE *tab= thd->open_tables; tab; tab= tab->next) { if (! tab->mdl_ticket->is_upgradable_or_exclusive()) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2855bb0ec4a..677d2095a77 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1917,7 +1917,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, by parser) it is safe to cache pointer to the TABLE instances in its elements. */ - table->table= find_table_for_mdl_upgrade(thd->open_tables, table->db, + table->table= find_table_for_mdl_upgrade(thd, table->db, table->table_name, false); if (!table->table) DBUG_RETURN(true); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index c2e3cd9944a..e986f6d7e92 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -467,8 +467,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) if (thd->locked_tables_mode) { /* Under LOCK TABLES we must only accept write locked tables. */ - if (!(tables->table= find_table_for_mdl_upgrade(thd->open_tables, - tables->db, + if (!(tables->table= find_table_for_mdl_upgrade(thd, tables->db, tables->table_name, FALSE))) goto end; diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 909c6a08b67..67ed608f114 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -327,7 +327,7 @@ bool Truncate_statement::lock_table(THD *thd, TABLE_LIST *table_ref, */ if (thd->locked_tables_mode) { - if (!(table= find_table_for_mdl_upgrade(thd->open_tables, table_ref->db, + if (!(table= find_table_for_mdl_upgrade(thd, table_ref->db, table_ref->table_name, FALSE))) DBUG_RETURN(TRUE); From c171d99ded053201cef9ae25aaf70d91e6b7c496 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 7 Mar 2011 14:30:49 +0100 Subject: [PATCH 036/152] Bug #11784056 ENABLE CONCURRENT READS WHILE CREATING NON-PRIMARY UNIQUE INDEX USING INNODB This patch adds the HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE capability flag to InnoDB, indicating that concurrent reads can be allowed while non-primary unique indexes are created. This is an follow-up to Bug #11751388 which enabled concurrent reads when creating non-primary non-unique indexes. Test case added to innodb_mysql_sync.test. --- mysql-test/r/innodb_mysql_sync.result | 10 ++++++++++ mysql-test/t/innodb_mysql_sync.test | 27 ++++++++++++--------------- storage/innobase/handler/ha_innodb.cc | 1 + 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 58948835f66..8e210a7e205 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -153,5 +153,15 @@ SET DEBUG_SYNC= "now SIGNAL query"; a b # Test 4: Secondary unique index, should not block reads. # Connection default +SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +# Sending: +ALTER TABLE t1 ADD UNIQUE (b); +# Connection con1 +SET DEBUG_SYNC= "now WAIT_FOR manage"; +SELECT * FROM t1; +a b +SET DEBUG_SYNC= "now SIGNAL query"; +# Connection default +# Reaping: ALTER TABLE t1 ADD UNIQUE (b) SET DEBUG_SYNC= "RESET"; DROP TABLE t1; diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index a8925306c70..bf1e5de1587 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -253,26 +253,23 @@ connection con1; --reap --echo # Test 4: Secondary unique index, should not block reads. -# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported -# by InnoDB. Adding this flag currently introduces a regression so -# this test is disabled until the regression has been fixed. --echo # Connection default connection default; -#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -#--echo # Sending: -#--send ALTER TABLE t1 ADD UNIQUE (b) +SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +--echo # Sending: +--send ALTER TABLE t1 ADD UNIQUE (b) -#--echo # Connection con1 -#connection con1; -#SET DEBUG_SYNC= "now WAIT_FOR manage"; -#SELECT * FROM t1; -#SET DEBUG_SYNC= "now SIGNAL query"; +--echo # Connection con1 +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR manage"; +SELECT * FROM t1; +SET DEBUG_SYNC= "now SIGNAL query"; -#--echo # Connection default -#connection default; -#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) -#--reap +--echo # Connection default +connection default; +--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) +--reap disconnect con1; disconnect con2; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 3763e6f9cef..bea92903c58 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2597,6 +2597,7 @@ innobase_alter_table_flags( | HA_INPLACE_ADD_INDEX_NO_WRITE | HA_INPLACE_DROP_INDEX_NO_READ_WRITE | HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE + | HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE | HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE | HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE); } From d072bb0d7f40822ae13affadd897bb47ea01d4cc Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Mon, 7 Mar 2011 09:42:07 -0600 Subject: [PATCH 037/152] Bug#60196 / Bug#11831040 Setting lowercase_table_names to 2 on Windows causing Foreign Key problems This problem was exposed by the fix for Bug#55222. There was a codepath in dict0load.c, dict_load_foreigns() that made sure the table name matched case sensitive in order to load a referenced table into the dictionary as needed. If an engine is rebooted which accesses a table with foreign keys, and lower_case_table_names=2, then the table with foreign keys will get an error when it is changed (insert/updated/delete). Once the referenced tables are loaded into the dictionary cache by a select statement on those tables, the same change would succeed because the affected code path would not get followed. --- .../suite/innodb/r/innodb_bug60196.result | 76 ++++++++++++++++ .../suite/innodb/t/innodb_bug60196-master.opt | 1 + .../suite/innodb/t/innodb_bug60196.test | 91 +++++++++++++++++++ storage/innobase/dict/dict0load.c | 8 +- 4 files changed, 173 insertions(+), 3 deletions(-) create mode 100755 mysql-test/suite/innodb/r/innodb_bug60196.result create mode 100755 mysql-test/suite/innodb/t/innodb_bug60196-master.opt create mode 100755 mysql-test/suite/innodb/t/innodb_bug60196.test diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result new file mode 100755 index 00000000000..296c5ce7e1d --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -0,0 +1,76 @@ +DROP TABLE IF EXISTS Bug_60196_FK1 ; +DROP TABLE IF EXISTS Bug_60196_FK2 ; +DROP TABLE IF EXISTS Bug_60196 ; +CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196` ( +FK1_Key INT NOT NULL, +FK2_Key INT NOT NULL, +PRIMARY KEY (FK2_Key, FK1_Key), +KEY FK1_Key (FK1_Key), +KEY FK2_Key (FK2_Key), +CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) +REFERENCES Bug_60196_FK1 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE, +CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) +REFERENCES Bug_60196_FK2 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +INSERT INTO Bug_60196 VALUES (1, 99); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK2` FOREIGN KEY (`FK2_Key`) REFERENCES `Bug_60196_FK2` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO Bug_60196 VALUES (99, 1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK1` FOREIGN KEY (`FK1_Key`) REFERENCES `Bug_60196_FK1` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +SELECT * FROM bug_60196_FK1; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196_FK2; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +# Stop master server +# Restart server. +# +# Try to insert more to the example table with foreign keys. +# Bug60196 causes the foreign key file not to be found after +# the resstart above. +# +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 + +# Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; diff --git a/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt new file mode 100755 index 00000000000..c0a1981fa7c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt @@ -0,0 +1 @@ +--lower-case-table-names=2 diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test new file mode 100755 index 00000000000..70da220d68a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -0,0 +1,91 @@ +# Bug#60196 - Setting lowercase_table_names to 2 on Windows causing +# Foreign Key problems after an engine is restarted. + +# This test case needs InnoDB. +-- source include/have_innodb.inc + +# +# Precautionary clean up. +# +--disable_warnings +DROP TABLE IF EXISTS Bug_60196_FK1 ; +DROP TABLE IF EXISTS Bug_60196_FK2 ; +DROP TABLE IF EXISTS Bug_60196 ; +--enable_warnings + +# +# Create test data. +# +CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196` ( + FK1_Key INT NOT NULL, + FK2_Key INT NOT NULL, + PRIMARY KEY (FK2_Key, FK1_Key), + KEY FK1_Key (FK1_Key), + KEY FK2_Key (FK2_Key), + CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) + REFERENCES Bug_60196_FK1 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) + REFERENCES Bug_60196_FK2 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (1, 99); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (99, 1); + +SELECT * FROM bug_60196_FK1; +SELECT * FROM bug_60196_FK2; +SELECT * FROM bug_60196; + +--echo # Stop master server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Send a shutdown request to the server +-- shutdown_server 10 + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +--echo # +--echo # Try to insert more to the example table with foreign keys. +--echo # Bug60196 causes the foreign key file not to be found after +--echo # the resstart above. +--echo # +SELECT * FROM Bug_60196; +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; + +--echo +--echo # Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; + diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index 14490980bb6..37bf4a1ad59 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -2258,10 +2258,12 @@ loop: /* Since table names in SYS_FOREIGN are stored in a case-insensitive order, we have to check that the table name matches also in a binary string comparison. On Unix, MySQL allows table names that only differ - in character case. */ - - if (0 != ut_memcmp(field, table_name, len)) { + in character case. If lower_case_table_names=2 then what is stored + may not be the same case, but the previous comparison showed that they + match with no-case. */ + if ((srv_lower_case_table_names != 2) + && (0 != ut_memcmp(field, table_name, len))) { goto next_rec; } From 984988cfbd559ee31a15b0ea1035a609ff6538c3 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 8 Mar 2011 09:41:57 +0100 Subject: [PATCH 038/152] Bug #11755431 (former 47205) MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT SUPPORTING NATIVE REPAIR Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue 'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the tables are compatible with the current version of MySQL. Any tables that are found incompatible are then upgraded using 'REPAIR TABLE'. The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'. This caused any such tables to be left incompatible. As a result such tables were not properly fixed by the mysql_upgrade tool. This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return a different error message if the engine does not support REPAIR. Instead of "Table upgrade required. Please do "REPAIR TABLE ..." it will report "Table rebuild required. Please do "ALTER TABLE ... FORCE ..." Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of 'REPAIR TABLE' in these cases. This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table. This change should be reflected in the documentation. Before this patch, 'ALTER TABLE ... FORCE' was unused (See Bug#11746162) Test case added to mysqlcheck.test --- client/mysqlcheck.c | 54 ++++++++++++++-- mysql-test/r/mysqlcheck.result | 90 ++++++++++++++++++++++---- mysql-test/std_data/bug47205.frm | Bin 0 -> 8554 bytes mysql-test/t/mysqlcheck.test | 108 +++++++++++++++++++++++++++---- sql/handler.cc | 10 ++- sql/handler.h | 11 +++- sql/share/errmsg-utf8.txt | 5 ++ sql/sql_admin.cc | 8 ++- sql/sql_lex.h | 27 ++++---- sql/sql_yacc.yy | 2 +- storage/archive/ha_archive.h | 2 +- storage/csv/ha_tina.h | 3 +- storage/federated/ha_federated.h | 3 +- storage/myisam/ha_myisam.cc | 2 +- 14 files changed, 268 insertions(+), 57 deletions(-) create mode 100644 mysql-test/std_data/bug47205.frm diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index f38d674ae8d..78a1ec7d87d 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -42,7 +42,7 @@ static char *opt_password = 0, *current_user = 0, *default_charset= 0, *current_host= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static int first_error = 0; -DYNAMIC_ARRAY tables4repair; +DYNAMIC_ARRAY tables4repair, tables4rebuild; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; #endif @@ -626,6 +626,27 @@ static int fix_database_storage_name(const char *name) return rc; } +static int rebuild_table(char *name) +{ + char *query, *ptr; + int rc= 0; + query= (char*)my_malloc(sizeof(char) * (12 + fixed_name_length(name) + 6 + 1), + MYF(MY_WME)); + if (!query) + return 1; + ptr= strmov(query, "ALTER TABLE "); + ptr= fix_table_name(ptr, name); + ptr= strxmov(ptr, " FORCE", NullS); + if (mysql_real_query(sock, query, (uint)(ptr - query))) + { + fprintf(stderr, "Failed to %s\n", query); + fprintf(stderr, "Error: %s\n", mysql_error(sock)); + rc= 1; + } + my_free(query); + return rc; +} + static int process_one_db(char *database) { if (what_to_do == DO_UPGRADE) @@ -739,7 +760,7 @@ static void print_result() MYSQL_ROW row; char prev[NAME_LEN*2+2]; uint i; - my_bool found_error=0; + my_bool found_error=0, table_rebuild=0; res = mysql_use_result(sock); @@ -758,8 +779,14 @@ static void print_result() */ if (found_error && opt_auto_repair && what_to_do != DO_REPAIR && strcmp(row[3],"OK")) - insert_dynamic(&tables4repair, (uchar*) prev); + { + if (table_rebuild) + insert_dynamic(&tables4rebuild, (uchar*) prev); + else + insert_dynamic(&tables4repair, (uchar*) prev); + } found_error=0; + table_rebuild=0; if (opt_silent) continue; } @@ -769,7 +796,11 @@ static void print_result() { printf("%s\n%-9s: %s", row[0], row[2], row[3]); if (strcmp(row[2],"note")) + { found_error=1; + if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL) + table_rebuild=1; + } } else printf("%-9s: %s", row[2], row[3]); @@ -778,7 +809,12 @@ static void print_result() } /* add the last table to be repaired to the list */ if (found_error && opt_auto_repair && what_to_do != DO_REPAIR) - insert_dynamic(&tables4repair, (uchar*) prev); + { + if (table_rebuild) + insert_dynamic(&tables4rebuild, (uchar*) prev); + else + insert_dynamic(&tables4repair, (uchar*) prev); + } mysql_free_result(res); } @@ -876,7 +912,8 @@ int main(int argc, char **argv) } if (opt_auto_repair && - my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64)) + (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) || + my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64))) { first_error = 1; goto end; @@ -894,7 +931,7 @@ int main(int argc, char **argv) { uint i; - if (!opt_silent && tables4repair.elements) + if (!opt_silent && (tables4repair.elements || tables4rebuild.elements)) puts("\nRepairing tables"); what_to_do = DO_REPAIR; for (i = 0; i < tables4repair.elements ; i++) @@ -902,11 +939,16 @@ int main(int argc, char **argv) char *name= (char*) dynamic_array_ptr(&tables4repair, i); handle_request_for_tables(name, fixed_name_length(name)); } + for (i = 0; i < tables4rebuild.elements ; i++) + rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i)); } end: dbDisconnect(current_host); if (opt_auto_repair) + { delete_dynamic(&tables4repair); + delete_dynamic(&tables4rebuild); + } my_free(opt_password); #ifdef HAVE_SMEM my_free(shared_memory_base_name); diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index ef46eba5ccb..42fb1945d8b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -109,7 +109,7 @@ mysql.time_zone_name Table is already up to date mysql.time_zone_transition Table is already up to date mysql.time_zone_transition_type Table is already up to date mysql.user Table is already up to date -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; test.t1 OK test.t1 Table is already up to date @@ -117,14 +117,14 @@ test.t1 OK test.t1 Table is already up to date drop view v1; drop table t1; -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; test.t 1 OK test.t`1 OK drop table `t``1`, `t 1`; create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -164,15 +164,15 @@ Table Op Msg_type Msg_text test.v1 check status OK information_schema.routines check note The storage engine for the table doesn't support check drop view v1; -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; test.t1 Error : Incorrect information in file: './test/t1.frm' error : Corrupt test.t2 OK DROP TABLE t1, t2; End of 5.0 tests -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; Tables_in_test @@ -192,7 +192,7 @@ v-1 drop view v1, `v-1`; drop table t1; SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; Tables_in_test #mysql50#@ @@ -203,7 +203,7 @@ SHOW TABLES; Tables_in_test @ DROP TABLE `@`; -CREATE TABLE `Ñ` (a INT); +CREATE TABLE `Ñ` (a INT) engine=myisam; SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test test.? @@ -216,8 +216,8 @@ DROP TABLE `Ñ`; SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -246,12 +246,12 @@ USE test; # Bug #31821: --all-in-1 and --fix-table-names don't work together # drop table if exists `#mysql50#t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 @@ -260,3 +260,67 @@ End of 5.1 tests # # Bug #35269: mysqlcheck behaves different depending on order of parameters # +# +# Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +# ENGINES NOT SUPPORTING NATIVE +# +DROP TABLE IF EXISTS bug47205; +# +# Test 1: Check that ALTER TABLE ... rebuilds the table +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# ALTER TABLE ... FORCE should rebuild the table +# and therefore output "affected rows: 1" +ALTER TABLE bug47205 FORCE; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 2: InnoDB - REPAIR not supported +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! + +Repairing tables +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 3: MyISAM - REPAIR supported +# Use an old FRM that will require upgrade +# Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! + +Repairing tables +test.bug47205 OK +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; diff --git a/mysql-test/std_data/bug47205.frm b/mysql-test/std_data/bug47205.frm new file mode 100644 index 0000000000000000000000000000000000000000..6d53b221d283074a58acb015688f2e1b34859033 GIT binary patch literal 8554 zcmeI&F%E(-6b9h`RWy;9$Y7jd(+L+gOwhP6m=HEcRtLO-7xEOIhD%r<(K4GbfXUyX zeeLktep_Gq5`QrP0s(eFgFU)tBFuqlJCEFAqru||_--MNfzVAjQh)*!pa2CZKmiI+ zfC3bt00k&8N&(S_zmE-4XaKpleU`!&Wqv-C7dy&B4{)d%^18mAjstAXEh#_&3Q&Lo z6rcbFC_n)UP=Erx1+IdicalF&AX@iGwE6-4`QUZ;D6sy<35=N4HvF+^4pYH1>8GBO LX_jRK*vjG!{5KdS literal 0 HcmV?d00001 diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index dd113cb4e74..8f93ac7b864 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -2,6 +2,8 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +--source include/have_innodb.inc + # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc @@ -34,7 +36,7 @@ drop database if exists client_test_db; # # Bug #16502: mysqlcheck tries to check views # -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --analyze --databases test @@ -48,8 +50,8 @@ drop table t1; # # Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks # -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --databases test drop table `t``1`, `t 1`; @@ -59,7 +61,7 @@ drop table `t``1`, `t 1`; # create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -91,8 +93,8 @@ drop view v1; # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption # -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; # backup then null t1.frm --copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak --remove_file $MYSQLD_DATADIR/test/t1.frm @@ -112,7 +114,7 @@ DROP TABLE t1, t2; # # Bug #30679: 5.1 name encoding not performed for views during upgrade # -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; let $MYSQLD_DATADIR= `select @@datadir`; @@ -131,7 +133,7 @@ drop table t1; # triggers # SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; SET NAMES DEFAULT; --echo mysqlcheck --fix-table-names --databases test @@ -140,7 +142,7 @@ SET NAMES utf8; SHOW TABLES; DROP TABLE `@`; -CREATE TABLE `Ñ` (a INT); +CREATE TABLE `Ñ` (a INT) engine=myisam; SET NAMES DEFAULT; --echo mysqlcheck --default-character-set="latin1" --databases test # Error returned depends on platform, replace it with "Table doesn't exist" @@ -154,8 +156,8 @@ SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers let $MYSQLTEST_VARDIR= `select @@datadir`; @@ -207,12 +209,12 @@ USE test; drop table if exists `#mysql50#t1-1`; --enable_warnings -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test show tables like 't1-1'; drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1" show tables like 't1-1'; drop table `t1-1`; @@ -229,3 +231,83 @@ drop table `t1-1`; --error 1 --exec $MYSQL_CHECK -aoc test "#mysql50#t1-1" + +--echo # +--echo # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +--echo # ENGINES NOT SUPPORTING NATIVE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS bug47205; +--enable_warnings + +--echo # +--echo # Test 1: Check that ALTER TABLE ... rebuilds the table + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # ALTER TABLE ... FORCE should rebuild the table +--echo # and therefore output "affected rows: 1" +--enable_info +ALTER TABLE bug47205 FORCE; +--disable_info + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 2: InnoDB - REPAIR not supported + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 3: MyISAM - REPAIR supported + +--echo # Use an old FRM that will require upgrade +--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/bug47205.MYD +--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/bug47205.MYI + +--echo # Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; diff --git a/sql/handler.cc b/sql/handler.cc index 9ca1f3a20f8..fefc0553c88 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3214,9 +3214,13 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt) mark_trx_read_write(); - if ((result= repair(thd, check_opt))) - return result; - return update_frm_version(table); + result= repair(thd, check_opt); + DBUG_ASSERT(result == HA_ADMIN_NOT_IMPLEMENTED || + ha_table_flags() & HA_CAN_REPAIR); + + if (result == HA_ADMIN_OK) + result= update_frm_version(table); + return result; } diff --git a/sql/handler.h b/sql/handler.h index 3cd4acee80d..ca72640f887 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -153,6 +153,12 @@ ordered. */ #define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 36) +/* + Engine supports REPAIR TABLE. Used by CHECK TABLE FOR UPGRADE if an + incompatible table is detected. If this flag is set, CHECK TABLE FOR UPGRADE + will report ER_TABLE_NEEDS_UPGRADE, otherwise ER_TABLE_NEED_REBUILD. +*/ +#define HA_CAN_REPAIR (LL(1) << 37) /* Set of all binlog flags. Currently only contain the capabilities @@ -2010,7 +2016,10 @@ private: upon the table. */ virtual int repair(THD* thd, HA_CHECK_OPT* check_opt) - { return HA_ADMIN_NOT_IMPLEMENTED; } + { + DBUG_ASSERT(!(ha_table_flags() & HA_CAN_REPAIR)); + return HA_ADMIN_NOT_IMPLEMENTED; + } virtual void start_bulk_insert(ha_rows rows) {} virtual int end_bulk_insert() { return 0; } virtual int index_read(uchar * buf, const uchar * key, uint key_len, diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 998e88704d8..0d315fe1441 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6397,3 +6397,8 @@ ER_STMT_CACHE_FULL ER_MULTI_UPDATE_KEY_CONFLICT eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'." + +# When translating this error message make sure to include "ALTER TABLE" in the +# message as mysqlcheck parses the error message looking for ALTER TABLE. +ER_TABLE_NEEDS_REBUILD + eng "Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!" diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index eb6853751ee..dea8d38938c 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -771,8 +771,12 @@ send_result_message: size_t length; protocol->store(STRING_WITH_LEN("error"), system_charset_info); - length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), - table->table_name); + if (table->table->file->ha_table_flags() & HA_CAN_REPAIR) + length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), + table->table_name); + else + length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_REBUILD), + table->table_name); protocol->store(buf, length, system_charset_info); fatal_error=1; break; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index a9abe174d6e..e6b5f23f17e 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -944,20 +944,19 @@ inline bool st_select_lex_unit::is_union () #define ALTER_CHANGE_COLUMN_DEFAULT (1L << 8) #define ALTER_KEYS_ONOFF (1L << 9) #define ALTER_CONVERT (1L << 10) -#define ALTER_FORCE (1L << 11) -#define ALTER_RECREATE (1L << 12) -#define ALTER_ADD_PARTITION (1L << 13) -#define ALTER_DROP_PARTITION (1L << 14) -#define ALTER_COALESCE_PARTITION (1L << 15) -#define ALTER_REORGANIZE_PARTITION (1L << 16) -#define ALTER_PARTITION (1L << 17) -#define ALTER_ADMIN_PARTITION (1L << 18) -#define ALTER_TABLE_REORG (1L << 19) -#define ALTER_REBUILD_PARTITION (1L << 20) -#define ALTER_ALL_PARTITION (1L << 21) -#define ALTER_REMOVE_PARTITIONING (1L << 22) -#define ALTER_FOREIGN_KEY (1L << 23) -#define ALTER_TRUNCATE_PARTITION (1L << 24) +#define ALTER_RECREATE (1L << 11) +#define ALTER_ADD_PARTITION (1L << 12) +#define ALTER_DROP_PARTITION (1L << 13) +#define ALTER_COALESCE_PARTITION (1L << 14) +#define ALTER_REORGANIZE_PARTITION (1L << 15) +#define ALTER_PARTITION (1L << 16) +#define ALTER_ADMIN_PARTITION (1L << 17) +#define ALTER_TABLE_REORG (1L << 18) +#define ALTER_REBUILD_PARTITION (1L << 19) +#define ALTER_ALL_PARTITION (1L << 20) +#define ALTER_REMOVE_PARTITIONING (1L << 21) +#define ALTER_FOREIGN_KEY (1L << 22) +#define ALTER_TRUNCATE_PARTITION (1L << 23) enum enum_alter_table_change_level { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 02e0d347ef7..13a1b8029f2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6747,7 +6747,7 @@ alter_list_item: } | FORCE_SYM { - Lex->alter_info.flags|= ALTER_FORCE; + Lex->alter_info.flags|= ALTER_RECREATE; } | alter_order_clause { diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index fec41c12b81..a56cc3dd799 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -90,7 +90,7 @@ public: return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_STATS_RECORDS_IS_EXACT | - HA_HAS_RECORDS | + HA_HAS_RECORDS | HA_CAN_REPAIR | HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY); } ulong index_flags(uint idx, uint part, bool all_parts) const diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 845b50e3869..9fcaf2519c6 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -106,7 +106,8 @@ public: ulonglong table_flags() const { return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE); + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_CAN_REPAIR); } ulong index_flags(uint idx, uint part, bool all_parts) const { diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index e39bac525b5..6614b389b1f 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -149,7 +149,8 @@ public: HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_NO_TRANSACTIONS /* until fixed by WL#2952 */ | - HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); + HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY | + HA_CAN_REPAIR); } /* This is a bitmap of flags that says how the storage engine diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index c7b6b2239ce..16457088f9c 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -639,7 +639,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | - HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), + HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_REPAIR), can_enable_indexes(1) {} From 627707e2f8bc40c43b7f1ac04f12dbc3f65992f2 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 8 Mar 2011 13:42:00 +0100 Subject: [PATCH 039/152] Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS Before this fix, two performance schema unit tests crashed on windows. The problem was a missing initialization to PFS_atomics, which caused the crash only for platform not compiled with native atomics. This fix adds the missing initialization in the unit tests. No production code was changed, this is a unit test bug only. --- storage/perfschema/unittest/pfs-t.cc | 2 ++ storage/perfschema/unittest/pfs_instr-oom-t.cc | 4 ++++ storage/perfschema/unittest/pfs_instr-t.cc | 4 ++++ storage/perfschema/unittest/pfs_instr_class-oom-t.cc | 4 ++++ storage/perfschema/unittest/pfs_instr_class-t.cc | 4 ++++ storage/perfschema/unittest/pfs_timer-t.cc | 4 ++++ 6 files changed, 22 insertions(+) diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index 20e736a546f..46e02306aca 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -1205,6 +1205,8 @@ void test_enabled() void do_all_tests() { + /* Using initialize_performance_schema(), no partial init needed. */ + test_bootstrap(); test_bad_registration(); test_init_disabled(); diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc index 13335326932..a00afe8b36a 100644 --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -199,7 +199,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc index 2ef9a5769ca..b13135aa615 100644 --- a/storage/perfschema/unittest/pfs_instr-t.cc +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -400,10 +400,14 @@ void test_per_thread_wait() void do_all_tests() { + PFS_atomic::init(); + test_no_instruments(); test_no_instances(); test_with_instances(); test_per_thread_wait(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc index 9ccaf432ba2..95dccc420d7 100644 --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -47,7 +47,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc index f9a1ee510b1..ac34f082fe8 100644 --- a/storage/perfschema/unittest/pfs_instr_class-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -554,6 +554,8 @@ void test_instruments_reset() void do_all_tests() { + PFS_atomic::init(); + test_no_registration(); test_mutex_registration(); test_rwlock_registration(); @@ -562,6 +564,8 @@ void do_all_tests() test_file_registration(); test_table_registration(); test_instruments_reset(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc index d8663c5ccda..69b554c7b31 100644 --- a/storage/perfschema/unittest/pfs_timer-t.cc +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -105,7 +105,11 @@ void test_timers() void do_all_tests() { + PFS_atomic::init(); + test_timers(); + + PFS_atomic::cleanup(); } int main(int, char **) From d7aee58201ee1bff769bcc0d41d2c64df176391c Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Tue, 8 Mar 2011 09:04:13 -0600 Subject: [PATCH 040/152] Fix test failure on case-sensitive file systems. --- mysql-test/suite/innodb/t/innodb_bug60196.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test index 70da220d68a..6d77baf8d6c 100755 --- a/mysql-test/suite/innodb/t/innodb_bug60196.test +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -2,7 +2,9 @@ # Foreign Key problems after an engine is restarted. # This test case needs InnoDB. --- source include/have_innodb.inc +--source include/have_innodb.inc +--source include/have_lowercase2.inc +--source include/have_case_insensitive_file_system.inc # # Precautionary clean up. From f0e0baea0bd2b2849fa9eaf112b33957c3da4fd0 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 8 Mar 2011 19:21:44 +0100 Subject: [PATCH 041/152] Add extra line after unit test report in MTR --- mysql-test/mysql-test-run.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 97737443e1c..ddbd8d1d639 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -508,7 +508,10 @@ sub main { $opt_gcov_msg, $opt_gcov_err); } - print "$ctest_report\n" if $ctest_report; + if ($ctest_report) { + print "$ctest_report\n"; + mtr_print_line(); + } print_total_times($opt_parallel) if $opt_report_times; @@ -5730,7 +5733,7 @@ sub run_ctest() { $tinfo->{comment}.= "\nctest did not pruduce report summary" if ! $ctres; $tinfo->{result}= ($ctres && !$ctfail) ? 'MTR_RES_PASSED' : 'MTR_RES_FAILED'; - $ctest_report .= "Report from unit tests in $ctfile\n"; + $ctest_report .= "Report from unit tests in $ctfile"; $tinfo->{failures}= ($tinfo->{result} eq 'MTR_RES_FAILED'); mark_time_used('test'); From 9b30e2e29c975687ad356a7a9722c3b84993765a Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Wed, 9 Mar 2011 16:06:13 +0100 Subject: [PATCH 042/152] Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY KEY NO 0 FOR TABLE IN ERROR LOG With the changes made by the patches for Bug#11751388 and Bug#11784056, concurrent reads are allowed while secondary indexes are created in InnoDB. This means that the metadata lock on the affected table is not upgraded to exclusive until the .FRM is updated at the end of ALTER TABLE processing. The problem was that if this lock upgrade failed for some reason (e.g. timeout), the index information in the server and inside InnoDB would be out of sync. This would happen since the add index operation already was committed inside InnoDB but the table metadata inside the server had not been updated yet. This patch fixes the problem by (for now) reverting the effects of the patches for Bug#11751388 and Bug#11784056. Concurrent reads will now again be blocked during creation of secondary indexes in InnoDB. Test case added to innodb_mysql_lock.test. --- mysql-test/r/innodb_mysql_lock.result | 22 +++ mysql-test/r/innodb_mysql_sync.result | 64 +------- mysql-test/t/innodb_mysql_lock.test | 32 ++++ mysql-test/t/innodb_mysql_sync.test | 227 +++++++++++++------------- storage/innobase/handler/ha_innodb.cc | 1 - 5 files changed, 171 insertions(+), 175 deletions(-) diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index bf1c3a89f40..cd9487721b6 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -148,3 +148,25 @@ COMMIT; # Connection default DROP TABLE t1, t2; DROP VIEW v1; +# +# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +# KEY NO 0 FOR TABLE IN ERROR LOG +# +DROP TABLE IF EXISTS t1; +# Connection default +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; +id value +1 12345 +# Connection con1 +SET lock_wait_timeout=1; +ALTER TABLE t1 ADD INDEX idx(value); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# Connection default +SELECT * FROM t1; +id value +1 12345 +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 58948835f66..71f567a4ad2 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -94,64 +94,6 @@ SET DEBUG_SYNC= 'RESET'; # Bug#42230 during add index, cannot do queries on storage engines # that implement add_index # -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; -# Test 1: Secondary index, should not block reads (original test case). -# Connection default -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE db1.t1 ADD INDEX(value); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE db1; -SELECT * FROM t1; -id value -1 1 -2 2 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE db1.t1 ADD INDEX(value) -DROP DATABASE db1; -# Test 2: Primary index (implicit), should block reads. -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD UNIQUE INDEX(a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 3: Primary index (explicit), should block reads. -# Connection default -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD PRIMARY KEY (a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 4: Secondary unique index, should not block reads. -# Connection default -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +# DISABLED due to Bug#11815600 +# diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index 975444a44b1..f1dc0d52484 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -279,6 +279,38 @@ disconnect con2; disconnect con3; +--echo # +--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +--echo # KEY NO 0 FOR TABLE IN ERROR LOG +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root) + +--echo # Connection default +connection default; +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; + +--echo # Connection con1 +--connection con1 +SET lock_wait_timeout=1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 ADD INDEX idx(value); + +--echo # Connection default +--connection default +SELECT * FROM t1; +COMMIT; +DROP TABLE t1; +disconnect con1; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index a8925306c70..13c854d6b61 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -152,132 +152,133 @@ disconnect con1; --echo # that implement add_index --echo # ---disable_warnings -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; ---enable_warnings +--echo # +--echo # DISABLED due to Bug#11815600 +--echo # -connect(con1,localhost,root); -connect(con2,localhost,root); - ---echo # Test 1: Secondary index, should not block reads (original test case). - ---echo # Connection default -connection default; -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE db1.t1 ADD INDEX(value) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Neither of these two statements should be blocked -USE db1; -SELECT * FROM t1; -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) ---reap -DROP DATABASE db1; - ---echo # Test 2: Primary index (implicit), should block reads. - -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD UNIQUE INDEX(a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 3: Primary index (explicit), should block reads. - ---echo # Connection default -connection default; -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD PRIMARY KEY (a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 4: Secondary unique index, should not block reads. -# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported -# by InnoDB. Adding this flag currently introduces a regression so -# this test is disabled until the regression has been fixed. - ---echo # Connection default -connection default; +#--disable_warnings +#DROP DATABASE IF EXISTS db1; +#DROP TABLE IF EXISTS t1; +#--enable_warnings +# +#connect(con1,localhost,root); +#connect(con2,localhost,root); +# +#--echo # Test 1: Secondary index, should not block reads (original test case). +# +#--echo # Connection default +#connection default; +#CREATE DATABASE db1; +#CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; +#INSERT INTO db1.t1(value) VALUES (1), (2); +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE db1.t1 ADD INDEX(value) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +# # Neither of these two statements should be blocked +#USE db1; +#SELECT * FROM t1; +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) +#--reap +#DROP DATABASE db1; +# +#--echo # Test 2: Primary index (implicit), should block reads. +# +#CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD UNIQUE INDEX(a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#USE test; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 3: Primary index (explicit), should block reads. +# +#--echo # Connection default +#connection default; +#ALTER TABLE t1 DROP INDEX a; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD PRIMARY KEY (a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 4: Secondary unique index, should not block reads. +# +#--echo # Connection default +#connection default; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #--echo # Sending: #--send ALTER TABLE t1 ADD UNIQUE (b) - +# #--echo # Connection con1 #connection con1; #SET DEBUG_SYNC= "now WAIT_FOR manage"; #SELECT * FROM t1; #SET DEBUG_SYNC= "now SIGNAL query"; - +# #--echo # Connection default #connection default; #--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) #--reap - -disconnect con1; -disconnect con2; -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +#disconnect con1; +#disconnect con2; +#SET DEBUG_SYNC= "RESET"; +#DROP TABLE t1; # Check that all connections opened by test cases in this file are really diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index daeaca90aec..8f128806054 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2594,7 +2594,6 @@ innobase_alter_table_flags( uint flags) { return(HA_INPLACE_ADD_INDEX_NO_READ_WRITE - | HA_INPLACE_ADD_INDEX_NO_WRITE | HA_INPLACE_DROP_INDEX_NO_READ_WRITE | HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE | HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE From 4bd4f411c733a256d156dbea98916d195b640275 Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Wed, 9 Mar 2011 11:15:55 -0600 Subject: [PATCH 043/152] Bug#60196 / Bug#11831040 Test case cannot run on embedded server. No need for precautionary cleanup of unique names. --- .../suite/innodb/r/innodb_bug60196.result | 11 ++++----- .../suite/innodb/t/innodb_bug60196.test | 24 +++++++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result index 296c5ce7e1d..85707f81a28 100755 --- a/mysql-test/suite/innodb/r/innodb_bug60196.result +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -1,9 +1,6 @@ -DROP TABLE IF EXISTS Bug_60196_FK1 ; -DROP TABLE IF EXISTS Bug_60196_FK2 ; -DROP TABLE IF EXISTS Bug_60196 ; -CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196` ( +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( FK1_Key INT NOT NULL, FK2_Key INT NOT NULL, PRIMARY KEY (FK2_Key, FK1_Key), @@ -46,7 +43,7 @@ FK1_Key FK2_Key 1 1 1 2 1 3 -# Stop master server +# Stop server # Restart server. # # Try to insert more to the example table with foreign keys. diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test index 6d77baf8d6c..47c646a5a75 100755 --- a/mysql-test/suite/innodb/t/innodb_bug60196.test +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -1,26 +1,20 @@ # Bug#60196 - Setting lowercase_table_names to 2 on Windows causing # Foreign Key problems after an engine is restarted. -# This test case needs InnoDB. ---source include/have_innodb.inc +# This test case needs InnoDB, a lowercase file system, +# lower-case-table-names=2, and cannot use the embedded server +# because it restarts the server. +--source include/not_embedded.inc --source include/have_lowercase2.inc --source include/have_case_insensitive_file_system.inc - -# -# Precautionary clean up. -# ---disable_warnings -DROP TABLE IF EXISTS Bug_60196_FK1 ; -DROP TABLE IF EXISTS Bug_60196_FK2 ; -DROP TABLE IF EXISTS Bug_60196 ; ---enable_warnings +--source include/have_innodb.inc # # Create test data. # -CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196` ( +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( FK1_Key INT NOT NULL, FK2_Key INT NOT NULL, PRIMARY KEY (FK2_Key, FK1_Key), @@ -49,7 +43,7 @@ SELECT * FROM bug_60196_FK1; SELECT * FROM bug_60196_FK2; SELECT * FROM bug_60196; ---echo # Stop master server +--echo # Stop server # Write file to make mysql-test-run.pl wait for the server to stop -- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect From 5ea2bf1ded6f73adc356f66cff702269efdfa5fc Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Thu, 10 Mar 2011 09:47:49 +0530 Subject: [PATCH 044/152] Bug11817185# : Disabled MAIN.ARCHIVE-BIG.TEST --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 985493481e9..063bbb9ce4b 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,3 +16,4 @@ read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested create-big : Bug#37248 2010-11-15 mattiasj was not tested +archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc From 34f3953b5991203f3bec6a6ee191fb0d567ca0b8 Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Thu, 10 Mar 2011 09:54:16 +0530 Subject: [PATCH 045/152] Skip the tests listed in disabled-weekly.list --- mysql-test/collections/default.weekly | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index a1339fcf0fc..40f0548f374 100755 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,7 +1,7 @@ -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list From d7a4372fbe367d54c086f5dfe3cdddf050247868 Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Thu, 10 Mar 2011 09:57:14 +0530 Subject: [PATCH 046/152] Skip tests in disabled-daily.list --- mysql-test/collections/default.daily | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily index 75c03d4d47b..665da0d152c 100644 --- a/mysql-test/collections/default.daily +++ b/mysql-test/collections/default.daily @@ -1,15 +1,15 @@ -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-ps_nist --suite=nist --ps-protocol From 8602f2d77d7195c62f012293615c9136aaf475b5 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 10 Mar 2011 09:00:43 +0100 Subject: [PATCH 047/152] Implemented code review comments, improved the result file readability. --- mysql-test/suite/perfschema/r/relaylog.result | 4 ++++ mysql-test/suite/perfschema/t/relaylog.test | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result index 0cd346b62a1..1ec9f4f4b29 100644 --- a/mysql-test/suite/perfschema/r/relaylog.result +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -17,6 +17,7 @@ FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_ select * from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +"Expect a master binlog + binlog_index" select * from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE @@ -35,6 +36,7 @@ wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 1 wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 3 wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +"Expect no slave relay log" select * from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE @@ -60,6 +62,7 @@ FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_ [DATADIR]slave-relay-bin.000001 wait/io/file/sql/relaylog 4 3 370 263 [DATADIR]slave-relay-bin.000002 wait/io/file/sql/relaylog 2 4 368 368 [DATADIR]slave-relay-bin.index wait/io/file/sql/relaylog_index 2 4 50 125 +"Expect a slave binlog + binlog_index" select * from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE @@ -78,6 +81,7 @@ wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 0 wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 5 wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +"Expect a slave relay log" select * from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test index 43822e30f0e..126dacb8803 100644 --- a/mysql-test/suite/perfschema/t/relaylog.test +++ b/mysql-test/suite/perfschema/t/relaylog.test @@ -44,7 +44,7 @@ select * from performance_schema.file_summary_by_instance select * from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; -# Expect a master binlog + binlog_index +-- echo "Expect a master binlog + binlog_index" --replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance @@ -57,7 +57,7 @@ select event_name, count_star from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -# Expect no slave relay log. +-- echo "Expect no slave relay log" --replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance @@ -82,7 +82,7 @@ select * from performance_schema.file_summary_by_instance select * from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; -# Expect a slave binlog + binlog_index +-- echo "Expect a slave binlog + binlog_index" --replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance @@ -95,7 +95,7 @@ select event_name, count_star from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -# Expect a slave relay log. +-- echo "Expect a slave relay log" --replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance From 2b86f34a483e4fd09241abf0297acb5272358ead Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Thu, 10 Mar 2011 11:07:57 +0300 Subject: [PATCH 048/152] Patch for Bug#11765684 (58674: SP-cache does not detect changes in pre-locking list caused by triggers). The thing is that CREATE TRIGGER / DROP TRIGGER may actually change pre-locking list of (some) stored routines. The SP-cache does not detect such changes. Thus if sp_head-instance is cached in SP-cache, subsequent executions of the cached sp_head will use inaccurate pre-locking list. The patch is to invalidate SP-cache on CREATE TRIGGER / DROP TRIGGER. --- mysql-test/r/sp.result | 30 +++++++++++++++++++++++++++ mysql-test/r/trigger.result | 1 - mysql-test/t/sp.test | 41 +++++++++++++++++++++++++++++++++++++ mysql-test/t/trigger.test | 4 ---- sql/sql_trigger.cc | 7 +++++++ 5 files changed, 78 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 243bfb6c07d..f9b338dd414 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7452,4 +7452,34 @@ c1 # Cleanup drop table t1; drop procedure p1; + +# -- +# -- Bug 11765684 - 58674: SP-cache does not detect changes in +# -- pre-locking list caused by triggers +# --- +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP PROCEDURE IF EXISTS p1; +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +CREATE TABLE t3(a INT); +CREATE PROCEDURE p1() +INSERT INTO t1(a) VALUES (1); + +CREATE TRIGGER t1_ai AFTER INSERT ON t1 +FOR EACH ROW +INSERT INTO t2(a) VALUES (new.a); + +CALL p1(); + +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +INSERT INTO t3(a) VALUES (new.a); + +CALL p1(); + +DROP TABLE t1, t2, t3; +DROP PROCEDURE p1; + # End of 5.5 test diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index b24c5b87fa0..11e0d7313b7 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -821,7 +821,6 @@ drop trigger t1_bi; create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id); execute stmt1; call p1(); -ERROR 42S02: Table 'test.t3' doesn't exist deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 11edeaf9811..1ed11c50ba8 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -8713,4 +8713,45 @@ call p1(3, 2); drop table t1; drop procedure p1; +--echo +--echo # -- +--echo # -- Bug 11765684 - 58674: SP-cache does not detect changes in +--echo # -- pre-locking list caused by triggers +--echo # --- + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP PROCEDURE IF EXISTS p1; +--enable_warnings + +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +CREATE TABLE t3(a INT); + +CREATE PROCEDURE p1() + INSERT INTO t1(a) VALUES (1); + +--echo +CREATE TRIGGER t1_ai AFTER INSERT ON t1 + FOR EACH ROW + INSERT INTO t2(a) VALUES (new.a); + +--echo +CALL p1(); + +--echo +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 + FOR EACH ROW + INSERT INTO t3(a) VALUES (new.a); + +--echo +CALL p1(); + +--echo +DROP TABLE t1, t2, t3; +DROP PROCEDURE p1; +--echo + --echo # End of 5.5 test diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 3e4c3660f88..e5039c3ea23 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -998,10 +998,6 @@ call p1(); drop trigger t1_bi; create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id); execute stmt1; -# Until we implement proper mechanism for invalidation of SP statements -# invoked whenever a table used in SP changes, this statement will fail with -# 'Table ... does not exist' error. ---error ER_NO_SUCH_TABLE call p1(); deallocate prepare stmt1; drop procedure p1; diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e986f6d7e92..4908fce5950 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -30,6 +30,7 @@ #include "sql_db.h" // get_default_db_collation #include "sql_acl.h" // *_ACL, is_acl_user #include "sql_handler.h" // mysql_ha_rm_tables +#include "sp_cache.h" // sp_invalidate_cache /*************************************************************************/ @@ -517,6 +518,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) */ thd->locked_tables_list.reopen_tables(thd); + /* + Invalidate SP-cache. That's needed because triggers may change list of + pre-locking tables. + */ + sp_cache_invalidate(); + end: if (!result) { From 46b7a382121c4bbf90fc3f7e59b64591f2f169ab Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 10 Mar 2011 13:02:28 +0100 Subject: [PATCH 049/152] Reworked the test case to be more robust. --- mysql-test/suite/perfschema/r/relaylog.result | 147 ++++++++++++------ mysql-test/suite/perfschema/t/relaylog.test | 93 ++++++++--- 2 files changed, 173 insertions(+), 67 deletions(-) diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result index 1ec9f4f4b29..079d1e482b2 100644 --- a/mysql-test/suite/perfschema/r/relaylog.result +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -9,33 +9,55 @@ Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; create table test.t1(a int) slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ "============ Performance schema on master ============" -select * from performance_schema.file_summary_by_instance +select +substring(file_name, locate("master-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance where file_name like "%master-%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -[DATADIR]master-bin.000001 wait/io/file/sql/binlog 6 4 221 329 -[DATADIR]master-bin.index wait/io/file/sql/binlog_index 0 2 0 40 +master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY select * from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE "Expect a master binlog + binlog_index" -select * from performance_schema.file_summary_by_instance +select +substring(file_name, locate("master-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -[DATADIR]master-bin.000001 wait/io/file/sql/binlog 6 4 221 329 -[DATADIR]master-bin.index wait/io/file/sql/binlog_index 0 2 0 40 -select * from performance_schema.file_summary_by_event_name +master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name where event_name like "%binlog%" order by event_name; EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -wait/io/file/sql/binlog 6 4 221 329 -wait/io/file/sql/binlog_index 0 2 0 40 -select event_name, count_star +wait/io/file/sql/binlog MANY MANY MANY MANY +wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -event_name count_star -wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 -wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 1 -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 3 -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE "Expect no slave relay log" select * from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; @@ -54,49 +76,86 @@ wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0 select * from performance_schema.file_summary_by_instance where file_name like "%master-%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -select * from performance_schema.file_summary_by_instance +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -[DATADIR]slave-bin.000001 wait/io/file/sql/binlog 3 8 602 631 -[DATADIR]slave-bin.index wait/io/file/sql/binlog_index 0 3 0 57 -[DATADIR]slave-relay-bin.000001 wait/io/file/sql/relaylog 4 3 370 263 -[DATADIR]slave-relay-bin.000002 wait/io/file/sql/relaylog 2 4 368 368 -[DATADIR]slave-relay-bin.index wait/io/file/sql/relaylog_index 2 4 50 125 +slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY "Expect a slave binlog + binlog_index" -select * from performance_schema.file_summary_by_instance +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -[DATADIR]slave-bin.000001 wait/io/file/sql/binlog 3 8 602 631 -[DATADIR]slave-bin.index wait/io/file/sql/binlog_index 0 3 0 57 -select * from performance_schema.file_summary_by_event_name +slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY +slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name where event_name like "%binlog%" order by event_name; EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -wait/io/file/sql/binlog 3 8 602 631 -wait/io/file/sql/binlog_index 0 3 0 57 -select event_name, count_star +wait/io/file/sql/binlog MANY MANY MANY MANY +wait/io/file/sql/binlog_index NONE MANY NONE MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -event_name count_star -wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids 0 -wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond 0 -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index 5 -wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids 0 +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE "Expect a slave relay log" -select * from performance_schema.file_summary_by_instance +select +substring(file_name, locate("slave-", file_name)) as FILE_NAME, +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -[DATADIR]slave-relay-bin.000001 wait/io/file/sql/relaylog 4 3 370 263 -[DATADIR]slave-relay-bin.000002 wait/io/file/sql/relaylog 2 4 368 368 -[DATADIR]slave-relay-bin.index wait/io/file/sql/relaylog_index 2 4 50 125 -select * from performance_schema.file_summary_by_event_name +slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY +slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY +select +EVENT_NAME, +if (count_read > 0, "MANY", "NONE") as COUNT_READ, +if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, +if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, +if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE +from performance_schema.file_summary_by_event_name where event_name like "%relaylog%" order by event_name; EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -wait/io/file/sql/relaylog 6 7 738 631 -wait/io/file/sql/relaylog_index 2 4 50 125 -select event_name, count_star +wait/io/file/sql/relaylog MANY MANY MANY MANY +wait/io/file/sql/relaylog_index MANY MANY MANY MANY +select +EVENT_NAME, +if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_RELAY_LOG%" order by event_name; -event_name count_star -wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 2 -wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 12 +EVENT_NAME COUNT_STAR +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY include/stop_slave.inc diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test index 126dacb8803..f9a4d7bfe00 100644 --- a/mysql-test/suite/perfschema/t/relaylog.test +++ b/mysql-test/suite/perfschema/t/relaylog.test @@ -34,32 +34,48 @@ drop table test.t1; connection master; -- echo "============ Performance schema on master ============" -let $MYSQLD_DATADIR= `SELECT @@datadir`; - ---replace_result $MYSQLD_DATADIR [DATADIR] -select * from performance_schema.file_summary_by_instance +select + substring(file_name, locate("master-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance where file_name like "%master-%" order by file_name; ---replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; -- echo "Expect a master binlog + binlog_index" ---replace_result $MYSQLD_DATADIR [DATADIR] -select * from performance_schema.file_summary_by_instance +select + substring(file_name, locate("master-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; -select * from performance_schema.file_summary_by_event_name +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name where event_name like "%binlog%" order by event_name; -select event_name, count_star +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -- echo "Expect no slave relay log" ---replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; @@ -72,39 +88,70 @@ select * from performance_schema.events_waits_summary_global_by_event_name sync_slave_with_master; -- echo "============ Performance schema on slave ============" -let $MYSQLD_DATADIR= `SELECT @@datadir`; - ---replace_result $MYSQLD_DATADIR [DATADIR] select * from performance_schema.file_summary_by_instance where file_name like "%master-%" order by file_name; ---replace_result $MYSQLD_DATADIR [DATADIR] -select * from performance_schema.file_summary_by_instance +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance where file_name like "%slave-%" order by file_name; -- echo "Expect a slave binlog + binlog_index" ---replace_result $MYSQLD_DATADIR [DATADIR] -select * from performance_schema.file_summary_by_instance +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance where event_name like "%binlog%" order by file_name; -select * from performance_schema.file_summary_by_event_name +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name where event_name like "%binlog%" order by event_name; -select event_name, count_star +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_BIN_LOG%" order by event_name; -- echo "Expect a slave relay log" ---replace_result $MYSQLD_DATADIR [DATADIR] -select * from performance_schema.file_summary_by_instance +select + substring(file_name, locate("slave-", file_name)) as FILE_NAME, + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_instance where event_name like "%relaylog%" order by file_name; -select * from performance_schema.file_summary_by_event_name +select + EVENT_NAME, + if (count_read > 0, "MANY", "NONE") as COUNT_READ, + if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, + if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, + if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE + from performance_schema.file_summary_by_event_name where event_name like "%relaylog%" order by event_name; -select event_name, count_star +select + EVENT_NAME, + if (count_star > 0, "MANY", "NONE") as COUNT_STAR from performance_schema.events_waits_summary_global_by_event_name where event_name like "%MYSQL_RELAY_LOG%" order by event_name; From a7211fb810ea7b7a517cfcd64bce6cafbc2d7f41 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 11 Mar 2011 11:45:16 +0100 Subject: [PATCH 050/152] Test cleanup --- mysql-test/suite/perfschema/r/relaylog.result | 12 ++++++++-- mysql-test/suite/perfschema/t/relaylog.test | 24 +++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result index 079d1e482b2..e2f8270b1f0 100644 --- a/mysql-test/suite/perfschema/r/relaylog.result +++ b/mysql-test/suite/perfschema/r/relaylog.result @@ -84,7 +84,11 @@ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE from performance_schema.file_summary_by_instance -where file_name like "%slave-%" order by file_name; +where file_name like "%slave-%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") +order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY @@ -134,7 +138,11 @@ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE, if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE from performance_schema.file_summary_by_instance -where event_name like "%relaylog%" order by file_name; +where event_name like "%relaylog%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") +order by file_name; FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test index f9a4d7bfe00..68ba57dd502 100644 --- a/mysql-test/suite/perfschema/t/relaylog.test +++ b/mysql-test/suite/perfschema/t/relaylog.test @@ -31,6 +31,18 @@ drop table test.t1; --source include/show_binlog_events.inc +# Notes +# +# The point of this test is to make sure code is properly instrumented, +# where instruments have the proper key (binlog or relaylog), +# it is not to dive into statistics for each instruments. +# Different test execution sequence in different platforms do make the +# results vary, making the test results very sensitive to changes. +# To ensure robustness: +# - log file rotation is limited to file .000001 and .000002 +# - statistics are normalized to "NONE" or "MANY" +# + connection master; -- echo "============ Performance schema on master ============" @@ -99,7 +111,11 @@ select if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE from performance_schema.file_summary_by_instance - where file_name like "%slave-%" order by file_name; + where file_name like "%slave-%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") + order by file_name; -- echo "Expect a slave binlog + binlog_index" @@ -138,7 +154,11 @@ select if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ, if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE from performance_schema.file_summary_by_instance - where event_name like "%relaylog%" order by file_name; + where event_name like "%relaylog%" + and (file_name not like "%slave-relay-bin.0%" + or file_name like "%slave-relay-bin.000001" + or file_name like "%slave-relay-bin.000002") + order by file_name; select EVENT_NAME, From 74a438fc5b65c9a6c2e132c1c60473eb3e3b3384 Mon Sep 17 00:00:00 2001 From: Mayank Prasad Date: Fri, 11 Mar 2011 16:16:34 +0530 Subject: [PATCH 051/152] BUG #11760210: 52596: SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" Issue: SSL_CIPHER set to a specific CIPHER name was not getting picked up by SHOW STATUS Command. Solution: If specific cipher name is specified, avoid overwriting of Cipher List with default Cipher names. --- extra/yassl/src/yassl_int.cpp | 2 +- mysql-test/r/ssl_cipher.result | 9 +++++++++ mysql-test/t/ssl_cipher-master.opt | 1 + mysql-test/t/ssl_cipher.test | 23 +++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/ssl_cipher.result create mode 100644 mysql-test/t/ssl_cipher-master.opt create mode 100644 mysql-test/t/ssl_cipher.test diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 8e4a9aa95ec..5af2f180bb1 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -308,7 +308,7 @@ SSL::SSL(SSL_CTX* ctx) SetError(YasslError(err)); return; } - else if (serverSide) { + else if (serverSide && !(ctx->GetCiphers().setSuites_)) { // remove RSA or DSA suites depending on cert key type ProtocolVersion pv = secure_.get_connection().version_; diff --git a/mysql-test/r/ssl_cipher.result b/mysql-test/r/ssl_cipher.result new file mode 100644 index 00000000000..78081300b5b --- /dev/null +++ b/mysql-test/r/ssl_cipher.result @@ -0,0 +1,9 @@ +# +# BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" +# +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher AES128-SHA +SHOW STATUS LIKE 'Ssl_cipher_list'; +Variable_name Value +Ssl_cipher_list AES128-SHA diff --git a/mysql-test/t/ssl_cipher-master.opt b/mysql-test/t/ssl_cipher-master.opt new file mode 100644 index 00000000000..9525c238c40 --- /dev/null +++ b/mysql-test/t/ssl_cipher-master.opt @@ -0,0 +1 @@ +--ssl-cipher=AES128-SHA diff --git a/mysql-test/t/ssl_cipher.test b/mysql-test/t/ssl_cipher.test new file mode 100644 index 00000000000..5346968175c --- /dev/null +++ b/mysql-test/t/ssl_cipher.test @@ -0,0 +1,23 @@ +# Turn on ssl between the client and server +# and run a number of tests + +--echo # +--echo # BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" +--echo # + +-- source include/have_ssl.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +connect (ssl_con,localhost,root,,,,,SSL); + +# Check Cipher Name and Cipher List +SHOW STATUS LIKE 'Ssl_cipher'; +SHOW STATUS LIKE 'Ssl_cipher_list'; + +connection default; +disconnect ssl_con; + +# Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc From a8f5ef6259ef285f6880c1bc76626cf406b91093 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 11 Mar 2011 16:00:53 +0100 Subject: [PATCH 052/152] Fight a problem in internal test builds: When a RPM test build in a non-release branch is done, the $MYSQL_BINDIR variable ends in "/usr" (rather than in "/usr/lib" as in a RPM release build), this made test "file_contents" fail. A branch for this case is added to the test. The test result is unchanged. --- mysql-test/t/file_contents.test | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index 2a112e14495..33cd65fb2b4 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -10,9 +10,10 @@ --perl print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; -$dir_docs = $ENV{'MYSQL_BINDIR'}; -if($dir_docs =~ m|/usr/|) { +$dir_bin = $ENV{'MYSQL_BINDIR'}; +if ($dir_bin =~ m|/usr/|) { # RPM package + $dir_docs = $dir_bin; $dir_docs =~ s|/lib|/share/doc|; if(-d "$dir_docs/packages/MySQL-server") { # SuSE @@ -21,8 +22,19 @@ if($dir_docs =~ m|/usr/|) { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; } +} elsif ($dir_bin =~ m|/usr$|) { + # RPM build during development + $dir_docs = "$dir_bin/share/doc"; + if(-d "$dir_docs/packages/MySQL-server") { + # SuSE + $dir_docs = "$dir_docs/packages/MySQL-server"; + } else { + # RedHat: version number in directory name + $dir_docs = glob "$dir_docs/MySQL-server*"; + } } else { # tar.gz package, Windows, or developer work (in BZR) + $dir_docs = $dir_bin; $dir_docs =~ s|/lib||; if(-d "$dir_docs/docs") { $dir_docs = "$dir_docs/docs"; # package @@ -32,7 +44,7 @@ if($dir_docs =~ m|/usr/|) { } $found_version = "No line 'MySQL source #.#.#'"; $found_revision = "No line 'revision-id: .....'"; -open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs'\n"; +open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = )) { if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";} if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} @@ -41,7 +53,7 @@ close I_SRC; print "INFO_SRC: $found_version / $found_revision\n"; $found_compiler = "No line about compiler information"; $found_features = "No line 'Feature flags'"; -open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs'\n"; +open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = )) { # "generator" on Windows, "flags" on Unix: if (($line =~ m| Compiler / generator used: |) || From ba8b8ccb789fb97d3573fcff867f6af85ef5830b Mon Sep 17 00:00:00 2001 From: Chuck Bell Date: Fri, 11 Mar 2011 10:15:57 -0500 Subject: [PATCH 053/152] BUG#59752 : mysql.user.plugin length (60) vs. mysql.plugin.name length (64) This patch corrects the problem by fixing the definition and alterations of the mysql.user table in the .sql files. Also included are new result files for tests that examine the name column of the mysql.user table. --- mysql-test/r/system_mysql_db.result | 2 +- mysql-test/suite/funcs_1/r/is_columns_mysql.result | 4 ++-- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 0028f2ce5c1..b24f0186506 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -120,7 +120,7 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL DEFAULT '0', `max_connections` int(11) unsigned NOT NULL DEFAULT '0', `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', - `plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `plugin` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `authentication_string` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index c61a09084a8..1d20dca9903 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -207,7 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references -def mysql user plugin 41 NO char 60 180 NULL NULL utf8 utf8_bin char(60) select,insert,update,references +def mysql user plugin 41 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -516,5 +516,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned -3.0000 mysql user plugin char 60 180 utf8 utf8_bin char(60) +3.0000 mysql user plugin char 64 192 utf8 utf8_bin char(64) 1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 70e1d4fcdce..f5448b7caa6 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,7 +28,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 362464d5b60..90dd49c254a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -640,8 +640,8 @@ DROP PREPARE stmt; drop procedure mysql.die; -ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; -ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; +ALTER TABLE user ADD plugin char(64) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; +ALTER TABLE user MODIFY plugin char(64) DEFAULT '' NOT NULL; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions From 42e3c5d13cf179f437e1346523cd1d8ebd503842 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 14 Mar 2011 14:03:08 +0300 Subject: [PATCH 054/152] A patch for Bug#11765297 (58251 - archive_plugin and blackhole_plugin fails when running with ps-protocol). The problem was that when running in --ps-protocol mode mysqltest.cc didn't close created prepared statements. So, the plugins could not be unistalled because there was a prepared statement using them. A fix is to add a dummy statement that forces mysqltest.cc to close the last prepared statement (which uses a plugin-defined table). --- mysql-test/r/archive_plugin.result | 3 +++ mysql-test/r/blackhole_plugin.result | 3 +++ mysql-test/t/archive_plugin.test | 8 ++++++++ mysql-test/t/blackhole_plugin.test | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/mysql-test/r/archive_plugin.result b/mysql-test/r/archive_plugin.result index 221b343cca5..90c1f10bf19 100644 --- a/mysql-test/r/archive_plugin.result +++ b/mysql-test/r/archive_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN archive; INSTALL PLUGIN archive SONAME 'ha_archive.so'; CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN archive; UNINSTALL PLUGIN archive; ERROR 42000: PLUGIN archive does not exist diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result index 9fc0cacd9cc..4ef9fa0fa47 100644 --- a/mysql-test/r/blackhole_plugin.result +++ b/mysql-test/r/blackhole_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN blackhole; INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so'; CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN blackhole; UNINSTALL PLUGIN blackhole; ERROR 42000: PLUGIN blackhole does not exist diff --git a/mysql-test/t/archive_plugin.test b/mysql-test/t/archive_plugin.test index 567a0a58ce7..7d9b0ea065f 100644 --- a/mysql-test/t/archive_plugin.test +++ b/mysql-test/t/archive_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN archive; --error ER_SP_DOES_NOT_EXIST diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test index 1de5b2d0499..448104bed2b 100644 --- a/mysql-test/t/blackhole_plugin.test +++ b/mysql-test/t/blackhole_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN blackhole; --error ER_SP_DOES_NOT_EXIST UNINSTALL PLUGIN blackhole; From 658340319b80a1d43389bc81f5c93538164524c6 Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Mon, 14 Mar 2011 14:03:48 +0100 Subject: [PATCH 055/152] Bug#11858960 - WINDOWS SERVICE FAILING TO START IMMEDIATELY AFTER INSTALLATION When starting mysqld as an MS Windows NT service, it crashed with "Error 1067: The process terminated unexpectedly". The problem is that thread local variables are not allocated and initialized properly when started as a service. When the server is started as a regular executable, the problem does not occur. Analysis showed that this is a regression after the patch for Bug#11765237/Bug#11763065. Before, the thread local storage was initialized by the call chain: win_main->my_basic_init->my_thread_basic_global_init-> my_thread_init When the my_init() structure was changed, this initialization was moved from win_main to mysqld_main. When started as a service win_main is run in a separate thread, which does not have mysqld_main in its call path, so my_thread_init is never called for this thread. Added a call to my_thread_init / my_thread_end in the service handler function, which solves the problem. --- sql/mysqld.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 53f82e02e97..24ce134b40d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4656,10 +4656,15 @@ int mysqld_main(int argc, char **argv) #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) int mysql_service(void *p) { + if (my_thread_init()) + return 1; + if (use_opt_args) win_main(opt_argc, opt_argv); else win_main(Service.my_argc, Service.my_argv); + + my_thread_end(); return 0; } From 8da2b4f5d756c3b6993cd4be734cf2a49eeb81a5 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 14 Mar 2011 15:03:22 -0300 Subject: [PATCH 056/152] Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. Add a missing DBUG_RETURN function test_if_number(). --- mysql-test/r/analyse.result | 13 +++++++++++++ mysql-test/t/analyse.test | 12 ++++++++++++ sql/sql_analyse.cc | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 1820782d2f8..92fc26e7ba3 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -123,3 +123,16 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT DROP TABLE t1; End of 5.0 tests +# +# Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +# +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 05f739bfd69..63929d8766b 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -133,3 +133,15 @@ DROP TABLE t1; --echo End of 5.0 tests + +--echo # +--echo # Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +--echo # + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 29ba956bf6c..2b894282a9c 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -242,7 +242,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) if (str == end) { info->is_float = 1; // we can't use variable decimals here - return 1; + DBUG_RETURN(1); } DBUG_RETURN(0); } From e9394e9955ae142c73d33366f36dcfcf8698e02b Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 15 Mar 2011 10:58:54 +0100 Subject: [PATCH 057/152] Add warning suppression to test rpl.rpl_slave_load_remove_tmpfile --- mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result | 1 + mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index 55aef7676f1..21ae716b088 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -15,4 +15,5 @@ drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 2791bab0bcc..90263684e0d 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -62,6 +62,7 @@ drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); --let $rpl_only_running_threads= 1 --source include/rpl_end.inc From 3d124532134b2442934f7ba5e8fd75d96be33c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 15 Mar 2011 12:01:02 +0200 Subject: [PATCH 058/152] Bug#11849231 inflateInit() invoked without initializing all memory According to the zlib documentation, next_in and avail_in must be initialized before invoking inflateInit or inflateInit2. Furthermore, the zalloc function must clear the allocated memory. btr_copy_zblob_prefix(): Replace the d_stream parameter with buf,len and return the copied length. page_zip_decompress(): Invoke inflateInit2 a little later. page_zip_zalloc(): Rename from page_zip_alloc(). Invoke mem_heap_zalloc() instead of mem_heap_alloc(). rb:619 approved by Jimmy Yang --- storage/innodb_plugin/ChangeLog | 5 ++ storage/innodb_plugin/btr/btr0cur.c | 76 ++++++++++++++------------- storage/innodb_plugin/page/page0zip.c | 17 +++--- 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index fdd29908192..7c82cd9c27f 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,8 @@ +2011-03-15 The InnoDB Team + + * btr/btr0cur.c, page/page0zip.c: + Fix Bug#11849231 inflateInit() invoked without initializing all memory + 2011-02-28 The InnoDB Team * btr/btr0sea.c, buf/buf0buf.c, buf/buf0lru.c: diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 86d77c79e7b..d7b5ed0d135 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -4627,27 +4627,45 @@ btr_copy_blob_prefix( /*******************************************************************//** Copies the prefix of a compressed BLOB. The clustered index record -that points to this BLOB must be protected by a lock or a page latch. */ +that points to this BLOB must be protected by a lock or a page latch. +@return number of bytes written to buf */ static -void +ulint btr_copy_zblob_prefix( /*==================*/ - z_stream* d_stream,/*!< in/out: the decompressing stream */ + byte* buf, /*!< out: the externally stored part of + the field, or a prefix of it */ + ulint len, /*!< in: length of buf, in bytes */ ulint zip_size,/*!< in: compressed BLOB page size */ ulint space_id,/*!< in: space id of the BLOB pages */ ulint page_no,/*!< in: page number of the first BLOB page */ ulint offset) /*!< in: offset on the first BLOB page */ { - ulint page_type = FIL_PAGE_TYPE_ZBLOB; + ulint page_type = FIL_PAGE_TYPE_ZBLOB; + mem_heap_t* heap; + int err; + z_stream d_stream; + + d_stream.next_out = buf; + d_stream.avail_out = len; + d_stream.next_in = Z_NULL; + d_stream.avail_in = 0; + + /* Zlib inflate needs 32 kilobytes for the default + window size, plus a few kilobytes for small objects. */ + heap = mem_heap_create(40000); + page_zip_set_alloc(&d_stream, heap); ut_ad(ut_is_2pow(zip_size)); ut_ad(zip_size >= PAGE_ZIP_MIN_SIZE); ut_ad(zip_size <= UNIV_PAGE_SIZE); ut_ad(space_id); + err = inflateInit(&d_stream); + ut_a(err == Z_OK); + for (;;) { buf_page_t* bpage; - int err; ulint next_page_no; /* There is no latch on bpage directly. Instead, @@ -4663,7 +4681,7 @@ btr_copy_zblob_prefix( " compressed BLOB" " page %lu space %lu\n", (ulong) page_no, (ulong) space_id); - return; + goto func_exit; } if (UNIV_UNLIKELY @@ -4689,13 +4707,13 @@ btr_copy_zblob_prefix( offset += 4; } - d_stream->next_in = bpage->zip.data + offset; - d_stream->avail_in = zip_size - offset; + d_stream.next_in = bpage->zip.data + offset; + d_stream.avail_in = zip_size - offset; - err = inflate(d_stream, Z_NO_FLUSH); + err = inflate(&d_stream, Z_NO_FLUSH); switch (err) { case Z_OK: - if (!d_stream->avail_out) { + if (!d_stream.avail_out) { goto end_of_blob; } break; @@ -4712,13 +4730,13 @@ inflate_error: " compressed BLOB" " page %lu space %lu returned %d (%s)\n", (ulong) page_no, (ulong) space_id, - err, d_stream->msg); + err, d_stream.msg); case Z_BUF_ERROR: goto end_of_blob; } if (next_page_no == FIL_NULL) { - if (!d_stream->avail_in) { + if (!d_stream.avail_in) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: unexpected end of" @@ -4727,7 +4745,7 @@ inflate_error: (ulong) page_no, (ulong) space_id); } else { - err = inflate(d_stream, Z_FINISH); + err = inflate(&d_stream, Z_FINISH); switch (err) { case Z_STREAM_END: case Z_BUF_ERROR: @@ -4739,7 +4757,7 @@ inflate_error: end_of_blob: buf_page_release_zip(bpage); - return; + goto func_exit; } buf_page_release_zip(bpage); @@ -4751,6 +4769,12 @@ end_of_blob: offset = FIL_PAGE_NEXT; page_type = FIL_PAGE_TYPE_ZBLOB2; } + +func_exit: + inflateEnd(&d_stream); + mem_heap_free(heap); + UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); + return(d_stream.total_out); } /*******************************************************************//** @@ -4776,28 +4800,8 @@ btr_copy_externally_stored_field_prefix_low( } if (UNIV_UNLIKELY(zip_size)) { - int err; - z_stream d_stream; - mem_heap_t* heap; - - /* Zlib inflate needs 32 kilobytes for the default - window size, plus a few kilobytes for small objects. */ - heap = mem_heap_create(40000); - page_zip_set_alloc(&d_stream, heap); - - err = inflateInit(&d_stream); - ut_a(err == Z_OK); - - d_stream.next_out = buf; - d_stream.avail_out = len; - d_stream.avail_in = 0; - - btr_copy_zblob_prefix(&d_stream, zip_size, - space_id, page_no, offset); - inflateEnd(&d_stream); - mem_heap_free(heap); - UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); - return(d_stream.total_out); + return(btr_copy_zblob_prefix(buf, len, zip_size, + space_id, page_no, offset)); } else { return(btr_copy_blob_prefix(buf, len, space_id, page_no, offset)); diff --git a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c index a1dd4177ba8..6e866b3f016 100644 --- a/storage/innodb_plugin/page/page0zip.c +++ b/storage/innodb_plugin/page/page0zip.c @@ -653,13 +653,13 @@ page_zip_dir_encode( Allocate memory for zlib. */ static void* -page_zip_malloc( +page_zip_zalloc( /*============*/ void* opaque, /*!< in/out: memory heap */ uInt items, /*!< in: number of items to allocate */ uInt size) /*!< in: size of an item in bytes */ { - return(mem_heap_alloc(opaque, items * size)); + return(mem_heap_zalloc(opaque, items * size)); } /**********************************************************************//** @@ -684,7 +684,7 @@ page_zip_set_alloc( { z_stream* strm = stream; - strm->zalloc = page_zip_malloc; + strm->zalloc = page_zip_zalloc; strm->zfree = page_zip_free; strm->opaque = heap; } @@ -2912,19 +2912,18 @@ zlib_error: page_zip_set_alloc(&d_stream, heap); - if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) - != Z_OK)) { - ut_error; - } - d_stream.next_in = page_zip->data + PAGE_DATA; /* Subtract the space reserved for the page header and the end marker of the modification log. */ d_stream.avail_in = page_zip_get_size(page_zip) - (PAGE_DATA + 1); - d_stream.next_out = page + PAGE_ZIP_START; d_stream.avail_out = UNIV_PAGE_SIZE - PAGE_ZIP_START; + if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) + != Z_OK)) { + ut_error; + } + /* Decode the zlib header and the index information. */ if (UNIV_UNLIKELY(inflate(&d_stream, Z_BLOCK) != Z_OK)) { From 14df359b396b5eb3253826b4e81af7c41125e039 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 15 Mar 2011 11:49:14 +0100 Subject: [PATCH 059/152] Bug #11765416 (former 58381) FAILED DROP DATABASE CAN BREAK STATEMENT BASED REPLICATION The first phase of DROP DATABASE is to delete the tables in the database. If deletion of one or more of the tables fail (e.g. due to a FOREIGN KEY constraint), DROP DATABASE will be aborted. However, some tables could still have been deleted. The problem was that nothing would be written to the binary log in this case, so any slaves would not delete these tables. Therefore the master and the slaves would get out of sync. This patch fixes the problem by making sure that DROP TABLE is written to the binary log for the tables that were in fact deleted by the failed DROP DATABASE statement. Test case added to binlog.binlog_database.test. --- mysql-test/extra/binlog_tests/database.test | 27 ++++++++ .../suite/binlog/r/binlog_database.result | 66 +++++++++++++++++++ sql/sql_db.cc | 23 ++++--- 3 files changed, 108 insertions(+), 8 deletions(-) diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test index 326ecedb60e..d071415bf65 100644 --- a/mysql-test/extra/binlog_tests/database.test +++ b/mysql-test/extra/binlog_tests/database.test @@ -30,3 +30,30 @@ drop table tt1, t1; source include/show_binlog_events.inc; FLUSH STATUS; + + +--echo # +--echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +--echo # BASED REPLICATION +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +--enable_warnings + +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) + engine=innodb; +RESET MASTER; + +--error ER_ROW_IS_REFERENCED +DROP DATABASE db1; # Fails because of the fk +SHOW TABLES FROM db1; # t1 was dropped, t2 remains +--source include/show_binlog_events.inc # Check that the binlog drops t1 + +# Cleanup +DROP TABLE t3; +DROP DATABASE db1; diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index b6299f9a940..0eaed3c97d7 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -39,6 +39,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; set binlog_format=mixed; reset master; create database testing_1; @@ -80,6 +102,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; set binlog_format=row; reset master; create database testing_1; @@ -122,6 +166,28 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; +# +# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT +# BASED REPLICATION +# +DROP DATABASE IF EXISTS db1; +DROP TABLE IF EXISTS t3; +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; +CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) +engine=innodb; +RESET MASTER; +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SHOW TABLES FROM db1; +Tables_in_db1 +t2 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1`; drop table `t1` +DROP TABLE t3; +DROP DATABASE db1; show databases; Database information_schema diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 38f39ec0be7..665bcbbbe9f 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -833,12 +833,9 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) } thd->push_internal_handler(&err_handler); - if (thd->killed || - (tables && mysql_rm_table_no_locks(thd, tables, true, false, true, true))) - { - tables= NULL; - } - else + if (!thd->killed && + !(tables && + mysql_rm_table_no_locks(thd, tables, true, false, true, true))) { /* We temporarily disable the binary log while dropping the objects @@ -923,7 +920,7 @@ update_binlog: thd->server_status|= SERVER_STATUS_DB_DROPPED; my_ok(thd, deleted_tables); } - else if (mysql_bin_log.is_open()) + else if (mysql_bin_log.is_open() && !silent) { char *query, *query_pos, *query_end, *query_data_start; TABLE_LIST *tbl; @@ -938,6 +935,16 @@ update_binlog: for (tbl= tables; tbl; tbl= tbl->next_local) { uint tbl_name_len; + bool exists; + + // Only write drop table to the binlog for tables that no longer exist. + if (check_if_table_exists(thd, tbl, &exists)) + { + error= true; + goto exit; + } + if (exists) + continue; /* 3 for the quotes and the comma*/ tbl_name_len= strlen(tbl->table_name) + 3; From 6c2f5e306ca3fa621cd25cedd49181d6e0d5cbc6 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Tue, 15 Mar 2011 17:36:12 +0600 Subject: [PATCH 060/152] Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS". The problem was that server didn't check resulting size of prepared statement argument which was set using mysql_send_long_data() API. By calling mysql_send_long_data() several times it was possible to create overly big string and thus force server to allocate memory for it. There was no way to limit this allocation. The solution is to add check for size of result string against value of max_long_data_size start-up parameter. When intermediate string exceeds max_long_data_size value an appropriate error message is emitted. We can't use existing max_allowed_packet parameter for this purpose since its value is limited by 1GB and therefore using it as a limit for data set through mysql_send_long_data() API would have been an incompatible change. Newly introduced max_long_data_size parameter gets value from max_allowed_packet parameter unless its value is specified explicitly. This new parameter is marked as deprecated and will be eventually replaced by max_allowed_packet parameter. Value of max_long_data_size parameter can be set only at server startup. --- mysql-test/r/variables.result | 3 ++ mysql-test/t/variables.test | 5 ++++ sql/item.cc | 10 +++++++ sql/mysql_priv.h | 1 + sql/mysqld.cc | 28 +++++++++++++++++- sql/set_var.cc | 6 ++++ sql/sql_prepare.cc | 56 +++++++++++++++++++++++++++-------- tests/mysql_client_test.c | 51 +++++++++++++++++++++++++++++++ 8 files changed, 146 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 20f41c4a83c..f4e2a8c08fc 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1540,6 +1540,9 @@ ERROR HY000: Cannot drop default keycache SET @@global.key_cache_block_size=0; Warnings: Warning 1292 Truncated incorrect key_cache_block_size value: '0' +select @@max_long_data_size; +@@max_long_data_size +1048576 SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 2513f4fbcc8..c61e2aa3708 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1293,6 +1293,11 @@ SET @@global.max_join_size=0; SET @@global.key_buffer_size=0; SET @@global.key_cache_block_size=0; +# +# Bug#56976: added new start-up parameter +# +select @@max_long_data_size; + # cleanup SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; diff --git a/sql/item.cc b/sql/item.cc index c01671aff56..357cc6d7fe4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2742,6 +2742,16 @@ bool Item_param::set_longdata(const char *str, ulong length) (here), and first have to concatenate all pieces together, write query to the binary log and only then perform conversion. */ + if (str_value.length() + length > max_long_data_size) + { + my_message(ER_UNKNOWN_ERROR, + "Parameter of prepared statement which is set through " + "mysql_send_long_data() is longer than " + "'max_long_data_size' bytes", + MYF(0)); + DBUG_RETURN(true); + } + if (str_value.append(str, length, &my_charset_bin)) DBUG_RETURN(TRUE); state= LONG_DATA_VALUE; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 67631b265ab..8f9a9080d12 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1965,6 +1965,7 @@ extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; extern uint delay_key_write_options; +extern ulong max_long_data_size; #endif /* MYSQL_SERVER */ #if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 694d64c81df..46376a08ec9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -409,6 +409,7 @@ TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"", /* the default log output is log tables */ static bool lower_case_table_names_used= 0; +static bool max_long_data_size_used= false; static bool volatile select_thread_in_use, signal_thread_in_use; static bool volatile ready_to_exit; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; @@ -574,6 +575,11 @@ ulong delayed_insert_errors,flush_time; ulong specialflag=0; ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong max_connections, max_connect_errors; +/* + Maximum length of parameter value which can be set through + mysql_send_long_data() call. +*/ +ulong max_long_data_size; uint max_user_connections= 0; /** Limit of the total number of prepared statements in the server. @@ -5800,7 +5806,8 @@ enum options_mysqld OPT_SLOW_QUERY_LOG_FILE, OPT_IGNORE_BUILTIN_INNODB, OPT_BINLOG_DIRECT_NON_TRANS_UPDATE, - OPT_DEFAULT_CHARACTER_SET_OLD + OPT_DEFAULT_CHARACTER_SET_OLD, + OPT_MAX_LONG_DATA_SIZE }; @@ -6880,6 +6887,13 @@ thread is in the relay logs.", &global_system_variables.max_length_for_sort_data, &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, + {"max_long_data_size", OPT_MAX_LONG_DATA_SIZE, + "The maximum size of prepared statement parameter which can be provided " + "through mysql_send_long_data() API call. " + "Deprecated option; use max_allowed_packet instead.", + &max_long_data_size, + &max_long_data_size, 0, GET_ULONG, + REQUIRED_ARG, 1024*1024L, 1024, UINT_MAX32, MALLOC_OVERHEAD, 1, 0}, {"max_prepared_stmt_count", OPT_MAX_PREPARED_STMT_COUNT, "Maximum number of prepared statements in the server.", &max_prepared_stmt_count, &max_prepared_stmt_count, @@ -8688,6 +8702,10 @@ mysqld_get_one_option(int optid, } break; #endif /* defined(ENABLED_DEBUG_SYNC) */ + case OPT_MAX_LONG_DATA_SIZE: + max_long_data_size_used= true; + WARN_DEPRECATED(NULL, VER_CELOSIA, "--max_long_data_size", "--max_allowed_packet"); + break; } return 0; } @@ -8849,6 +8867,14 @@ static int get_options(int *argc,char **argv) else pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */ #endif + + /* + If max_long_data_size is not specified explicitly use + value of max_allowed_packet. + */ + if (!max_long_data_size_used) + max_long_data_size= global_system_variables.max_allowed_packet; + return 0; } diff --git a/sql/set_var.cc b/sql/set_var.cc index 831b68bbe14..333fb90c795 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -394,6 +394,12 @@ static sys_var_thd_ulong sys_max_seeks_for_key(&vars, "max_seeks_for_key", &SV::max_seeks_for_key); static sys_var_thd_ulong sys_max_length_for_sort_data(&vars, "max_length_for_sort_data", &SV::max_length_for_sort_data); +static sys_var_const sys_max_long_data_size(&vars, + "max_long_data_size", + OPT_GLOBAL, SHOW_LONG, + (uchar*) + &max_long_data_size); + #ifndef TO_BE_DELETED /* Alias for max_join_size */ static sys_var_thd_ha_rows sys_sql_max_join_size(&vars, "sql_max_join_size", &SV::max_join_size, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index da03bfbfedb..a94d1e519db 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2730,6 +2730,32 @@ void mysql_sql_stmt_close(THD *thd) } } + +class Set_longdata_error_handler : public Internal_error_handler +{ +public: + Set_longdata_error_handler(Prepared_statement *statement) + : stmt(statement) + { } + +public: + bool handle_error(uint sql_errno, + const char *message, + MYSQL_ERROR::enum_warning_level level, + THD *) + { + stmt->state= Query_arena::ERROR; + stmt->last_errno= sql_errno; + strncpy(stmt->last_error, message, MYSQL_ERRMSG_SIZE); + + return TRUE; + } + +private: + Prepared_statement *stmt; +}; + + /** Handle long data in pieces from client. @@ -2786,16 +2812,19 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) param= stmt->param_array[param_number]; + Set_longdata_error_handler err_handler(stmt); + /* + Install handler that will catch any errors that can be generated + during execution of Item_param::set_longdata() and propagate + them to Statement::last_error. + */ + thd->push_internal_handler(&err_handler); #ifndef EMBEDDED_LIBRARY - if (param->set_longdata(packet, (ulong) (packet_end - packet))) + param->set_longdata(packet, (ulong) (packet_end - packet)); #else - if (param->set_longdata(thd->extra_data, thd->extra_length)) + param->set_longdata(thd->extra_data, thd->extra_length); #endif - { - stmt->state= Query_arena::ERROR; - stmt->last_errno= ER_OUTOFMEMORY; - sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0); - } + thd->pop_internal_handler(); general_log_print(thd, thd->command, NullS); @@ -3257,6 +3286,13 @@ Prepared_statement::execute_loop(String *expanded_query, bool error; int reprepare_attempt= 0; + /* Check if we got an error when sending long data */ + if (state == Query_arena::ERROR) + { + my_message(last_errno, last_error, MYF(0)); + return TRUE; + } + if (set_parameters(expanded_query, packet, packet_end)) return TRUE; @@ -3497,12 +3533,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) status_var_increment(thd->status_var.com_stmt_execute); - /* Check if we got an error when sending long data */ - if (state == Query_arena::ERROR) - { - my_message(last_errno, last_error, MYF(0)); - return TRUE; - } if (flags & (uint) IS_IN_USE) { my_error(ER_PS_NO_RECURSION, MYF(0)); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index fc1f2e8293e..2e78c846fbc 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18464,6 +18464,56 @@ static void test_bug58036() } +/* + Bug #56976: Severe Denial Of Service in prepared statements +*/ +static void test_bug56976() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[1]; + int rc; + const char* query = "SELECT LENGTH(?)"; + char *long_buffer; + unsigned long i, packet_len = 256 * 1024L; + unsigned long dos_len = 2 * 1024 * 1024L; + + DBUG_ENTER("test_bug56976"); + myheader("test_bug56976"); + + stmt= mysql_stmt_init(mysql); + check_stmt(stmt); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + memset(bind, 0, sizeof(bind)); + bind[0].buffer_type = MYSQL_TYPE_TINY_BLOB; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + long_buffer= (char*) my_malloc(packet_len, MYF(0)); + DIE_UNLESS(long_buffer); + + memset(long_buffer, 'a', packet_len); + + for (i= 0; i < dos_len / packet_len; i++) + { + rc= mysql_stmt_send_long_data(stmt, 0, long_buffer, packet_len); + check_execute(stmt, rc); + } + + my_free(long_buffer, MYF(0)); + rc= mysql_stmt_execute(stmt); + + DIE_UNLESS(rc && mysql_stmt_errno(stmt) == ER_UNKNOWN_ERROR); + + mysql_stmt_close(stmt); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -18791,6 +18841,7 @@ static struct my_tests_st my_tests[]= { { "test_bug54041", test_bug54041 }, { "test_bug47485", test_bug47485 }, { "test_bug58036", test_bug58036 }, + { "test_bug56976", test_bug56976 }, { 0, 0 } }; From 9a4dd4adf9044ef9c926188e9efac78922640b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 15 Mar 2011 15:24:51 +0200 Subject: [PATCH 061/152] Remove trailing white space. --- storage/innobase/buf/buf0buf.c | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index fcfc15f03e8..aece9586fd2 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1233,7 +1233,7 @@ buf_pool_init_instance( buf_pool->page_hash = hash_create(2 * buf_pool->curr_size); buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size); - + buf_pool->last_printout_time = ut_time(); } /* 2. Initialize flushing fields @@ -1365,11 +1365,11 @@ buf_pool_drop_hash_index_instance( /* block->is_hashed cannot be modified when we have an x-latch on btr_search_latch; see the comment in buf0buf.h */ - + if (!block->is_hashed) { continue; } - + /* To follow the latching order, we have to release btr_search_latch before acquiring block->latch. */ @@ -1378,14 +1378,14 @@ buf_pool_drop_hash_index_instance( we must rescan all blocks, because some may become hashed again. */ *released_search_latch = TRUE; - + rw_lock_x_lock(&block->lock); - + /* This should be guaranteed by the callers, which will be holding btr_search_enabled_mutex. */ ut_ad(!btr_search_enabled); - + /* Because we did not buffer-fix the block by calling buf_block_get_gen(), it is possible that the block has been @@ -1395,7 +1395,7 @@ buf_pool_drop_hash_index_instance( block is mapped to. All we want to do is to drop any hash entries referring to the page. */ - + /* It is possible that block->page.state != BUF_FILE_PAGE. Even that does not matter, because @@ -1403,18 +1403,18 @@ buf_pool_drop_hash_index_instance( check block->is_hashed before doing anything. block->is_hashed can only be set on uncompressed file pages. */ - + btr_search_drop_page_hash_index(block); - + rw_lock_x_unlock(&block->lock); - + rw_lock_x_lock(&btr_search_latch); - + ut_ad(!btr_search_enabled); } } } - + /********************************************************************//** Drops the adaptive hash index. To prevent a livelock, this function is only to be called while holding btr_search_latch and while @@ -1990,30 +1990,30 @@ buf_pool_resize(void) ulint min_change_size = 1048576 * srv_buf_pool_instances; buf_pool_mutex_enter_all(); - + if (srv_buf_pool_old_size == srv_buf_pool_size) { - + buf_pool_mutex_exit_all(); return; } else if (srv_buf_pool_curr_size + min_change_size > srv_buf_pool_size) { - + change_size = (srv_buf_pool_curr_size - srv_buf_pool_size) / UNIV_PAGE_SIZE; buf_pool_mutex_exit_all(); - + /* Disable adaptive hash indexes and empty the index in order to free up memory in the buffer pool chunks. */ buf_pool_shrink(change_size); } else if (srv_buf_pool_curr_size + min_change_size < srv_buf_pool_size) { - + /* Enlarge the buffer pool by at least one megabyte */ - + change_size = srv_buf_pool_size - srv_buf_pool_curr_size; buf_pool_mutex_exit_all(); @@ -2026,10 +2026,10 @@ buf_pool_resize(void) return; } - + buf_pool_page_hash_rebuild(); } - + /****************************************************************//** Remove the sentinel block for the watch before replacing it with a real block. buf_page_watch_clear() or buf_page_watch_occurred() will notice that @@ -2890,7 +2890,7 @@ wait_until_unfixed: Try again later. */ buf_pool_mutex_exit(buf_pool); os_thread_sleep(WAIT_FOR_READ); - + goto loop; } @@ -4806,7 +4806,7 @@ buf_get_modified_ratio_pct(void) buf_get_total_list_len(&lru_len, &free_len, &flush_list_len); ratio = (100 * flush_list_len) / (1 + lru_len + free_len); - + /* 1 + is there to avoid division by zero */ return(ratio); @@ -5189,7 +5189,7 @@ buf_all_freed(void) return(TRUE); } - + /*********************************************************************//** Checks that there currently are no pending i/o-operations for the buffer pool. From aa4bfebaee1c2130519f5878b29b55e8919f3185 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 15 Mar 2011 16:06:59 +0100 Subject: [PATCH 062/152] Bug #11762804 55442: MYSQLD DEBUG CRASHES WHILE RUNNING MYISAM_CRASH_BEFORE_FLUSH_KEYS.TEST This will cause affected tests to skip if CrashReporter would popup Found 5 tests that needed modification --- mysql-test/include/not_crashrep.inc | 24 +++++++++++++++++++ mysql-test/suite/binlog/t/binlog_index.test | 2 ++ .../suite/innodb/t/innodb_bug53756.test | 3 +++ .../innodb_plugin/t/innodb_bug53756.test | 3 +++ mysql-test/t/crash_commit_before.test | 2 ++ .../t/myisam_crash_before_flush_keys.test | 3 +++ 6 files changed, 37 insertions(+) create mode 100644 mysql-test/include/not_crashrep.inc diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc new file mode 100644 index 00000000000..e126f339a5f --- /dev/null +++ b/mysql-test/include/not_crashrep.inc @@ -0,0 +1,24 @@ +# Check if CrashReporter is enabled and would open a window + +perl; +sub skip_test { + # Only relevant on Mac OS X + return 0 unless $^O eq 'darwin'; + my $crep= `defaults read com.apple.CrashReporter DialogType`; + return 0 if $?; + chomp ($crep); + $crep= lc $crep; + return ($crep eq 'basic' || $crep eq 'developer'); +} +my $skip= skip_test(); +open (F, ">" . $ENV{'MYSQL_TMP_DIR'} . "/crashrep.inc"); +print F "let \$crashrep= $skip;\n"; +close F; +EOF + +--source $MYSQL_TMP_DIR/crashrep.inc +--remove_file $MYSQL_TMP_DIR/crashrep.inc + +if ($crashrep) { + --skip CrashReporter would popup a window +} diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index b735574fdb9..086c0842b20 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -6,6 +6,8 @@ source include/not_embedded.inc; # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc source include/have_debug.inc; +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index d3b0a77c680..7a48f130b2c 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. --source include/have_innodb.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test index 8c48550a64d..37a79ea3021 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. -- source include/have_innodb_plugin.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index e3dba58d4df..6e36d2345e1 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -1,6 +1,8 @@ -- source include/not_embedded.inc # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc # Binary must be compiled with debug for crash to occur --source include/have_debug.inc diff --git a/mysql-test/t/myisam_crash_before_flush_keys.test b/mysql-test/t/myisam_crash_before_flush_keys.test index 1860ddd27e3..ea41b3559ca 100644 --- a/mysql-test/t/myisam_crash_before_flush_keys.test +++ b/mysql-test/t/myisam_crash_before_flush_keys.test @@ -8,6 +8,9 @@ --echo # Binary must be compiled with debug for crash to occur --source include/have_debug.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + let $MYSQLD_DATADIR= `select @@datadir`; SET GLOBAL delay_key_write=ALL; CREATE TABLE t1(a INT, From 634c654c27483c367bd054bf5f5f1302655d2549 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 15 Mar 2011 16:12:41 +0100 Subject: [PATCH 063/152] BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2 Problem: the test failed because errors were found in the error log. The test case contains suppressions for an old version of the error message, but the format of the error message has changed without updating the suppression. Fix: Update the suppression. Also small fixes to improve the test. --- .../r/rpl_slave_load_remove_tmpfile.result | 4 ++- .../t/rpl_slave_load_remove_tmpfile-slave.opt | 1 - .../rpl/t/rpl_slave_load_remove_tmpfile.test | 32 +++++++++++++------ 3 files changed, 25 insertions(+), 12 deletions(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index 21ae716b088..e08c066d226 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -1,12 +1,13 @@ include/master-slave.inc [connection master] +SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write'; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; start transaction; insert into t1(b) values (1); insert into t1(b) values (2); load data infile '../../std_data/rpl_loaddata.dat' into table t1; commit; -include/wait_for_slave_sql_to_stop.inc +include/wait_for_slave_sql_error.inc [errno=29, 13] drop table t1; include/sync_slave_io_with_master.inc include/stop_slave_io.inc @@ -16,4 +17,5 @@ call mtr.add_suppression("Slave: Can't get stat of .*"); call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); call mtr.add_suppression("Slave: File.* not found.*"); call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); +SET @@GLOBAL.DEBUG = ''; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt deleted file mode 100644 index 51e410f911f..00000000000 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-debug=d,remove_slave_load_file_before_write diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 90263684e0d..36327e2354a 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -1,12 +1,21 @@ -########################################################################## +# ==== Purpose ==== +# # This test verifies if the slave fails gracefully when the temporary -# file used to load data is removed while it is about to be used it. +# file used to load data is removed while it is about to be used. # Similar errors are caught if the temporary directory is removed. # +# ==== Implementation ==== +# # Steps: +# 0 - Set debug variable remove_slave_load_file_before_write. This +# causes the slave to remove the file. # 1 - Creates a table and populates it through "LOAD DATA INFILE". # 2 - Catches error. -########################################################################## +# +# ==== References ==== +# +# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave +# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2 --source include/have_binlog_format_statement.inc --source include/have_innodb.inc @@ -18,6 +27,11 @@ ########################################################################## # Loading data ########################################################################## + +connection slave; +--let $old_debug= `SELECT @@GLOBAL.DEBUG` +SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write'; + connection master; create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb; @@ -32,19 +46,14 @@ commit; # Catch Error ########################################################################## connection slave; -source include/wait_for_slave_sql_to_stop.inc; ---let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1) # windows and linux different error numbers here: # Windows: # - Last_Errno 29 (File not found) # Unix like OS: # - Last_Errno 13 (Can't stat file) ---let $assertion= `SELECT $error=29 OR $error=13` -if (!$assertion) -{ - --echo UNEXPECTED ERROR NUMBER: $error -} +--let $slave_sql_errno= 29, 13 +--source include/wait_for_slave_sql_error.inc ########################################################################## # Clean up @@ -64,5 +73,8 @@ call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13") call mtr.add_suppression("Slave: File.* not found.*"); call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); --let $rpl_only_running_threads= 1 + +eval SET @@GLOBAL.DEBUG = '$old_debug'; + --source include/rpl_end.inc From 5aed24509824dae9fb61f4cdc17510707ec314ad Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Wed, 16 Mar 2011 00:46:30 +0300 Subject: [PATCH 064/152] bug#58525 postfix --- mysql-test/include/wait_for_status_var.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 86831164c71..1ab58ffb548 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -81,7 +81,7 @@ while (`$_query`) sleep 0.1; let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1); let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value'); - if ($is_number) + if ($_is_number) { let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value); } From f39b86d772fcf805a96068a800bedc6067948b7f Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 16 Mar 2011 15:11:54 +0000 Subject: [PATCH 065/152] Fix for BUG#11868903 (BUG#59717) There is a race between two threads: user thread and the dump thread. The former sets a debug instruction that makes the latter wait before processing an Xid event. There can be cases that the dump thread has not yet processed the previous Xid event, causing it to wait one Xid event too soon, thus causing sync_slave_with_master never to resume. We fix this by moving the instructions that set the debug variable after calling sync_slave_with_master. --- mysql-test/suite/rpl/r/rpl_stop_slave.result | 1 + mysql-test/suite/rpl/t/rpl_stop_slave.test | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index ff0061f264b..7ea613fedd6 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -146,6 +146,7 @@ DROP TABLE t1, t2; CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); +[connection master] SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; [connection slave] include/restart_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index e44b2f15f25..8d2b26dd4ea 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -76,11 +76,13 @@ CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); +sync_slave_with_master; + +--source include/rpl_connection_master.inc + let $debug_save= `SELECT @@GLOBAL.debug`; SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; -sync_slave_with_master; - --source include/rpl_connection_slave.inc source include/restart_slave_sql.inc; From 6d07a87a58b7b1809413e5401beae4881c173cb5 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 16 Mar 2011 16:38:30 +0000 Subject: [PATCH 066/152] BUG#11877568 - RPL_SEMI_SYNC FAILS IN PB Currently, rpl_semi_sync is failing in PB due to the warning message: "Slave SQL: slave SQL thread is being stopped in the middle of " "applying of a group having updated a non-transaction table; " "waiting for the group completion ..." The problem started happening after the fix for BUG#11762407 what was automatically suppressing some warning messages. To fix the current issue, we suppress the aforementioned warning message and exploit the opportunity to make the sentence clearer. --- .../rpl_tests/rpl_stop_middle_group.test | 4 ++-- .../rpl/r/rpl_circular_for_4_hosts.result | 2 +- .../suite/rpl/r/rpl_heartbeat_basic.result | 2 +- .../suite/rpl/r/rpl_slow_query_log.result | 2 +- .../rpl/r/rpl_stm_start_stop_slave.result | 2 +- .../rpl/r/rpl_stm_stop_middle_group.result | 12 +++++------ mysql-test/suite/rpl/r/rpl_stop_slave.result | 2 +- .../suite/rpl/t/rpl_circular_for_4_hosts.test | 2 +- .../suite/rpl/t/rpl_heartbeat_basic.test | 2 +- mysql-test/suite/rpl/t/rpl_semi_sync.test | 1 + .../suite/rpl/t/rpl_slow_query_log.test | 3 +-- .../suite/rpl/t/rpl_stm_start_stop_slave.test | 2 +- mysql-test/suite/rpl/t/rpl_stop_slave.test | 2 +- sql/slave.cc | 20 +++++++++---------- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test index 4941cdbafd1..977d93ec36d 100644 --- a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test +++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test @@ -23,8 +23,8 @@ insert into tm set a=null; # to simulate killed status on the slave commit; connection slave; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); -call mtr.add_suppression("Slave SQL.*The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed."); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); # slave will catch the killed status but won't shut down immediately # only after the whole group has done (commit) diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index c2877510da2..f9c5b48e227 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -5,7 +5,7 @@ include/rpl_init.inc [topology=1->2->3->4->1] CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; include/rpl_sync.inc -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); *** Testing schema A->B->C->D->A *** diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index d510a14769c..93faf37053a 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -207,7 +207,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result index 5bb1ba050a8..79b83b4ceb9 100644 --- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result +++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); include/stop_slave.inc SET @old_log_output= @@log_output; SET GLOBAL log_output= 'TABLE'; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 9261721b1c9..57206873e2f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -70,6 +70,6 @@ include/start_slave.inc # Clean up DROP TABLE t1; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 5936c64d0ca..0b3233437aa 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -11,8 +11,8 @@ insert into tm set a=null; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); -call mtr.add_suppression("Slave SQL.*The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed."); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); include/wait_for_slave_sql_to_stop.inc SELECT "NO" AS Last_SQL_Error, @check as `true`; Last_SQL_Error true @@ -36,9 +36,9 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select count(*) as one from tm; one 1 @@ -53,9 +53,9 @@ set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select max(a) as two from tm; two 2 diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 8d85c2d26b5..014e65500c7 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -75,7 +75,7 @@ include/wait_for_slave_sql_to_start.inc # Test end SET GLOBAL debug= '$debug_save'; include/restart_slave.inc -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); [connection master] DROP TABLE t1, t2; diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 4bbd367b483..7d4b538c8a6 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -30,7 +30,7 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; --source include/rpl_sync.inc --connection server_4 -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --echo # diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index e3147ca1b0a..b9a170c5bc1 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -320,7 +320,7 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); --connection slave call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); let $slave_errno= ER_DUP_ENTRY --source include/wait_for_slave_sql_error.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index a57ebc236a1..228757496f3 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test index 35df117e5a2..faf037a9dff 100644 --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -29,8 +29,7 @@ source include/master-slave.inc; source include/have_binlog_format_statement.inc; CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); - +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); # Prepare slave for different long_query_time we need to stop the slave # and restart it as long_query_time variable is dynamic and, after diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index 6fd5045cc43..ada080e9071 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -19,7 +19,7 @@ SET @@session.binlog_direct_non_transactional_updates= FALSE; # clean up --connection slave SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --connection master SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index 8192302fdc0..fae9822e3e9 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -48,7 +48,7 @@ SET GLOBAL debug= '$debug_save'; source include/restart_slave_sql.inc; connection slave; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); connection master; --source include/rpl_connection_master.inc diff --git a/sql/slave.cc b/sql/slave.cc index a96ee505fe9..c676c89b369 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -903,18 +903,18 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) && rli->is_in_group()) { char msg_stopped[]= - "... The slave SQL is stopped, leaving the current group " - "of events unfinished with a non-transaction table changed. " - "If the group consists solely of Row-based events, you can try " - "restarting the slave with --slave-exec-mode=IDEMPOTENT, which " + "... Slave SQL Thread stopped with incomplete event group " + "having non-transactional changes. " + "If the group consists solely of row-based events, you can try " + "to restart the slave with --slave-exec-mode=IDEMPOTENT, which " "ignores duplicate key, key not found, and similar errors (see " "documentation for details)."; if (rli->abort_slave) { - DBUG_PRINT("info", ("Slave SQL thread is being stopped in the middle of" - " a group having updated a non-trans table, giving" - " it some grace period")); + DBUG_PRINT("info", ("Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... ")); /* Slave sql thread shutdown in face of unfinished group modified @@ -938,9 +938,9 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) if (ret == 0) { rli->report(WARNING_LEVEL, 0, - "slave SQL thread is being stopped in the middle " - "of applying of a group having updated a non-transaction " - "table; waiting for the group completion ... "); + "Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... "); } else { From 35bda0ae15fcf8b231aec6b1a949c7c7103cd808 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Wed, 16 Mar 2011 23:04:29 +0100 Subject: [PATCH 067/152] Removed the "Third-Party Component Notices" part --- README | 2209 +------------------------------------------------------- 1 file changed, 1 insertion(+), 2208 deletions(-) diff --git a/README b/README index 2e18fb55a22..795d325e2d5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -MySQL Server +MySQL Server 5.0 This is a release of MySQL, a dual-license SQL database server. For the avoidance of doubt, this particular copy of the software @@ -54,2210 +54,3 @@ You can browse the MySQL Reference Manual online or download it in any of several formats at the URL given earlier in this file. Source distributions include a local copy of the manual in the Docs directory. - -******************************************************************** - -Third-Party Component Notices - -********************************************************************* - -%%The following software may be included in this product: -FindGTest.cmake (part of CMake 2.8.0) - -Use of any of this software is governed by the terms of the license below: - -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman -# Copyright 2009 Daniel Blezek -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#=========================================================================== -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) -# -# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code - - -Text of Copyright.txt mentioned above: - -CMake - Cross Platform Makefile Generator -Copyright 2000-2009 Kitware, Inc., Insight Software Consortium -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the names of Kitware, Inc., the Insight Software Consortium, - nor the names of their contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Cmake - -Use of any of this software is governed by the terms of the license below: - -CMake is distributed under BSD License - - Copyright (c) 2008, Kitware, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Kitware, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -Additional License(s) - -cmake-2.4.8/Utilities/cmtar/compat/gethostname.c: - gethostname.c: minimal substitute for missing gethostname() function - created 2000-Mar-02 jmk - requires SVR4 uname() and -lc - - by Jim Knoble - Copyright ? 2000 Jim Knoble - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies and - that both that copyright notice and this permission notice appear in - supporting documentation. - - This software is provided "as is", without warranty of any kind, - express or implied, including but not limited to the warranties of - merchantability, fitness for a particular purpose and - noninfringement. In no event shall the author(s) be liable for any - claim, damages or other liability, whether in an action of contract, - tort or otherwise, arising from, out of or in connection with the - software or the use or other dealings in the software. - ----------------------------------- - -* Originally written by Steven M. Bellovin while -* at the University of North Carolina at Chapel Hill. Later tweaked by -* a couple of people on Usenet. Completely overhauled by Rich $alz -* and Jim Berets in August, 1990. -* -* This code is in the public domain and has no copyright. - -------------------------------- - - THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT. - You may freely copy it for use as a template for your own field types. - If you develop a field type that might be of general use, please send - it back to the ncurses maintainers for inclusion in the next version. - -************************************************************************** - - * Author : Per Foreby, perf@efd.lth.se - * Author : Juergen Pfeifer, juergen.pfeifer@gmx.net - -************************************************************************** - ----------------------------------------- - - Copyright (c) 2002 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for - details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - --------------------------------------------- - - Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. - ---------------------------------------------------- - -cmake-2.4.8/Utilities/cmzlib/zlib.h: - zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.4, March 11th, 2002 - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source - distribution. - - Jean-loup Gailly Mark Adler - ----------------------------------------------- - - This source code was modified by Martin Hedenfalk for use in Curl. His - latest changes were done 2000-09-18. - - It has since been patched away like a madman by Daniel Stenberg to make it - better applied to curl conditions, and to make it not use globals, pollute - name space and more. This source code awaits a rewrite to work around the - paragraph 2 in the BSD licenses as explained below. - - Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan - It has since been patched and modified a lot by Daniel Stenberg to make it - better applied to curl conditions, and to make it not use globals, pollute - name space and more. This source code awaits a rewrite to work around the - paragraph 2 in the BSD licenses as explained below. - - Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan - (Royal Institute of Technology, Stockholm, Sweden). - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - ---------------------------------------------- - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND - CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. - --------------------------------------------------- - -cmake-2.4.8/Utilities/cmcurl/inet_pton.c, -cmake-2.4.8/Source/CTest/Curl/inet_pton.c: - This is from the BIND 4.9.4 release, modified to compile by itself - - Copyright (c) 1996 by Internet Software Consortium. - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, - OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------- - -* Copyright (C) 2001 by Eric Kidd. All rights reserved. -* Copyright (C) 2001 by Luke Howard. All rights reserved. -* Copyright (C) 2002 Ximian, Inc. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. The name of the author may not be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR -* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - ---------------------------------------------------- - - Copyright (c) 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Chuck Karish of Mindcraft, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - Copyright (c) 1985, 1986 The Regents of the University of California. - All rights reserved. - - This code is derived from software contributed to Berkeley by - James A. Woods, derived from original work by Spencer Thomas - and Joseph Orost. - ------------------------------------------------- - - Copyright (c) 1989, 1993, 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Guido van Rossum. - - Copyright (c) 1990 The Regents of the University of California. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. - 4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - ------------------------------------------------------- - - Project ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - - Copyright (C) 2004, Daniel Stenberg, , et al. - - This software is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at http://curl.haxx.se/docs/copyright.html. - - You may opt to use, copy, modify, merge, publish, distribute and/or sell - copies of the Software, and permit persons to whom the Software is - furnished to do so, under the terms of the COPYING file. - - This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - KIND, either express or implied. - ------------------------------------------------------------- - -*************************************************************************** - Copyright (c) 1998 Free Software Foundation, Inc. - Copyright (c) 1998,2000 Free Software Foundation, Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, distribute with modifications, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished - to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - USE OR OTHER DEALINGS IN THE SOFTWARE. - - - Except as contained in this notice, the name(s) of the above copyright - holders shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization. -*************************************************************************** - ------------------------------------------------------- - - Copyright (c) 1997 Todd C. Miller - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Fred Fish's Dbug Library - -Use of any of this software is governed by the terms of the license below: - - * N O T I C E * - * * - * Copyright Abandoned, 1987, Fred Fish * - * * - * * - * This previously copyrighted work has been placed into the public * - * domain by the author and may be freely used for any purpose, * - * private or commercial. * - * * - * Because of the number of inquiries I was receiving about the use * - * of this product in commercially developed works I have decided to * - * simply make it public domain to further its unrestricted use. I * - * specifically would be most happy to see this material become a * - * part of the standard Unix distributions by AT&T and the Berkeley * - * Computer Science Research Group, and a standard part of the GNU * - * system from the Free Software Foundation. * - * * - * I would appreciate it, as a courtesy, if this notice is left in * - * all copies and derivative works. Thank you. * - * * - * The author makes no warranty of any kind with respect to this * - * product and explicitly disclaims any implied warranties of mer- * - * chantability or fitness for any particular purpose. * - -*************************************************************************** - -%%The following software may be included in this product: -dbug_analyze.c (part of Fred Fish's Dbug Library) - -Use of any of this software is governed by the terms of the license below: - -* Copyright Abandoned, 1987, Fred Fish * -* * -* * -* This previously copyrighted work has been placed into the public * -* domain by the author and may be freely used for any purpose, * -* private or commercial. * -* * -* Because of the number of inquiries I was receiving about the use * -* of this product in commercially developed works I have decided to * -* simply make it public domain to further its unrestricted use. I * -* specifically would be most happy to see this material become a * -* part of the standard Unix distributions by AT&T and the Berkeley * -* Computer Science Research Group, and a standard part of the GNU * -* system from the Free Software Foundation. * -* * -* I would appreciate it, as a courtesy, if this notice is left in * -* all copies and derivative works. Thank you. * -* * -* The author makes no warranty of any kind with respect to this * -* product and explicitly disclaims any implied warranties of mer- * -* chantability or fitness for any particular purpose. * - -*************************************************************************** - -%%The following software may be included in this product: -GNU Libtool, only ltmain.sh, libtool, auto-gen fil - -Use of any of this software is governed by the terms of the license below: - -ltmain.sh inclusion: -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -libtool inclusion: -# libtoolT - Provide generalized library-building support services. -# Generated automatically by (GNU mysql 5.1.30) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -Auto-generated files: -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building -# support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -Additional License(s) - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -*************************************************************************** - -%%The following software may be included in this product: -innochecksum.c - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to most -of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you can -do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for a -fee, you must give the recipients all the rights that you have. You must make -sure that they, too, receive or can get the source code. And you must show them -these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) offer -you this license which gives you legal permission to copy, distribute and/or -modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced by -others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish -to avoid the danger that redistributors of a free program will individually -obtain patent licenses, in effect making the program proprietary. To prevent -this, we have made it clear that any patent must be licensed for everyone's free -use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification follow. -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program or -work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included without -limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is not -restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence of any -warranty; and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at -your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating that -you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in whole or -in part contains or is derived from the Program or any part thereof, to be -licensed as a whole at no charge to all third parties under the terms of this -License. - c) If the modified program normally reads commands interactively when run, -you must cause it, when started running for such interactive use in the most -ordinary way, to print or display an announcement including an appropriate -copyright notice and a notice that there is no warranty (or else, saying that -you provide a warranty) and that users may redistribute the program under these -conditions, and telling the user how to view a copy of this License. (Exception: -if the Program itself is interactive but does not normally print such an -announcement, your work based on the Program is not required to print an -announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the entire whole, -and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on the -Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under Section -2) in object code or executable form under the terms of Sections 1 and 2 above -provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source -code, which must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange; or, - b) Accompany it with a written offer, valid for at least three years, to -give any third party, for a charge no more than your cost of physically -performing source distribution, a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of Sections 1 and 2 -above on a medium customarily used for software interchange; or, - c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed only for -noncommercial distribution and only if you received the program in object code -or executable form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all the -source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code distributed -need not include anything that is normally distributed (in either source or -binary form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component itself -accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source code -from the same place counts as distribution of the source code, even though third -parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or any -work based on the Program), you indicate your acceptance of this License to do -so, and all its terms and conditions for copying, distributing or modifying the -Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by third -parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement -or for any other reason (not limited to patent issues), conditions are imposed -on you (whether by court order, agreement or otherwise) that contradict the -conditions of this License, they do not excuse you from the conditions of this -License. If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, then as a -consequence you may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by all those -who receive copies directly or indirectly through you, then the only way you -could satisfy both it and this License would be to refrain entirely from -distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and the -section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original copyright -holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In such -case, this License incorporates the limitation as if written in the body of this -License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program specifies -a version number of this License which applies to it and "any later version", -you have the option of following the terms and conditions either of that version -or of any later version published by the Free Software Foundation. If the -Program does not specify a version number of this License, you may choose any -version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE -PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS -IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY -TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use -to the public, the best way to achieve this is to make it free software which -everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - -one line to give the program's name and an idea of what it does. -Copyright (C) yyyy name of author - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - -Gnomovision version 69, Copyright (C) year name of author -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details -type `show w'. This is free software, and you are welcome -to redistribute it under certain conditions; type `show c' -for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here is -a sample; alter the names: - -Yoyodyne, Inc., hereby disclaims all copyright -interest in the program `Gnomovision' -(which makes passes at compilers) written -by James Hacker. - -signature of Ty Coon, 1 April 1989 -Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may consider -it more useful to permit linking proprietary applications with the library. If -this is what you want to do, use the GNU Lesser General Public License instead -of this License. - -Additional Documentation License(s) - -innochecksum.c is documented in the MySQL Reference -Manual at http://dev.mysql.com/doc/refman/5.1/en/innochecksum.html -The Reference Manual is not licensed under the GPL; rather, it -is offered under normal copyright, but with permission to -copy/redistribute electronically. - -*************************************************************************** - -%%The following software may be included in this product: -lib_sql.cc - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000 - * SWsoft company - * - * This material is provided "as is", with absolutely no warranty expressed - * or implied. Any use is at your own risk. - * - * Permission to use or copy this software for any purpose is hereby granted - * without fee, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * - - This code was modified by the MySQL team -*/ - -*************************************************************************** - -%%The following software may be included in this product: -libevent - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000-2004 Niels Provos - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -Additional License(s) - -http://creativecommons.org/licenses/publicdomain - -*************************************************************************** - -%%The following software may be included in this product: -Async DNS Library - -Use of any of this software is governed by the terms of the license below: - -/* Async DNS Library - * Adam Langley - * http://www.imperialviolet.org/eventdns.html - * Public Domain code - * - * This software is Public Domain. To view a copy of the public domain dedication, - * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to - * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - * - * I ask and expect, but do not require, that all derivative works contain an - * attribution similar to: - * Parts developed by Adam Langley - * - * You may wish to replace the word "Parts" with something else depending on - * the amount of original code. - * - * (Derivative works does not include programs which link against, run or include - * the source verbatim in their source distributions) - * - * Version: 0.1b - */ - -*************************************************************************** - -%%The following software may be included in this product: -log.c - -Use of any of this software is governed by the terms of the license below: - -/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */ - -/* - * log.c - * - * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. - * - * Copyright (c) 2005 Nick Mathewson - * - * Copyright (c) 2000 Dug Song - * - * Copyright (c) 1993 - * The Regents of the University of California. All rights -reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -min_heap.h - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2006 Maxim Yegorushkin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -win32.c - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright 2000-2002 Niels Provos - * Copyright 2003 Michael A. Davis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -regex++ - -Use of any of this software is governed by the terms of the license below: - -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/*- - * Copyright (c) 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 - */ - -*************************************************************************** - -%%The following software may be included in this product: -Richard A. O'Keefe strings package - -Use of any of this software is governed by the terms of the license below: - -These files are in the public domain. This includes getopt.c, which -is the work of Henry Spencer, University of Toronto Zoology, who says of -it "None of this software is derived from Bell software. I had no access -to the source for Bell's versions at the time I wrote it. This software -is hereby explicitly placed in the public domain. It may be used for -any purpose on any machine by anyone." I would greatly prefer it if *my* -material received no military use. - -*************************************************************************** - -%%The following software may be included in this product: -t_ctype.h - -Use of any of this software is governed by the terms of the license below: - -http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.h - -/* - Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. - Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. - Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies. - Smaphan Raruenrom and Pruet Boonma makes no representations about - the suitability of this software for any purpose. It is provided - "as is" without express or implied warranty. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -SHA-1 in C - -Use of any of this software is governed by the terms of the license below: - - SHA-1 in C - By Steve Reid - 100% Public Domain - -Additional License(s) - -100% Public Domain - -*************************************************************************** - -%%The following software may be included in this product: -TCMalloc (part of google-perftools) - -Use of any of this software is governed by the terms of the license below: - -# Copyright (c) 1998-2006, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Additional License(s) - -*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later) -text: - -/* Basic platform-independent macro definitions for mutexes and - thread-specific data. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Wolfram Gloger , 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite - 330, Boston, MA 02111-1307, USA. */ - - - -*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text: - -/* Basic platform-independent macro definitions for mutexes, - thread-specific data and parameters for malloc. - Posix threads (pthreads) version. - Copyright (C) 2004 Wolfram Gloger . - -Permission to use, copy, modify, distribute, and sell this software -and its documentation for any purpose is hereby granted without fee, -provided that (i) the above copyright notices and this permission -notice appear in all copies of the software and related documentation, -and (ii) the name of Wolfram Gloger may not be used in any advertising -or publicity relating to the software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, -INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY -DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY -OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -The tz database - -Use of any of this software is governed by the terms of the license below: - -Sources for Time Zone and Daylight Saving Time Data -@(#)tz-link.htm 7.54 - -Please send corrections to this web page to the time zone mailing list. -The tz database - -The public-domain time zone database contains code and data that represent the -history of local time for many representative locations around the globe. It is -updated periodically to reflect changes made by political bodies to time zone -boundaries, UTC offsets, and daylight-saving rules. This database (often called -tz or zoneinfo) is used by several implementations, including the GNU C Library -used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS -X, OpenVMS, Solaris, Tru64, and UnixWare. - -Each location in the database represents a national region where all clocks -keeping local time have agreed since 1970. Locations are identified by continent -or ocean and then by the name of the location, which is typically the largest -city within the region. For example, America/New_York represents most of the US -eastern time zone; America/Phoenix represents most of Arizona, which uses -mountain time without daylight saving time (DST); America/Detroit represents -most of Michigan, which uses eastern time but with different DST rules in 1975; -and other entries represent smaller regions like Starke County, Indiana, which -switched from central to eastern time in 1991 and switched back in 2006. To use -the database on an extended POSIX implementation set the TZ environment variable -to the location's full name, e.g., TZ="America/New_York". - -In the tz database's FTP distribution the code is in the file tzcodeC.tar.gz, -where C is the code's version; similarly, the data are in tzdataD.tar.gz, where -D is the data's version. The following shell commands download these files to a -GNU/Linux or similar host; see the downloaded README file for what to do next. - -wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz' -gzip -dc tzcode*.tar.gz | tar -xf - -gzip -dc tzdata*.tar.gz | tar -xf - - -The code lets you compile the tz source files into machine-readable binary -files, one for each location. It also lets you read a tz binary file and -interpret time stamps for that location. - -The data are by no means authoritative. If you find errors, please send changes -to the time zone mailing list. You can also subscribe to the mailing list, -retrieve the archive of old messages (in gzip compressed format), or retrieve -archived older versions of code and data; there is also a smaller HTTP mirror. - -*************************************************************************** - -%%The following software may be included in this product: -UnicodeData.txt - -Use of any of this software is governed by the terms of the license below: - -Unicode Terms of Use - - For the general privacy policy governing access to this site, see the - Unicode Privacy Policy. For trademark usage, see the Unicode - Consortium (R) Trademarks and Logo Policy. - Notice to End User: Terms of Use - Carefully read the following legal agreement ("Agreement"). Use or - copying of the software and/or codes provided with this agreement (The - "Software") constitutes your acceptance of these terms - - 1. Unicode Copyright. - 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. - 2. Certain documents and files on this website contain a - legend indicating that "Modification is permitted." Any person - is hereby authorized, without fee, to modify such documents - and files to create derivative works conforming to the - Unicode (R) Standard, subject to Terms and Conditions herein. - 3. Any person is hereby authorized, without fee, to view, use, - reproduce, and distribute all documents and files solely for - informational purposes in the creation of products supporting - the Unicode Standard, subject to the Terms and Conditions - herein. - 4. Further specifications of rights and restrictions - pertaining to the use of the particular set of data files - known as the "Unicode Character Database" can be found in - Exhibit 1. - 5. Each version of the Unicode Standard has further - specifications of rights and restrictions of use. For the book - editions, these are found on the back of the title page. For - the online edition, certain files (such as the PDF files for - book chapters and code charts) carry specific restrictions. - All other files are covered under these general Terms of Use. - To request a permission to reproduce any part of the Unicode - Standard, please contact the Unicode Consortium. - 6. No license is granted to "mirror" the Unicode website where - a fee is charged for access to the "mirror" site. - 7. Modification is not permitted with respect to this - document. All copies of this document must be verbatim. - 2. Restricted Rights Legend. Any technical data or software which is - licensed to the United States of America, its agencies and/or - instrumentalities under this Agreement is commercial technical data - or commercial computer software developed exclusively at private - expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), - as applicable. For technical data, use, duplication, or disclosure - by the Government is subject to restrictions as set forth in DFARS - 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and - this Agreement. For Software, in accordance with FAR 12-212 or DFARS - 227-7202, as applicable, use, duplication or disclosure by the - Government is subject to the restrictions set forth in this - Agreement. - 3. Warranties and Disclaimers. - 1. This publication and/or website may include technical or - typographical errors or other inaccuracies . Changes are - periodically added to the information herein; these changes - will be incorporated in new editions of the publication and/or - website. Unicode may make improvements and/or changes in the - product(s) and/or program(s) described in this publication - and/or website at any time. - 2. If this file has been purchased on magnetic or optical - media from Unicode, Inc. the sole and exclusive remedy for any - claim will be exchange of the defective media within ninety - (90) days of original purchase. - 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR - SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND - EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT - LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS - LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN - THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE - REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE - WEBSITE. - 4. Waiver of Damages. In no event shall Unicode or its licensors be - liable for any special, incidental, indirect or consequential - damages of any kind, or any damages whatsoever, whether or not - Unicode was advised of the possibility of the damage, including, - without limitation, those resulting from the following: loss of use, - data or profits, in connection with the use, modification or - distribution of this information or its derivatives. - 5. Trademarks. - 1. Unicode and the Unicode logo are registered trademarks of - Unicode, Inc. - 2. This site contains product names and corporate names of - other companies. All product names and company names and logos - mentioned herein are the trademarks or registered trademarks - of their respective owners. Other products and corporate names - mentioned herein which are trademarks of a third party are - used only for explanation and for the owners' benefit and with - no intent to infringe. - 3. Use of third party products or information referred to - herein is at the user's risk. - 6. Miscellaneous. - 1. Jurisdiction and Venue. This server is operated from a - location in the State of California, United States of America. - Unicode makes no representation that the materials are - appropriate for use in other locations. If you access this - server from other locations, you are responsible for - compliance with local laws. This Agreement, all use of this - site and any claims and damages resulting from use of this - site are governed solely by the laws of the State of - California without regard to any principles which would apply - the laws of a different jurisdiction. The user agrees that any - disputes regarding this site shall be resolved solely in the - courts located in Santa Clara County, California. The user - agrees said courts have personal jurisdiction and agree to - waive any right to transfer the dispute to any other forum. - 2. Modification by Unicode Unicode shall have the right to - modify this Agreement at any time by posting it to this site. - The user may not assign any part of this Agreement without - Unicode's prior written consent. - 3. Taxes. The user agrees to pay any taxes arising from access - to this website or use of the information herein, except for - those based on Unicode's net income. - 4. Severability. If any provision of this Agreement is - declared invalid or unenforceable, the remaining provisions of - this Agreement shall remain in effect. - 5. Entire Agreement. This Agreement constitutes the entire - agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/ . Unicode Software includes any source code -published in the Unicode Standard or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. - - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU -DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES -OR SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - - Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -of the Unicode data files and any associated documentation (the "Data Files") or -Unicode software and any associated documentation (the "Software") to deal in -the Data Files or Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files or -Software are furnished to do so, provided that (a) the above copyright notice(s) -and this permission notice appear with all copies of the Data Files or Software, -(b) both the above copyright notice(s) and this permission notice appear in -associated documentation, and (c) there is clear notice in each modified Data -File or in the Software as well as in the documentation associated with the Data -File(s) or Software that the data or software has been modified. - - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of the -copyright holder. - - Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be -registered in some jurisdictions. All other trademarks and registered trademarks -mentioned herein are the property of their respective owners. - -*************************************************************************** - -%%The following software may be included in this product: -zlib - -Use of any of this software is governed by the terms of the license below: - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly jloup@gzip.org - Mark Adler madler@alumni.caltech.edu - -*/ - -*************************************************************************** - -%%The following software may be included in this product: -dtoa.c - -Use of any of this software is governed by the terms of the license below: - -/**************************************************************** - - This file incorporates work covered by the following copyright and - permission notice: - - The author of this software is David M. Gay. - - Copyright (c) 1991, 2000, 2001 by Lucent Technologies. - - Permission to use, copy, modify, and distribute this software for any - purpose without fee is hereby granted, provided that this entire - notice is included in all copies of any software which is or includes a copy - or modification of this software and in all copies of the supporting - documentation for such software. - - THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - - ***************************************************************/ - -*************************************************************************** - -%%The following software may be included in this product: -getarg.{c,h} - -Use of any of this software is governed by the terms of the license below: - -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -MD5 message-digest algorithm (md5_hash.cpp) - -Use of any of this software is governed by the terms of the license below: - -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * The code has been modified by Mikael Ronstroem to handle - * calculating a hash value of a key that is always a multiple - * of 4 bytes long. Word 0 of the calculated 4-word hash value - * is returned as the hash value. - */ - -*************************************************************************** - -%%The following software may be included in this product: -nt_servc.{cc,h} - -Use of any of this software is governed by the terms of the license below: - -/** - @file - - @brief - Windows NT Service class library. - - Copyright Abandoned 1998 Irena Pancirov - Irnet Snc - This file is public domain and comes with NO WARRANTY of any kind -*/ - -*************************************************************************** - -%%The following software may be included in this product: -GNU Readline - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - -*************************************************************************** - -%%The following software may be included in this product: -pstack (part of GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -pstack is comprised of various .c and .h files; all begin like this: - -/* bucomm.h -- binutils common include file. - Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -*************************************************************************** - -%%The following software may be included in this product: -libiberty.h (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -See -http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx - -/* Function declarations for libiberty. - Written by Cygnus Support, 1994. - - The libiberty library provides a number of functions which are - missing on some operating systems. We do not declare those here, - to avoid conflicts with the system header files on operating - systems that do support those functions. In this file we only - declare those functions which are specific to libiberty. */ - -*************************************************************************** - -%%The following software may be included in this product: -ieee.h (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -See -http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h - - -/* IEEE Standard 695-1980 "Universal Format for Object Modules" - header file - Contributed by Cygnus Support. */ - -*************************************************************************** - -%%The following software may be included in this product: -pstack.c (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -/* - pstack.c -- asynchronous stack trace of a running process - Copyright (c) 1999 Ross Thompson - Author: Ross Thompson - Critical bug fix: Tim Waugh -*/ - -/* - This file is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -********************************************************************** From c0613a9fd7ea2e40610ab1927aff2ec2feaa5b9a Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Thu, 17 Mar 2011 11:31:42 +0100 Subject: [PATCH 068/152] BUG#11877618: rpl_slave_net_timeout fails in rpl_sync.inc (at sync_slave_with_master) Problem: the test had not been updated after BUG#49978 was pushed Fix: add 'set $rpl_only_running_threads= 1' to the end of the test and update the result file. Also, use include/assert.inc for an assertion (instead of relying on result file comparison). Also, move 'set @@global.slave_net_timeout' forwards, to get rid of a warning. --- .../large_tests/r/rpl_slave_net_timeout.result | 15 +++++---------- .../large_tests/t/rpl_slave_net_timeout.test | 17 +++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result index 81de6e228e0..4dcc2e6295f 100644 --- a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result +++ b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result @@ -1,25 +1,20 @@ -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/master-slave.inc +[connection master] set @save_general_log = @@global.general_log; set @save_log_output = @@global.log_output; set @save_slave_net_timeout = @@global.slave_net_timeout; set @@global.general_log = ON; set @@global.log_output = 'table,file'; include/stop_slave.inc -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; change master to master_host = '127.0.0.1',master_port = MASTER_PORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; include/start_slave.inc include/stop_slave.inc select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; -select @result as 'Must be 1'; -Must be 1 -1 +include/assert.inc [time between last reconnection and the reconnection before that should be >= slave_net_timeout] set @@global.general_log = @save_general_log; set @@global.log_output = @save_log_output; set @@global.slave_net_timeout = @save_slave_net_timeout; +include/rpl_end.inc diff --git a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test index bfe7f712a20..238146cdaaa 100644 --- a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test +++ b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test @@ -21,11 +21,6 @@ set @@global.log_output = 'table,file'; connection slave; --source include/stop_slave.inc ---disable_warnings -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; ---enable_warnings -let $idle_time=`select @@global.slave_net_timeout * 2`; - # # if heartbeat is disabled then reconnecting to the idle master # should happen with `slave_net_timeout' period. @@ -42,6 +37,9 @@ let $idle_time=`select @@global.slave_net_timeout * 2`; eval change master to master_host = '127.0.0.1',master_port = $MASTER_MYPORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; +let $idle_time=`select @@global.slave_net_timeout * 2`; + let $slave_net_timeout = `select @@global.slave_net_timeout`; --source include/start_slave.inc @@ -64,11 +62,9 @@ connection master; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; ---disable_query_log -eval select time_to_sec(@ts_last) - $slave_net_timeout >= time_to_sec(@ts_prev) into @result; ---enable_query_log - -select @result as 'Must be 1'; +--let $assert_cond= time_to_sec(@ts_last) - time_to_sec(@ts_prev) >= $slave_net_timeout +--let $assert_text= time between last reconnection and the reconnection before that should be >= slave_net_timeout +--source include/assert.inc # cleanup @@ -79,4 +75,5 @@ set @@global.log_output = @save_log_output; connection slave; set @@global.slave_net_timeout = @save_slave_net_timeout; +--let $rpl_only_running_threads= 1 --source include/rpl_end.inc From da70b67a417cf522338c3df33ff6d5e4e012527e Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 17 Mar 2011 16:28:16 +0530 Subject: [PATCH 069/152] Minor fix in mysqldump test. --- mysql-test/r/mysqldump.result | 1 + mysql-test/t/mysqldump.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index fb70e0f1731..a337c0384f6 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4626,6 +4626,7 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; +USE `test`; # # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 0b533284ffa..8ecf8187ff9 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2193,6 +2193,8 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; --exec $MYSQL_DUMP --quote-names --compact test-database DROP DATABASE `test-database`; +# Switching back to test database. +USE `test`; --echo # --echo # End of 5.1 tests From bb0c50c7b146b0096bf098f495854636668cc7b8 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 17 Mar 2011 18:01:06 +0530 Subject: [PATCH 070/152] BUG#11766184 - 59234 : cmdline clients crash --defaults-extra-file with no .cnf or .ini extension. Fix for this bug was pushed as part of Bug#11765482. --- mysql-test/r/mysqladmin.result | 7 +++++++ mysql-test/t/mysqladmin.test | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 748152bffcc..8a9b009946b 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -10,3 +10,10 @@ mysqld is alive # Displaying the output : mysqld is alive mysqld is alive +# +# BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +# with no .cnf or .ini extension. +# +# Creating an empty file 'cnf_file' +# Using --defaults-extra-file option with 'cnf_file'. +mysqld is alive diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index c3bfc585289..4811c5fdbc6 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -45,3 +45,17 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; --cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp --remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp + +--echo # +--echo # BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +--echo # with no .cnf or .ini extension. +--echo # + +--echo # Creating an empty file 'cnf_file' +--write_file $MYSQLTEST_VARDIR/tmp/cnf_file +EOF + +--echo # Using --defaults-extra-file option with 'cnf_file'. +--exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1 + +--remove_file $MYSQLTEST_VARDIR/tmp/cnf_file From cc1b046c3e68374de3f947a7f6bde253ca0a5956 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Mar 2011 15:52:49 +0200 Subject: [PATCH 071/152] Bug #11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR Added the cleanup code. Extended mysql_client_test to take --plugin-dir and --default_auth. Added a C test case. --- mysql-test/t/mysql_client_test.test | 2 +- sql-common/client_plugin.c | 1 + tests/mysql_client_test.c | 41 +++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 2c19671d11b..cf1ea70e404 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -12,7 +12,7 @@ SET @old_slow_query_log= @@global.slow_query_log; # var/log/mysql_client_test.trace --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index 6b4cca8aeea..47409e34d9a 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -163,6 +163,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, p->next= plugin_list[plugin->type]; plugin_list[plugin->type]= p; + net_clear_error(&mysql->net); return plugin; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 7911393758c..b5326c5bee9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -34,6 +34,7 @@ #include #include #include +#include #define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ @@ -59,6 +60,7 @@ static unsigned int test_count= 0; static unsigned int opt_count= 0; static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static const char *opt_basedir= "./"; static const char *opt_vardir= "mysql-test/var"; @@ -245,6 +247,11 @@ static MYSQL *mysql_client_init(MYSQL* con) if (res && shared_memory_base_name) mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); #endif + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); return res; } @@ -326,6 +333,11 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) /* enable local infile, in non-binary builds often disabled by default */ mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); if (!(mysql_real_connect(mysql, opt_host, opt_user, opt_password, opt_db ? opt_db:"test", opt_port, @@ -19552,6 +19564,28 @@ static void test_bug57058() } +/** + Bug#11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR +*/ + +static void test_bug11766854() +{ + struct st_mysql_client_plugin *plugin; + + DBUG_ENTER("test_bug11766854"); + myheader("test_bug11766854"); + + plugin= mysql_load_plugin(mysql, "foo", -1, 0); + DIE_UNLESS(plugin == 0); + + plugin= mysql_load_plugin(mysql, "qa_auth_client", -1, 0); + DIE_UNLESS(plugin != 0); + DIE_IF(mysql_errno(mysql)); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -19609,6 +19643,12 @@ static struct my_option client_test_long_options[] = {"getopt-ll-test", 'g', "Option for testing bug in getopt library", &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, + {"plugin_dir", 0, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", 0, "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -19889,6 +19929,7 @@ static struct my_tests_st my_tests[]= { { "test_bug58036", test_bug58036 }, { "test_bug57058", test_bug57058 }, { "test_bug56976", test_bug56976 }, + { "test_bug11766854", test_bug11766854 }, { 0, 0 } }; From 0ded0c6f60e46e418f7bf7d0c180678c03107e2a Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 18 Mar 2011 10:31:39 +0100 Subject: [PATCH 072/152] Bug #11766854 addendum : Fixed test suite failures when the auth plugin is not compiled in. --- mysql-test/include/have_plugin_auth.inc | 1 + mysql-test/t/mysql_client_test-master.opt | 5 ++++- mysql-test/t/mysql_client_test.test | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/have_plugin_auth.inc b/mysql-test/include/have_plugin_auth.inc index 41f11419c64..44ff4c2520d 100644 --- a/mysql-test/include/have_plugin_auth.inc +++ b/mysql-test/include/have_plugin_auth.inc @@ -2,3 +2,4 @@ disable_query_log; --require r/true.require select (PLUGIN_LIBRARY LIKE 'auth_test_plugin%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server'; +enable_query_log; diff --git a/mysql-test/t/mysql_client_test-master.opt b/mysql-test/t/mysql_client_test-master.opt index 4c683f7f0a2..3dfaf15666f 100644 --- a/mysql-test/t/mysql_client_test-master.opt +++ b/mysql-test/t/mysql_client_test-master.opt @@ -1 +1,4 @@ ---log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE +--log=$MYSQLTEST_VARDIR/log/master.log +--log-output=FILE,TABLE +$PLUGIN_AUTH_OPT +$PLUGIN_AUTH_LOAD diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index cf1ea70e404..529d60517c0 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,5 +1,7 @@ # This test should work in embedded server after we fix mysqltest -- source include/not_embedded.inc +# need to have the dynamic loading turned on for the client plugin tests +--source include/have_plugin_auth.inc SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; From be59ccd6a970b40b0de3e4d38bb3139eb1becb94 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Mar 2011 11:03:54 +0100 Subject: [PATCH 073/152] Bug#11867664: SERVER CRASHES ON UPDATE WITH JOIN ON PARTITIONED TABLE Regression from bug#11766232. m_last_part could be set beyond the last partition. Fixed by only setting it if within the limit. Also added check in print_error. --- sql/ha_partition.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0e70ae60068..59b904aceac 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4448,7 +4448,8 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index, break; } } - m_last_part= part; + if (part <= m_part_spec.end_part) + m_last_part= part; } else { @@ -6391,7 +6392,14 @@ void ha_partition::print_error(int error, myf errflag) { /* In case m_file has not been initialized, like in bug#42438 */ if (m_file) + { + if (m_last_part >= m_tot_parts) + { + DBUG_ASSERT(0); + m_last_part= 0; + } m_file[m_last_part]->print_error(error, errflag); + } else handler::print_error(error, errflag); } From e8ad8f4fd86ba66c43b6aae4c7ddddcd83aa333f Mon Sep 17 00:00:00 2001 From: Vinay Fisrekar Date: Fri, 18 Mar 2011 16:35:57 +0530 Subject: [PATCH 074/152] Bug#11766500 - 59624: FUNCS_1 SUITE TESTS FAILING WITH RESULT DIFFERENCE WHEN RUN USING EMBEDDED MODE Updating result files --- .../funcs_1/r/is_columns_is_embedded.result | 68 +++++++++---------- .../r/is_columns_myisam_embedded.result | 12 ++-- .../r/is_columns_mysql_embedded.result | 16 ++--- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 59ad695c413..e64dc27078c 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -15,8 +15,8 @@ NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 u NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) -NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) @@ -27,9 +27,9 @@ NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 42949 NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) -NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -71,14 +71,14 @@ NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) @@ -88,27 +88,27 @@ NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) -NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -125,29 +125,29 @@ NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES var NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -231,27 +231,27 @@ NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NU NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index 2721dcf3c6e..739f62e371a 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -479,9 +479,9 @@ NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zero NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) -NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill @@ -602,9 +602,9 @@ NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) -NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 9c9d3cd26de..983f9dd833e 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -97,13 +97,13 @@ NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum( NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') -NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI +NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned PRI NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) -NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128) NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob @@ -130,7 +130,7 @@ NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') -NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI @@ -411,7 +411,7 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp 3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16) -3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64) +3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_general_ci char(64) 3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE') 3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77) 3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant') From f4ac6eb117347075ad0d859ca640f13c869a23d9 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Fri, 18 Mar 2011 12:13:54 +0100 Subject: [PATCH 075/152] Bug #11885854 MYSQLTEST: PS-PROTOCOL IMPLIED BY CURSOR-PROTOCOL LOST AFTER ENABLE_PS_PROTOCOL The condition cursor-protocol => ps-protocol was done at "current setting" level" Moved it to "set by command line" level --- client/mysqltest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a94dba90979..52c76b8c68e 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8032,13 +8032,15 @@ int main(int argc, char **argv) cur_file->lineno= 1; } init_re(); + + /* Cursor protcol implies ps protocol */ + if (cursor_protocol) + ps_protocol= 1; + ps_protocol_enabled= ps_protocol; sp_protocol_enabled= sp_protocol; view_protocol_enabled= view_protocol; cursor_protocol_enabled= cursor_protocol; - /* Cursor protcol implies ps protocol */ - if (cursor_protocol_enabled) - ps_protocol_enabled= 1; st_connection *con= connections; if (!( mysql_init(&con->mysql))) From 52edb4a5b95de617d0627e8476785e404f380eeb Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 18 Mar 2011 16:16:17 +0200 Subject: [PATCH 076/152] Bug # 11766011: mysql.user.authentication_string column causes configuration wizard to fail Made the fields mysql.user.plugin and mysql.user.authentication_string nullable to conform with some older clients doing inserts instead of using the commands. --- mysql-test/r/grant.result | 7 +- mysql-test/r/grant2.result | 2 - mysql-test/r/plugin_auth.result | 58 ++++++++++++++++ mysql-test/r/plugin_auth_qa.result | 30 ++++----- mysql-test/r/plugin_auth_qa_1.result | 38 +++++------ mysql-test/r/plugin_auth_qa_2.result | 22 +++---- mysql-test/r/sp_notembedded.result | 2 - mysql-test/r/system_mysql_db.result | 4 +- .../suite/funcs_1/r/is_columns_mysql.result | 4 +- .../suite/funcs_1/r/is_user_privileges.result | 66 +++++++++---------- .../suite/rpl/r/rpl_ignore_table.result | 1 - mysql-test/suite/rpl/r/rpl_stm_000001.result | 1 - mysql-test/t/plugin_auth.test | 57 ++++++++++++++++ scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 +- sql/sql_acl.cc | 2 + 16 files changed, 205 insertions(+), 95 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 49db157f35f..7603e4b1b1c 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -54,7 +54,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' @@ -125,7 +125,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 @@ -172,7 +172,7 @@ max_updates 20 max_connections 30 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 @@ -284,7 +284,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index b5e82794658..70388b06daf 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -287,7 +287,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; @@ -355,7 +354,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value INSERT INTO mysql.db (host, db, user, select_priv) VALUES ('%','TESTDB','mysqltest_1','Y'); FLUSH PRIVILEGES; diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 7f26cdf447a..591a403a0c5 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -342,4 +342,62 @@ select USER(),CURRENT_USER(); USER() CURRENT_USER() uplain@localhost uplain@localhost DROP USER uplain@localhost; +# +# Bug #59038 : mysql.user.authentication_string column +# causes configuration wizard to fail +INSERT INTO mysql.user( +Host, +User, +Password, +Select_priv, +Insert_priv, +Update_priv, +Delete_priv, +Create_priv, +Drop_priv, +Reload_priv, +Shutdown_priv, +Process_priv, +File_priv, +Grant_priv, +References_priv, +Index_priv, +Alter_priv, +Show_db_priv, +Super_priv, +Create_tmp_table_priv, +Lock_tables_priv, +Execute_priv, +Repl_slave_priv, +Repl_client_priv, +/*!50001 +Create_view_priv, +Show_view_priv, +Create_routine_priv, +Alter_routine_priv, +Create_user_priv, +*/ +ssl_type, +ssl_cipher, +x509_issuer, +x509_subject, +max_questions, +max_updates, +max_connections) +VALUES ( +'localhost', +'inserttest', '', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +/*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0'); +FLUSH PRIVILEGES; +DROP USER inserttest@localhost; +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE +COLUMN_NAME IN ('authentication_string', 'plugin') AND +TABLE_NAME='user' AND +TABLE_SCHEMA='mysql' +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result index d1ecf6a6470..d1128cf04ee 100644 --- a/mysql-test/r/plugin_auth_qa.result +++ b/mysql-test/r/plugin_auth_qa.result @@ -105,7 +105,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -115,7 +115,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -125,7 +125,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -135,7 +135,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -145,7 +145,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -155,7 +155,7 @@ DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -210,7 +210,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; @@ -221,7 +221,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -pl??g_dest +pl??g_dest NULL DROP USER 'plüg_dest'; SET NAMES latin1; ========== test 1.1.1.5 ==================================== @@ -235,7 +235,7 @@ DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; SET NAMES utf8; CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; @@ -248,7 +248,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -258,7 +258,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; ========== test 1.1.1.2/1.1.2.2============================= SET @auth_name= 'test_plugin_server'; @@ -278,7 +278,7 @@ DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -hh's_plug_dest +hh's_plug_dest NULL DROP USER 'hh''s_plug_dest'; ========== test 1.1.1.4 ==================================== CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; @@ -294,7 +294,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string grant_user test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER grant_user,plug_dest; set @save_sql_mode= @@sql_mode; SET @@sql_mode=no_auto_create_user; @@ -315,13 +315,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *939AEE68989794C0F408277411C26055CDF41119 +plug_dest NULL *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D +plug_dest NULL *560881EB651416CEF77314D07D55EDCD5FC1BD6D DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result index 00ee47b56b3..51c7260d9ae 100644 --- a/mysql-test/r/plugin_auth_qa_1.result +++ b/mysql-test/r/plugin_auth_qa_1.result @@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas GRANT PROXY ON plug_dest TO plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest 1) current_user() @@ -73,7 +73,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -91,7 +91,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -113,13 +113,13 @@ connection default; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL disconnect plug_user; UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_dest,plug_user; ========== test 1.3 ======================================== @@ -135,26 +135,26 @@ connection default; disconnect plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server new_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user new_plugin_server new_dest -plug_dest +plug_dest NULL connect(plug_user,localhost,new_user,new_dest); ERROR HY000: Plugin 'new_plugin_server' is not loaded UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; @@ -163,7 +163,7 @@ FLUSH PRIVILEGES; GRANT PROXY ON new_dest TO new_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest connect(plug_user,localhost,new_user,new_dest); select USER(),CURRENT_USER(); @@ -176,9 +176,9 @@ FLUSH PRIVILEGES; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest -plug_dest +plug_dest NULL GRANT ALL PRIVILEGES ON test.* TO new_user; connect(plug_user,localhost,new_dest,new_dest_passwd); select USER(),CURRENT_USER(); @@ -193,7 +193,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -230,7 +230,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -273,11 +273,11 @@ GRANT PROXY ON proxied_user_5 TO ''@''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user_1 -proxied_user_2 -proxied_user_3 -proxied_user_4 -proxied_user_5 +proxied_user_1 NULL +proxied_user_2 NULL +proxied_user_3 NULL +proxied_user_4 NULL +proxied_user_5 NULL connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'); connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd); connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd); diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index 99fe9c6f5a9..f4706e5aa0b 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest SELECT @@proxy_user; @@proxy_user @@ -20,7 +20,7 @@ current_user() user() @@local.proxy_user @@local.external_user qa_test_1_user@% qa_test_1_user@localhost NULL NULL SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest DROP USER qa_test_1_user; DROP USER qa_test_1_dest; @@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; GRANT PROXY ON authenticated_as TO qa_test_2_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest SELECT @@proxy_user; @@proxy_user @@ -47,8 +47,8 @@ current_user() user() @@local.proxy_user @@local.external_user authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest DROP USER qa_test_2_user; DROP USER qa_test_2_dest; @@ -83,8 +83,8 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password - *DFCACE76914AD7BD801FC1A1ECF6562272621A22 -qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 + NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_user qa_auth_interface qa_test_5_dest exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) @@ -98,7 +98,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -109,7 +109,7 @@ ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using p GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -121,7 +121,7 @@ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y REVOKE PROXY ON qa_test_6_dest FROM root; SELECT user,plugin,authentication_string FROM mysql.user; user plugin authentication_string -qa_test_6_dest +qa_test_6_dest NULL qa_test_6_user qa_auth_interface qa_test_6_dest root root diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 7da95416e29..6b6c98ea226 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -249,8 +249,6 @@ max_updates, max_connections, max_user_connections) VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '', '', '', '', '0', '0', '0', '0'); -Warnings: -Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; CREATE PROCEDURE p1(i INT) BEGIN END; DROP PROCEDURE p1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index b24f0186506..0e0d555d492 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -120,8 +120,8 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL DEFAULT '0', `max_connections` int(11) unsigned NOT NULL DEFAULT '0', `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', - `plugin` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `authentication_string` text COLLATE utf8_bin NOT NULL, + `plugin` char(64) COLLATE utf8_bin DEFAULT '', + `authentication_string` text COLLATE utf8_bin, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 1d20dca9903..95ffd62fbb8 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -185,7 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references -def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references +def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -207,7 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references -def mysql user plugin 41 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references +def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result index 1ec1ffc4ce1..b269da53a3d 100644 --- a/mysql-test/suite/funcs_1/r/is_user_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result @@ -128,7 +128,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -170,7 +170,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -212,7 +212,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # # Add GRANT OPTION db_datadict.* to testuser1; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; @@ -278,7 +278,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -320,7 +320,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -362,7 +362,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Establish connection testuser1 (user=testuser1) SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -414,7 +414,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -456,7 +456,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -498,7 +498,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -572,7 +572,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -614,7 +614,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -656,7 +656,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; # # Here