From 9493866e26b8e3e475ba677389b478f2c36803f8 Mon Sep 17 00:00:00 2001 From: "balasubramanian.kandasamy@oracle.com" Date: Tue, 27 Aug 2013 09:08:49 +0200 Subject: [PATCH 01/80] Raise version number after cloning 5.5.34 --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20130827070849-h3sum2kngibir760 property-audit-revid: balasubramanian.kandasamy@oracle.com-20130827070849-fkellmp0vfgr1eok property-authors: balasubramanian.kandasamy@oracle.com property-branch-nick: mysql-5.5 testament3-sha1: 9ff125e107037faf951bc77623876bf4cffaa48c --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 26414adb678..3a42bb0f600 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=34 +MYSQL_VERSION_PATCH=35 MYSQL_VERSION_EXTRA= From 68af0325cb4825b876c0e649d7ad853d0edd94c7 Mon Sep 17 00:00:00 2001 From: Neeraj Bisht Date: Wed, 28 Aug 2013 14:54:53 +0530 Subject: [PATCH 02/80] Bug#16346241 - SERVER CRASH IN ITEM_PARAM::QUERY_VAL_STR Problem:- Second execution of prepared statement for query with parameter in limit clause, causes an assert when using connectors (e.g., Connector C). Analysis:- In prepared statement, LIMIT parameters can be specified using '?' markers. Value for the parameter can be supplied while executing the prepared statement. Passing string, float or double values for LIMIT clause works well from command-line client. That's because, while setting the LIMIT parameter value from a user-variable, the value is converted to integer value. However, when prepared statement is executed from other interfaces as J connectors, or C applications etc, the value for the parameters are sent to the server with execute command. Each item in command has value and the data TYPE. So, while setting parameter values from this log, value is set to all the parameters with the same data type as passed. Here, we have the logic to convert the value to change the state and item_type if it is part of LIMIT parameter and its item_type is not INT. But when we reset this parameter we save the item_type but change state. So on second execution we have old item_type but our state has been changed, which make us to use string type variable in Item_param::query_str_val(). This cause an assert. Fix: Instead of checking the item_type of the parameter, check for the state of the parameter. As state value are reset everytime we execute the statement. --BZR-- revision-id: neeraj.x.bisht@oracle.com-20130828092453-k49wbwhfo43giwxj property-audit-revid: neeraj.x.bisht@oracle.com-20130828092453-9hpov6wmwdppahms property-branch-nick: 5.5 testament3-sha1: e2f753320135f8dba6b3670b312bf311d78476db --- sql/sql_prepare.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 74279c5539d..48d23cd5d21 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -877,7 +877,7 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array, if (param->state == Item_param::NO_VALUE) DBUG_RETURN(1); - if (param->limit_clause_param && param->item_type != Item::INT_ITEM) + if (param->limit_clause_param && param->state != Item_param::INT_VALUE) { param->set_int(param->val_int(), MY_INT64_NUM_DECIMAL_DIGITS); param->item_type= Item::INT_ITEM; From f470c06696eaaf08fa17e90e1e46f3a1814891cd Mon Sep 17 00:00:00 2001 From: Raghav Kapoor Date: Wed, 28 Aug 2013 15:17:46 +0530 Subject: [PATCH 03/80] BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL ERROR HANDLING CODE BACKGROUND: There can be a potential crash due to buffer overrun in SSL error handling code due to missing comma in ssl_error_string[] array in viosslfactories.c. ANALYSIS: Found by code Inspection. FIX: Added the missing comma in SSL error handling code in ssl_error_string[] array in viosslfactories.c. --BZR-- revision-id: raghav.kapoor@oracle.com-20130828094746-0x0c24dzwzrlugpl property-audit-revid: raghav.kapoor@oracle.com-20130828094746-yivvatr7auabz5ao property-branch-nick: mysql-5.1-bug-17294150 testament3-sha1: 095d3673977a7e285bfb2eaa5e0c37d0b9c7ff87 --- vio/viosslfactories.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 5d31d1dde56..9f689bf7c86 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -80,7 +80,7 @@ ssl_error_string[] = "No error", "Unable to get certificate", "Unable to get private key", - "Private key does not match the certificate public key" + "Private key does not match the certificate public key", "SSL_CTX_set_default_verify_paths failed", "Failed to set ciphers to use", "SSL_CTX_new failed" From 11d41492a0c150dc2597f7cb61fe78dc4e6b102f Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 29 Aug 2013 14:42:55 +0200 Subject: [PATCH 04/80] Fix for Bug#17377159, ignore mysqld_safe.pid file created by mysqld_safe script --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20130829124255-2uo5g3sj3whjd6jg property-audit-revid: balasubramanian.kandasamy@oracle.com-20130829124255-4ycxmy839amud1p6 property-branch-nick: mysql-5.1.72-release testament3-sha1: b118bd1758fed940e5b8a87f0370afa5ab6f1f80 --- support-files/mysql.spec.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 2d8aa78464b..bcd66b96c2b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -643,7 +643,7 @@ then fi if [ -z "$PID_FILE_PATT" ] then - PID_FILE_PATT="$mysql_datadir/*.pid" + PID_FILE_PATT=`ls $mysql_datadir/*.pid 2>/dev/null | grep -v "mysqld_safe.pid"` fi # Check if we can safely upgrade. An upgrade is only safe if it's from one @@ -1194,6 +1194,9 @@ fi # merging BK trees) ############################################################################## %changelog +* Thu Aug 29 2013 Balasubramanian Kandasamy +- Added logic to ignore mysqld_safe.pid file created by mysqld_safe script + * Tue Sep 11 2012 Joerg Bruehe - Disable "maintainer mode" in debug builds, there is a cast ulonglong -> int From f76323c9e0e757ce660ef36fe07ba77dbec53cc4 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Fri, 30 Aug 2013 17:14:46 +0200 Subject: [PATCH 05/80] Fix to ignore mysqld_safe.pid --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20130830151446-we5p5cml0da52n7a property-audit-revid: balasubramanian.kandasamy@oracle.com-20130830151446-sn7kf0g68d4sac5p property-branch-nick: mysql-5.1.72-release testament3-sha1: a1cbe5c6fd8d13cd2e429cf2837cc9ac78423d2d --- support-files/mysql.spec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index bcd66b96c2b..ea6eddd7279 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -643,7 +643,7 @@ then fi if [ -z "$PID_FILE_PATT" ] then - PID_FILE_PATT=`ls $mysql_datadir/*.pid 2>/dev/null | grep -v "mysqld_safe.pid"` + PID_FILE_PATT="$mysql_datadir/*.pid" fi # Check if we can safely upgrade. An upgrade is only safe if it's from one @@ -716,7 +716,7 @@ fi # We assume that if there is exactly one ".pid" file, # it contains the valid PID of a running MySQL server. -NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l` +NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | grep -v "mysqld_safe.pid" | wc -l` case $NR_PID_FILES in 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server 1 ) SERVER_TO_START='true' ;; From d94f6a75a0cf317eda377cd25d354f20b296171f Mon Sep 17 00:00:00 2001 From: Igor Solodovnikov Date: Fri, 30 Aug 2013 20:05:37 +0300 Subject: [PATCH 06/80] Bug #17297012 MEMORY LEAK IN MYSQL_OPTIONS WHILE CALLING WITH OPTION MYSQL_SET_CLIENT_IP Memory Leak in mysql_options() was caused by missing call to my_free() in MYSQL_SET_CLIENT_IP branch. Fixed by adding my_free() to cleanup mysql->options.client_ip value before assigning new value. --BZR-- revision-id: igor.solodovnikov@oracle.com-20130830170537-luihb5fffmlve3n6 property-audit-revid: igor.solodovnikov@oracle.com-20130830170537-x1mdnif5hyu2ayzl property-branch-nick: mysql-5.1 testament3-sha1: b06e1bf04bdd262d5b63997ff1ec41a1ad4e3533 --- sql-common/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql-common/client.c b/sql-common/client.c index 51911d913c7..7ee0eabe0ef 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2003, 2013, 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 @@ -3167,6 +3167,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) mysql->options.methods_to_use= option; break; case MYSQL_SET_CLIENT_IP: + my_free(mysql->options.client_ip,MYF(MY_ALLOW_ZERO_PTR)); mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); break; case MYSQL_SECURE_AUTH: From 5cc1c39229dc1d0b0566a1a65ee1da3a44c27ece Mon Sep 17 00:00:00 2001 From: Igor Solodovnikov Date: Fri, 30 Aug 2013 20:22:09 +0300 Subject: [PATCH 07/80] Bug #17297012 MEMORY LEAK IN MYSQL_OPTIONS WHILE CALLING WITH OPTION MYSQL_SET_CLIENT_IP Memory Leak in mysql_options() was caused by missing call to my_free() in MYSQL_SET_CLIENT_IP branch. Fixed by adding my_free() to cleanup mysql->options.client_ip value before assigning new value. --BZR-- revision-id: igor.solodovnikov@oracle.com-20130830172209-5phr9u98x4za7czc property-audit-revid: igor.solodovnikov@oracle.com-20130830172209-s9f8rz1mhfw9kmy0 property-branch-nick: mysql-5.5 testament3-sha1: 30a805fdc9c58a2bf110b2f8bbfef9b6898cab3b --- sql-common/client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-common/client.c b/sql-common/client.c index 1e98eadda28..16a61d7f53d 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -4151,6 +4151,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) mysql->options.methods_to_use= option; break; case MYSQL_SET_CLIENT_IP: + my_free(mysql->options.client_ip); mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); break; case MYSQL_SECURE_AUTH: From ad49525b33bf93d483f3d93f1238b5f5c6d79a2a Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Sun, 1 Sep 2013 18:51:52 +0530 Subject: [PATCH 08/80] --BZR-- revision-id: mysql-builder@oracle.com-20130901132152-yybn4zgdyk9agiv1 property-audit-revid: neeraj.x.bisht@oracle.com-20130901132152-nyih2ffmlhv59z79 property-branch-nick: clone testament3-sha1: 297b1f124bf8699320fba85b6a518ce951155404 From 9dba3e418c3252960aefdc8d8f430cc62132bb70 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Mon, 2 Sep 2013 14:53:45 +0530 Subject: [PATCH 09/80] Bug #17168602 MYSQL_PLUGIN REMOVES NON-DIRECTORY TYPE FILES SPECIFIED WITH THE BASEDIR OPTION Description: The mysql_plugin client attempts to remove any filename specified to the --basedir option. The problem is that if the filename does not end with a slash, it will attempt to unlink it, which succeeds for files, but not for directories. Analysis: When we are starting mysql_plugin with basedir option and if we are giving path of a file as basedir, it deletes that file. It was because it uses a function my_delete which unlinks the file path given. Fix: As a fix we replace that line using another function my_free, which will only free the pointer which is having that file path. --BZR-- revision-id: arun.kuruvila@oracle.com-20130902092345-vhv2ol8x7rw7tbgv property-audit-revid: arun.kuruvila@oracle.com-20130902092345-q3nn73l2yavwfvn0 property-branch-nick: fixed-5-5 testament3-sha1: 77320dd6b56d10e1df17935eb773ac3f12cafbe6 --- client/mysql_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 72bab3ad528..7fbfeb9e9a6 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -856,7 +856,7 @@ static int process_options(int argc, char *argv[], char *operation) strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1); #endif buff[sizeof(buff) - 1]= 0; - my_delete(opt_basedir, MYF(0)); + my_free(opt_basedir); opt_basedir= my_strdup(buff, MYF(MY_FAE)); } } From 8ceee434a3f5d22ec194faabccdb8d8c70b35ca9 Mon Sep 17 00:00:00 2001 From: Hery Ramilison Date: Tue, 3 Sep 2013 18:37:46 +0200 Subject: [PATCH 10/80] Fixing sles11 build that /usr/lib/mysql/plugin is not owned by a package --BZR-- revision-id: hery.ramilison@oracle.com-20130903163746-yeu8uof3972qymvl property-audit-revid: hery.ramilison@oracle.com-20130903163746-2ihyv5mokr26bp7i property-branch-nick: mysql-5.1.72-release testament3-sha1: 661129652cd38782a86758325ff55f80cee499bb --- support-files/mysql.spec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index ea6eddd7279..9560eeea53a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1025,6 +1025,7 @@ fi %attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqlmanager %attr(755, root, root) %{_sbindir}/rcmysql +%attr(755, root, root) %{_libdir}/mysql/plugin %if %{INNODB_BUILD} %if %{WITH_INNODB_PLUGIN} %attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so* From 2e1bccf514edd67c3db269e39c077f28ceec5a35 Mon Sep 17 00:00:00 2001 From: Neeraj Bisht Date: Wed, 4 Sep 2013 10:45:55 +0530 Subject: [PATCH 11/80] Bug#17222452 - SELECT COUNT(DISTINCT A,B) INCORRECTLY COUNTS ROWS CONTAINING NULL Problem:- In MySQL, We can obtain the number of distinct expression combinations that do not contain NULL by giving a list of expressions in COUNT(DISTINCT). However rows with NULL values are incorrectly included in the count when loose index scan is used. Analysis:- In case of loose index scan, we check whether the field is null or not and increase the count in Item_sum_count::add(). But there we are checking for the first field in COUNT(DISTINCT), not for every field. This is causing an incorrect result. Solution:- Check all field in Item_sum_count::add(), whether there values are null or not. Then only increment the count. ****** Bug#17222452 - SELECT COUNT(DISTINCT A,B) INCORRECTLY COUNTS ROWS CONTAINING NULL Problem:- In MySQL, We can obtain the number of distinct expression combinations that do not contain NULL by giving a list of expressions in COUNT(DISTINCT). However rows with NULL values are incorrectly included in the count when loose index scan is used. Analysis:- In case of loose index scan, we check whether the field is null or not and increase the count in Item_sum_count::add(). But there we are checking for the first field in COUNT(DISTINCT), not for every field. This is causing an incorrect result. Solution:- Check all field in Item_sum_count::add(), whether there values are null or not. Then only increment the count. --BZR-- revision-id: neeraj.x.bisht@oracle.com-20130904051555-axfo64sey4smbwfe property-audit-revid: neeraj.x.bisht@oracle.com-20130904051555-p167z9gavd80l6hf property-branch-nick: 5.5 testament3-sha1: 4b94af8ec9a691f245c0e2320b6490829deac0e2 --- sql/item_sum.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e194907fa06..3fbbc1b811a 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1496,8 +1496,12 @@ void Item_sum_count::clear() bool Item_sum_count::add() { - if (!args[0]->maybe_null || !args[0]->is_null()) - count++; + for (uint i=0; imaybe_null && args[i]->is_null()) + return 0; + } + count++; return 0; } From 7a1ff6ae1a8045a3d496f416499bd4663b822f17 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Thu, 5 Sep 2013 13:40:27 +0530 Subject: [PATCH 12/80] BUG#16032946 - PLEASE GIVE A MESSAGE FOR "THREAD_CONCURRENCY DOESN'T DO WHAT YOU EXPECT" Fix info: -------- Backport of the deprecation bug fix (WL#5265) for global variable 'THREAD_CONCURRENCY' from mysql-5.6 to mysql-5.5 Note: With this backport, certain additional deprecation warnings would be reported under error conditions while setting the global/session variables. --BZR-- revision-id: nisha.gopalakrishnan@oracle.com-20130905081027-z82ciode93vrq98k property-audit-revid: nisha.gopalakrishnan@oracle.com-20130905081027-9gpoei2fr7235inh property-branch-nick: mysql-5.5-16032946 testament3-sha1: d1748fefda216b0452a2f92d73e513f3e81520aa --- sql/set_var.cc | 2 +- sql/set_var.h | 3 ++- sql/sys_vars.cc | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 75387b974f1..82ea8298a66 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -217,7 +217,6 @@ uchar *sys_var::global_value_ptr(THD *thd, LEX_STRING *base) bool sys_var::check(THD *thd, set_var *var) { - do_deprecated_warning(thd); if ((var->value && do_check(thd, var)) || (on_check && on_check(this, thd, var))) { @@ -593,6 +592,7 @@ int sql_set_variables(THD *thd, List *var_list) int set_var::check(THD *thd) { + var->do_deprecated_warning(thd); if (var->is_readonly()) { my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name.str, "read only"); diff --git a/sql/set_var.h b/sql/set_var.h index 01e3be11621..60164ba0363 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -143,6 +143,7 @@ class sys_var return (option.id != -1) && (m_parse_flag & parse_flags) && insert_dynamic(array, (uchar*)&option); } + void do_deprecated_warning(THD *thd); private: virtual bool do_check(THD *thd, set_var *var) = 0; @@ -156,7 +157,7 @@ class sys_var virtual void global_save_default(THD *thd, set_var *var) = 0; virtual bool session_update(THD *thd, set_var *var) = 0; virtual bool global_update(THD *thd, set_var *var) = 0; - void do_deprecated_warning(THD *thd); + protected: /** A pointer to a value of the variable for SHOW. diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 1d0f9691629..63f478be5f0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2013, 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 @@ -1797,9 +1797,13 @@ static Sys_var_charptr Sys_socket( static Sys_var_ulong Sys_thread_concurrency( "thread_concurrency", "Permits the application to give the threads system a hint for " - "the desired number of threads that should be run at the same time", + "the desired number of threads that should be run at the same time." + "This variable has no effect, and is deprecated. " + "It will be removed in a future release.", READ_ONLY GLOBAL_VAR(concurrency), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1)); + VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED("")); static Sys_var_ulong Sys_thread_stack( "thread_stack", "The stack size for each thread", From 326d54385d1bea5e54dcbceeff5d48d8f1a4f7bf Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Thu, 5 Sep 2013 14:18:43 +0530 Subject: [PATCH 13/80] Bug #17168602 MYSQL_PLUGIN REMOVES NON-DIRECTORY TYPE FILES SPECIFIED WITH THE BASEDIR OPTION Reverting the patch. Because asked for second review. --BZR-- revision-id: venkata.sidagam@oracle.com-20130905084843-iizoh25ut6zd5jd7 property-audit-revid: venkata.sidagam@oracle.com-20130905084843-6j65hbfgv21i2jsu property-branch-nick: 5.5 testament3-sha1: 5890cda40fc53bea82c49ebdb8b239027a369cfc --- client/mysql_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 7fbfeb9e9a6..72bab3ad528 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -856,7 +856,7 @@ static int process_options(int argc, char *argv[], char *operation) strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1); #endif buff[sizeof(buff) - 1]= 0; - my_free(opt_basedir); + my_delete(opt_basedir, MYF(0)); opt_basedir= my_strdup(buff, MYF(MY_FAE)); } } From 0c5972c578592a0dd8e853bbce084bd7f05cc837 Mon Sep 17 00:00:00 2001 From: Raghav Kapoor Date: Fri, 6 Sep 2013 12:38:11 +0530 Subject: [PATCH 14/80] Post push fix of openssl_1.test failure --BZR-- revision-id: raghav.kapoor@oracle.com-20130906070811-orguzigayo5ir0ns property-audit-revid: raghav.kapoor@oracle.com-20130906070811-yrmy5nsep9m6aoyw property-branch-nick: mysql-5.5-bug-17294150 testament3-sha1: f88bbccf828adc26e8c13accd3d58014c2ad978f --- mysql-test/r/openssl_1.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index b6efab9c055..2a3eeacab3b 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -83,7 +83,7 @@ Ssl_cipher AES128-SHA SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher AES128-SHA -mysqltest: Could not open connection 'default': 2026 SSL connection error: SSL_CTX_new failed +mysqltest: Could not open connection 'default': 2026 SSL connection error: Failed to set ciphers to use CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); From ecd11a757b457d358f2d0b5260c847165653a0d5 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 9 Sep 2013 12:43:08 +0200 Subject: [PATCH 15/80] Bug#16870783 RECENT REGRESSION: CRASH WITH GROUP_CONCAT AND INVALID SEPARATOR Add missing initialization in lex_start() --BZR-- revision-id: tor.didriksen@oracle.com-20130909104308-jyucm8f6hz21auyl property-audit-revid: tor.didriksen@oracle.com-20130909104308-1pv4xr06g6l4rnfr property-branch-nick: 5.5-bug16870783groupconcat testament3-sha1: e38c411599163c94771f84692d8cc9e4d30e835d --- sql/sql_lex.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index bc313ed0486..9113f31c76c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -411,6 +411,7 @@ void lex_start(THD *thd) lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc; lex->select_lex.group_list.empty(); lex->select_lex.order_list.empty(); + lex->select_lex.gorder_list.empty(); lex->duplicates= DUP_ERROR; lex->ignore= 0; lex->spname= NULL; From 854e30fad82477429e3ef849e1994164a397ac24 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 9 Sep 2013 14:20:50 +0200 Subject: [PATCH 16/80] Bug#17296644 CONV(X, INT_MIN, INT_MIN) SEGFAULTS THE SERVER Do not call abs(INT_MIN) as the result is undefined. --BZR-- revision-id: tor.didriksen@oracle.com-20130909122050-m0zin9n1o1hlyt8x property-audit-revid: tor.didriksen@oracle.com-20130909122050-ptz7fdjj8l5uzxu3 property-branch-nick: 5.5 testament3-sha1: 3c02f6f6b83e7f4e60814cc9ef4b08a0a3d288d2 --- configure.cmake | 4 ++++ sql/item_strfunc.cc | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index 3474f12f1e1..c3ac3a8222f 100644 --- a/configure.cmake +++ b/configure.cmake @@ -147,6 +147,10 @@ IF(UNIX) SET(CMAKE_REQUIRED_LIBRARIES ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT}) + # Need explicit pthread for gcc -fsanitize=address + IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=") + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread) + ENDIF() LIST(LENGTH CMAKE_REQUIRED_LIBRARIES required_libs_length) IF(${required_libs_length} GREATER 0) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index f654d260564..363ca02fd7a 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2013, 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 @@ -2928,7 +2928,9 @@ String *Item_func_conv::val_str(String *str) int to_base= (int) args[2]->val_int(); int err; + // Note that abs(INT_MIN) is undefined. if (args[0]->null_value || args[1]->null_value || args[2]->null_value || + from_base == INT_MIN || to_base == INT_MIN || abs(to_base) > 36 || abs(to_base) < 2 || abs(from_base) > 36 || abs(from_base) < 2 || !(res->length())) { From 374d4b366b8a83cb11c4e0c959664cad15c5a874 Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Mon, 9 Sep 2013 20:32:50 +0530 Subject: [PATCH 17/80] Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY Reverting the patch. Because this change is not to me made for GA versions. --BZR-- revision-id: venkata.sidagam@oracle.com-20130909150250-6026cifvpp9iug6o property-audit-revid: venkata.sidagam@oracle.com-20130909150250-zaeypntgb6tegv3o property-branch-nick: 5.1 testament3-sha1: b4699927be4376602dad15fe9d8bfda20c24f1b7 --- scripts/mysqld_safe.sh | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f3759cbbf6b..48c98f2fde3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -343,32 +343,6 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# A pid file is created for the mysqld_safe process. This file protects the -# server instance resources during race conditions. -safe_pid="$DATADIR/mysqld_safe.pid" -if test -f $safe_pid -then - PID=`cat "$safe_pid"` - if @CHECK_PID@ - then - if @FIND_PROC@ - then - log_error "A mysqld_safe process already exists" - exit 1 - fi - fi - rm -f "$safe_pid" - if test -f "$safe_pid" - then - log_error "Fatal error: Can't remove the mysqld_safe pid file" - exit 1 - fi -fi - -# Insert pid proerply into the pid file. -ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid -# End of mysqld_safe pid(safe_pid) check. - # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -378,7 +352,6 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -483,7 +456,6 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -577,7 +549,6 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -588,7 +559,6 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -674,5 +644,3 @@ done log_notice "mysqld from pid file $pid_file ended" -rm -f "$safe_pid" # Some Extra Safety. File is deleted - # once the mysqld process ends. From b4a1239c96a1f4a75058042e3596e869d590f314 Mon Sep 17 00:00:00 2001 From: Hery Ramilison Date: Mon, 9 Sep 2013 18:58:08 +0200 Subject: [PATCH 18/80] Committing patch from venkata.sidagam@oracle.com for Bug#16776528 --BZR-- revision-id: hery.ramilison@oracle.com-20130909165808-8xoyprwu8qgcgxa4 property-audit-revid: hery.ramilison@oracle.com-20130909165808-df5zltqezu4flg0m property-branch-nick: mysql-5.1.72-release testament3-sha1: d3762db04ae52cdf461eea32a9e147ed259ab5ab --- scripts/mysqld_safe.sh | 32 -------------------------------- support-files/mysql.spec.sh | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f3759cbbf6b..48c98f2fde3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -343,32 +343,6 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# A pid file is created for the mysqld_safe process. This file protects the -# server instance resources during race conditions. -safe_pid="$DATADIR/mysqld_safe.pid" -if test -f $safe_pid -then - PID=`cat "$safe_pid"` - if @CHECK_PID@ - then - if @FIND_PROC@ - then - log_error "A mysqld_safe process already exists" - exit 1 - fi - fi - rm -f "$safe_pid" - if test -f "$safe_pid" - then - log_error "Fatal error: Can't remove the mysqld_safe pid file" - exit 1 - fi -fi - -# Insert pid proerply into the pid file. -ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid -# End of mysqld_safe pid(safe_pid) check. - # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -378,7 +352,6 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -483,7 +456,6 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -577,7 +549,6 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -588,7 +559,6 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -674,5 +644,3 @@ done log_notice "mysqld from pid file $pid_file ended" -rm -f "$safe_pid" # Some Extra Safety. File is deleted - # once the mysqld process ends. diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 9560eeea53a..93a74ac8445 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1025,9 +1025,9 @@ fi %attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqlmanager %attr(755, root, root) %{_sbindir}/rcmysql -%attr(755, root, root) %{_libdir}/mysql/plugin %if %{INNODB_BUILD} %if %{WITH_INNODB_PLUGIN} +%attr(755, root, root) %{_libdir}/mysql/plugin/ %attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so* %endif %endif From cc559d724182c951a82c7b30b532f194f4e4d012 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 9 Sep 2013 20:07:12 +0200 Subject: [PATCH 19/80] Reverted the changes to spec file to ignore mysqld_safe.pid file, updated the logic to get the correct count of PID files --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20130909180712-0ewu3uqnwgb2urpg property-audit-revid: balasubramanian.kandasamy@oracle.com-20130909180712-5irho4lzlt5wdxsz property-branch-nick: mysql-5.1.72-release testament3-sha1: 380a81958835a92b6db1b36dfd95a54defcc4e55 --- support-files/mysql.spec.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 93a74ac8445..8fbf9f08b9e 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -716,7 +716,7 @@ fi # We assume that if there is exactly one ".pid" file, # it contains the valid PID of a running MySQL server. -NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | grep -v "mysqld_safe.pid" | wc -l` +NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l` case $NR_PID_FILES in 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server 1 ) SERVER_TO_START='true' ;; @@ -1195,8 +1195,8 @@ fi # merging BK trees) ############################################################################## %changelog -* Thu Aug 29 2013 Balasubramanian Kandasamy -- Added logic to ignore mysqld_safe.pid file created by mysqld_safe script +* Mon Sep 09 2013 Balasubramanian Kandasamy +- Updated logic to get the correct count of PID files * Tue Sep 11 2012 Joerg Bruehe From 60d9af318c3d1966ecfc84b61a3bf8fe1dbc53fa Mon Sep 17 00:00:00 2001 From: Libing Song Date: Tue, 10 Sep 2013 09:35:49 +0800 Subject: [PATCH 20/80] Bug#17402313 DUMP THREAD SENDS SOME EVENTS MORE THAN ONCE Dump thread may encounter an error when reading events from the active binlog file. However the errors may be temporary, so dump thread will try to read the event again. But dump thread seeked to an wrong position, it caused some events was sent twice. To fix the bug, prev_pos is defined out the while loop and is set the correct position after reading every event correctly. This patch also make binlog_can_be_corrupted more accurate, only the binlogs not closed normally are marked binlog_can_be_corrupted. Finally, two warnings are added when dump threads encounter the temporary errors. --BZR-- revision-id: libing.song@oracle.com-20130910013549-thxfg69qpkiuopt7 property-audit-revid: libing.song@oracle.com-20130910013549-da1mpc910v1zgfai property-branch-nick: mysql-5.1 testament3-sha1: 4e5db3d4a1915766ce5086dd69a2e12a0b13fb32 --- sql/log_event.cc | 11 +++++++++++ sql/sql_repl.cc | 51 ++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 16388fbbef7..d7e912cfe1a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1027,6 +1027,17 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, if (log_file_name_arg) *is_binlog_active= mysql_bin_log.is_active(log_file_name_arg); + DBUG_EXECUTE_IF("dump_fake_io_error", + { + if (log_lock) + { + pthread_mutex_unlock(log_lock); + + DBUG_SET("-d,dump_fake_io_error"); + DBUG_RETURN(LOG_READ_IO); + } + }); + if (my_b_read(file, (uchar*) buf, sizeof(buf))) { /* diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 06c25c324c7..4da7c5851ba 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -360,6 +360,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, int left_events = max_binlog_dump_events; #endif int old_max_allowed_packet= thd->variables.max_allowed_packet; + bool is_active_binlog= false; + my_off_t prev_pos= pos; + DBUG_ENTER("mysql_binlog_send"); DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos)); @@ -483,7 +486,8 @@ impossible position"; Try to find a Format_description_log_event at the beginning of the binlog */ - if (!(error = Log_event::read_log_event(&log, packet, log_lock))) + if (!(error = Log_event::read_log_event(&log, packet, log_lock, + log_file_name, &is_active_binlog))) { /* The packet has offsets equal to the normal offsets in a binlog @@ -494,8 +498,14 @@ impossible position"; (*packet)[EVENT_TYPE_OFFSET+1])); if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT) { - binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] & - LOG_EVENT_BINLOG_IN_USE_F); + /* + If a binlog is not active, but LOG_EVENT_BINLOG_IN_USE_F + flag is 1. That means it is not closed in normal way + (E.g server crash) and may include corrupted events. + */ + binlog_can_be_corrupted= (!is_active_binlog) && + test((*packet)[FLAGS_OFFSET+1] & LOG_EVENT_BINLOG_IN_USE_F); + (*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F; /* mark that this event with "log_pos=0", so the slave @@ -547,12 +557,11 @@ impossible position"; while (!net->error && net->vio != 0 && !thd->killed) { - my_off_t prev_pos= pos; - bool is_active_binlog= false; while (!(error= Log_event::read_log_event(&log, packet, log_lock, log_file_name, &is_active_binlog))) { + DBUG_ASSERT(prev_pos < my_b_tell(&log)); prev_pos= my_b_tell(&log); #ifndef DBUG_OFF if (max_binlog_dump_events && !left_events--) @@ -580,8 +589,9 @@ impossible position"; if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT) { - binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] & - LOG_EVENT_BINLOG_IN_USE_F); + binlog_can_be_corrupted= (!is_active_binlog) && + test((*packet)[FLAGS_OFFSET+1] & LOG_EVENT_BINLOG_IN_USE_F); + (*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F; } else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT) @@ -620,9 +630,31 @@ impossible position"; here we were reading binlog that was not closed properly (as a result of a crash ?). treat any corruption as EOF */ - if (binlog_can_be_corrupted && + if ((binlog_can_be_corrupted || is_active_binlog) && error != LOG_READ_MEM && error != LOG_READ_EOF) { + test_for_non_eof_log_read_errors(error, &errmsg); + + if (is_active_binlog) + { + sql_print_warning("Failed to read an event from active binlog(%s,%lu). " + "error: %s. Dump thread will try to read it again.", + log_file_name, (ulong)prev_pos, errmsg); + } + else + { + sql_print_warning("Failed to read an event from inactive binlog" + "(%s, %lu). error: %s. Dump thread found the binlog " + "was not rotated correctly. It will jump to next " + "binlog directly.", + log_file_name, (ulong) prev_pos, errmsg); + } + errmsg= NULL; + + /* + If binlog is active, it will try to read the event again. Otherwise, + skip the corrupted events and switch to next binlog. + */ my_b_seek(&log, prev_pos); error=LOG_READ_EOF; } @@ -695,6 +727,8 @@ impossible position"; /* we read successfully, so we'll need to send it to the slave */ pthread_mutex_unlock(log_lock); read_packet = 1; + DBUG_ASSERT(prev_pos < my_b_tell(&log)); + prev_pos= my_b_tell(&log); break; case LOG_READ_EOF: @@ -757,6 +791,7 @@ impossible position"; thd_proc_info(thd, "Finished reading one binlog; switching to next binlog"); switch (mysql_bin_log.find_next_log(&linfo, 1)) { case 0: + prev_pos= BIN_LOG_HEADER_SIZE; break; case LOG_INFO_EOF: if (mysql_bin_log.is_active(log_file_name)) From c4f1592e8fcbeccb30f8cdd0fa74ad43eaf07540 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 10 Sep 2013 07:25:01 +0200 Subject: [PATCH 21/80] MTR: fix broken logic for ignoring missing ctest in Pushbuild --BZR-- revision-id: bjorn.munch@oracle.com-20130910052501-kqtqibwa20r36wvf property-audit-revid: bjorn.munch@oracle.com-20130910052501-5l058e56gswnypqm property-branch-nick: main-55 testament3-sha1: 8f0acc336895a37fea3aac094db0f8ae486e7a29 --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 19f82303221..54dcd982a4c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5998,7 +5998,7 @@ () # 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 && ! defined $ENV{PB2WORKDIR}) { + if ($? == $no_ctest && ($opt_ctest == -1 || defined $ENV{PB2WORKDIR})) { chdir($olddir); return; } From bdf31d04a1289e47a8738008c53a52b6eba9086f Mon Sep 17 00:00:00 2001 From: Libing Song Date: Tue, 10 Sep 2013 16:12:25 +0800 Subject: [PATCH 22/80] Bug#17402313 DUMP THREAD SENDS SOME EVENTS MORE THAN ONCE Postfix, suppress the new warning generated by the bug's fix. --BZR-- revision-id: libing.song@oracle.com-20130910081225-fvfgulm9wdd5i2ri property-audit-revid: libing.song@oracle.com-20130910081225-t621j9oc14kko54r property-branch-nick: mysql-5.1 testament3-sha1: ac0e31b1e787b41601d91dd211e08248be8b871f --- mysql-test/suite/rpl/r/rpl_log_pos.result | 1 + mysql-test/suite/rpl/t/rpl_log_pos.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index b2224dcd725..b3f68157211 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 484ffa52a44..87be576c285 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -12,6 +12,7 @@ source include/master-slave.inc; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); source include/show_master_status.inc; sync_slave_with_master; source include/stop_slave.inc; From b9a45b009171e9343182ce1173f4e1521565c861 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 10 Sep 2013 11:20:29 +0200 Subject: [PATCH 23/80] Bug#16482467 ORDER BY IGNORED IN SOME SITUATIONS FOR UPDATE QUERY For queries like update t1 set ... where order by ... limit ... we need to handle the fact that unique keys allow NULL values, and hence can return more than one row. --BZR-- revision-id: tor.didriksen@oracle.com-20130910092029-fcwi3vkanrwnk5xj property-audit-revid: tor.didriksen@oracle.com-20130910092029-5a38o5pfov0jjt9p property-branch-nick: 5.5-bug16482467updatelimit property-file-info: ld7:file_id65:sp1f-opt_range.cc-19700101030959-afe3wtevb7zwrg4xyibt35uamov5r7ds7:message202:When the unique key has multiple key parts, property-file-info: check each key_part for nullability, rather than the first key part. property-file-info: (s/key->part ==/key_tree->part ==/) property-file-info: property-file-info: Also: revert the if() test, for better readability. property-file-info: 4:path16:sql/opt_range.ccee property-rebase-of: tor.didriksen@oracle.com-20130910092029-f0vfq22msfo875kd testament3-sha1: 5f291d45d05c634d7117557af7d761b26087f299 --- sql/opt_range.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 386faed3aa2..c7a7d2531af 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -8071,15 +8071,16 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { KEY *table_key=quick->head->key_info+quick->index; flag=EQ_RANGE; - if ((table_key->flags & HA_NOSAME) && key->part == table_key->key_parts-1) + if ((table_key->flags & HA_NOSAME) && + key_tree->part == table_key->key_parts-1) { - if (!(table_key->flags & HA_NULL_PART_KEY) || - !null_part_in_key(key, - param->min_key, - (uint) (tmp_min_key - param->min_key))) - flag|= UNIQUE_RANGE; - else - flag|= NULL_RANGE; + if ((table_key->flags & HA_NULL_PART_KEY) && + null_part_in_key(key, + param->min_key, + (uint) (tmp_min_key - param->min_key))) + flag|= NULL_RANGE; + else + flag|= UNIQUE_RANGE; } } } @@ -8109,7 +8110,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, } /* - Return 1 if there is only one range and this uses the whole primary key + Return 1 if there is only one range and this uses the whole unique key */ bool QUICK_RANGE_SELECT::unique_key_range() From 1092e2751c386f6d77227177114d0bec03c9e1eb Mon Sep 17 00:00:00 2001 From: mithun Date: Tue, 10 Sep 2013 15:32:27 +0530 Subject: [PATCH 24/80] Bug #16978278 : BUFFER OVERFLOW WHEN PRINTING A LARGE 64-BIT INTEGER WITH MY_B_VPRINTF() Issue : In LP 64 machine max long value can be 20 digit decimal value. But in my_b_vprintf() the intermediate buffer storage used is 17 bytes length. This will lead to buffer overflow. Solution : Increased the buffer storage from 17 to 32 bytes. code is backported from 5.6 --BZR-- revision-id: mithun.c.y@oracle.com-20130910100227-v2uxyxj2n81e0l27 property-audit-revid: mithun.c.y@oracle.com-20130910100227-ee439v6lselpuivk property-branch-nick: mysql-5.1 property-file-info: ld7:file_id66:sp1f-mf_iocache2.c-20001116015729-5j5qaiexq3nz2grqfr2z5ooomdhy4pl57:message78:In function my_b_vprintf increased the size of local buff from 17 to property-file-info: 32 bytes.4:path19:mysys/mf_iocache2.cee testament3-sha1: d3caefb86cc03e69f60bd565d27e272c0072282d --- mysys/mf_iocache2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index eaa70782f16..f65ca97bd16 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -415,7 +415,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) { register int iarg; size_t length2; - char buff[17]; + char buff[32]; iarg = va_arg(args, int); if (*fmt == 'd') @@ -450,7 +450,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) { register long iarg; size_t length2; - char buff[17]; + char buff[32]; iarg = va_arg(args, long); if (*++fmt == 'd') From 69f8eaadb67a6d9edc502d1afed27466680f8c1e Mon Sep 17 00:00:00 2001 From: Satya Bodapati Date: Wed, 11 Sep 2013 16:57:02 +0530 Subject: [PATCH 25/80] Bug#16752251 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE OPERATION IF IT IS DONE IN-PLACE With change buffer enabled, InnoDB doesn't write a transaction log record when it merges a record from the insert buffer to an secondary index page if the insertion is performed as an update-in-place. Fixed by logging the 'update-in-place' operation on secondary index pages. Approved by Marko. rb#2429 --BZR-- revision-id: satya.bodapati@oracle.com-20130911112702-614w83r7s5y0untb property-audit-revid: satya.bodapati@oracle.com-20130911112702-4ppk60xlw2bnr13y property-branch-nick: mysq-5.1 testament3-sha1: 8a76fcc739b0b78b10f690c50d175c9c52804b77 --- .bzrfileids | Bin 1059099 -> 1059307 bytes .../include/have_innodb_change_buffering.inc | 6 ++ mysql-test/include/search_pattern_in_file.inc | 66 ++++++++++++++++++ storage/innobase/btr/btr0cur.c | 30 +++++--- storage/innobase/ibuf/ibuf0ibuf.c | 18 +++++ storage/innobase/include/btr0cur.h | 13 ++++ storage/innodb_plugin/btr/btr0cur.c | 30 +++++--- storage/innodb_plugin/ibuf/ibuf0ibuf.c | 18 +++++ storage/innodb_plugin/include/btr0cur.h | 17 ++++- 9 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 mysql-test/include/have_innodb_change_buffering.inc create mode 100644 mysql-test/include/search_pattern_in_file.inc diff --git a/.bzrfileids b/.bzrfileids index b51fc03a2bca9a8b9d4c69326c182f42a14159fc..e6757bb8d558c873ee3c129a216166de75e44e03 100644 GIT binary patch delta 245 zcmbPz$>H^7hlVYTfd(GQ8Hsu6sqsmrX=$lNnR)4YnR&?!8Hr`7@tJvf`6)^9Fa^3s z28PB47RCmKMkYpvCb~I>206yXhB?Nm<))@7>C-2MF^W(Bpv1_!-OGS6($F`tC^;j( zAhDz*wI~m0R(x7!PAb^&;#5p2B*Tr(42*PBj4O&PijB>S$|`eGD{{@JKg?hhZ(o$i s2*gZ4%nZaVK+FonY(UHo#2i4(3B+7L%nigmK+FroeA^c#@>d=Q0RPNbdjJ3c delta 79 zcmaET* diff --git a/mysql-test/include/have_innodb_change_buffering.inc b/mysql-test/include/have_innodb_change_buffering.inc new file mode 100644 index 00000000000..aadad84c6a1 --- /dev/null +++ b/mysql-test/include/have_innodb_change_buffering.inc @@ -0,0 +1,6 @@ +if (!`SHOW VARIABLES LIKE 'innodb_change_buffering_debug'`) +{ + # innodb_change_buffering_debug is enabled by UNIV_DEBUG or + # UNIV_IBUF_DEBUG + --skip Test requires binary with UNIV_DEBUG enabled +} diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc new file mode 100644 index 00000000000..c047b5bc499 --- /dev/null +++ b/mysql-test/include/search_pattern_in_file.inc @@ -0,0 +1,66 @@ +# Purpose: +# Simple search with Perl for a pattern in some file. +# +# The advantages compared to thinkable auxiliary constructs using the +# mysqltest language and SQL are: +# 1. We do not need a running MySQL server. +# 2. SQL causes "noise" during debugging and increases the size of logs. +# Perl code does not disturb at all. +# +# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set +# before sourcing this routine. +# +# In case of +# - SEARCH_FILE and/or SEARCH_PATTERN is not set +# - SEARCH_FILE cannot be opened +# - SEARCH_FILE does not contain SEARCH_PATTERN +# the test will abort immediate. +# MTR will report something like +# .... +# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 +# main.1st [ pass ] 3 +# innodb.innodb_page_size [ fail ] +# Test ended at 2011-11-11 18:15:58 +# +# CURRENT_TEST: innodb.innodb_page_size +# # ERROR: The file '' does not contain the expected pattern +# mysqltest: In included file "./include/search_pattern_in_file.inc": +# included from ./include/search_pattern_in_file.inc at line 36: +# At line 25: command "perl" failed with error 255. my_errno=175 +# +# The result from queries just before the failure was: +# ... +# - saving '' to '' +# main.1st [ pass ] 2 +# +# Typical use case (check invalid server startup options): +# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; +# --error 0,1 +# --remove_file $error_log +# let SEARCH_FILE= $error_log; +# # Stop the server +# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +# --exec echo "wait" > $restart_file +# --shutdown_server 10 +# --source include/wait_until_disconnected.inc +# +# --error 1 +# --exec $MYSQLD_CMD > $error_log 2>&1 +# # The server restart aborts +# let SEARCH_PATTERN= \[ERROR\] Aborting; +# --source include/search_pattern_in_file.inc +# +# Created: 2011-11-11 mleich +# + +perl; + use strict; + my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set"; + my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set"; + open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n"); + read(FILE, my $file_content, 50000, 0); + close(FILE); + if ( not $file_content =~ m{$search_pattern} ) { + die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n"); + } +EOF diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 8dc0a92408b..4ad4bacdc0f 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -31,6 +31,7 @@ Created 10/16/1994 Heikki Tuuri #include "btr0sea.h" #include "row0upd.h" #include "trx0rec.h" +#include "trx0undo.h" #include "trx0roll.h" /* trx_roll_crash_recv_trx */ #include "que0que.h" #include "row0row.h" @@ -1363,18 +1364,31 @@ btr_cur_update_in_place_log( return; } - /* The code below assumes index is a clustered index: change index to - the clustered index if we are updating a secondary index record (or we - could as well skip writing the sys col values to the log in this case - because they are not needed for a secondary index record update) */ - - index = dict_table_get_first_index(index->table); + /* For secondary indexes, we could skip writing the dummy system fields + to the redo log but we have to change redo log parsing of + MLOG_REC_UPDATE_IN_PLACE/MLOG_COMP_REC_UPDATE_IN_PLACE or we have to add + new redo log record. For now, just write dummy sys fields to the redo + log if we are updating a secondary index record. + */ mach_write_to_1(log_ptr, flags); log_ptr++; - log_ptr = row_upd_write_sys_vals_to_log(index, trx, roll_ptr, log_ptr, - mtr); + if (index->type & DICT_CLUSTERED) { + log_ptr = row_upd_write_sys_vals_to_log( + index, trx, roll_ptr, log_ptr, mtr); + } else { + /* Dummy system fields for a secondary index */ + /* TRX_ID Position */ + log_ptr += mach_write_compressed(log_ptr, 0); + /* ROLL_PTR */ + trx_write_roll_ptr(log_ptr, ut_dulint_zero); + log_ptr += DATA_ROLL_PTR_LEN; + /* TRX_ID */ + log_ptr += mach_dulint_write_compressed(log_ptr, + ut_dulint_zero); + } + mach_write_to_2(log_ptr, page_offset(rec)); log_ptr += 2; diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 2ba3d785194..ae6c5f6636f 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -3024,6 +3024,24 @@ ibuf_insert_to_index_page( /* This is the easy case. Do something similar to btr_cur_update_in_place(). */ row_upd_rec_in_place(rec, offsets, update); + + /* Log the update in place operation. During recovery + MLOG_COMP_REC_UPDATE_IN_PLACE/MLOG_REC_UPDATE_IN_PLACE + expects trx_id, roll_ptr for secondary indexes. So we + just write dummy trx_id(0), roll_ptr(0) */ + btr_cur_update_in_place_log(BTR_KEEP_SYS_FLAG, rec, + index, update, + NULL, + ut_dulint_zero, mtr); + DBUG_EXECUTE_IF( + "crash_after_log_ibuf_upd_inplace", + log_buffer_flush_to_disk(); + fprintf(stderr, + "InnoDB: Wrote log record for ibuf " + "update in place operation\n"); + DBUG_SUICIDE(); + ); + goto updated_in_place; } diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index c2b81d0ae91..bab405fa91e 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -558,6 +558,19 @@ btr_push_update_extern_fields( const ulint* offsets,/* in: array returned by rec_get_offsets() */ upd_t* update);/* in: update vector or NULL */ +/*************************************************************** +Writes a redo log record of updating a record in-place. */ +UNIV_INLINE +void +btr_cur_update_in_place_log( +/*========================*/ + ulint flags, /* in: flags */ + rec_t* rec, /* in: record */ + dict_index_t* index, /* in: index where cursor positioned */ + upd_t* update, /* in: update vector */ + trx_t* trx, /* in: transaction */ + dulint roll_ptr, /* in: roll ptr */ + mtr_t* mtr); /* in: mtr */ /*######################################################################*/ diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 2b98b416793..f653929193a 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -58,6 +58,7 @@ Created 10/16/1994 Heikki Tuuri #include "btr0btr.h" #include "btr0sea.h" #include "trx0rec.h" +#include "trx0undo.h" #include "trx0roll.h" /* trx_is_recv() */ #include "que0que.h" #include "row0row.h" @@ -1557,18 +1558,31 @@ btr_cur_update_in_place_log( return; } - /* The code below assumes index is a clustered index: change index to - the clustered index if we are updating a secondary index record (or we - could as well skip writing the sys col values to the log in this case - because they are not needed for a secondary index record update) */ - - index = dict_table_get_first_index(index->table); + /* For secondary indexes, we could skip writing the dummy system fields + to the redo log but we have to change redo log parsing of + MLOG_REC_UPDATE_IN_PLACE/MLOG_COMP_REC_UPDATE_IN_PLACE or we have to add + new redo log record. For now, just write dummy sys fields to the redo + log if we are updating a secondary index record. + */ mach_write_to_1(log_ptr, flags); log_ptr++; - log_ptr = row_upd_write_sys_vals_to_log(index, trx, roll_ptr, log_ptr, - mtr); + if (index->type & DICT_CLUSTERED) { + log_ptr = row_upd_write_sys_vals_to_log( + index, trx, roll_ptr, log_ptr, mtr); + } else { + /* Dummy system fields for a secondary index */ + /* TRX_ID Position */ + log_ptr += mach_write_compressed(log_ptr, 0); + /* ROLL_PTR */ + trx_write_roll_ptr(log_ptr, ut_dulint_zero); + log_ptr += DATA_ROLL_PTR_LEN; + /* TRX_ID */ + log_ptr += mach_dulint_write_compressed(log_ptr, + ut_dulint_zero); + } + mach_write_to_2(log_ptr, page_offset(rec)); log_ptr += 2; diff --git a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c index e084a61d5d3..5d018bcdbc9 100644 --- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c +++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c @@ -3072,6 +3072,24 @@ ibuf_insert_to_index_page( to btr_cur_update_in_place(). */ row_upd_rec_in_place(rec, index, offsets, update, page_zip); + + /* Log the update in place operation. During recovery + MLOG_COMP_REC_UPDATE_IN_PLACE/MLOG_REC_UPDATE_IN_PLACE + expects trx_id, roll_ptr for secondary indexes. So we + just write dummy trx_id(0), roll_ptr(0) */ + btr_cur_update_in_place_log(BTR_KEEP_SYS_FLAG, rec, + index, update, + NULL, + ut_dulint_zero, mtr); + DBUG_EXECUTE_IF( + "crash_after_log_ibuf_upd_inplace", + log_buffer_flush_to_disk(); + fprintf(stderr, + "InnoDB: Wrote log record for ibuf " + "update in place operation\n"); + DBUG_SUICIDE(); + ); + goto updated_in_place; } diff --git a/storage/innodb_plugin/include/btr0cur.h b/storage/innodb_plugin/include/btr0cur.h index 7744d2d1ee2..2321d718f03 100644 --- a/storage/innodb_plugin/include/btr0cur.h +++ b/storage/innodb_plugin/include/btr0cur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2013, 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 @@ -636,6 +636,21 @@ btr_push_update_extern_fields( mem_heap_t* heap) /*!< in: memory heap */ __attribute__((nonnull)); +/***********************************************************//** +Writes a redo log record of updating a record in-place. */ +UNIV_INLINE +void +btr_cur_update_in_place_log( +/*========================*/ + ulint flags, /*!< in: flags */ + rec_t* rec, /*!< in: record */ + dict_index_t* index, /*!< in: index where cursor + positioned */ + const upd_t* update, /*!< in: update vector */ + trx_t* trx, /*!< in: transaction */ + roll_ptr_t roll_ptr, /*!< in: roll ptr */ + mtr_t* mtr); /*!< in: mtr */ + /*######################################################################*/ /** In the pessimistic delete, if the page data size drops below this From bc3836cae35b5f84dde86d8521cfd5f6b1f35f55 Mon Sep 17 00:00:00 2001 From: Satya Bodapati Date: Thu, 12 Sep 2013 12:28:16 +0530 Subject: [PATCH 26/80] Additional Fix to BUG#16755251 for 5.1 build failure and disable testcase due to BUG#17446090 --BZR-- revision-id: satya.bodapati@oracle.com-20130912065816-b48h01flo4dfam39 property-audit-revid: satya.bodapati@oracle.com-20130912065816-rao2mr82kdm9ydtw property-branch-nick: mysql-5.1 testament3-sha1: 737531aacdd4e1ea2be9ac55e2d2611f9744da06 --- storage/innobase/btr/btr0cur.c | 1 - storage/innobase/include/btr0cur.h | 2 +- storage/innodb_plugin/btr/btr0cur.c | 2 +- storage/innodb_plugin/include/btr0cur.h | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 4ad4bacdc0f..8704e443099 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -1336,7 +1336,6 @@ btr_cur_upd_lock_and_undo( /*************************************************************** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE void btr_cur_update_in_place_log( /*========================*/ diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index bab405fa91e..5095fd5e875 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -560,7 +560,7 @@ btr_push_update_extern_fields( /*************************************************************** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE + void btr_cur_update_in_place_log( /*========================*/ diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index f653929193a..93b150341b0 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -1530,7 +1530,7 @@ btr_cur_upd_lock_and_undo( /***********************************************************//** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE +UNIV_INTERN void btr_cur_update_in_place_log( /*========================*/ diff --git a/storage/innodb_plugin/include/btr0cur.h b/storage/innodb_plugin/include/btr0cur.h index 2321d718f03..5d07fffbf8c 100644 --- a/storage/innodb_plugin/include/btr0cur.h +++ b/storage/innodb_plugin/include/btr0cur.h @@ -638,7 +638,7 @@ btr_push_update_extern_fields( /***********************************************************//** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE +UNIV_INTERN void btr_cur_update_in_place_log( /*========================*/ From 7321a7b5c5e60e0167dfb95e77913d007f3d8abb Mon Sep 17 00:00:00 2001 From: Satya Bodapati Date: Thu, 12 Sep 2013 17:59:14 +0530 Subject: [PATCH 27/80] Fix FreeBSD build failure due to BUG#16752251 (only in 5.5) --BZR-- revision-id: satya.bodapati@oracle.com-20130912122914-089z8v00w05ifnh0 property-audit-revid: satya.bodapati@oracle.com-20130912122914-m6sy10sa1q42m7yb property-branch-nick: mysql-5.5 testament3-sha1: 96097c94d07e0a89eeb77cdccb326c9b67c2e019 --- storage/innobase/btr/btr0cur.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 16d5016a9b5..7762907b6aa 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -61,6 +61,7 @@ Created 10/16/1994 Heikki Tuuri #include "row0upd.h" #include "trx0rec.h" #include "trx0roll.h" /* trx_is_recv() */ +#include "trx0undo.h" #include "que0que.h" #include "row0row.h" #include "srv0srv.h" From 11af38976fa41666b504f2dbf9992eb5584271fe Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 12 Sep 2013 21:26:15 +0200 Subject: [PATCH 28/80] post-push fix for bug#53947 test change only. Removed --source include/not_windows_embedded.inc which was added due to that bug. --BZR-- revision-id: mattias.jonsson@oracle.com-20130912192615-q2jkk1hqbc7bn82x property-audit-revid: mattias.jonsson@oracle.com-20130912192615-13ptcnvqsohl8rso property-branch-nick: test-5.5 property-rebase-of: mattias.jonsson@oracle.com-20130912192615-rksb28t1igxf029p testament3-sha1: 7aa1f08f6ed1d70a83810f39b2951392bbd71d9d --- mysql-test/suite/innodb/t/innodb.test | 6 ------ mysql-test/suite/sys_vars/t/identity_func.test | 6 ------ .../suite/sys_vars/t/innodb_autoinc_lock_mode_func.test | 6 ------ mysql-test/suite/sys_vars/t/last_insert_id_func.test | 6 ------ mysql-test/suite/sys_vars/t/storage_engine_basic.test | 6 ------ mysql-test/suite/sys_vars/t/tx_isolation_func.test | 6 ------ 6 files changed, 36 deletions(-) diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 3038bb0331e..9c407759fd8 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/suite/sys_vars/t/identity_func.test b/mysql-test/suite/sys_vars/t/identity_func.test index 6f7b6bac18e..ff93607a2cd 100644 --- a/mysql-test/suite/sys_vars/t/identity_func.test +++ b/mysql-test/suite/sys_vars/t/identity_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - #################### mysql-test\t\identity_func.test ########################## # # # Variable Name: identity # diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test index 082507efd07..89c1c80a6dc 100644 --- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test +++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ################# mysql-test\t\innodb_autoinc_lock_mode_func.test ############ # # # Variable Name: innodb_autoinc_lock_mode # diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_func.test b/mysql-test/suite/sys_vars/t/last_insert_id_func.test index bb3adbc1c64..2309c539bd9 100644 --- a/mysql-test/suite/sys_vars/t/last_insert_id_func.test +++ b/mysql-test/suite/sys_vars/t/last_insert_id_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ################# mysql-test\t\last_insert_id_func.test ####################### # # # Variable Name: last_insert_id # diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test index 49e8a52efea..6c8c777be98 100644 --- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test +++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ############## mysql-test\t\storage_engine_basic.test ################## # # # # diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test index 3a78d46e527..7072de6b086 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test +++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ############# mysql-test\t\tx_isolation_func.test ####################################### # # # Variable Name: tx_isolation # From 931cb0e48dcba703f7f14e67bd00f9d1e1147c3a Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 17 Sep 2013 12:43:34 +0200 Subject: [PATCH 29/80] Bug#16765410 FTS: STACK AROUND THE VARIABLE 'MYSTR' WAS CORRUPTED IN INNOBASE_STRNXFRM my_strnxfrm_win1250ch could write into dest[destlen] i.e. write a byte to the past-the-end of dest. --BZR-- revision-id: tor.didriksen@oracle.com-20130917104334-wyzfhpbhfzg3zkiy property-audit-revid: tor.didriksen@oracle.com-20130917104334-p4nd5pu1f2nd8zpi property-branch-nick: 5.5 testament3-sha1: da2f478b1f0040abd4f447f3ff4c450fc05c3f46 --- strings/ctype-win1250ch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index cbb1ad5e685..a8181afa776 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -500,7 +500,7 @@ static size_t my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), do { NEXT_CMP_VALUE(src, p, pass, value, (int)srclen); - if (totlen <= len) + if (totlen < len) dest[totlen] = value; totlen++; } while (value) ; From ad7cbe7eb9f28ae45513999f252bc49cd5ca87d0 Mon Sep 17 00:00:00 2001 From: Vinay Fisrekar Date: Thu, 19 Sep 2013 13:52:01 +0530 Subject: [PATCH 30/80] Making rpl.rpl_spec_variables experimental for solaris till bug#17337114 is fixed. --BZR-- revision-id: vinay.fisrekar@oracle.com-20130919082201-f4mmew920lve4yca property-audit-revid: vinay.fisrekar@oracle.com-20130919082201-1klef6052d3efbbh property-branch-nick: mysql-5.5 testament3-sha1: 7328e8755459819e4f614066397cecd30f514e79 --- mysql-test/collections/default.experimental | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index e4c839ce705..ff4bc960acb 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -15,6 +15,7 @@ main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_tim rpl.rpl_innodb_bug28430 # Bug#11754425 rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun +rpl.rpl_spec_variables @solaris # Bug #17337114 2013-08-20 Luis Soares failing on pb2 with timeout for 'CHECK WARNINGS' sys_vars.max_sp_recursion_depth_func @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails From f1417f884113652d41243d1783446a819c7212b2 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 20 Sep 2013 16:10:31 +0200 Subject: [PATCH 31/80] Bug#17435338 ADD A -DWITH_ASAN SWITCH/OPTION TO OUR CMAKE SCRIPTS Tested with: gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) clang version 3.1 (tags/RELEASE_31/final) Target: x86_64-apple-darwin10.8.0 --BZR-- revision-id: tor.didriksen@oracle.com-20130920141031-6y11m51c8kj0ktl9 property-audit-revid: tor.didriksen@oracle.com-20130920141031-axwhxx376gvp7w7p property-branch-nick: 5.5 testament3-sha1: db18fdf106d3ae9300eec5dbd9f46986722e897a --- CMakeLists.txt | 78 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aee0fb650e8..369a6b5c8f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,83 @@ ENDIF() OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) - + + +include(CheckCSourceCompiles) +include(CheckCXXSourceCompiles) +# We need some extra FAIL_REGEX patterns +# Note that CHECK_C_SOURCE_COMPILES is a misnomer, it will also link. +MACRO (MY_CHECK_C_COMPILER_FLAG FLAG RESULT) + SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") + CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} + FAIL_REGEX "argument unused during compilation" + FAIL_REGEX "unsupported .*option" + FAIL_REGEX "unknown .*option" + FAIL_REGEX "unrecognized .*option" + FAIL_REGEX "ignoring unknown option" + FAIL_REGEX "[Ww]arning: [Oo]ption" + ) + SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") +ENDMACRO() + +MACRO (MY_CHECK_CXX_COMPILER_FLAG FLAG RESULT) + SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") + CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} + FAIL_REGEX "argument unused during compilation" + FAIL_REGEX "unsupported .*option" + FAIL_REGEX "unknown .*option" + FAIL_REGEX "unrecognized .*option" + FAIL_REGEX "ignoring unknown option" + FAIL_REGEX "[Ww]arning: [Oo]ption" + ) + SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") +ENDMACRO() + +OPTION(WITH_ASAN "Enable address sanitizer" OFF) +IF (WITH_ASAN) + # gcc 4.8.1 and new versions of clang + MY_CHECK_C_COMPILER_FLAG("-fsanitize=address" HAVE_C_FSANITIZE) + MY_CHECK_CXX_COMPILER_FLAG("-fsanitize=address" HAVE_CXX_FSANITIZE) + + IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE) + # We switch on basic optimization also for debug builds. + # With optimization we may get some warnings, so we switch off -Werror + SET(CMAKE_C_FLAGS_DEBUG + "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -O1 -Wno-error -fPIC") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO + "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=address -fPIC") + SET(CMAKE_CXX_FLAGS_DEBUG + "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -O1 -Wno-error -fPIC") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=address -fPIC") + SET(WITH_ASAN_OK 1) + ELSE() + # older versions of clang + MY_CHECK_C_COMPILER_FLAG("-faddress-sanitizer" HAVE_C_FADDRESS) + MY_CHECK_CXX_COMPILER_FLAG("-faddress-sanitizer" HAVE_CXX_FFADDRESS) + + IF(HAVE_C_FADDRESS AND HAVE_CXX_FFADDRESS) + # We switch on basic optimization also for debug builds. + SET(CMAKE_C_FLAGS_DEBUG + "${CMAKE_C_FLAGS_DEBUG} -faddress-sanitizer -O1 -fPIC") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO + "${CMAKE_C_FLAGS_RELWITHDEBINFO} -faddress-sanitizer -fPIC") + SET(CMAKE_CXX_FLAGS_DEBUG + "${CMAKE_CXX_FLAGS_DEBUG} -faddress-sanitizer -O1 -fPIC") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -faddress-sanitizer -fPIC") + SET(WITH_ASAN_OK 1) + ENDIF() + ENDIF() + + IF(NOT WITH_ASAN_OK) + MESSAGE(FATAL_ERROR "Do not know how to enable address sanitizer") + ENDIF() +ENDIF() + + OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) IF(ENABLE_DEBUG_SYNC) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") From 39222dcc6b339d925873e9ec72726cc26ca773fc Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Mon, 23 Sep 2013 12:13:37 +0530 Subject: [PATCH 32/80] Bug#17327454:SEMI-SYNC REPLICATION MASTER CRASH WHEN SET RPL_SEMI_SYNC_MASTER_ENABLED OFF. Problem: ======= If master is waiting for a reply from slave, at this time set global rpl_semi_sync_master_enabled=OFF, the master server will crash. Analysis: ======== When master is waiting for a reply from slave, at this time if semi sync is switched off on master, during switch off if active transactions are present the transactions will be cleared and "active_tranxs_" variable will be set to NULL. When the waiting master connection finds that semi sync is switched of it tries to access "active_tranxs_" without checking if the transaction list exists or not. Accessing NULL transaction list causes the crash. Fix: === A check has been added to see a valid list exists before accessing the "active_tranxs_". --BZR-- revision-id: sujatha.sivakumar@oracle.com-20130923064337-iv3vpavkubr5g7rp property-audit-revid: sujatha.sivakumar@oracle.com-20130923064337-dni2h2cqcyig5xzj property-branch-nick: Bug17327454_mysql-5.5 property-file-info: ld7:file_id52:semisync_master.cc-20090926043316-1tenv210xoci1uvm-87:message56:Added check for the existence of valid 'active_transx_'.4:path34:plugin/semisync/semisync_master.ccee testament3-sha1: b35c64efe93124a3a37f776b98cc0013655b1939 --- plugin/semisync/semisync_master.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 1be876d0f1b..87adbdcae79 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -752,7 +752,8 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, At this point, the binlog file and position of this transaction must have been removed from ActiveTranx. */ - assert(!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name, + assert(!getMasterEnabled() || + !active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name, trx_wait_binlog_pos)); /* Update the status counter. */ From 85ca8d9a5bfa9b5c75c70d6a7eab7847dbfa8544 Mon Sep 17 00:00:00 2001 From: Shivji Kumar Jha Date: Fri, 27 Sep 2013 01:24:16 +0530 Subject: [PATCH 33/80] BUG#16580366- MTR TESTS FAILING SPORADICALLY ON PB2 (5.5, 5.6 AND 5.7) DURING INNODB RECOVERY Problem: ======= The connection 'master' is dropped by mysqltest after rpl_end.inc. At this point, dropping temporary tables at the connection 'master' are not synced at slave. So, the temporary tables replicated from master remain on slave leading to an inconsistent close of the test. The following test thus complains about the presence of temporary table(s) left over from the previous test. Fix: === - Put explicit drop commands in replication tests so that the temporary tables are dropped at slave as well. - Added the check for Slave_open_temp_tables in mtr_check.sql to warn about the remaining temporary table, if any, at the close of a test. --BZR-- revision-id: shivji.jha@oracle.com-20130926195416-68y2iogiv46j035n property-audit-revid: shivji.jha@oracle.com-20130926195416-0rgrupx2mw5ewdzt property-branch-nick: mysql-5.5 testament3-sha1: afe113db271addcafbfec22b473ee7ccdf1396b1 --- .../extra/rpl_tests/rpl_drop_create_temp_table.inc | 10 +++++++--- mysql-test/extra/rpl_tests/rpl_innodb.test | 2 +- mysql-test/extra/rpl_tests/rpl_reset_slave.test | 3 +++ mysql-test/include/mtr_check.sql | 2 ++ .../rpl/r/rpl_create_tmp_table_if_not_exists.result | 3 +++ mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result | 1 + .../rpl/r/rpl_mixed_drop_create_temp_table.result | 6 ++++++ mysql-test/suite/rpl/r/rpl_rotate_logs.result | 1 + .../suite/rpl/r/rpl_row_drop_create_temp_table.result | 6 ++++++ mysql-test/suite/rpl/r/rpl_row_reset_slave.result | 1 + mysql-test/suite/rpl/r/rpl_stm_000001.result | 1 + .../suite/rpl/r/rpl_stm_drop_create_temp_table.result | 6 ++++++ mysql-test/suite/rpl/r/rpl_stm_innodb.result | 1 + mysql-test/suite/rpl/r/rpl_stm_reset_slave.result | 1 + .../rpl/t/rpl_create_tmp_table_if_not_exists.test | 4 ++++ mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test | 1 + mysql-test/suite/rpl/t/rpl_rotate_logs.test | 1 + mysql-test/suite/rpl/t/rpl_stm_000001.test | 2 +- 18 files changed, 47 insertions(+), 5 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc index 094e84537db..983851adfcd 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -150,10 +150,9 @@ if (`SELECT HEX(@commands) = HEX('configure')`) } # -# Drops tables and synchronizes master and slave. Note that temporary -# tables are not explitcily dropped as they will be dropped while -# closing the connection. +# Drops tables and synchronizes master and slave. # + if (`SELECT HEX(@commands) = HEX('clean')`) { connection master; @@ -162,10 +161,15 @@ if (`SELECT HEX(@commands) = HEX('clean')`) DROP TABLE IF EXISTS nt_xx_1; + DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; + DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; + --let $n= $tot_table while ($n) { --eval DROP TABLE IF EXISTS nt_$n + --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n + --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --dec $n } diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test index e590bd70c88..11aa58f730f 100644 --- a/mysql-test/extra/rpl_tests/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -112,7 +112,7 @@ FLUSH LOGS; --echo -------- switch to master -------- connection master; FLUSH LOGS; - +DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; DROP DATABASE mysqltest1; --echo End of 5.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test index 0d94f04ca44..44bd650682d 100644 --- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test @@ -38,6 +38,9 @@ reset slave; source include/start_slave.inc; sync_with_master; show status like 'slave_open_temp_tables'; +connection master; +drop temporary table if exists t1; +sync_slave_with_master; # #Bug#34654 RESET SLAVE does not clear LAST_IO_Err* diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index fbe5df632c6..9c51b333ec6 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -72,6 +72,8 @@ BEGIN mysql.time_zone_transition_type, mysql.user; + show status like 'slave_open_temp_tables'; + END|| -- diff --git a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result index 6bafbb32897..40a38ee8592 100644 --- a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result +++ b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result @@ -15,4 +15,7 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS t master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp +DROP TEMPORARY TABLE tmp; +DROP TEMPORARY TABLE tmp1; +DROP TEMPORARY TABLE tmp2; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result index 99c5846cea0..55c74b0b533 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result @@ -42,4 +42,5 @@ t5 CREATE TABLE `t5` ( `created` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2,t3,t5; +drop temporary table t4; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result index 761ff2f8e98..57c947c9333 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result @@ -1554,8 +1554,14 @@ master-bin.000001 # Query # # COMMIT SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 256ed4eaad2..9459361cb30 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -85,6 +85,7 @@ lock tables t3 read; include/assert.inc [Table t3 should contain 100 lines on the slave] unlock tables; drop table if exists t1,t2,t3,t4; +drop temporary table temp_table; End of 4.1 tests show binlog events in 'non existing_binlog_file'; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result index 88754e2cf8c..a55c8e2a2bc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result @@ -1619,8 +1619,14 @@ master-bin.000001 # Query # # COMMIT SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 41fe0b1a9f3..1cf70ba7e67 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -23,6 +23,7 @@ include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +drop temporary table if exists t1; include/stop_slave.inc reset slave; include/check_slave_no_error.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index 9493013a283..7aeff0d3d46 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -48,6 +48,7 @@ select (@id := id) - id from t2; 0 kill @id; drop table t2; +drop temporary table t3; Got one of the listed errors include/wait_for_slave_sql_error_and_skip.inc [errno=1053] select count(*) from t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result index 42f16a4c175..08b318fbb43 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result @@ -1604,8 +1604,14 @@ master-bin.000001 # Query # # ROLLBACK SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result index 0e9531317b9..6f54b232e71 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result @@ -79,6 +79,7 @@ COUNT(*) FLUSH LOGS; -------- switch to master -------- FLUSH LOGS; +DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; DROP DATABASE mysqltest1; End of 5.1 tests # diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index b1473c937a1..e5870cec2c9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -23,6 +23,7 @@ include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +drop temporary table if exists t1; include/stop_slave.inc reset slave; include/check_slave_no_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test index daf6b7e9ad8..bf2c5442d40 100644 --- a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test +++ b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test @@ -38,4 +38,8 @@ CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; source include/show_binlog_events.inc; +DROP TEMPORARY TABLE tmp; +DROP TEMPORARY TABLE tmp1; +DROP TEMPORARY TABLE tmp2; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test index cbd7e9c2558..4309dc3f9b1 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test @@ -43,6 +43,7 @@ show create table t3; show create table t5; connection master; drop table t2,t3,t5; +drop temporary table t4; sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index dc158d7ef92..4d0c93f46bd 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -218,6 +218,7 @@ unlock tables; #clean up connection master; drop table if exists t1,t2,t3,t4; +drop temporary table temp_table; sync_slave_with_master; --echo End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test index 268a10ad1fa..e7237af57c3 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -91,8 +91,8 @@ connection master1; sleep 3; select (@id := id) - id from t2; kill @id; -# We don't drop t3 as this is a temporary table drop table t2; +drop temporary table t3; connection master; # The get_lock function causes warning for unsafe statement. --disable_warnings From 7daaa17ed11c1753584f93da932004afe1d0d976 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Fri, 27 Sep 2013 18:30:46 +0530 Subject: [PATCH 34/80] --BZR-- revision-id: mysql-builder@oracle.com-20130927130046-jrvpd97ax50g9esr property-audit-revid: satya.bodapati@oracle.com-20130927130046-qei35fqojx1ofvzf property-branch-nick: clone testament3-sha1: 8eb53af88cc721767e25357e958a2b4faac23cd7 From 6e6165582e2957a5ed6368998a5a594031704593 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Mon, 30 Sep 2013 13:41:48 +0900 Subject: [PATCH 35/80] Bug#11758196 : INNODB ASSERTION FAILURE WHEN CONVERTING FROM MYISAM TO INNODB Changed to try to extend log buffer instead of crash, when log size is too large for the size. Approved by Marko in rb#3229 --BZR-- revision-id: yasufumi.kinoshita@oracle.com-20130930044148-8hzgn8ofxtw1efro property-audit-revid: yasufumi.kinoshita@oracle.com-20130930044148-nhw4ws7ehg5q4mik property-branch-nick: mysql-5.5 testament3-sha1: ff13f2fdcfd9c2e490d09fcaac69342c53081574 --- storage/innobase/include/log0log.h | 2 + storage/innobase/log/log0log.c | 109 ++++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 5524272d811..b0e5e9bda3b 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -809,6 +809,8 @@ struct log_struct{ later; this is advanced when a flush operation is completed to all the log groups */ + volatile ibool is_extending; /*!< this is set to true during extend + the log buffer size */ ib_uint64_t written_to_some_lsn; /*!< first log sequence number not yet written to any log group; for this to diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index 8bae95f0a5d..046c494c99d 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -213,6 +213,84 @@ log_buf_pool_get_oldest_modification(void) return(lsn); } +/** Extends the log buffer. +@param[in] len requested minimum size in bytes */ +static +void +log_buffer_extend( + ulint len) +{ + ulint move_start; + ulint move_end; + byte tmp_buf[OS_FILE_LOG_BLOCK_SIZE]; + + mutex_enter(&(log_sys->mutex)); + + while (log_sys->is_extending) { + /* Another thread is trying to extend already. + Needs to wait for. */ + mutex_exit(&(log_sys->mutex)); + + log_buffer_flush_to_disk(); + + mutex_enter(&(log_sys->mutex)); + + if (srv_log_buffer_size > len / UNIV_PAGE_SIZE) { + /* Already extended enough by the others */ + mutex_exit(&(log_sys->mutex)); + return; + } + } + + log_sys->is_extending = TRUE; + + while (log_sys->n_pending_writes != 0 + || ut_calc_align_down(log_sys->buf_free, + OS_FILE_LOG_BLOCK_SIZE) + != ut_calc_align_down(log_sys->buf_next_to_write, + OS_FILE_LOG_BLOCK_SIZE)) { + /* Buffer might have >1 blocks to write still. */ + mutex_exit(&(log_sys->mutex)); + + log_buffer_flush_to_disk(); + + mutex_enter(&(log_sys->mutex)); + } + + move_start = ut_calc_align_down( + log_sys->buf_free, + OS_FILE_LOG_BLOCK_SIZE); + move_end = log_sys->buf_free; + + /* store the last log block in buffer */ + ut_memcpy(tmp_buf, log_sys->buf + move_start, + move_end - move_start); + + log_sys->buf_free -= move_start; + log_sys->buf_next_to_write -= move_start; + + /* reallocate log buffer */ + srv_log_buffer_size = len / UNIV_PAGE_SIZE + 1; + mem_free(log_sys->buf_ptr); + log_sys->buf_ptr = mem_alloc(LOG_BUFFER_SIZE + OS_FILE_LOG_BLOCK_SIZE); + log_sys->buf = ut_align(log_sys->buf_ptr, OS_FILE_LOG_BLOCK_SIZE); + log_sys->buf_size = LOG_BUFFER_SIZE; + log_sys->max_buf_free = log_sys->buf_size / LOG_BUF_FLUSH_RATIO + - LOG_BUF_FLUSH_MARGIN; + + /* restore the last log block */ + ut_memcpy(log_sys->buf, tmp_buf, move_end - move_start); + + ut_ad(log_sys->is_extending); + log_sys->is_extending = FALSE; + + mutex_exit(&(log_sys->mutex)); + + fprintf(stderr, + "InnoDB: innodb_log_buffer_size was extended to %lu.\n", + LOG_BUFFER_SIZE); +} + /************************************************************//** Opens the log for log_write_low. The log must be closed with log_close and released with log_release. @@ -233,11 +311,39 @@ log_reserve_and_open( ulint count = 0; #endif /* UNIV_DEBUG */ - ut_a(len < log->buf_size / 2); + if (len >= log->buf_size / 2) { + DBUG_EXECUTE_IF("ib_log_buffer_is_short_crash", + DBUG_SUICIDE();); + + /* log_buffer is too small. try to extend instead of crash. */ + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Warning: " + "The transaction log size is too large" + " for innodb_log_buffer_size (%lu >= %lu / 2). " + "Trying to extend it.\n", + len, LOG_BUFFER_SIZE); + + log_buffer_extend((len + 1) * 2); + } loop: mutex_enter(&(log->mutex)); ut_ad(!recv_no_log_write); + if (log->is_extending) { + + mutex_exit(&(log->mutex)); + + /* Log buffer size is extending. Writing up to the next block + should wait for the extending finished. */ + + os_thread_sleep(100000); + + ut_ad(++count < 50); + + goto loop; + } + /* Calculate an upper limit for the space the string may take in the log buffer */ @@ -788,6 +894,7 @@ log_init(void) log_sys->buf = ut_align(log_sys->buf_ptr, OS_FILE_LOG_BLOCK_SIZE); log_sys->buf_size = LOG_BUFFER_SIZE; + log_sys->is_extending = FALSE; memset(log_sys->buf, '\0', LOG_BUFFER_SIZE); From 59799b1ba67b014fd904243c267a119650403835 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Mon, 30 Sep 2013 15:02:54 +0900 Subject: [PATCH 36/80] Adjustment for fix for Bug#11758196 log_buffer_extend() should fill the new buffer with 0. --BZR-- revision-id: yasufumi.kinoshita@oracle.com-20130930060254-54pj1nlqx3fxtdqo property-audit-revid: yasufumi.kinoshita@oracle.com-20130930060254-rjae55lw70htfbt7 property-branch-nick: mysql-5.5 testament3-sha1: b1b3a3c686da4c19b42536a6f7a0d0337633fb0c --- storage/innobase/log/log0log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index 046c494c99d..eacee12a2d4 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -275,6 +275,7 @@ log_buffer_extend( log_sys->buf_ptr = mem_alloc(LOG_BUFFER_SIZE + OS_FILE_LOG_BLOCK_SIZE); log_sys->buf = ut_align(log_sys->buf_ptr, OS_FILE_LOG_BLOCK_SIZE); log_sys->buf_size = LOG_BUFFER_SIZE; + memset(log_sys->buf, '\0', LOG_BUFFER_SIZE); log_sys->max_buf_free = log_sys->buf_size / LOG_BUF_FLUSH_RATIO - LOG_BUF_FLUSH_MARGIN; From ca86f5635c8c1a6ce418a66e44bd53f38d475e01 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Mon, 30 Sep 2013 12:29:10 +0530 Subject: [PATCH 37/80] Fix to copy missing pdb files BUG 13878021 --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20130930065910-obv6mlhe1c6qbzg3 property-audit-revid: sreedhar.sreedhargadda@oracle.com-20130930065910-m4o8nqo6qbze9fzv property-branch-nick: mysql-5.5 testament3-sha1: ee0d22454061ae62e27d3c95c4bd80b5ccb33e98 --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 369a6b5c8f9..0de56225155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -464,6 +464,27 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") ) INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) + + IF(WIN32) + SET(EXTRA_PDB_FILES + ${CMAKE_BINARY_DIR}/libmysql/authentication_win/${CMAKE_BUILD_TYPE}/auth_win_client.pdb + ${CMAKE_BINARY_DIR}/libmysql/${CMAKE_BUILD_TYPE}/clientlib.pdb + ${CMAKE_BINARY_DIR}/strings/${CMAKE_BUILD_TYPE}/strings.pdb + ${CMAKE_BINARY_DIR}/mysys/${CMAKE_BUILD_TYPE}/mysys.pdb + ${CMAKE_BINARY_DIR}/vio/${CMAKE_BUILD_TYPE}/vio.pdb + ${CMAKE_BINARY_DIR}/zlib/${CMAKE_BUILD_TYPE}/zlib.pdb + ${CMAKE_BINARY_DIR}/extra/yassl/${CMAKE_BUILD_TYPE}/yassl.pdb + ${CMAKE_BINARY_DIR}/extra/yassl/taocrypt/${CMAKE_BUILD_TYPE}/taocrypt.pdb + ) + INSTALL(FILES ${EXTRA_PDB_FILES} DESTINATION ${INSTALL_LIBDIR} COMPONENT DebugBinaries) + FOREACH(f ${EXTRA_PDB_FILES}) + STRING(REPLACE "RelWithDebInfo" "Debug" df ${f}) + IF(EXISTS ${df}) + INSTALL(FILES ${df} DESTINATION ${INSTALL_LIBDIR}/debug COMPONENT DebugBinaries) + ENDIF() + ENDFOREACH() + ENDIF() + IF(UNIX) INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) ENDIF() From 41a0784333ed51e854d7db93e9266e74792db9dc Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Mon, 30 Sep 2013 12:41:22 +0530 Subject: [PATCH 38/80] Fix for Bug:16053094 Registry redirection was improper and hence not able to pick the value for the OLDERVERSION property. as a result in the install upgrade dialog null value wa being passed. --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20130930071122-qxw7kpfkch7s3qsv property-audit-revid: sreedhar.sreedhargadda@oracle.com-20130930071122-gqcpduyvo4nekb0r property-branch-nick: mysql-5.5 testament3-sha1: 35e06e8d825eb485babec966a3cfb10fe17d0371 --- packaging/WiX/mysql_server.wxs.in | 42 ++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index 752dc15304e..65688838316 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -70,10 +70,10 @@ Installed - + - + @@ -83,31 +83,43 @@ Name="InstallLocation" Type="raw" /> - - - - + + + + + + + + + + - + - - - INSTALLDIR2 - + + + INSTALLDIR2 + From c4ac2f3a375b534fd7e62c6931ed54a49812e8d4 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Mon, 30 Sep 2013 13:01:17 +0530 Subject: [PATCH 39/80] Bug #16619754 - MYSQL_INSTALL_DB.PL FAILS TO CREATE DATABASE ON WINDOWS. As this mysql_install_db.pl file has always generated lots of confusion on Windows. This fix will make sure to get it removed only from Windows --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20130930073117-spvpgdfqenmf1v1j property-audit-revid: sreedhar.sreedhargadda@oracle.com-20130930073117-qats15mb4qzp1f3b property-branch-nick: mysql-5.5 testament3-sha1: f93626727f53e277cfc967cbba9aea6f0e1a0abc --- scripts/CMakeLists.txt | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 424d92e31e1..d5a3311d942 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -198,24 +198,17 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() -IF(UNIX) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) +IF(NOT WIN32) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) - SET(EXT) -ELSE() - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db.pl ESCAPE_QUOTES @ONLY) - SET(DEST ${INSTALL_SCRIPTDIR}) - SET(EXT ".pl") -ENDIF() -INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" - DESTINATION ${DEST} - COMPONENT Server + INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" + DESTINATION ${DEST} + COMPONENT Server ) - +ENDIF() SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) From aa5ae81e5c3c3647be8e078f0a41e317f5fa689f Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 1 Oct 2013 10:05:45 +0200 Subject: [PATCH 40/80] Bug#14621190: HA_INNOBASE::INDEX_NEXT SKIPS A RECORD IF PREVIOUS INDEX_READ_MAP HAD NO MATCH If index_read_map is called for exact search and no matching records exists it will position the cursor on the next record, but still having the relative position to BTR_PCUR_ON. This will make a call for index_next to read yet another next record, instead of returning the record the cursor points to. Fixed by setting pcur->rel_pos = BTR_PCUR_BEFORE if an exact [prefix] search is done, but failed. Also avoids optimistic restoration if rel_pos != BTR_PCUR_ON, since btr_cur may be different than old_rec. rb#3324, approved by Marko and Jimmy --BZR-- revision-id: mattias.jonsson@oracle.com-20131001080545-a353d15zxga1e8dz property-audit-revid: mattias.jonsson@oracle.com-20131001080545-k9xlf65imx0mi6wl property-branch-nick: b14621190-55 testament3-sha1: d7c8e494d3b21ac7707d817c1caffd00b487c639 --- .../suite/innodb/r/innodb_bug13510739.result | 2 +- storage/innobase/btr/btr0pcur.c | 12 +++++----- storage/innobase/row/row0sel.c | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_bug13510739.result b/mysql-test/suite/innodb/r/innodb_bug13510739.result index 8aa4323eeb0..e1e6e27239c 100644 --- a/mysql-test/suite/innodb/r/innodb_bug13510739.result +++ b/mysql-test/suite/innodb/r/innodb_bug13510739.result @@ -6,5 +6,5 @@ HANDLER bug13510739 READ `primary` = (2); c HANDLER bug13510739 READ `primary` NEXT; c -4 +3 DROP TABLE bug13510739; diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c index 0cfdf138bad..fbedc1e7d04 100644 --- a/storage/innobase/btr/btr0pcur.c +++ b/storage/innobase/btr/btr0pcur.c @@ -273,13 +273,15 @@ btr_pcur_restore_position_func( if (UNIV_LIKELY(latch_mode == BTR_SEARCH_LEAF) || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) { - /* Try optimistic restoration */ + /* Try optimistic restoration if cursor is expected to be + positioned on the same btr record as before (BTR_PCUR_ON). */ - if (UNIV_LIKELY(buf_page_optimistic_get( + if (cursor->rel_pos == BTR_PCUR_ON + && buf_page_optimistic_get( latch_mode, cursor->block_when_stored, cursor->modify_clock, - file, line, mtr))) { + file, line, mtr)) { cursor->pos_state = BTR_PCUR_IS_POSITIONED; buf_block_dbg_add_level( @@ -287,7 +289,7 @@ btr_pcur_restore_position_func( dict_index_is_ibuf(index) ? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE); - if (cursor->rel_pos == BTR_PCUR_ON) { + { #ifdef UNIV_DEBUG const rec_t* rec; const ulint* offsets1; @@ -312,8 +314,6 @@ btr_pcur_restore_position_func( #endif /* UNIV_DEBUG */ return(TRUE); } - - return(FALSE); } } diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 518eba975ab..28da1f69e8a 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3116,6 +3116,13 @@ sel_restore_position_for_mysql( return(TRUE); } + /* success can only be TRUE for BTR_PCUR_ON! */ + ut_ad(!success); + + /* BTR_PCUR_BEFORE -> the position is now set to the record before + pcur->old_rec. + BTR_PCUR_AFTER-> positioned to record after pcur->old_rec. */ + if (relative_position == BTR_PCUR_AFTER || relative_position == BTR_PCUR_AFTER_LAST_IN_TREE) { @@ -4120,6 +4127,14 @@ row_search_for_mysql( btr_pcur_store_position(pcur, &mtr); + /* The found record was not a match, but may be used + as NEXT record (index_next). Set the relative position + to BTR_PCUR_BEFORE, to reflect that the position of + the persistent cursor is before the found/stored row + (pcur->old_rec). */ + ut_ad(pcur->rel_pos == BTR_PCUR_ON); + pcur->rel_pos = BTR_PCUR_BEFORE; + err = DB_RECORD_NOT_FOUND; /* ut_print_name(stderr, index->name); fputs(" record not found 3\n", stderr); */ @@ -4159,6 +4174,14 @@ row_search_for_mysql( btr_pcur_store_position(pcur, &mtr); + /* The found record was not a match, but may be used + as NEXT record (index_next). Set the relative position + to BTR_PCUR_BEFORE, to reflect that the position of + the persistent cursor is before the found/stored row + (pcur->old_rec). */ + ut_ad(pcur->rel_pos == BTR_PCUR_ON); + pcur->rel_pos = BTR_PCUR_BEFORE; + err = DB_RECORD_NOT_FOUND; /* ut_print_name(stderr, index->name); fputs(" record not found 4\n", stderr); */ @@ -4736,6 +4759,7 @@ row_search_for_mysql( if (prebuilt->n_fetch_cached > 0) { row_sel_pop_cached_row_for_mysql(buf, prebuilt); + DEBUG_SYNC_C("row_search_cached_row"); err = DB_SUCCESS; } From 6fcad2f41f1df14af50a07ffb1550b4b8eb85b37 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Tue, 1 Oct 2013 14:17:35 +0300 Subject: [PATCH 41/80] --BZR-- revision-id: mysql-builder@oracle.com-20131001111735-3l3fs28hyub7wzt7 property-audit-revid: marko.makela@oracle.com-20131001111735-49h6uplhlnbk8e2e property-branch-nick: clone testament3-sha1: e496294443a3a73803e3fd29f262cec90960d5cb From 80f94eade366765c8dd687f8b47695b04e74a45a Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Fri, 4 Oct 2013 13:51:13 +0200 Subject: [PATCH 42/80] --BZR-- revision-id: mysql-builder@oracle.com-20131004115113-mhy1hpqhgnqpq4z7 property-audit-revid: kent.boortz@oracle.com-20131004115113-yd0jtpowqrudl5si property-branch-nick: clone testament3-sha1: ea62c3f0a111f3171b4b219536d0c7824badb814 From 97d12d3127f81826d7338e85c2a4bffb808d63f3 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Sat, 5 Oct 2013 15:29:02 +0530 Subject: [PATCH 43/80] Bug#11745656 - KILL THREAD -> ERROR: "SERVER SHUTDOWN IN PROGRESS" Description: ------------ There are 2 issues reported in the bug report, 1. One session running a "long" select, then, from the other session, you kill that first one, while select is running, and it receives that message "Server shutdown in progress". Reported Date: 02-Apr-2006 => Looks like this isuse is already fixed in 2009 by the patch pushed for bug28141. 2. Killing query which goes to filesort, logs error entries like: 120416 9:17:28 [ERROR] mysqld: Sort aborted: Server shutdown in progress 120416 9:18:48 [ERROR] mysqld: Sort aborted: Server shutdown in progress 120416 9:19:39 [ERROR] mysqld: Sort aborted: Server shutdown in progress Reported Date: 16-Apr-2012 => This issue is introduced in 5.5+ versions. Fixing this issue in this patch. Analysis: --------- In function "filesort()", on error we are logging error message. To the error message, the message related THD::killed_errno is also appeneded, if it is set.(THD::kill_errno value is obtained by calling member function THD::killed_errno) In the scenario mentioned in this bug report, when we kill the connection, THD::kill_errno is set to the THD::KILL_CONNECTION. Enum type THD::KILL_CONNECTION corressponds to value ER_SERVER_SHUTDOWN. Because of this, "Server shutdown in ...." is appended to the message logged. Fix: ---- Modified code of "filesort()" function to append "KILL_QUERY" status to error message when thread is killed and server shutdown is not in progress. --BZR-- revision-id: praveenkumar.hulakund@oracle.com-20131005095902-2zhl73898rb6h3db property-audit-revid: praveenkumar.hulakund@oracle.com-20131005095902-ucn1nggma8ue3ns6 property-branch-nick: mysql_5_5 testament3-sha1: 98d362494eafb5dee117c638fc5172b7632f14eb --- sql/filesort.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index e829721a29b..d877ff4a8a4 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -339,7 +339,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, "%s: %s", MYF(ME_ERROR + ME_WAITTANG), ER_THD(thd, ER_FILSORT_ABORT), - kill_errno ? ER(kill_errno) : thd->stmt_da->message()); + kill_errno ? ((kill_errno == THD::KILL_CONNECTION && + !shutdown_in_progress) ? ER(THD::KILL_QUERY) : + ER(kill_errno)) : + thd->stmt_da->message()); if (global_system_variables.log_warnings > 1) { From b3434f51999876407405eb539ae5b39abd5a4548 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Mon, 7 Oct 2013 09:49:32 +0530 Subject: [PATCH 44/80] --BZR-- revision-id: mysql-builder@oracle.com-20131007041932-919gicq0nooqdz0x property-audit-revid: praveenkumar.hulakund@oracle.com-20131007041932-jnf7hqth7qg0q6rq property-branch-nick: clone testament3-sha1: 93d85167710b10573bbe368073018233699fc95c From 5d4bf6d288cd18f7b14e7acc2a3004c61866c4b2 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Mon, 7 Oct 2013 15:16:31 +0900 Subject: [PATCH 45/80] Bug#17431533 : FAILING ASSERTION: INDEX->PAGE != 0XFFFFFFFF AFTER DISCARDING TABLESPACE ha_innobase::records_in_range() should return HA_POS_ERROR for the table during discarded without requesting pages. The later other handler method should treat the error correctly. Approved by Sunny in rb#3433 --BZR-- revision-id: yasufumi.kinoshita@oracle.com-20131007061631-csy0k4zq5n8cal7c property-audit-revid: yasufumi.kinoshita@oracle.com-20131007061631-jxtq34j2qw120723 property-branch-nick: mysql-5.1 testament3-sha1: 552824ec5ff5a6e462a3248fbde10655480ebd65 --- storage/innobase/handler/ha_innodb.cc | 7 +++++++ storage/innodb_plugin/handler/ha_innodb.cc | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 9f5ba543a47..8c9fc33fa35 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6454,6 +6454,11 @@ ha_innobase::records_in_range( index = dict_table_get_index_noninline(prebuilt->table, key->name); + if (prebuilt->table->ibd_file_missing) { + n_rows = HA_POS_ERROR; + goto func_exit; + } + range_start = dtuple_create_for_mysql(&heap1, key->key_parts); dict_index_copy_types(range_start, index, key->key_parts); @@ -6503,6 +6508,8 @@ ha_innobase::records_in_range( my_free(key_val_buff2, MYF(0)); +func_exit: + prebuilt->trx->op_info = (char*)""; /* The MySQL optimizer seems to believe an estimate of 0 rows is diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc index 971c55a623c..cde3c679766 100644 --- a/storage/innodb_plugin/handler/ha_innodb.cc +++ b/storage/innodb_plugin/handler/ha_innodb.cc @@ -7523,6 +7523,10 @@ ha_innobase::records_in_range( /* There exists possibility of not being able to find requested index due to inconsistency between MySQL and InoDB dictionary info. Necessary message should have been printed in innobase_get_index() */ + if (prebuilt->table->ibd_file_missing) { + n_rows = HA_POS_ERROR; + goto func_exit; + } if (UNIV_UNLIKELY(!index)) { n_rows = HA_POS_ERROR; goto func_exit; From 7a17e17d1c97c2e576aa5e77e4f3d4f5ea68f789 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Mon, 7 Oct 2013 14:03:57 +0530 Subject: [PATCH 46/80] --BZR-- revision-id: mysql-builder@oracle.com-20131007083357-z77sc0u1jihsp1fu property-audit-revid: praveenkumar.hulakund@oracle.com-20131007083357-mkc8lt7haiucc52p property-branch-nick: clone testament3-sha1: d04d3a67ff63f24b1c22760851fd916ff69bafd1 From baa1f66db4fc824623160ee027a806f2c02a2db2 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Mon, 7 Oct 2013 18:17:26 +0530 Subject: [PATCH 47/80] --BZR-- revision-id: mysql-builder@oracle.com-20131007124726-ee2ju4hycoudox2e property-audit-revid: praveenkumar.hulakund@oracle.com-20131007124726-wbxmdz6dwpil2szx property-branch-nick: clone testament3-sha1: 925740888883c97cd891ffe1857bf6b645b19325 From cc28d4f92cf00405068bda84771e8ad98ec43856 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 8 Oct 2013 18:37:43 +0100 Subject: [PATCH 48/80] BUG#17508351: REDUNDANT CODE IN REPLSEMISYNCMASTER::UPDATESYNCHEADER ReplSemiSyncMaster::updateSyncHeader contains redundant assignments to the local variable sync. This patch removes them. --BZR-- revision-id: luis.soares@oracle.com-20131008173743-ddrqfru3cgpd79x8 property-audit-revid: luis.soares@oracle.com-20131008173743-g6sksg2t8gky0ayq property-branch-nick: mysql-5.5 testament3-sha1: 0fe7e14a448c914efbed3441ace760621f5b7ddd --- plugin/semisync/semisync_master.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 87adbdcae79..6b8bb915445 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -894,10 +894,7 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet, * target, do not request replies from the slave. */ if (!getMasterEnabled() || !is_semi_sync_slave()) - { - sync = false; return 0; - } function_enter(kWho); @@ -905,15 +902,12 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet, /* This is the real check inside the mutex. */ if (!getMasterEnabled()) - { - sync = false; - goto l_end; - } + goto l_end; // sync= false at this point in time if (is_on()) { /* semi-sync is ON */ - sync = false; /* No sync unless a transaction is involved. */ + /* sync= false; No sync unless a transaction is involved. */ if (reply_file_name_inited_) { From 3d79d9d406888bdbe3db24b0d030d6f3c09837c2 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Wed, 9 Oct 2013 11:10:46 +0530 Subject: [PATCH 49/80] Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20131009054046-jv0fw1p1kv29x7si property-audit-revid: sreedhar.sreedhargadda@oracle.com-20131009054046-p6jiw7n26528li5k property-branch-nick: mysql-5.5 testament3-sha1: 79cfae4e287b54f4c438bcf4317b19fae7b2da5e --- CMakeLists.txt | 20 -------------------- extra/yassl/CMakeLists.txt | 5 +++++ extra/yassl/taocrypt/CMakeLists.txt | 5 +++++ libmysql/CMakeLists.txt | 2 ++ libmysql/authentication_win/CMakeLists.txt | 5 +++++ mysys/CMakeLists.txt | 5 +++++ strings/CMakeLists.txt | 5 +++++ vio/CMakeLists.txt | 5 +++++ zlib/CMakeLists.txt | 5 +++++ 9 files changed, 37 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0de56225155..7f46c671f3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -465,26 +465,6 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) - IF(WIN32) - SET(EXTRA_PDB_FILES - ${CMAKE_BINARY_DIR}/libmysql/authentication_win/${CMAKE_BUILD_TYPE}/auth_win_client.pdb - ${CMAKE_BINARY_DIR}/libmysql/${CMAKE_BUILD_TYPE}/clientlib.pdb - ${CMAKE_BINARY_DIR}/strings/${CMAKE_BUILD_TYPE}/strings.pdb - ${CMAKE_BINARY_DIR}/mysys/${CMAKE_BUILD_TYPE}/mysys.pdb - ${CMAKE_BINARY_DIR}/vio/${CMAKE_BUILD_TYPE}/vio.pdb - ${CMAKE_BINARY_DIR}/zlib/${CMAKE_BUILD_TYPE}/zlib.pdb - ${CMAKE_BINARY_DIR}/extra/yassl/${CMAKE_BUILD_TYPE}/yassl.pdb - ${CMAKE_BINARY_DIR}/extra/yassl/taocrypt/${CMAKE_BUILD_TYPE}/taocrypt.pdb - ) - INSTALL(FILES ${EXTRA_PDB_FILES} DESTINATION ${INSTALL_LIBDIR} COMPONENT DebugBinaries) - FOREACH(f ${EXTRA_PDB_FILES}) - STRING(REPLACE "RelWithDebInfo" "Debug" df ${f}) - IF(EXISTS ${df}) - INSTALL(FILES ${df} DESTINATION ${INSTALL_LIBDIR}/debug COMPONENT DebugBinaries) - ENDIF() - ENDFOREACH() - ENDIF() - IF(UNIX) INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) ENDIF() diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt index b8432f06ac6..94a336c53dc 100644 --- a/extra/yassl/CMakeLists.txt +++ b/extra/yassl/CMakeLists.txt @@ -37,4 +37,9 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES}) RESTRICT_SYMBOL_EXPORTS(yassl) +INSTALL_DEBUG_SYMBOLS(yassl) +IF(MSVC) + INSTALL_DEBUG_TARGET(yassl DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt index 10ed614445e..9f1f2a102da 100644 --- a/extra/yassl/taocrypt/CMakeLists.txt +++ b/extra/yassl/taocrypt/CMakeLists.txt @@ -36,3 +36,8 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES}) RESTRICT_SYMBOL_EXPORTS(taocrypt) +INSTALL_DEBUG_SYMBOLS(taocrypt) +IF(MSVC) + INSTALL_DEBUG_TARGET(taocrypt DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 1d7a134aefa..83386d8073a 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -168,8 +168,10 @@ ENDIF() MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development) # Visual Studio users need debug static library for debug projects +INSTALL_DEBUG_SYMBOLS(clientlib) IF(MSVC) INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug) + INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() IF(UNIX) diff --git a/libmysql/authentication_win/CMakeLists.txt b/libmysql/authentication_win/CMakeLists.txt index 80cd14780e6..cd790975b34 100644 --- a/libmysql/authentication_win/CMakeLists.txt +++ b/libmysql/authentication_win/CMakeLists.txt @@ -31,3 +31,8 @@ TARGET_LINK_LIBRARIES(auth_win_client Secur32) # In IDE, group headers in a separate folder. SOURCE_GROUP(Headers REGULAR_EXPRESSION ".*h$") + +INSTALL_DEBUG_SYMBOLS(auth_win_client) +IF(MSVC) + INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 95d3e568be7..648a87d1e95 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -77,3 +77,8 @@ ENDIF() ADD_EXECUTABLE(thr_lock thr_lock.c) TARGET_LINK_LIBRARIES(thr_lock mysys) SET_TARGET_PROPERTIES(thr_lock PROPERTIES COMPILE_FLAGS "-DMAIN") + +INSTALL_DEBUG_SYMBOLS(mysys) +IF(MSVC) + INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 552bf942700..77b093c4fb1 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -31,3 +31,8 @@ ENDIF() # Avoid dependencies on perschema data defined in mysys ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H) ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES}) + +INSTALL_DEBUG_SYMBOLS(strings) +IF(MSVC) + INSTALL_DEBUG_TARGET(strings DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt index e61281a43d8..bf811a0de9b 100644 --- a/vio/CMakeLists.txt +++ b/vio/CMakeLists.txt @@ -20,3 +20,8 @@ ADD_DEFINITIONS(${SSL_DEFINES}) SET(VIO_SOURCES vio.c viosocket.c viossl.c viosslfactories.c) ADD_CONVENIENCE_LIBRARY(vio ${VIO_SOURCES}) TARGET_LINK_LIBRARIES(vio ${LIBSOCKET}) + +INSTALL_DEBUG_SYMBOLS(vio) +IF(MSVC) + INSTALL_DEBUG_TARGET(vio DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt index 68799947e44..bcfacea4b0b 100644 --- a/zlib/CMakeLists.txt +++ b/zlib/CMakeLists.txt @@ -23,3 +23,8 @@ SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio. ADD_CONVENIENCE_LIBRARY(zlib ${ZLIB_SOURCES}) RESTRICT_SYMBOL_EXPORTS(zlib) +INSTALL_DEBUG_SYMBOLS(zlib) +IF(MSVC) + INSTALL_DEBUG_TARGET(zlib DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + From 0b9c77e79407a43cef1d62f09d843407e73e00dd Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Wed, 9 Oct 2013 13:32:31 +0530 Subject: [PATCH 50/80] Bug#17474166 - EXECUTING STATEMENT LIKE 'SHOW ENGINE INNODB' AND 'KILL SESSION' LEAD TO CRASH Analysis: -------- This situation occurs when the connection executes query "show engine innodb status" and this connection is killed by executing statement "kill " by another connection. In function "innodb_show_status", function "stat_print" is called to print the status but return value of function is not checked. After killing connection, if write to connection fails then error is returned and same is set in Diagnostic area. Since FALSE is returned from "innodb_show_status" now, assert to check no error is set in function "set_eof_status" (called from my_eof) is failing. Fix: ---- Changed code to check return value of function "stat_print" in "innodb_show_status". --BZR-- revision-id: praveenkumar.hulakund@oracle.com-20131009080231-wqoquyx9g3lmh0hi property-audit-revid: praveenkumar.hulakund@oracle.com-20131009080231-4ncbuphsoiufgizo property-branch-nick: mysql-5.5 testament3-sha1: 20cfd58a3ece337d2fda7f9238520ee518e2e4a1 --- sql/handler.cc | 6 ++++++ sql/net_serv.cc | 8 +++++++- storage/innobase/handler/ha_innodb.cc | 8 +++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index c3ad1cade99..6307e95a194 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4921,8 +4921,14 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) "", 0, "DISABLED", 8) ? 1 : 0; } else + { + DBUG_EXECUTE_IF("simulate_show_status_failure", + DBUG_SET("+d,simulate_net_write_failure");); result= db_type->show_status && db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0; + DBUG_EXECUTE_IF("simulate_show_status_failure", + DBUG_SET("-d,simulate_net_write_failure");); + } } if (!result) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 1a79679ed7c..8b44c7d443f 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, 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 @@ -370,6 +370,12 @@ my_net_write(NET *net,const uchar *packet,size_t len) MYSQL_NET_WRITE_START(len); + DBUG_EXECUTE_IF("simulate_net_write_failure", { + my_error(ER_NET_ERROR_ON_WRITE, MYF(0)); + return 1; + }; + ); + /* Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH length. The last packet is always a packet that is < MAX_PACKET_LENGTH. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cabea01c95a..7d0a363be69 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9526,6 +9526,7 @@ innodb_show_status( const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; + bool ret_val; DBUG_ENTER("innodb_show_status"); DBUG_ASSERT(hton == innodb_hton_ptr); @@ -9590,12 +9591,13 @@ innodb_show_status( mutex_exit(&srv_monitor_file_mutex); - stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name), - STRING_WITH_LEN(""), str, flen); + ret_val= stat_print(thd, innobase_hton_name, + (uint) strlen(innobase_hton_name), + STRING_WITH_LEN(""), str, flen); my_free(str); - DBUG_RETURN(FALSE); + DBUG_RETURN(ret_val); } /************************************************************************//** From 8e304f9d19de3c38d401cbb61c0f4233ead90148 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Wed, 9 Oct 2013 17:08:45 +0530 Subject: [PATCH 51/80] BUG 17560050 - MYSQL_INSTALL_DB SCRIPT FAILING WITH RESOLVEIP ISSUES. --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20131009113845-an963x1ba7p38rfn property-audit-revid: sreedhar.sreedhargadda@oracle.com-20131009113845-268mcefvewe2lrr5 property-branch-nick: mysql-5.5 testament3-sha1: f39979949d372da64ae525b43b60f4ac18820621 --- scripts/CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index d5a3311d942..16d820e147e 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -198,17 +198,23 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() -IF(NOT WIN32) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) +IF(UNIX) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) + SET(EXT) +ELSE() + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db.pl ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_SCRIPTDIR}) + SET(EXT ".pl") +ENDIF() - INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" - DESTINATION ${DEST} - COMPONENT Server +INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" + DESTINATION ${DEST} + COMPONENT Server ) -ENDIF() SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) From 3a310b7f8d7d97484953f8b485b7cc42e7c099a3 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Wed, 9 Oct 2013 18:42:27 +0530 Subject: [PATCH 52/80] --BZR-- revision-id: mysql-builder@oracle.com-20131009131227-n1so7dih5323orgx property-audit-revid: satya.bodapati@oracle.com-20131009131227-lepddc8gwhe1vfal property-branch-nick: clone testament3-sha1: 9aab06850dd45b733fb95c8a32c9d76041222b32 From 1849374270fd79380bd86844c30446b072d0f01b Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Mon, 14 Oct 2013 15:45:12 +0100 Subject: [PATCH 53/80] WL#7266: Dump-thread additional concurrency tests This worklog aims at testing the two following scenarios: 1) Whenever the mysql_binlog_send method (dump thread) reaches the end of file when reading events from the binlog, before checking if it should wait for more events, there was a test to check if the file being read was still active, i.e, it was the last known binlog. However, it was possible that something was written to the binary log and then a rotation would happen, after EOF was detected and before the check for active was performed. In this case, the end of the binary log would not be read by the dump thread, and this would cause the slave to lose updates. This test verifies that the problem has been fixed. It waits during this window while forcing a rotation in the binlog. 2) Verify dump thread can send events in active file, correctly after encountering an IO error. --BZR-- revision-id: nuno.carvalho@oracle.com-20131014144512-6yqeida5zw3qnn1e property-audit-revid: nuno.carvalho@oracle.com-20131014144512-1uazqapos0y9ydyx property-branch-nick: mysql-5.1 testament3-sha1: 1dd95f87bf0b8bd6fa6f617283188c92d818c68a --- .bzrfileids | Bin 1059307 -> 1059747 bytes .../rpl/r/rpl_dump_events_twice_bug.result | 15 ++++++ .../rpl/r/rpl_lost_events_on_rotate.result | 14 +++++ .../rpl/t/rpl_dump_events_twice_bug.test | 28 ++++++++++ .../rpl/t/rpl_lost_events_on_rotate.test | 51 ++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result create mode 100644 mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result create mode 100644 mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test create mode 100644 mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test diff --git a/.bzrfileids b/.bzrfileids index e6757bb8d558c873ee3c129a216166de75e44e03..da2eaf0cfbdf78f8211bb3178ff620402bb79120 100644 GIT binary patch delta 438 zcmaET*F7M2#)7Pc+y>$3t=N^=Y1Q_E8GN{Zu4$}^Kwu9 zOLIyXiVAY#(G}<#85kNHSQ=Uw8kicHnCKRzm6%joq^DXIX5}8kRzCMdx zQ!+3ozqkZucz#}dQGQ8cNh-48=n4oLe(^WE#Pkmx?CjfbHnWGM`lGuJ;{1}-Vlo}S z@EW_^^bIfBg|^$jWIwCskM2N-58&pbOA~ZIV>HnH8-zL7+j#{zfS41Axqz4(hF7M2#)7Pc+y>$A4YWwUEaZr|3z9-2D+_bYax?Om_f&#Fxa j3P`r!732V7P9Ww2Vs0Sj0b*Vt<^y8>?RNzQj!6OlY=a}X diff --git a/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result new file mode 100644 index 00000000000..8e6c8c122b5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); +[connection master] +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result new file mode 100644 index 00000000000..eee2effccea --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t (i INT); +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; +INSERT INTO t VALUES (1); +INSERT INTO t VALUES (2); +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; +include/diff_tables.inc [master:t,slave:t] +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test new file mode 100644 index 00000000000..de82769010e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test @@ -0,0 +1,28 @@ +# +# Verify dump thread can send events in active file, correctly after +# encountering an IO error. +# +--source include/have_debug.inc +--source include/master-slave.inc + +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); + +--sync_slave_with_master + +--source include/rpl_connection_master.inc +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); + +--sync_slave_with_master +--let $diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +--source include/rpl_connection_master.inc +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test new file mode 100644 index 00000000000..08884ee8e26 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -0,0 +1,51 @@ +# +# Whenever the mysql_binlog_send method (dump thread) reaches the +# end of file when reading events from the binlog, before checking +# if it should wait for more events, there was a test to check if +# the file being read was still active, i.e, it was the last known +# binlog. However, it was possible that something was written to +# the binary log and then a rotation would happen, after EOF was +# detected and before the check for active was performed. In this +# case, the end of the binary log would not be read by the dump +# thread, and this would cause the slave to lose updates. +# +# This test verifies that the problem has been fixed. It waits +# during this window while forcing a rotation in the binlog. +# +--source include/have_debug.inc +--source include/master-slave.inc + +--connection master + +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t (i INT); + +# When reaching the EOF the dump thread will wait before deciding if +# it should move to a new binlong file. +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; + +INSERT INTO t VALUES (1); + +--sleep 1 + +# A insert and a rotate happens before the decision +INSERT INTO t VALUES (2); +FLUSH LOGS; + +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; + +--sync_slave_with_master + +# All the rows should be sent to the slave. +--let $diff_tables=master:t,slave:t +--source include/diff_tables.inc + +##Clean up +--connection master + +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; + +DROP TABLE t; +--source include/rpl_end.inc From 98ffdd716474ea8ae848dd5d18180c303326f445 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Wed, 16 Oct 2013 11:05:20 +0530 Subject: [PATCH 54/80] Fix for Bug 17584523 - LICENSE AND DOCUMENTATION FILES MISSING FROM WINDOWS MSI PACKAGE --BZR-- revision-id: sreedhar.sreedhargadda@oracle.com-20131016053520-g8vpj5mz7pr920bo property-audit-revid: sreedhar.sreedhargadda@oracle.com-20131016053520-atq1xsd1icz50wn5 property-branch-nick: mysql-5.5 testament3-sha1: d2c6b2466c3a2a18048a096171822ff5c634288f --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f46c671f3f..2a85f630d21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,7 +449,6 @@ ADD_SUBDIRECTORY(packaging/solaris) # (see http://public.kitware.com/Bug/view.php?id=11452) SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "") -INCLUDE(CPack) IF(UNIX) INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info) ENDIF() @@ -482,3 +481,5 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") PATTERN "sp-imp-spec.txt" EXCLUDE ) ENDIF() + +INCLUDE(CPack) From f996c98f4d2711201dc99bc48d305505eadc6b35 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Wed, 16 Oct 2013 11:49:00 +0530 Subject: [PATCH 55/80] Bug#17429677:LAST ARGUMENT OF LOAD DATA ...SET ...STATEMENT REPEATED TWICE IN BINLOG Problem: ======= If LOAD DATA ... SET ... is used the last argument of SET is repeated twice in replication binlog. Analysis: ======== LOAD DATA statements are reconstructed once again before they are written to the binary log. When SET clauses are specified as part of LOAD DATA statement, these SET clause user command strings need to be stored in order to rebuild the original user command. During parsing each column and the value in the SET command are stored in two differenet lists. All the values are stored in a string list. When SET expression has more than one value as shown in the following example: SET a = @a, b = CONCAT(@b, '| 123456789'); Parser extracts values in the following manner i.e Item name , value string, actual length of the value of the item with in the string. Item a: Value for a:"= @a, b = CONCAT(@b, '| 123456789') str_length = 4 Item b: Value for b:"= CONCAT(@b, '| 123456789') str_length = 27 During reconstructing the LOAD DATA command the above strings are retrived as it is and appended to the LOAD DATA statement. Hence it becomes as shown below. SET `a`= @a, b = CONCAT(@b, '| 123456789'), `b`= CONCAT(@b, '| 123456789') Fix: === During reconstruction of SET command, retrieve exact item value string rather than reading the entire string. --BZR-- revision-id: sujatha.sivakumar@oracle.com-20131016061900-zom1tjk4iclfv685 property-audit-revid: sujatha.sivakumar@oracle.com-20131016061900-mvvs5qdkr38k49wj property-branch-nick: Bug17429677_mysql-5.5 property-file-info: ld7:file_id64:sp1f-sql_load.cc-19700101030959-hoqlay5we4yslrw23xqedulkejw6a3o57:message43:Added code to extract the exact Item value.4:path15:sql/sql_load.ccee testament3-sha1: 0346658f688020bf88a82307c9743504bc2ee46c --- sql/sql_load.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 2e85cb105b0..b593412c559 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -738,8 +738,16 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, if (n++) pfields.append(", "); append_identifier(thd, &pfields, item->name, strlen(item->name)); + // Extract exact Item value + str->copy(); pfields.append((char *)str->ptr()); + str->free(); } + /* + Clear the SET string list once the SET command is reconstructed + as we donot require the list anymore. + */ + thd->lex->load_set_str_list.empty(); } p= pfields.c_ptr_safe(); From c82f7e3df8e2395d7ca4691adbcb27547575c555 Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Wed, 16 Oct 2013 14:14:44 +0530 Subject: [PATCH 56/80] Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE Description: Fix for bug CVE-2012-5611 (bug 67685) is incomplete. The ACL_KEY_LENGTH-sized buffers in acl_get() and check_grant_db() can be overflown by up to two bytes. That's probably not enough to do anything more serious than crashing mysqld. Analysis: In acl_get() when "copy_length" is calculated it just adding the variable lengths. But when we are using them with strmov() we are adding +1 to each. This will lead to a three byte buffer overflow (i.e two +1's at strmov() and one byte for the null added by strmov() function). Similarly it happens for check_grant_db() function as well. Fix: We need to add "+2" to "copy_length" in acl_get() and "+1" to "copy_length" in check_grant_db(). --BZR-- revision-id: venkata.sidagam@oracle.com-20131016084444-q6y9evhhfjrm3451 property-audit-revid: venkata.sidagam@oracle.com-20131016084444-3wfrq06aaxsy4fco property-branch-nick: 5.1 testament3-sha1: 40e506875c237f08c01071eb3863a8ce15b34ab5 --- sql/sql_acl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2458a7120da..cf150439391 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1363,7 +1363,8 @@ ulong acl_get(const char *host, const char *ip, copy_length= (size_t) (strlen(ip ? ip : "") + strlen(user ? user : "") + - strlen(db ? db : "")); + strlen(db ? db : "")) + 2; /* Added 2 at the end to avoid + buffer overflow at strmov()*/ /* Make sure that strmov() operations do not result in buffer overflow. */ @@ -4353,7 +4354,8 @@ bool check_grant_db(THD *thd,const char *db) size_t copy_length; copy_length= (size_t) (strlen(sctx->priv_user ? sctx->priv_user : "") + - strlen(db ? db : "")); + strlen(db ? db : "")) + 1; /* Added 1 at the end to avoid + buffer overflow at strmov()*/ /* Make sure that strmov() operations do not result in buffer overflow. From 4a9abe84c592286fee5e49c640aeed7e03d72272 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 16 Oct 2013 22:12:23 +0530 Subject: [PATCH 57/80] Bug#17234370 LAST_INSERT_ID IS REPLICATED INCORRECTLY IF REPLICATION FILTERS ARE USED. Problem: When Filtered-slave applies Int_var_log_event and when it tries to write the event to its own binlog, LAST_INSERT_ID value is written wrongly. Analysis: THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt is a variable which is set when LAST_INSERT_ID() is used by a statement. If it is set, first_successful_insert_id_in_ prev_stmt_for_binlog will be stored in the statement-based binlog. This variable is CUMULATIVE along the execution of a stored function or trigger: if one substatement sets it to 1 it will stay 1 until the function/trigger ends, thus making sure that first_successful_insert_id_in_ prev_stmt_for_binlog does not change anymore and is propagated to the caller for binlogging. This is achieved using the following code if(!stmt_depends_on_first_successful_insert_id_in_prev_stmt) { /* It's the first time we read it */ first_successful_insert_id_in_prev_stmt_for_binlog= first_successful_insert_id_in_prev_stmt; stmt_depends_on_first_successful_insert_id_in_prev_stmt= 1; } Slave server, after receiving Int_var_log_event event from master, it is setting stmt_depends_on_first_successful_insert_id_in_prev_stmt to true(*which is wrong*) and not setting first_successful_insert_id_in_prev_stmt_for_binlog. Because of this problem, when the actual DML statement with LAST_INSERT_ID() is parsed by slave SQL thread, first_successful_insert_id_in_prev_stmt_for_binlog is not set. Hence the value zero (default value) is written to slave's binlog. Why only *Filtered slave* is effected when the code is in common place: ------------------------------------------------------- In Query_log_event::do_apply_event, THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt is reset to zero at the end of the function. In case of normal slave (No Filters), this variable will be reset. In Filtered slave, Slave SQL thread defers all IRU events's execution until IRU's Query_log event is received. Once it receives Query_log_event it executes all pending IRU events and then it executes Query_log_event. Hence the variable is not getting reset to 0, causing this bug. Fix: As described above, the root cause was setting THD::stmt_depends_on_first_successful_insert_id_in_prev_stmt when Int_var_log_event was executed by a SQL thread. Hence removing the problematic line from the code. --BZR-- revision-id: venkatesh.duggirala@oracle.com-20131016164223-i5y0wunc0zhakmn9 property-audit-revid: venkatesh.duggirala@oracle.com-20131016164223-df4y6rrykysw48tq property-branch-nick: mysql-5.1 testament3-sha1: 54e8ca47bc0d765ab3cc6909b5cfb5ec1bb91f6f --- sql/log_event.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index d7e912cfe1a..7a557c42154 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5397,7 +5397,6 @@ int Intvar_log_event::do_apply_event(Relay_log_info const *rli) switch (type) { case LAST_INSERT_ID_EVENT: - thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 1; thd->first_successful_insert_id_in_prev_stmt= val; break; case INSERT_ID_EVENT: From 7b5f44e63d6c175166fdcd352d82d32801a69ff0 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Thu, 17 Oct 2013 17:59:45 +0530 Subject: [PATCH 58/80] --BZR-- revision-id: mysql-builder@oracle.com-20131017122945-6qv1fvab0spm2ev3 property-audit-revid: praveenkumar.hulakund@oracle.com-20131017122945-xblz1iq6lr6u0e6l property-branch-nick: clone testament3-sha1: ab0abd1dcd06a963d61f4159bbc974a6fd78ac60 From bff991f05e082ef075b580ed70a53d6abf70b6e0 Mon Sep 17 00:00:00 2001 From: Anil Toshniwal Date: Thu, 17 Oct 2013 18:09:04 +0530 Subject: [PATCH 59/80] Bug#17513737 INTRODUCE CHECK TABLE...QUICK --Implemented CHECK TABLE...QUICK. Introduce CHECK TABLE...QUICK that would skip the btr_validate_index() and btr_search_validate() call, and count the no. of records in each index. Approved by Marko and Kevin. (rb#3567). --BZR-- revision-id: anil.toshniwal@oracle.com-20131017123904-h9ei9ss3qqd3x2sl property-audit-revid: anil.toshniwal@oracle.com-20131017123904-6hdhg8m22fb70j1n property-branch-nick: mysql-5.5 testament3-sha1: a72111a2d62f4625a1bdafd7119354949c8992cd --- .bzrfileids | Bin 1050109 -> 1050181 bytes include/my_check_opt.h | 69 ++++++++++++++++++++++++++ include/myisam.h | 47 +----------------- storage/innobase/dict/dict0dict.c | 2 + storage/innobase/handler/ha_innodb.cc | 68 ++++++++++++++----------- storage/innobase/include/btr0sea.h | 2 - 6 files changed, 112 insertions(+), 76 deletions(-) create mode 100644 include/my_check_opt.h diff --git a/.bzrfileids b/.bzrfileids index 99e5c88b5ad246354bea27d4a8977e55c12e5ea9..697da9b4d153bfc05d7e8d1cc2361ff761980a85 100644 GIT binary patch delta 133 zcmey{?QpcmVFTA5>x|Uo?D+hG61@zD+{*Z51XtI{z|h#xz|h>#(7?#hR5!DvysEs+ zysV%!BP-W3)lk>4`S0%bzq=WMm - +#include /* Limit max keys according to HA_MAX_POSSIBLE_KEY */ @@ -311,51 +311,6 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def); #define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */ #define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */ -/* - Definitions needed for myisamchk.c - - Entries marked as "QQ to be removed" are NOT used to - pass check/repair options to mi_check.c. They are used - internally by myisamchk.c or/and ha_myisam.cc and should NOT - be stored together with other flags. They should be removed - from the following list to make addition of new flags possible. -*/ - -#define T_AUTO_INC 1 -#define T_AUTO_REPAIR 2 /* QQ to be removed */ -#define T_BACKUP_DATA 4 -#define T_CALC_CHECKSUM 8 -#define T_CHECK 16 /* QQ to be removed */ -#define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */ -#define T_CREATE_MISSING_KEYS 64 -#define T_DESCRIPT 128 -#define T_DONT_CHECK_CHECKSUM 256 -#define T_EXTEND 512 -#define T_FAST (1L << 10) /* QQ to be removed */ -#define T_FORCE_CREATE (1L << 11) /* QQ to be removed */ -#define T_FORCE_UNIQUENESS (1L << 12) -#define T_INFO (1L << 13) -#define T_MEDIUM (1L << 14) -#define T_QUICK (1L << 15) /* QQ to be removed */ -#define T_READONLY (1L << 16) /* QQ to be removed */ -#define T_REP (1L << 17) -#define T_REP_BY_SORT (1L << 18) /* QQ to be removed */ -#define T_REP_PARALLEL (1L << 19) /* QQ to be removed */ -#define T_RETRY_WITHOUT_QUICK (1L << 20) -#define T_SAFE_REPAIR (1L << 21) -#define T_SILENT (1L << 22) -#define T_SORT_INDEX (1L << 23) /* QQ to be removed */ -#define T_SORT_RECORDS (1L << 24) /* QQ to be removed */ -#define T_STATISTICS (1L << 25) -#define T_UNPACK (1L << 26) -#define T_UPDATE_STATE (1L << 27) -#define T_VERBOSE (1L << 28) -#define T_VERY_SILENT (1L << 29) -#define T_WAIT_FOREVER (1L << 30) -#define T_WRITE_LOOP ((ulong) 1L << 31) - -#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL) - /* Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed to mi_check.c follows: diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 1fe7000f718..546794be26c 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -4485,6 +4485,8 @@ dict_update_statistics( dict_index_t* index; ulint sum_of_index_sizes = 0; + DBUG_EXECUTE_IF("skip_innodb_statistics", return;); + if (table->ibd_file_missing) { ut_print_timestamp(stderr); fprintf(stderr, diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 7d0a363be69..546b0b8905b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -53,6 +53,7 @@ this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include /** @file ha_innodb.cc */ @@ -8466,8 +8467,7 @@ int ha_innobase::check( /*===============*/ THD* thd, /*!< in: user thread handle */ - HA_CHECK_OPT* check_opt) /*!< in: check options, currently - ignored */ + HA_CHECK_OPT* check_opt) /*!< in: check options */ { dict_index_t* index; ulint n_rows; @@ -8524,11 +8524,6 @@ ha_innobase::check( do additional check */ prebuilt->table->corrupted = FALSE; - /* Enlarge the fatal lock wait timeout during CHECK TABLE. */ - mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION; - mutex_exit(&kernel_mutex); - for (index = dict_table_get_first_index(prebuilt->table); index != NULL; index = dict_table_get_next_index(index)) { @@ -8541,20 +8536,41 @@ ha_innobase::check( /* If this is an index being created, break */ if (*index->name == TEMP_INDEX_PREFIX) { - break; - } else if (!btr_validate_index(index, prebuilt->trx)) { - is_ok = FALSE; + continue; + } + if (!(check_opt->flags & T_QUICK)) { + /* Enlarge the fatal lock wait timeout during + CHECK TABLE. */ + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold += + SRV_SEMAPHORE_WAIT_EXTENSION; + mutex_exit(&kernel_mutex); + + ibool valid = TRUE; + valid = btr_validate_index(index, prebuilt->trx); + + /* Restore the fatal lock wait timeout after + CHECK TABLE. */ + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold -= + SRV_SEMAPHORE_WAIT_EXTENSION; + mutex_exit(&kernel_mutex); + + if (!valid) { + is_ok = FALSE; - innobase_format_name( - index_name, sizeof index_name, - prebuilt->index->name, TRUE); + innobase_format_name( + index_name, sizeof index_name, + index->name, TRUE); + push_warning_printf(thd, + MYSQL_ERROR::WARN_LEVEL_WARN, + ER_NOT_KEYFILE, + "InnoDB: The B-tree of" + " index %s is corrupted.", + index_name); - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_NOT_KEYFILE, - "InnoDB: The B-tree of" - " index %s is corrupted.", - index_name); - continue; + continue; + } } /* Instead of invoking change_active_index(), set up @@ -8658,21 +8674,17 @@ ha_innobase::check( /* Restore the original isolation level */ prebuilt->trx->isolation_level = old_isolation_level; - /* We validate also the whole adaptive hash index for all tables - at every CHECK TABLE */ +#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG + /* We validate the whole adaptive hash index for all tables + at every CHECK TABLE only when QUICK flag is not present. */ - if (!btr_search_validate()) { + if (!(check_opt->flags & T_QUICK) && !btr_search_validate()) { push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_NOT_KEYFILE, "InnoDB: The adaptive hash index is corrupted."); is_ok = FALSE; } - - /* Restore the fatal lock wait timeout after CHECK TABLE. */ - mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION; - mutex_exit(&kernel_mutex); - +#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */ prebuilt->trx->op_info = ""; if (thd_killed(user_thd)) { my_error(ER_QUERY_INTERRUPTED, MYF(0)); diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index 0ee68101ee7..081dc88435e 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -188,8 +188,6 @@ UNIV_INTERN ibool btr_search_validate(void); /*======================*/ -#else -# define btr_search_validate() TRUE #endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */ /** The search info struct in an index */ From 451c35769f5b4fe0186a478b87aef429ba24f64f Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 17 Oct 2013 17:48:26 +0100 Subject: [PATCH 60/80] BUG#17460821: ASSERTION ERROR WHEN STOPPING SLAVE AFTER SEMI-SYNC ON MASTER IS DISABLED The assertion happens when: (i) the master and slave are configured to use the semisync plugin; (ii) the DBA disables semisync on the master; (iii) and he also unsets the option to wait for slaves ACK even if the semisync slave count reaches 0 during the waiting period. This combination of factors makes the server run into an assertion as soon as the last semisync slave disconnects and its dump thread exits. The root of the problem is the fact that when the dump thread disconnects and calls the observer hook transmit_stop, which ends up calling ReplSemiSyncMaster::remove_slave, there is no check whether the master has already disabled semisync or not. If it has, the then a second call to the switch_off member function must be avoided. The quick fix is to avoid calling switch_off if the DBA has disabled the semisync plugin interactively on the master. Also, the switch_off member function should only be called if the plugin has not been switched off already. This is basically the pattern throughout the rest of the semisync plugin and no other calls seem vulnerable to similar crashes/assertions. (This a backport of the patch to 5.5, which is also vulnerable.) --BZR-- revision-id: luis.soares@oracle.com-20131017164826-dt6yui4c5i2rwqle property-audit-revid: luis.soares@oracle.com-20131017164826-vtiy2bdpuh2qiyyz property-branch-nick: mysql-5.5 testament3-sha1: 3ffa27786686e4eceaafa45bc2b8a99fe7f59a3a --- plugin/semisync/semisync_master.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 6b8bb915445..2e40fc8b5c5 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -482,13 +482,17 @@ void ReplSemiSyncMaster::remove_slave() lock(); rpl_semi_sync_master_clients--; - /* If user has chosen not to wait if no semi-sync slave available - and the last semi-sync slave exits, turn off semi-sync on master - immediately. - */ - if (!rpl_semi_sync_master_wait_no_slave && - rpl_semi_sync_master_clients == 0) - switch_off(); + /* Only switch off if semi-sync is enabled and is on */ + if (getMasterEnabled() && is_on()) + { + /* If user has chosen not to wait if no semi-sync slave available + and the last semi-sync slave exits, turn off semi-sync on master + immediately. + */ + if (!rpl_semi_sync_master_wait_no_slave && + rpl_semi_sync_master_clients == 0) + switch_off(); + } unlock(); } From 70bc82802c1648643d2f9256a86e3ec990196382 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Fri, 18 Oct 2013 12:26:28 +0530 Subject: [PATCH 61/80] Bug#17559867 AFTER REBUILDING,A MYISAM PARTITION ENDS UP AS A INNODB PARTITTION. PROBLEM ------- The correct engine_type was not being set during rebuild of the partition due to which the handler was always created with the default engine, which is innodb for 5.5+ ,therefore even if the table was myisam, after rebuilding the partitions ended up as innodb partitions. FIX --- Set the correct engine type during rebuild. [Approved by mattiasj #rb3599] --BZR-- revision-id: aditya.a@oracle.com-20131018065628-eluafi0mohmgbx5m property-audit-revid: aditya.a@oracle.com-20131018065628-5jwbl2oy3qh5p1rk property-branch-nick: mysql-5.1 testament3-sha1: aa6d99348de0401ad6901149e8e8a28f56f0347f --- sql/sql_partition.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a3ad138043c..aa367abe22a 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4725,6 +4725,8 @@ that are reorganised. { uint no_parts_found; uint no_parts_opt= alter_info->partition_names.elements; + set_engine_all_partitions(tab_part_info, + tab_part_info->default_engine_type); no_parts_found= set_part_state(alter_info, tab_part_info, PART_CHANGED); if (no_parts_found != no_parts_opt && (!(alter_info->flags & ALTER_ALL_PARTITION))) From 967581648fb755500401fc0d974f4402993881e2 Mon Sep 17 00:00:00 2001 From: Anirudh Mangipudi Date: Fri, 18 Oct 2013 17:14:39 +0530 Subject: [PATCH 62/80] Bug #17357535 BACKPORT BUG#16241992 TO 5.5 Problem: COM_CHANGE_USER allows brute-force attempts to crack a password at a very high rate as it does not cause any significant delay after a login attempt has failed. This issue was reproduced using John-The-Ripper password cracking tool through which about 5000 passwords per second could be attempted. Solution: The non-GA version's solution was to disconnect the connection when a login attempt failed. Now since our aim to to reduce the rate at which passwords are tested, we introduced a sleep(1) after every login attempt failed. This significantly increased the delay with which the password was cracked. --BZR-- revision-id: anirudh.mangipudi@oracle.com-20131018114439-xmt48g6z1jmquggt property-audit-revid: anirudh.mangipudi@oracle.com-20131018114439-l67li21nkj6lulzz property-branch-nick: 5.5 testament3-sha1: f4ae8ccf4c258e906329fb04c18ce02c5c52cc4f --- sql/sql_parse.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f787fe4058f..6e2b422bd44 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -971,6 +971,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->variables.collation_connection= save_collation_connection; thd->variables.character_set_results= save_character_set_results; thd->update_charset(); + sleep(1); } else { From 042d1b7f0535e1c31ccd4d22271ca702b55cf6d1 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 19:25:59 +0200 Subject: [PATCH 63/80] Bug#17565888: UP TO 75% INCREASE IN DBT3 QUERY (Q7) EXECUTION TIME Regression from bug#14621190 due to disabled optimistic restoration of cursor, which required full key lookup instead of verifying if previously positioned btree cursor could be reused. Fixed by enable optimistic restore and adjust cursor afterward. rb#3324 approved by Marko. --BZR-- revision-id: mattias.jonsson@oracle.com-20131018172559-cbgfzdev3q4oymd2 property-audit-revid: mattias.jonsson@oracle.com-20131018172559-8fq6bmg3asho9rp0 property-branch-nick: test-5.5 testament3-sha1: 56112513fb0da8c73523902e2b92e81ed183d064 --- storage/innobase/btr/btr0pcur.c | 44 ++++++-------- storage/innobase/include/btr0pcur.h | 44 ++++++++------ storage/innobase/include/btr0pcur.ic | 7 ++- storage/innobase/row/row0sel.c | 91 +++++++++++++++++----------- 4 files changed, 102 insertions(+), 84 deletions(-) diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c index fbedc1e7d04..d8f43a9ae75 100644 --- a/storage/innobase/btr/btr0pcur.c +++ b/storage/innobase/btr/btr0pcur.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, 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 @@ -110,7 +110,7 @@ btr_pcur_store_position( page_t* page; ulint offs; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); block = btr_pcur_get_block(cursor); @@ -235,21 +235,12 @@ btr_pcur_restore_position_func( ut_ad(mtr); ut_ad(mtr->state == MTR_ACTIVE); + ut_ad(cursor->old_stored == BTR_PCUR_OLD_STORED); + ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor)); - if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED) - || UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED - && cursor->pos_state != BTR_PCUR_IS_POSITIONED)) { - ut_print_buf(stderr, cursor, sizeof(btr_pcur_t)); - putc('\n', stderr); - if (cursor->trx_if_known) { - trx_print(stderr, cursor->trx_if_known, 0); - } - - ut_error; - } - if (UNIV_UNLIKELY (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE || cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) { @@ -273,29 +264,26 @@ btr_pcur_restore_position_func( if (UNIV_LIKELY(latch_mode == BTR_SEARCH_LEAF) || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) { - /* Try optimistic restoration if cursor is expected to be - positioned on the same btr record as before (BTR_PCUR_ON). */ + /* Try optimistic restoration. */ - if (cursor->rel_pos == BTR_PCUR_ON - && buf_page_optimistic_get( - latch_mode, - cursor->block_when_stored, - cursor->modify_clock, - file, line, mtr)) { - cursor->pos_state = BTR_PCUR_IS_POSITIONED; + if (buf_page_optimistic_get(latch_mode, + cursor->block_when_stored, + cursor->modify_clock, + file, line, mtr)) { buf_block_dbg_add_level( btr_pcur_get_block(cursor), dict_index_is_ibuf(index) ? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE); - { + if (cursor->rel_pos == BTR_PCUR_ON) { #ifdef UNIV_DEBUG const rec_t* rec; const ulint* offsets1; const ulint* offsets2; #endif /* UNIV_DEBUG */ cursor->latch_mode = latch_mode; + cursor->pos_state = BTR_PCUR_IS_POSITIONED; #ifdef UNIV_DEBUG rec = btr_pcur_get_rec(cursor); @@ -314,6 +302,11 @@ btr_pcur_restore_position_func( #endif /* UNIV_DEBUG */ return(TRUE); } + /* This is the same record as stored, + may need to be adjusted for BTR_PCUR_BEFORE/AFTER, + depending on search mode and direction. */ + cursor->pos_state = BTR_PCUR_IS_POSITIONED_OPTIMISTIC; + return(FALSE); } } @@ -414,7 +407,7 @@ btr_pcur_move_to_next_page( buf_block_t* next_block; page_t* next_page; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(btr_pcur_is_after_last_on_page(cursor)); @@ -469,7 +462,6 @@ btr_pcur_move_backward_from_page( ulint latch_mode; ulint latch_mode2; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(btr_pcur_is_before_first_on_page(cursor)); ut_ad(!btr_pcur_is_before_first_in_tree(cursor, mtr)); diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index 4312f73ca4a..d9ce02283d7 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, 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 @@ -447,6 +447,27 @@ btr_pcur_move_to_prev_on_page( /*==========================*/ btr_pcur_t* cursor);/*!< in/out: persistent cursor */ +/** Position state of persistent B-tree cursor. */ +enum pcur_pos_t { + /** The persistent cursor is not positioned. */ + BTR_PCUR_NOT_POSITIONED = 0, + /** The persistent cursor was previously positioned. + TODO: currently, the state can be BTR_PCUR_IS_POSITIONED, + though it really should be BTR_PCUR_WAS_POSITIONED, + because we have no obligation to commit the cursor with + mtr; similarly latch_mode may be out of date. This can + lead to problems if btr_pcur is not used the right way; + all current code should be ok. */ + BTR_PCUR_WAS_POSITIONED, + /** The persistent cursor is positioned by optimistic get to the same + record as it was positioned at. Not used for rel_pos == BTR_PCUR_ON. + It may need adjustment depending on previous/current search direction + and rel_pos. */ + BTR_PCUR_IS_POSITIONED_OPTIMISTIC, + /** The persistent cursor is positioned by index search. + Or optimistic get for rel_pos == BTR_PCUR_ON. */ + BTR_PCUR_IS_POSITIONED +}; /* The persistent B-tree cursor structure. This is used mainly for SQL selects, updates, and deletes. */ @@ -480,10 +501,8 @@ struct btr_pcur_struct{ ib_uint64_t modify_clock; /*!< the modify clock value of the buffer block when the cursor position was stored */ - ulint pos_state; /*!< see TODO note below! - BTR_PCUR_IS_POSITIONED, - BTR_PCUR_WAS_POSITIONED, - BTR_PCUR_NOT_POSITIONED */ + enum pcur_pos_t pos_state; /*!< btr_pcur_store_position() and + btr_pcur_restore_position() state. */ ulint search_mode; /*!< PAGE_CUR_G, ... */ trx_t* trx_if_known; /*!< the transaction, if we know it; otherwise this field is not defined; @@ -499,21 +518,6 @@ struct btr_pcur_struct{ is not NULL */ }; -#define BTR_PCUR_IS_POSITIONED 1997660512 /* TODO: currently, the state - can be BTR_PCUR_IS_POSITIONED, - though it really should be - BTR_PCUR_WAS_POSITIONED, - because we have no obligation - to commit the cursor with - mtr; similarly latch_mode may - be out of date. This can - lead to problems if btr_pcur - is not used the right way; - all current code should be - ok. */ -#define BTR_PCUR_WAS_POSITIONED 1187549791 -#define BTR_PCUR_NOT_POSITIONED 1328997689 - #define BTR_PCUR_OLD_STORED 908467085 #define BTR_PCUR_OLD_NOT_STORED 122766467 diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 696dfc728dc..5eb8ed0f32d 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, 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 @@ -309,7 +309,8 @@ btr_pcur_move_to_next_user_rec( function may release the page latch */ mtr_t* mtr) /*!< in: mtr */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; loop: @@ -379,7 +380,7 @@ btr_pcur_commit_specify_mtr( btr_pcur_t* pcur, /*!< in: persistent cursor */ mtr_t* mtr) /*!< in: mtr to commit */ { - ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); pcur->latch_mode = BTR_NO_LATCHES; diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 28da1f69e8a..c8e293080c1 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3095,55 +3095,76 @@ sel_restore_position_for_mysql( mtr_t* mtr) /*!< in: mtr; CAUTION: may commit mtr temporarily! */ { - ibool success; - ulint relative_position; - - relative_position = pcur->rel_pos; + ibool success; success = btr_pcur_restore_position(latch_mode, pcur, mtr); *same_user_rec = success; - if (relative_position == BTR_PCUR_ON) { - if (success) { - return(FALSE); - } - - if (moves_up) { - btr_pcur_move_to_next(pcur, mtr); - } - - return(TRUE); + ut_ad(!success || pcur->rel_pos == BTR_PCUR_ON); +#ifdef UNIV_DEBUG + if (pcur->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC) { + ut_ad(pcur->rel_pos == BTR_PCUR_BEFORE + || pcur->rel_pos == BTR_PCUR_AFTER); + } else { + ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); } +#endif - /* success can only be TRUE for BTR_PCUR_ON! */ - ut_ad(!success); - - /* BTR_PCUR_BEFORE -> the position is now set to the record before - pcur->old_rec. - BTR_PCUR_AFTER-> positioned to record after pcur->old_rec. */ - - if (relative_position == BTR_PCUR_AFTER - || relative_position == BTR_PCUR_AFTER_LAST_IN_TREE) { + /* The position may need be adjusted for rel_pos and moves_up. */ - if (moves_up) { + switch (pcur->rel_pos) { + case BTR_PCUR_ON: + if (!success && moves_up) { +next: + btr_pcur_move_to_next(pcur, mtr); return(TRUE); } - - if (btr_pcur_is_on_user_rec(pcur)) { + return(!success); + case BTR_PCUR_AFTER_LAST_IN_TREE: + case BTR_PCUR_BEFORE_FIRST_IN_TREE: + return(TRUE); + case BTR_PCUR_AFTER: + /* positioned to record after pcur->old_rec. */ + pcur->pos_state = BTR_PCUR_IS_POSITIONED; +prev: + if (btr_pcur_is_on_user_rec(pcur) && !moves_up) { btr_pcur_move_to_prev(pcur, mtr); } - return(TRUE); + case BTR_PCUR_BEFORE: + /* For non optimistic restoration: + The position is now set to the record before pcur->old_rec. + + For optimistic restoration: + The position also needs to take the previous search_mode into + consideration. */ + + switch (pcur->pos_state) { + case BTR_PCUR_IS_POSITIONED_OPTIMISTIC: + pcur->pos_state = BTR_PCUR_IS_POSITIONED; + if (pcur->search_mode == PAGE_CUR_GE) { + /* Positioned during Greater or Equal search + with BTR_PCUR_BEFORE. Optimistic restore to + the same record. If scanning for lower then + we must move to previous record. + This can happen with: + HANDLER READ idx a = (const); + HANDLER READ idx PREV; */ + goto prev; + } + return(TRUE); + case BTR_PCUR_IS_POSITIONED: + if (moves_up && btr_pcur_is_on_user_rec(pcur)) { + goto next; + } + return(TRUE); + case BTR_PCUR_WAS_POSITIONED: + case BTR_PCUR_NOT_POSITIONED: + break; + } } - - ut_ad(relative_position == BTR_PCUR_BEFORE - || relative_position == BTR_PCUR_BEFORE_FIRST_IN_TREE); - - if (moves_up && btr_pcur_is_on_user_rec(pcur)) { - btr_pcur_move_to_next(pcur, mtr); - } - + ut_ad(0); return(TRUE); } From fea881e2560366e47591944b779422c9e035c216 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 23:39:15 +0200 Subject: [PATCH 64/80] post-push fix for bug17565888. Too restrictive assertion, can fail during purge --BZR-- revision-id: mattias.jonsson@oracle.com-20131018213915-7o7mwy6zp4zh4fm4 property-audit-revid: mattias.jonsson@oracle.com-20131018213915-9trdd16e5zxaxa96 property-branch-nick: test-5.5 testament3-sha1: 200a120d3853a53284708aa2340dec4c31000b61 --- storage/innobase/include/btr0pcur.ic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 5eb8ed0f32d..f5880e0564a 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -164,7 +164,8 @@ btr_pcur_is_after_last_on_page( /*===========================*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); From 4deac1935bc9664e13cd2ad755c4123b7f70981c Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Oct 2013 23:49:35 +0200 Subject: [PATCH 65/80] post-push fix for bug17565888. Too restrictive assertion, failing during purge --BZR-- revision-id: mattias.jonsson@oracle.com-20131018214935-rpw4lfbovogiy0bf property-audit-revid: mattias.jonsson@oracle.com-20131018214935-xtredzqp5ncwf9zp property-branch-nick: test-5.5 testament3-sha1: d6960c67a15582fa80bd6aa838e3b9de8e0b2df9 --- storage/innobase/include/btr0pcur.ic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index f5880e0564a..db3145132af 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -91,7 +91,8 @@ btr_pcur_get_block( /*===============*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); return(btr_cur_get_block(btr_pcur_get_btr_cur(cursor))); } From ae1adec0f7e96256d5ea9373a4cb8f0f3a3b6be9 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Sat, 19 Oct 2013 15:29:51 +0200 Subject: [PATCH 66/80] post-push fix for bug17565888. --BZR-- revision-id: mattias.jonsson@oracle.com-20131019132951-3ah7cc1jcb32bu98 property-audit-revid: mattias.jonsson@oracle.com-20131019132951-lnsef8ppxub02md0 property-branch-nick: test-5.5 testament3-sha1: c73610db8fe34c68aba071061a99d0d3b10ecf72 --- storage/innobase/btr/btr0pcur.c | 2 +- storage/innobase/include/btr0pcur.ic | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c index d8f43a9ae75..ea187305656 100644 --- a/storage/innobase/btr/btr0pcur.c +++ b/storage/innobase/btr/btr0pcur.c @@ -270,6 +270,7 @@ btr_pcur_restore_position_func( cursor->block_when_stored, cursor->modify_clock, file, line, mtr)) { + cursor->pos_state = BTR_PCUR_IS_POSITIONED; buf_block_dbg_add_level( btr_pcur_get_block(cursor), @@ -283,7 +284,6 @@ btr_pcur_restore_position_func( const ulint* offsets2; #endif /* UNIV_DEBUG */ cursor->latch_mode = latch_mode; - cursor->pos_state = BTR_PCUR_IS_POSITIONED; #ifdef UNIV_DEBUG rec = btr_pcur_get_rec(cursor); diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index db3145132af..647e8d0cde9 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -91,8 +91,7 @@ btr_pcur_get_block( /*===============*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); return(btr_cur_get_block(btr_pcur_get_btr_cur(cursor))); } @@ -165,8 +164,7 @@ btr_pcur_is_after_last_on_page( /*===========================*/ const btr_pcur_t* cursor) /*!< in: persistent cursor */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); return(page_cur_is_after_last(btr_pcur_get_page_cur(cursor))); @@ -311,8 +309,7 @@ btr_pcur_move_to_next_user_rec( function may release the page latch */ mtr_t* mtr) /*!< in: mtr */ { - ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC - || cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; loop: From 02de483170a8e6e7c0bab648fbbc34936eb41d8d Mon Sep 17 00:00:00 2001 From: Aditya A Date: Mon, 21 Oct 2013 12:07:02 +0530 Subject: [PATCH 67/80] Bug #16051817 GOT ERROR 124 FROM STORAGE ENGINE ON DELETE FROM A PARTITIONED TABLE PROBLEM ------- The user first disables all the non unique indexes in the table and then rebuilds one partition. During rebuild the indexes on that particular partition are enabled. Now when we give a query the optimizer is unaware that on one partition indexes are enabled and if the optimizer selects that index,myisam thinks that the index is not active and gives an error. FIX --- Before rebuilding a partition check whether non unique indexes are disabled on the partitons. If they are disabled then after rebuild disable the index on the partition. [Approved by Mattiasj #rb3469] --BZR-- revision-id: aditya.a@oracle.com-20131021063702-ak3uppt7h8a0czun property-audit-revid: aditya.a@oracle.com-20131021063702-qcg06a9pxy9j1q9x property-branch-nick: mysql-5.5 testament3-sha1: b0fb3981fbfd520b8719056b062f956b2c3fd33f --- sql/ha_partition.cc | 23 ++++++++++++++++++++--- sql/ha_partition.h | 3 ++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index c3f2af27282..507f202e349 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1337,7 +1337,8 @@ bool ha_partition::is_crashed() const int ha_partition::prepare_new_partition(TABLE *tbl, HA_CREATE_INFO *create_info, handler *file, const char *part_name, - partition_element *p_elem) + partition_element *p_elem, + uint disable_non_uniq_indexes) { int error; DBUG_ENTER("prepare_new_partition"); @@ -1362,6 +1363,7 @@ int ha_partition::prepare_new_partition(TABLE *tbl, if ((error= file->ha_open(tbl, part_name, m_mode, m_open_test_lock))) goto error_open; DBUG_PRINT("info", ("partition %s opened", part_name)); + /* Note: if you plan to add another call that may return failure, better to do it before external_lock() as cleanup_new_partition() @@ -1372,6 +1374,9 @@ int ha_partition::prepare_new_partition(TABLE *tbl, goto error_external_lock; DBUG_PRINT("info", ("partition %s external locked", part_name)); + if (disable_non_uniq_indexes) + file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE); + DBUG_RETURN(0); error_external_lock: (void) file->close(); @@ -1649,6 +1654,14 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, on them to prepare them for copy phase and also for later close calls */ + + /* + Before creating new partitions check whether indexes are disabled + in the partitions. + */ + + uint disable_non_uniq_indexes = indexes_are_disabled(); + i= 0; part_count= 0; part_it.rewind(); @@ -1683,11 +1696,13 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, if ((error= prepare_new_partition(table, create_info, new_file_array[part], (const char *)part_name_buff, - sub_elem))) + sub_elem, + disable_non_uniq_indexes))) { cleanup_new_partition(part_count); DBUG_RETURN(error); } + m_added_file[part_count++]= new_file_array[part]; } while (++j < num_subparts); } @@ -1700,11 +1715,13 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, if ((error= prepare_new_partition(table, create_info, new_file_array[i], (const char *)part_name_buff, - part_elem))) + part_elem, + disable_non_uniq_indexes))) { cleanup_new_partition(part_count); DBUG_RETURN(error); } + m_added_file[part_count++]= new_file_array[i]; } } diff --git a/sql/ha_partition.h b/sql/ha_partition.h index eef93e056ef..153e610d86f 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -270,7 +270,8 @@ class ha_partition :public handler void cleanup_new_partition(uint part_count); int prepare_new_partition(TABLE *table, HA_CREATE_INFO *create_info, handler *file, const char *part_name, - partition_element *p_elem); + partition_element *p_elem, + uint disable_non_uniq_indexes); /* delete_table, rename_table and create uses very similar logic which is packed into this routine. From 0c90b9538d3cff123b8cd2b3bb8fd175c6c95ab0 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 21 Oct 2013 13:14:46 +0200 Subject: [PATCH 68/80] Bug#17632386: WITH_ASAN CONFLICTS WITH -WL,--NO-UNDEFINED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Wl,--no-undefined (=-z defs) gives linking errors when used with WITH_ASAN. According to the documentation: "When linking shared libraries, the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link errors (don’t use it with AddressSanitizer)." This patch turns off -Wl,--no-undefined if WITH_ASAN is used. --BZR-- revision-id: jon.hauglid@oracle.com-20131021111446-zmz7o551kohs9ot3 property-audit-revid: jon.hauglid@oracle.com-20131021111446-4r34jvr0c0b0o7t3 property-branch-nick: mysql-5.5-bug17632386 testament3-sha1: 3905b9a729c46c919206d0b98a9785969957b766 --- cmake/os/Linux.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index 61361d1d48b..5a1bd2f2d0d 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -1,5 +1,5 @@ -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, 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 @@ -33,7 +33,10 @@ ENDFOREACH() # Ensure we have clean build for shared libraries # without unresolved symbols -SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +# Not supported with AddressSanitizer +IF(NOT WITH_ASAN) + SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +ENDIF() # 64 bit file offset support flag SET(_FILE_OFFSET_BITS 64) From bd8e381358ba3fe9fd227b59c968ba138b0af2ea Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Fri, 25 Oct 2013 11:38:34 +0530 Subject: [PATCH 69/80] Bug #17654275 - MTR EXTRACT_WARNING_LINES IS NOT REMOVING TIMESTAMP IN UTC FORMAT WITH TIMEZONES --BZR-- revision-id: sayantan.dutta@oracle.com-20131025060834-ghlo178ct1kzmhre property-audit-revid: sayantan.dutta@oracle.com-20131025060834-gv3b0k1d48u0woeu property-branch-nick: mysql-5.5 testament3-sha1: 042c39b2b976fc7f06f0b401be3aad61d1ff6e2b --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 54dcd982a4c..27f99941637 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4353,7 +4353,7 @@ ($$) { # Remove initial timestamp and look for consecutive identical lines my $line_pat= $line; - $line_pat =~ s/^[0-9: ]*//; + $line_pat =~ s/^[0-9:\-\+\.TZ ]*//; if ($line_pat eq $last_pat) { $num_rep++; } else { From d28263bc20e41acf386ca4c57231158921c80507 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Fri, 25 Oct 2013 09:42:59 +0100 Subject: [PATCH 70/80] --BZR-- revision-id: mysql-builder@oracle.com-20131025084259-h8g9jzeiljrcq7y5 property-audit-revid: luis.soares@oracle.com-20131025084259-oqn9c3003ok1r8dy property-branch-nick: clone testament3-sha1: 4eac352c09a16f4a86e4152c3c57b91894750a28 From f9791370e429695da7101294f9d354244032d8f3 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 28 Oct 2013 17:08:31 +0100 Subject: [PATCH 71/80] post-push fix for bug#17565888/bug#14621190 --BZR-- revision-id: mattias.jonsson@oracle.com-20131028160831-r3mp410k0rrtlf3x property-audit-revid: mattias.jonsson@oracle.com-20131028160831-kxdvqktqi6oszzgn property-branch-nick: test-5.5 testament3-sha1: 1deca9603a1852ee891009c7c0276a11b3ee561f --- storage/innobase/btr/btr0pcur.c | 10 +++++----- storage/innobase/row/row0sel.c | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c index ea187305656..09b3715e096 100644 --- a/storage/innobase/btr/btr0pcur.c +++ b/storage/innobase/btr/btr0pcur.c @@ -124,7 +124,6 @@ btr_pcur_store_position( ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); - ut_a(cursor->latch_mode != BTR_NO_LATCHES); if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) { /* It must be an empty index tree; NOTE that in this case @@ -271,6 +270,7 @@ btr_pcur_restore_position_func( cursor->modify_clock, file, line, mtr)) { cursor->pos_state = BTR_PCUR_IS_POSITIONED; + cursor->latch_mode = latch_mode; buf_block_dbg_add_level( btr_pcur_get_block(cursor), @@ -282,9 +282,6 @@ btr_pcur_restore_position_func( const rec_t* rec; const ulint* offsets1; const ulint* offsets2; -#endif /* UNIV_DEBUG */ - cursor->latch_mode = latch_mode; -#ifdef UNIV_DEBUG rec = btr_pcur_get_rec(cursor); heap = mem_heap_create(256); @@ -305,7 +302,10 @@ btr_pcur_restore_position_func( /* This is the same record as stored, may need to be adjusted for BTR_PCUR_BEFORE/AFTER, depending on search mode and direction. */ - cursor->pos_state = BTR_PCUR_IS_POSITIONED_OPTIMISTIC; + if (btr_pcur_is_on_user_rec(cursor)) { + cursor->pos_state + = BTR_PCUR_IS_POSITIONED_OPTIMISTIC; + } return(FALSE); } } diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index c8e293080c1..b8336f88532 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3108,6 +3108,8 @@ sel_restore_position_for_mysql( || pcur->rel_pos == BTR_PCUR_AFTER); } else { ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad((pcur->rel_pos == BTR_PCUR_ON) + == btr_pcur_is_on_user_rec(pcur)); } #endif From 12ccceb768811d22ca4b97339d107d87787e12a2 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 29 Oct 2013 17:26:20 +0100 Subject: [PATCH 72/80] Bug#17326567 MYSQL SERVER FILESORT IMPLEMENTATION HAS A VERY SERIOUS BUG The filesort implementation needs space for at least 15 records (plus some internal overhead) in its main sort buffer. --BZR-- revision-id: tor.didriksen@oracle.com-20131029162620-6nwl9oyrmx9zh0tj property-audit-revid: tor.didriksen@oracle.com-20131029162620-r2re9gddxxv20w63 property-branch-nick: 5.1 testament3-sha1: 846aa4b42ff51c59450d444cfab7e0ecbab2cd14 --- sql/filesort.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index 3a2102fa62b..a067f0236ed 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2013, 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 @@ -216,7 +216,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, goto err; memavl= thd->variables.sortbuff_size; - min_sort_memory= max(MIN_SORT_MEMORY, param.sort_length*MERGEBUFF2); + min_sort_memory= + max(MIN_SORT_MEMORY, + ALIGN_SIZE(MERGEBUFF2 * (param.rec_length + sizeof(uchar*)))); + while (memavl >= min_sort_memory) { ulong old_memavl; From ee8b73242dd799949016d2d47add29ae2acec3a5 Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" Date: Tue, 29 Oct 2013 11:39:04 -0500 Subject: [PATCH 73/80] Testcase i_innodb.innodb-alter-restart.test fails on some Windows platforms possibly since it was introduced in the patch for Bug#16720368 around 2013-04-30. This fix is simply to adjust the mtr.add_suppression() lines in the testcase and to add a missing "\n" in the error message. Approved by Marko in RB 3746 --BZR-- revision-id: kevin.lewis@oracle.com-20131029163904-dz6scu11cps8ati8 property-audit-revid: kevin.lewis@oracle.com-20131029163904-fuuy1vv7x3feaqtv property-branch-nick: mysql-5.5 testament3-sha1: a0ef484beb195d5062db94bf8bef32404692765a --- storage/innobase/fil/fil0fil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index be7d43c132d..9dfc3bb1d21 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -3531,7 +3531,7 @@ fil_load_single_table_tablespace( if (check_msg) { fprintf(stderr, - "InnoDB: Error: %s in file %s", + "InnoDB: Error: %s in file %s\n", check_msg, filepath); goto func_exit; } From ccf74408bb444471e65023364f05ee95a3636716 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Wed, 30 Oct 2013 04:07:07 +0100 Subject: [PATCH 74/80] Removed non gpl file docs/mysql.info from community packages --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20131030030707-3qurl7q3l0qb8afc property-audit-revid: balasubramanian.kandasamy@oracle.com-20131030030707-algb9r7lvcu1008x property-branch-nick: mysql-5.1 testament3-sha1: 3769d610fe7e6257fcb24b514598a9e00f52e7d9 --- support-files/mysql.spec.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 8fbf9f08b9e..c8b8941af4a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -956,7 +956,9 @@ fi %doc mysql-release-%{mysql_version}/support-files/ndb-*.ini %endif +%if 0%{?commercial} %doc %attr(644, root, root) %{_infodir}/mysql.info* +%endif %if %{INNODB_BUILD} %doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1* @@ -1195,6 +1197,9 @@ fi # merging BK trees) ############################################################################## %changelog +* Wed Oct 30 2013 Balasubramanian Kandasamy +- Removed non gpl file docs/mysql.info from community packages + * Mon Sep 09 2013 Balasubramanian Kandasamy - Updated logic to get the correct count of PID files From 9790c41a8070eb9195300e9b97900e1e95cc90fe Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Thu, 31 Oct 2013 09:01:09 +0530 Subject: [PATCH 75/80] --BZR-- revision-id: mysql-builder@oracle.com-20131031033109-qdn3sxvy1znunl4x property-audit-revid: saikumar.v@oracle.com-20131031033109-7ky71uwprhb2bcxj property-branch-nick: clone testament3-sha1: 5b3923f3d57bde97d50840767d94d4cf972b08e2 From 5ab2cc249f57d684d8ac61423791af227b312b6d Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Thu, 31 Oct 2013 23:02:44 +0530 Subject: [PATCH 76/80] Bug #12917164 DROP USER CAN'T DROP USERS WITH LEGACY UPPER CASE HOST NAME ANYMORE Description: It is not possible to drop users with host names with upper case letters in them. i.e DROP USER 'root'@'Tmp_Host_Name'; is failing with error. Analysis: Since the fix 11748570 we came up with lower case hostnames as standard. But in the current bug the hostname is created by mysql_install_db script is still having upper case hostnames. So, if we have the hostname with upper case letters like(Tmp_Host_Name) then we will have as it is stored in the mysql.user table. In this case if use "'DROP USER 'root'@'Tmp_Host_Name';" it gives error because we do compare with the lower case of hostname since the 11748570 fix. Fix: We need to convert the hostname to lower case before storing into the mysql.user table when we run the mysql_install_db script. --BZR-- revision-id: venkata.sidagam@oracle.com-20131031173244-9vf8hy0y4jepgkcj property-audit-revid: venkata.sidagam@oracle.com-20131031173244-h7thx1v5g03bc1bq property-branch-nick: 5.1 testament3-sha1: 22188195049e2e1fbf41ee29c81c250e4b103a63 --- scripts/mysql_system_tables_data.sql | 7 +++---- scripts/mysql_system_tables_fix.sql | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 7203e250656..82b185ebefc 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -25,8 +25,7 @@ -- Get the hostname, if the hostname has any wildcard character like "_" or "%" -- add escape character in front of wildcard character to convert "_" or "%" to -- a plain character -SET @get_hostname= @@hostname; -SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname; +SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; -- Fill "db" table with default grants for anyone to @@ -42,9 +41,9 @@ DROP TABLE tmp_db; -- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE @current_hostname != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; +INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 09f66c79c3f..56f6a64211a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -601,6 +601,9 @@ ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; +# Convering the host name to lower case for existing users +UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct From 0d82f2bd0948931b72972e58a2c48a1ea0c580c7 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Thu, 31 Oct 2013 22:53:56 +0000 Subject: [PATCH 77/80] --BZR-- revision-id: mysql-builder@oracle.com-20131031225356-h5i8xl92kkg5jcg9 property-audit-revid: nuno.carvalho@oracle.com-20131031225356-m11rnercfwxe06pj property-branch-nick: clone testament3-sha1: 2bee21763cb1bc37d3f8a8e5a3df8e9433b7add2 From c091c77132f9d73ed7776acac27b55220c89855d Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" Date: Fri, 1 Nov 2013 13:48:24 +0530 Subject: [PATCH 78/80] --BZR-- revision-id: mysql-builder@oracle.com-20131101081824-zlhg753hd221lpob property-audit-revid: venkata.sidagam@oracle.com-20131101081824-5svf3sagvck1mh0g property-branch-nick: clone testament3-sha1: a96911fba3dbbaae555759f2aa2b7005ed785bc2 From 0812f03078738cf6fac23a567512a480b2bb52bf Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 1 Nov 2013 16:39:19 +0100 Subject: [PATCH 79/80] Bug#17617945 BUFFER OVERFLOW IN GET_MERGE_MANY_BUFFS_COST WITH SMALL SORT_BUFFER_SIZE get_cost_calc_buff_size() could return wrong value for the size of imerge_cost_buff. --BZR-- revision-id: tor.didriksen@oracle.com-20131101153919-en27flbksl3uro1u property-audit-revid: tor.didriksen@oracle.com-20131101153919-jocmgv8dc9nyyl0p property-branch-nick: 5.1 testament3-sha1: 359f50fc209f3e23a620ad4b2c367a4564ebc7fc --- sql/sql_class.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 9a9b2058e2b..fd83930a8e9 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2987,11 +2987,13 @@ class Unique :public Sql_alloc bool get(TABLE *table); static double get_use_cost(uint *buffer, uint nkeys, uint key_size, ulonglong max_in_memory_size); + + // Returns the number of bytes needed in imerge_cost_buf. inline static int get_cost_calc_buff_size(ulong nkeys, uint key_size, ulonglong max_in_memory_size) { register ulonglong max_elems_in_tree= - (1 + max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size)); + (max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size)); return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree)); } From 4d83862d467d134756df500e3cce3d590c603931 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 5 Nov 2013 08:03:43 +0100 Subject: [PATCH 80/80] Removed non gpl file mysql.info from uln community package --BZR-- revision-id: balasubramanian.kandasamy@oracle.com-20131105070343-be7e1rgywdaeapof property-audit-revid: balasubramanian.kandasamy@oracle.com-20131105070343-fgb4ljwrh1hzgaeh property-branch-nick: mysql-5.5.35-release testament3-sha1: c94abd2c159aaf92d6e077d6f7b885e07ad14101 --- packaging/rpm-uln/mysql.spec.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh index 3fcbd5c1234..34aed51048f 100644 --- a/packaging/rpm-uln/mysql.spec.sh +++ b/packaging/rpm-uln/mysql.spec.sh @@ -858,7 +858,9 @@ fi %files -n mysql-server%{product_suffix} -f release/support-files/plugins.files %defattr(-,root,root) %doc release/support-files/*.cnf -%doc %{_datadir}/info/mysql.info* +%if 0%{?commercial} + %doc %{_datadir}/info/mysql.info* +%endif %doc %{src_dir}/Docs/ChangeLog %doc %{src_dir}/Docs/INFO_SRC* %doc release/Docs/INFO_BIN* @@ -981,6 +983,9 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Tue Nov 05 2013 Balasubramanian Kandasamy +- Removed non gpl file mysql.info from community packages + * Wed Jul 10 2013 Balasubramanian Kandasamy - Removed directory /usr/share/mysql/solaris/postinstall-solaris to resolve build error