#At file:///usr/local/devel/bzrroot/server/mysql-trunk/ based on revid:marc.alff@stripped
3333 Vasil Dimov 2011-04-28 [merge]
Merge mysql-trunk-innodb -> mysql-trunk
modified:
mysql-test/suite/innodb/r/innodb_bug60196.result
mysql-test/suite/innodb/t/innodb_bug60196.test
storage/innobase/btr/btr0cur.c
storage/innobase/dict/dict0boot.c
storage/innobase/dict/dict0crea.c
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0load.c
storage/innobase/dict/dict0mem.c
storage/innobase/fil/fil0fil.c
storage/innobase/fsp/fsp0fsp.c
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/i_s.cc
storage/innobase/ibuf/ibuf0ibuf.c
storage/innobase/include/dict0dict.h
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0mem.h
storage/innobase/include/fsp0fsp.h
storage/innobase/include/fsp0fsp.ic
storage/innobase/include/ha_prototypes.h
storage/innobase/include/hash0hash.h
storage/innobase/include/log0recv.h
storage/innobase/include/page0types.h
storage/innobase/include/page0zip.ic
storage/innobase/include/srv0mon.h
storage/innobase/include/srv0srv.h
storage/innobase/include/trx0purge.h
storage/innobase/include/trx0sys.h
storage/innobase/include/trx0sys.ic
storage/innobase/include/univ.i
storage/innobase/include/ut0bh.ic
storage/innobase/lock/lock0lock.c
storage/innobase/log/log0recv.c
storage/innobase/mtr/mtr0log.c
storage/innobase/os/os0file.c
storage/innobase/page/page0zip.c
storage/innobase/row/row0mysql.c
storage/innobase/row/row0purge.c
storage/innobase/row/row0row.c
storage/innobase/row/row0uins.c
storage/innobase/row/row0umod.c
storage/innobase/row/row0upd.c
storage/innobase/srv/srv0mon.c
storage/innobase/srv/srv0srv.c
storage/innobase/sync/sync0rw.c
storage/innobase/ut/ut0bh.c
storage/innobase/ut/ut0ut.c
=== modified file 'mysql-test/suite/innodb/r/innodb_bug60196.result'
--- a/mysql-test/suite/innodb/r/innodb_bug60196.result revid:marc.alff@stripped
+++ b/mysql-test/suite/innodb/r/innodb_bug60196.result revid:vasil.dimov@stripped
@@ -71,3 +71,47 @@ FK1_Key FK2_Key
DROP TABLE Bug_60196;
DROP TABLE Bug_60196_FK1;
DROP TABLE Bug_60196_FK2;
+CREATE TABLE Bug_60309_FK (
+ID INT PRIMARY KEY,
+ID2 INT,
+KEY K2(ID2)
+) ENGINE=InnoDB;
+CREATE TABLE Bug_60309 (
+ID INT PRIMARY KEY,
+FK_ID INT,
+KEY (FK_ID),
+CONSTRAINT FK FOREIGN KEY (FK_ID) REFERENCES Bug_60309_FK (ID)
+) ENGINE=InnoDB;
+INSERT INTO Bug_60309_FK (ID, ID2) VALUES (1, 1), (2, 2), (3, 3);
+INSERT INTO Bug_60309 VALUES (1, 1);
+INSERT INTO Bug_60309 VALUES (2, 99);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60309`, CONSTRAINT `FK` FOREIGN KEY (`FK_ID`) REFERENCES `Bug_60309_FK` (`ID`))
+SELECT * FROM Bug_60309_FK;
+ID ID2
+1 1
+2 2
+3 3
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+# Stop server
+# Restart server.
+#
+# Try to insert more to the example table with foreign keys.
+# Bug60309 causes the foreign key file not to be found after
+# the resstart above.
+#
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+INSERT INTO Bug_60309 VALUES (2, 2);
+INSERT INTO Bug_60309 VALUES (3, 3);
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+2 2
+3 3
+
+# Clean up.
+DROP TABLE Bug_60309;
+DROP TABLE Bug_60309_FK;
=== modified file 'mysql-test/suite/innodb/t/innodb_bug60196.test'
--- a/mysql-test/suite/innodb/t/innodb_bug60196.test revid:marc.alff@stripped
+++ b/mysql-test/suite/innodb/t/innodb_bug60196.test revid:vasil.dimov@stripped
@@ -85,3 +85,73 @@ DROP TABLE Bug_60196;
DROP TABLE Bug_60196_FK1;
DROP TABLE Bug_60196_FK2;
+
+# Bug#60309/12356829
+# MYSQL 5.5.9 FOR MAC OSX HAS BUG WITH FOREIGN KEY CONSTRAINTS
+# This testcase is different from that for Bug#60196 in that the
+# referenced table contains a secondary key. When the engine is
+# restarted, the referenced table is opened by the purge thread,
+# which does not notice that lower_case_table_names == 2.
+
+#
+# Create test data.
+#
+CREATE TABLE Bug_60309_FK (
+ ID INT PRIMARY KEY,
+ ID2 INT,
+ KEY K2(ID2)
+) ENGINE=InnoDB;
+CREATE TABLE Bug_60309 (
+ ID INT PRIMARY KEY,
+ FK_ID INT,
+ KEY (FK_ID),
+ CONSTRAINT FK FOREIGN KEY (FK_ID) REFERENCES Bug_60309_FK (ID)
+) ENGINE=InnoDB;
+
+INSERT INTO Bug_60309_FK (ID, ID2) VALUES (1, 1), (2, 2), (3, 3);
+INSERT INTO Bug_60309 VALUES (1, 1);
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO Bug_60309 VALUES (2, 99);
+
+SELECT * FROM Bug_60309_FK;
+SELECT * FROM Bug_60309;
+
+--echo # Stop server
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Send a shutdown request to the server
+-- shutdown_server 10
+
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+--echo # Restart server.
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
+--echo #
+--echo # Try to insert more to the example table with foreign keys.
+--echo # Bug60309 causes the foreign key file not to be found after
+--echo # the resstart above.
+--echo #
+SELECT * FROM Bug_60309;
+INSERT INTO Bug_60309 VALUES (2, 2);
+INSERT INTO Bug_60309 VALUES (3, 3);
+SELECT * FROM Bug_60309;
+
+--echo
+--echo # Clean up.
+DROP TABLE Bug_60309;
+DROP TABLE Bug_60309_FK;
=== modified file 'storage/innobase/btr/btr0cur.c'
--- a/storage/innobase/btr/btr0cur.c revid:marc.alff@stripped
+++ b/storage/innobase/btr/btr0cur.c revid:vasil.dimov@stripped
@@ -18,8 +18,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/dict/dict0boot.c'
--- a/storage/innobase/dict/dict0boot.c revid:marc.alff@stripped
+++ b/storage/innobase/dict/dict0boot.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/dict/dict0crea.c'
--- a/storage/innobase/dict/dict0crea.c revid:marc.alff@stripped
+++ b/storage/innobase/dict/dict0crea.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/dict/dict0dict.c'
--- a/storage/innobase/dict/dict0dict.c revid:marc.alff@stripped
+++ b/storage/innobase/dict/dict0dict.c revid:vasil.dimov@stripped
@@ -54,7 +54,6 @@ UNIV_INTERN dict_index_t* dict_ind_compa
#include "que0que.h"
#include "rem0cmp.h"
#include "row0merge.h"
-#include "srv0srv.h" /* srv_lower_case_table_names */
#include "m_ctype.h" /* my_isspace() */
#include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str() */
#include "srv0mon.h"
@@ -3446,14 +3445,14 @@ dict_scan_table_name(
/* Values; 0 = Store and compare as given; case sensitive
1 = Store and compare in lower; case insensitive
2 = Store as given, compare in lower; case semi-sensitive */
- if (srv_lower_case_table_names == 2) {
+ if (innobase_get_lower_case_table_names() == 2) {
innobase_casedn_str(ref);
*table = dict_table_get_low(ref);
memcpy(ref, database_name, database_name_len);
ref[database_name_len] = '/';
memcpy(ref + database_name_len + 1, table_name, table_name_len + 1);
} else {
- if (srv_lower_case_table_names == 1) {
+ if (innobase_get_lower_case_table_names() == 1) {
innobase_casedn_str(ref);
}
*table = dict_table_get_low(ref);
@@ -5473,9 +5472,8 @@ dict_close(void)
rw_lock_free(&dict_table_stats_latches[i]);
}
}
-#endif /* !UNIV_HOTBACKUP */
-#ifdef UNIV_DEBUG
+# ifdef UNIV_DEBUG
/**********************************************************************//**
Validate the dictionary table LRU list.
@return TRUE if valid */
@@ -5560,4 +5558,5 @@ dict_non_lru_find_table(
return(FALSE);
}
-#endif /* UNIV_DEBUG */
+# endif /* UNIV_DEBUG */
+#endif /* !UNIV_HOTBACKUP */
=== modified file 'storage/innobase/dict/dict0load.c'
--- a/storage/innobase/dict/dict0load.c revid:marc.alff@stripped
+++ b/storage/innobase/dict/dict0load.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -2260,7 +2260,7 @@ loop:
may not be the same case, but the previous comparison showed that they
match with no-case. */
- if ((srv_lower_case_table_names != 2)
+ if ((innobase_get_lower_case_table_names() != 2)
&& (0 != ut_memcmp(field, table_name, len))) {
goto next_rec;
}
=== modified file 'storage/innobase/dict/dict0mem.c'
--- a/storage/innobase/dict/dict0mem.c revid:marc.alff@stripped
+++ b/storage/innobase/dict/dict0mem.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -33,9 +33,9 @@ Created 1/8/1996 Heikki Tuuri
#include "data0type.h"
#include "mach0data.h"
#include "dict0dict.h"
-#include "srv0srv.h" /* srv_lower_case_table_names */
#ifndef UNIV_HOTBACKUP
-# include "ha_prototypes.h" /* innobase_casedn_str()*/
+#include "ha_prototypes.h" /* innobase_casedn_str(),
+ innobase_get_lower_case_table_names */
# include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_BLOB_DEBUG
@@ -298,9 +298,9 @@ dict_mem_foreign_create(void)
/**********************************************************************//**
Sets the foreign_table_name_lookup pointer based on the value of
-srv_lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
-will point to foreign_table_name. If 2, then another string is allocated
-of the heap and set to lower case. */
+lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
+will point to foreign_table_name. If 2, then another string is
+allocated from foreign->heap and set to lower case. */
UNIV_INTERN
void
dict_mem_foreign_table_name_lookup_set(
@@ -308,7 +308,7 @@ dict_mem_foreign_table_name_lookup_set(
dict_foreign_t* foreign, /*!< in/out: foreign struct */
ibool do_alloc) /*!< in: is an alloc needed */
{
- if (srv_lower_case_table_names == 2) {
+ if (innobase_get_lower_case_table_names() == 2) {
if (do_alloc) {
foreign->foreign_table_name_lookup = mem_heap_alloc(
foreign->heap,
@@ -325,9 +325,9 @@ dict_mem_foreign_table_name_lookup_set(
/**********************************************************************//**
Sets the referenced_table_name_lookup pointer based on the value of
-srv_lower_case_table_names. If that is 0 or 1,
-referenced_table_name_lookup will point to referenced_table_name. If 2,
-then another string is allocated of the heap and set to lower case. */
+lower_case_table_names. If that is 0 or 1, referenced_table_name_lookup
+will point to referenced_table_name. If 2, then another string is
+allocated from foreign->heap and set to lower case. */
UNIV_INTERN
void
dict_mem_referenced_table_name_lookup_set(
@@ -335,7 +335,7 @@ dict_mem_referenced_table_name_lookup_se
dict_foreign_t* foreign, /*!< in/out: foreign struct */
ibool do_alloc) /*!< in: is an alloc needed */
{
- if (srv_lower_case_table_names == 2) {
+ if (innobase_get_lower_case_table_names() == 2) {
if (do_alloc) {
foreign->referenced_table_name_lookup = mem_heap_alloc(
foreign->heap,
=== modified file 'storage/innobase/fil/fil0fil.c'
--- a/storage/innobase/fil/fil0fil.c revid:marc.alff@stripped
+++ b/storage/innobase/fil/fil0fil.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/fsp/fsp0fsp.c'
--- a/storage/innobase/fsp/fsp0fsp.c revid:marc.alff@stripped
+++ b/storage/innobase/fsp/fsp0fsp.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc revid:marc.alff@stripped
+++ b/storage/innobase/handler/ha_innodb.cc revid:vasil.dimov@stripped
@@ -27,7 +27,9 @@ FOR A PARTICULAR PURPOSE. See the GNU Ge
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+*****************************************************************************/
#include <sql_table.h> // explain_filename, nz2, EXPLAIN_PARTITIONS_AS_COMMENT,
// EXPLAIN_FILENAME_MAX_EXTRA_LENGTH
@@ -1372,7 +1374,7 @@ innobase_get_stmt(
}
/**********************************************************************//**
-Get the current seting of the table_def_size global parameter. We do
+Get the current setting of the table_def_size global parameter. We do
a dirty read because for one there is no synchronization object and
secondly there is little harm in doing so even if we get a torn read.
@return value of table_def_size */
@@ -1384,6 +1386,20 @@ innobase_get_table_cache_size(void)
return(table_def_size);
}
+/**********************************************************************//**
+Get the current setting of the lower_case_table_names global parameter from
+mysqld.cc. We do a dirty read because for one there is no synchronization
+object and secondly there is little harm in doing so even if we get a torn
+read.
+@return value of lower_case_table_names */
+extern "C" UNIV_INTERN
+ulint
+innobase_get_lower_case_table_names(void)
+/*=====================================*/
+{
+ return(lower_case_table_names);
+}
+
#if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN)
extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
/*******************************************************************//**
@@ -3898,7 +3914,6 @@ ha_innobase::open(
UT_NOT_USED(test_if_locked);
thd = ha_thd();
- srv_lower_case_table_names = lower_case_table_names;
/* Under some cases MySQL seems to call this function while
holding btr_search_latch. This breaks the latching order as
@@ -6799,8 +6814,6 @@ err_col:
col_len);
}
- srv_lower_case_table_names = lower_case_table_names;
-
error = row_create_table_for_mysql(table, trx);
if (error == DB_DUPLICATE_KEY) {
@@ -7673,8 +7686,6 @@ ha_innobase::delete_table(
/* Drop the table in InnoDB */
- srv_lower_case_table_names = lower_case_table_names;
-
error = row_drop_table_for_mysql(norm_name, trx,
thd_sql_command(thd)
== SQLCOM_DROP_DB);
@@ -7800,8 +7811,6 @@ innobase_rename_table(
row_mysql_lock_data_dictionary(trx);
}
- srv_lower_case_table_names = lower_case_table_names;
-
error = row_rename_table_for_mysql(
norm_from, norm_to, trx, lock_and_commit);
=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc revid:marc.alff@stripped
+++ b/storage/innobase/handler/handler0alter.cc revid:vasil.dimov@stripped
@@ -649,7 +649,7 @@ innobase_add_index_cleanup(
/* Note: This check excludes the system tables. However, we
should be safe because users cannot add indexes to system
- tables. */
+ tables. */
if (UT_LIST_GET_LEN(table->foreign_list) == 0
&& UT_LIST_GET_LEN(table->referenced_list) == 0
=== modified file 'storage/innobase/handler/i_s.cc'
--- a/storage/innobase/handler/i_s.cc revid:marc.alff@stripped
+++ b/storage/innobase/handler/i_s.cc revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/ibuf/ibuf0ibuf.c'
--- a/storage/innobase/ibuf/ibuf0ibuf.c revid:marc.alff@stripped
+++ b/storage/innobase/ibuf/ibuf0ibuf.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/dict0dict.h'
--- a/storage/innobase/include/dict0dict.h revid:marc.alff@stripped
+++ b/storage/innobase/include/dict0dict.h revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -688,6 +688,7 @@ ulint
dict_table_zip_size(
/*================*/
const dict_table_t* table); /*!< in: table */
+#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Obtain exclusive locks on all index trees of the table. This is to prevent
accessing index trees while InnoDB is updating internal metadata for
@@ -714,7 +715,6 @@ dict_table_col_in_clustered_key(
/*============================*/
const dict_table_t* table, /*!< in: table */
ulint n); /*!< in: column number */
-#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Copies types of columns contained in table to tuple and sets all
fields of the tuple to the SQL NULL value. This function should
=== modified file 'storage/innobase/include/dict0dict.ic'
--- a/storage/innobase/include/dict0dict.ic revid:marc.alff@stripped
+++ b/storage/innobase/include/dict0dict.ic revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/dict0mem.h'
--- a/storage/innobase/include/dict0mem.h revid:marc.alff@stripped
+++ b/storage/innobase/include/dict0mem.h revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -232,7 +232,9 @@ dict_mem_foreign_create(void);
/**********************************************************************//**
Sets the foreign_table_name_lookup pointer based on the value of
-srv_lower_case_table_names. */
+lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
+will point to foreign_table_name. If 2, then another string is
+allocated from the heap and set to lower case. */
UNIV_INTERN
void
dict_mem_foreign_table_name_lookup_set(
@@ -241,8 +243,10 @@ dict_mem_foreign_table_name_lookup_set(
ibool do_alloc); /*!< in: is an alloc needed */
/**********************************************************************//**
-Sets the reference_table_name_lookup pointer based on the value of
-srv_lower_case_table_names. */
+Sets the referenced_table_name_lookup pointer based on the value of
+lower_case_table_names. If that is 0 or 1, referenced_table_name_lookup
+will point to referenced_table_name. If 2, then another string is
+allocated from the heap and set to lower case. */
UNIV_INTERN
void
dict_mem_referenced_table_name_lookup_set(
=== modified file 'storage/innobase/include/fsp0fsp.h'
--- a/storage/innobase/include/fsp0fsp.h revid:marc.alff@stripped
+++ b/storage/innobase/include/fsp0fsp.h revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/fsp0fsp.ic'
--- a/storage/innobase/include/fsp0fsp.ic revid:marc.alff@stripped
+++ b/storage/innobase/include/fsp0fsp.ic revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/ha_prototypes.h'
--- a/storage/innobase/include/ha_prototypes.h revid:marc.alff@stripped
+++ b/storage/innobase/include/ha_prototypes.h revid:vasil.dimov@stripped
@@ -306,7 +306,7 @@ thd_set_lock_wait_time(
ulint value); /*!< in: time waited for the lock */
/**********************************************************************//**
-Get the current seting of the table_cache_size global parameter. We do
+Get the current setting of the table_cache_size global parameter. We do
a dirty read because for one there is no synchronization object and
secondly there is little harm in doing so even if we get a torn read.
@return SQL statement string */
@@ -314,4 +314,15 @@ UNIV_INTERN
ulint
innobase_get_table_cache_size(void);
/*===============================*/
+
+/**********************************************************************//**
+Get the current setting of the lower_case_table_names global parameter from
+mysqld.cc. We do a dirty read because for one there is no synchronization
+object and secondly there is little harm in doing so even if we get a torn
+read.
+@return value of lower_case_table_names */
+UNIV_INTERN
+ulint
+innobase_get_lower_case_table_names(void);
+/*=====================================*/
#endif
=== modified file 'storage/innobase/include/hash0hash.h'
--- a/storage/innobase/include/hash0hash.h revid:marc.alff@stripped
+++ b/storage/innobase/include/hash0hash.h revid:vasil.dimov@stripped
@@ -49,7 +49,7 @@ enum hash_table_sync_t {
this hash_table. */
HASH_TABLE_SYNC_MUTEX, /*!< Use mutexes to control
access to this hash_table. */
- HASH_TABLE_SYNC_RW_LOCK, /*!< Use rw_locks to control
+ HASH_TABLE_SYNC_RW_LOCK /*!< Use rw_locks to control
access to this hash_table. */
};
=== modified file 'storage/innobase/include/log0recv.h'
--- a/storage/innobase/include/log0recv.h revid:marc.alff@stripped
+++ b/storage/innobase/include/log0recv.h revid:vasil.dimov@stripped
@@ -40,19 +40,17 @@ Reads the checkpoint info needed in hot
@return TRUE if success */
UNIV_INTERN
ibool
-recv_read_cp_info_for_backup(
-/*=========================*/
+recv_read_checkpoint_info_for_backup(
+/*=================================*/
const byte* hdr, /*!< in: buffer containing the log group
header */
lsn_t* lsn, /*!< out: checkpoint lsn */
lsn_t* offset, /*!< out: checkpoint offset in the log group */
- ulint* fsp_limit,/*!< out: fsp limit of space 0,
- 1000000000 if the database is running
- with < version 3.23.50 of InnoDB */
- ib_uint64_t* cp_no, /*!< out: checkpoint number */
- lsn_t* first_header_lsn);
+ lsn_t* cp_no, /*!< out: checkpoint number */
+ lsn_t* first_header_lsn)
/*!< out: lsn of of the start of the
first log file */
+ __attribute__((nonnull));
/*******************************************************************//**
Scans the log segment and n_bytes_scanned is set to the length of valid
log scanned. */
=== modified file 'storage/innobase/include/page0types.h'
--- a/storage/innobase/include/page0types.h revid:marc.alff@stripped
+++ b/storage/innobase/include/page0types.h revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/page0zip.ic'
--- a/storage/innobase/include/page0zip.ic revid:marc.alff@stripped
+++ b/storage/innobase/include/page0zip.ic revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/srv0mon.h'
--- a/storage/innobase/include/srv0mon.h revid:marc.alff@stripped
+++ b/storage/innobase/include/srv0mon.h revid:vasil.dimov@stripped
@@ -28,6 +28,7 @@ Created 12/15/2009 Jimmy Yang
#define srv0mon_h
#include "univ.i"
+#ifndef UNIV_HOTBACKUP
/** Possible status values for "mon_status" in "struct monitor_value" */
@@ -754,5 +755,9 @@ srv_mon_default_on(void);
#ifndef UNIV_NONINL
#include "srv0mon.ic"
#endif
+#else /* !UNIV_HOTBACKUP */
+# define MONITOR_INC(x) ((void) 0)
+# define MONITOR_DEC(x) ((void) 0)
+#endif /* !UNIV_HOTBACKUP */
#endif
=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h revid:marc.alff@stripped
+++ b/storage/innobase/include/srv0srv.h revid:vasil.dimov@stripped
@@ -73,9 +73,6 @@ at a time */
#define SRV_AUTO_EXTEND_INCREMENT \
(srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE))
-/* This is set to the MySQL server value for this variable. */
-extern uint srv_lower_case_table_names;
-
/* Mutex for locking srv_monitor_file */
extern mutex_t srv_monitor_file_mutex;
/* Temporary file for innodb monitor output */
=== modified file 'storage/innobase/include/trx0purge.h'
--- a/storage/innobase/include/trx0purge.h revid:marc.alff@stripped
+++ b/storage/innobase/include/trx0purge.h revid:vasil.dimov@stripped
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/include/trx0sys.h'
--- a/storage/innobase/include/trx0sys.h revid:marc.alff@stripped
+++ b/storage/innobase/include/trx0sys.h revid:vasil.dimov@stripped
@@ -379,14 +379,12 @@ UNIV_INTERN
void
trx_sys_file_format_tag_init(void);
/*==============================*/
-#ifndef UNIV_HOTBACKUP
/*****************************************************************//**
Shutdown/Close the transaction system. */
UNIV_INTERN
void
trx_sys_close(void);
/*===============*/
-#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Get the name representation of the file format from its id.
@return pointer to the name */
@@ -406,31 +404,28 @@ trx_sys_file_format_max_set(
ulint format_id, /*!< in: file format id */
const char** name); /*!< out: max file format name or
NULL if not needed. */
-/*****************************************************************//**
-Get the name representation of the file format from its id.
-@return pointer to the max format name */
+/*********************************************************************
+Creates the rollback segments */
UNIV_INTERN
-const char*
-trx_sys_file_format_max_get(void);
-/*=============================*/
+void
+trx_sys_create_rsegs(
+/*=================*/
+ ulint n_rsegs); /*!< number of rollback segments to create */
/*****************************************************************//**
-Check for the max file format tag stored on disk.
-@return DB_SUCCESS or error code */
-UNIV_INTERN
+Get the number of transaction in the system, independent of their state.
+@return count of transactions in trx_sys_t::trx_list */
+UNIV_INLINE
ulint
-trx_sys_file_format_max_check(
-/*==========================*/
- ulint max_format_id); /*!< in: the max format id to check */
-/********************************************************************//**
-Update the file format tag in the system tablespace only if the given
-format id is greater than the known max id.
-@return TRUE if format_id was bigger than the known max id */
+trx_sys_get_n_trx(void);
+/*===================*/
+
+/*********************************************************************
+Check if there are any active (non-prepared) transactions.
+@return total number of active transactions or 0 if none */
UNIV_INTERN
-ibool
-trx_sys_file_format_max_upgrade(
-/*============================*/
- const char** name, /*!< out: max file format name */
- ulint format_id); /*!< in: file format identifier */
+ulint
+trx_sys_any_active_transactions(void);
+/*=================================*/
#else /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Prints to stderr the MySQL binlog info in the system header if the
@@ -467,6 +462,32 @@ trx_sys_read_pertable_file_format_id(
datafile */
ulint *format_id); /*!< out: file format of the per-table
data file */
+#endif /* !UNIV_HOTBACKUP */
+/*****************************************************************//**
+Get the name representation of the file format from its id.
+@return pointer to the max format name */
+UNIV_INTERN
+const char*
+trx_sys_file_format_max_get(void);
+/*=============================*/
+/*****************************************************************//**
+Check for the max file format tag stored on disk.
+@return DB_SUCCESS or error code */
+UNIV_INTERN
+ulint
+trx_sys_file_format_max_check(
+/*==========================*/
+ ulint max_format_id); /*!< in: the max format id to check */
+/********************************************************************//**
+Update the file format tag in the system tablespace only if the given
+format id is greater than the known max id.
+@return TRUE if format_id was bigger than the known max id */
+UNIV_INTERN
+ibool
+trx_sys_file_format_max_upgrade(
+/*============================*/
+ const char** name, /*!< out: max file format name */
+ ulint format_id); /*!< in: file format identifier */
/*****************************************************************//**
Get the name representation of the file format from its id.
@return pointer to the name */
@@ -476,31 +497,6 @@ trx_sys_file_format_id_to_name(
/*===========================*/
const ulint id); /*!< in: id of the file format */
-#endif /* !UNIV_HOTBACKUP */
-
-/*********************************************************************
-Creates the rollback segments */
-UNIV_INTERN
-void
-trx_sys_create_rsegs(
-/*=================*/
- ulint n_rsegs); /*!< number of rollback segments to create */
-/*****************************************************************//**
-Get the number of transaction in the system, independent of their state.
-@return count of transactions in trx_sys_t::trx_list */
-UNIV_INLINE
-ulint
-trx_sys_get_n_trx(void);
-/*===================*/
-
-/*********************************************************************
-Check if there are any active (non-prepared) transactions.
-@return total number of active transactions or 0 if none */
-UNIV_INTERN
-ulint
-trx_sys_any_active_transactions(void);
-/*=================================*/
-
#ifdef UNIV_DEBUG
/*************************************************************//**
Validate the trx_sys_t::trx_list. */
=== modified file 'storage/innobase/include/trx0sys.ic'
--- a/storage/innobase/include/trx0sys.ic revid:marc.alff@stripped
+++ b/storage/innobase/include/trx0sys.ic revid:vasil.dimov@stripped
@@ -387,7 +387,7 @@ trx_is_active_low(
} else if (UNIV_UNLIKELY(trx_id >= trx_sys->max_trx_id)) {
/* There must be corruption: we let the caller handle the
- diagnostic prints in this case. */
+ diagnostic prints in this case. */
trx = NULL;
if (corrupt != NULL) {
=== modified file 'storage/innobase/include/univ.i'
--- a/storage/innobase/include/univ.i revid:marc.alff@stripped
+++ b/storage/innobase/include/univ.i revid:vasil.dimov@stripped
@@ -25,8 +25,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -132,7 +132,7 @@ Sun Studio */
/* Following defines are to enable performance schema
instrumentation in each of four InnoDB modules if
HAVE_PSI_INTERFACE is defined. */
-#ifdef HAVE_PSI_INTERFACE
+#if defined HAVE_PSI_INTERFACE && !defined UNIV_HOTBACKUP
# define UNIV_PFS_MUTEX
# define UNIV_PFS_RWLOCK
/* For I/O instrumentation, performance schema rely
@@ -311,7 +311,7 @@ definitions: */
/* The following alignment is used in memory allocations in memory heap
management to ensure correct alignment for doubles etc. */
-#define UNIV_MEM_ALIGNMENT 8
+#define UNIV_MEM_ALIGNMENT 8
/* The following alignment is used in aligning lints etc. */
#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE
=== modified file 'storage/innobase/include/ut0bh.ic'
--- a/storage/innobase/include/ut0bh.ic revid:marc.alff@stripped
+++ b/storage/innobase/include/ut0bh.ic revid:vasil.dimov@stripped
@@ -1,5 +1,6 @@
/***************************************************************************//**
-Copyright (c) 2011, Oracle Corpn. All Rights Reserved.
+
+Copyright (c) 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -10,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/lock/lock0lock.c'
--- a/storage/innobase/lock/lock0lock.c revid:marc.alff@stripped
+++ b/storage/innobase/lock/lock0lock.c revid:vasil.dimov@stripped
@@ -5083,7 +5083,6 @@ lock_table_queue_validate(
dict_table_t* table) /*!< in: table */
{
lock_t* lock;
- ulint count = 0;
ut_ad(lock_mutex_own());
#ifdef UNIV_SYNC_DEBUG
@@ -5094,9 +5093,6 @@ lock_table_queue_validate(
lock != NULL;
lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock)) {
- ulint i;
- ib_vector_t* table_locks;
-
/* lock->trx->state cannot change from or to NOT_STARTED
while we are holding the trx_sys->lock. It may change
from ACTIVE to PREPARED, but it may not change to
@@ -5114,26 +5110,8 @@ lock_table_queue_validate(
}
ut_a(lock_trx_table_locks_find(lock->trx, lock));
-
- /* Skip the NULL entries and only count the locks that
- transactions have on this table. */
- table_locks = lock->trx->lock.table_locks;
-
- for (i = 0; i < ib_vector_size(table_locks); ++i) {
- const lock_t* trx_lock;
-
- trx_lock = ib_vector_get(table_locks, i);
-
- if (trx_lock != NULL
- && trx_lock->un_member.tab_lock.table == table) {
-
- ++count;
- }
- }
}
- ut_a(count == UT_LIST_GET_LEN(table->locks));
-
return(TRUE);
}
=== modified file 'storage/innobase/log/log0recv.c'
--- a/storage/innobase/log/log0recv.c revid:marc.alff@stripped
+++ b/storage/innobase/log/log0recv.c revid:vasil.dimov@stripped
@@ -768,8 +768,8 @@ recv_read_checkpoint_info_for_backup(
header */
lsn_t* lsn, /*!< out: checkpoint lsn */
lsn_t* offset, /*!< out: checkpoint offset in the log group */
- ib_uint64_t* cp_no, /*!< out: checkpoint number */
- ib_uint64_t* first_header_lsn)
+ lsn_t* cp_no, /*!< out: checkpoint number */
+ lsn_t* first_header_lsn)
/*!< out: lsn of of the start of the
first log file */
{
=== modified file 'storage/innobase/mtr/mtr0log.c'
--- a/storage/innobase/mtr/mtr0log.c revid:marc.alff@stripped
+++ b/storage/innobase/mtr/mtr0log.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/os/os0file.c'
--- a/storage/innobase/os/os0file.c revid:marc.alff@stripped
+++ b/storage/innobase/os/os0file.c revid:vasil.dimov@stripped
@@ -304,6 +304,7 @@ UNIV_INTERN ulint os_n_pending_writes =
UNIV_INTERN ulint os_n_pending_reads = 0;
#ifdef UNIV_DEBUG
+# ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Validates the consistency the aio system some of the time.
@return TRUE if ok or the check was skipped */
@@ -330,6 +331,7 @@ os_aio_validate_skip(void)
os_aio_validate_count = OS_AIO_VALIDATE_SKIP;
return(os_aio_validate());
}
+# endif /* !UNIV_HOTBACKUP */
#endif /* UNIV_DEBUG */
#ifdef __WIN__
=== modified file 'storage/innobase/page/page0zip.c'
--- a/storage/innobase/page/page0zip.c revid:marc.alff@stripped
+++ b/storage/innobase/page/page0zip.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -46,7 +46,6 @@ Created June 2005 by Marko Makela
#else /* !UNIV_HOTBACKUP */
# define lock_move_reorganize_page(block, temp_block) ((void) 0)
# define buf_LRU_stat_inc_unzip() ((void) 0)
-# define MONITOR_INC(x) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0mysql.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/row/row0purge.c'
--- a/storage/innobase/row/row0purge.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0purge.c revid:vasil.dimov@stripped
@@ -735,14 +735,20 @@ row_purge_record_func(
node->index = dict_table_get_next_index(clust_index);
- if (node->rec_type == TRX_UNDO_DEL_MARK_REC) {
+ switch (node->rec_type) {
+ case TRX_UNDO_DEL_MARK_REC:
row_purge_del_mark(node);
MONITOR_INC(MONITOR_N_DEL_ROW_PURGE);
- } else if (updated_extern
- || node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
-
+ break;
+ default:
+ if (!updated_extern) {
+ break;
+ }
+ /* fall through */
+ case TRX_UNDO_UPD_EXIST_REC:
row_purge_upd_exist_or_extern(thr, node, undo_rec);
MONITOR_INC(MONITOR_N_UPD_EXIST_EXTERN);
+ break;
}
if (node->found_clust) {
=== modified file 'storage/innobase/row/row0row.c'
--- a/storage/innobase/row/row0row.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0row.c revid:vasil.dimov@stripped
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/row/row0uins.c'
--- a/storage/innobase/row/row0uins.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0uins.c revid:vasil.dimov@stripped
@@ -307,6 +307,53 @@ row_undo_ins_parse_undo_rec(
}
}
+/***************************************************************//**
+Removes secondary index records.
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
+static
+ulint
+row_undo_ins_remove_sec_rec(
+/*========================*/
+ undo_node_t* node) /*!< in/out: row undo node */
+{
+ ulint err = DB_SUCCESS;
+ mem_heap_t* heap;
+
+ for (heap = mem_heap_create(1024);
+ node->index != NULL;
+ mem_heap_empty(heap),
+ node->index = dict_table_get_next_index(node->index)) {
+ dtuple_t* entry;
+
+ entry = row_build_index_entry(node->row, node->ext,
+ node->index, heap);
+ if (UNIV_UNLIKELY(!entry)) {
+ /* The database must have crashed after
+ inserting a clustered index record but before
+ writing all the externally stored columns of
+ that record. Because secondary index entries
+ are inserted after the clustered index record,
+ we may assume that the secondary index record
+ does not exist. However, this situation may
+ only occur during the rollback of incomplete
+ transactions. */
+ ut_a(trx_is_recv(node->trx));
+ } else {
+ log_free_check();
+
+ err = row_undo_ins_remove_sec(node->index, entry);
+
+ if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ goto func_exit;
+ }
+ }
+ }
+
+func_exit:
+ mem_heap_free(heap);
+ return(err);
+}
+
/***********************************************************//**
Undoes a fresh insert of a row to a table. A fresh insert means that
the same clustered index unique key did not have any record, even delete
@@ -342,44 +389,17 @@ row_undo_ins(
node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
- while (node->index != NULL) {
- dtuple_t* entry;
-
- entry = row_build_index_entry(node->row, node->ext,
- node->index, node->heap);
- if (UNIV_UNLIKELY(!entry)) {
- /* The database must have crashed after
- inserting a clustered index record but before
- writing all the externally stored columns of
- that record. Because secondary index entries
- are inserted after the clustered index record,
- we may assume that the secondary index record
- does not exist. However, this situation may
- only occur during the rollback of incomplete
- transactions. */
- ut_a(trx_is_recv(node->trx));
- } else {
- log_free_check();
-
- err = row_undo_ins_remove_sec(node->index, entry);
-
- if (err != DB_SUCCESS) {
-
- dict_table_close(node->table, dict_locked);
-
- node->table = NULL;
-
- return(err);
- }
- }
+ err = row_undo_ins_remove_sec_rec(node);
- node->index = dict_table_get_next_index(node->index);
+ if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ goto func_exit;
}
log_free_check();
err = row_undo_ins_remove_clust_rec(node);
+func_exit:
dict_table_close(node->table, dict_locked);
node->table = NULL;
=== modified file 'storage/innobase/row/row0umod.c'
--- a/storage/innobase/row/row0umod.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0umod.c revid:vasil.dimov@stripped
@@ -565,18 +565,17 @@ row_undo_mod_upd_del_sec(
que_thr_t* thr) /*!< in: query thread */
{
mem_heap_t* heap;
- dtuple_t* entry;
- dict_index_t* index;
ulint err = DB_SUCCESS;
ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
- heap = mem_heap_create(1024);
- while (node->index != NULL) {
- index = node->index;
-
- entry = row_build_index_entry(node->row, node->ext,
- index, heap);
+ for (heap = mem_heap_create(1024);
+ node->index != NULL;
+ mem_heap_empty(heap),
+ node->index = dict_table_get_next_index(node->index)) {
+ dict_index_t* index = node->index;
+ dtuple_t* entry = row_build_index_entry(
+ node->row, node->ext, index, heap);
if (UNIV_UNLIKELY(!entry)) {
/* The database must have crashed after
inserting a clustered index record but before
@@ -592,15 +591,11 @@ row_undo_mod_upd_del_sec(
err = row_undo_mod_del_mark_or_remove_sec(
node, thr, index, entry);
- if (err != DB_SUCCESS) {
+ if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
break;
}
}
-
- mem_heap_empty(heap);
-
- node->index = dict_table_get_next_index(node->index);
}
mem_heap_free(heap);
@@ -619,18 +614,17 @@ row_undo_mod_del_mark_sec(
que_thr_t* thr) /*!< in: query thread */
{
mem_heap_t* heap;
- dtuple_t* entry;
- dict_index_t* index;
- ulint err;
-
- heap = mem_heap_create(1024);
-
- while (node->index != NULL) {
- index = node->index;
+ ulint err = DB_SUCCESS;
- entry = row_build_index_entry(node->row, node->ext,
- index, heap);
+ for (heap = mem_heap_create(1024);
+ node->index != NULL;
+ mem_heap_empty(heap),
+ node->index = dict_table_get_next_index(node->index)) {
+ dict_index_t* index = node->index;
+ dtuple_t* entry = row_build_index_entry(
+ node->row, node->ext, index, heap);
ut_a(entry);
+
err = row_undo_mod_del_unmark_sec_and_undo_update(
BTR_MODIFY_LEAF, thr, index, entry);
if (err == DB_FAIL) {
@@ -638,19 +632,15 @@ row_undo_mod_del_mark_sec(
BTR_MODIFY_TREE, thr, index, entry);
}
- if (err != DB_SUCCESS) {
-
- mem_heap_free(heap);
+ if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
- return(err);
+ break;
}
-
- node->index = dict_table_get_next_index(node->index);
}
mem_heap_free(heap);
- return(DB_SUCCESS);
+ return(err);
}
/***********************************************************//**
@@ -664,109 +654,101 @@ row_undo_mod_upd_exist_sec(
que_thr_t* thr) /*!< in: query thread */
{
mem_heap_t* heap;
- dtuple_t* entry;
- dict_index_t* index;
- ulint err;
+ ulint err = DB_SUCCESS;
- if (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE) {
+ if (node->index == NULL
+ || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
/* No change in secondary indexes */
- return(DB_SUCCESS);
+ return(err);
}
- heap = mem_heap_create(1024);
-
- while (node->index != NULL) {
- index = node->index;
-
- if (row_upd_changes_ord_field_binary(node->index, node->update,
- thr,
- node->row, node->ext)) {
-
- /* Build the newest version of the index entry */
- entry = row_build_index_entry(node->row, node->ext,
- index, heap);
- if (UNIV_UNLIKELY(!entry)) {
- /* The server must have crashed in
- row_upd_clust_rec_by_insert() before
- the updated externally stored columns (BLOBs)
- of the new clustered index entry were
- written. */
-
- /* The table must be in DYNAMIC or COMPRESSED
- format. REDUNDANT and COMPACT formats
- store a local 768-byte prefix of each
- externally stored column. */
- ut_a(dict_table_get_format(index->table)
- >= UNIV_FORMAT_B);
-
- /* This is only legitimate when
- rolling back an incomplete transaction
- after crash recovery. */
- ut_a(thr_get_trx(thr)->is_recovered);
-
- /* The server must have crashed before
- completing the insert of the new
- clustered index entry and before
- inserting to the secondary indexes.
- Because node->row was not yet written
- to this index, we can ignore it. But
- we must restore node->undo_row. */
- } else {
- /* NOTE that if we updated the fields of a
- delete-marked secondary index record so that
- alphabetically they stayed the same, e.g.,
- 'abc' -> 'aBc', we cannot return to the
- original values because we do not know them.
- But this should not cause problems because
- in row0sel.c, in queries we always retrieve
- the clustered index record or an earlier
- version of it, if the secondary index record
- through which we do the search is
- delete-marked. */
-
- err = row_undo_mod_del_mark_or_remove_sec(
- node, thr, index, entry);
- if (err != DB_SUCCESS) {
- mem_heap_free(heap);
+ for (heap = mem_heap_create(1024); node->index != NULL;
+ mem_heap_empty(heap),
+ node->index = dict_table_get_next_index(node->index)) {
+ dict_index_t* index = node->index;
+ dtuple_t* entry;
+
+ if (!row_upd_changes_ord_field_binary(index, node->update, thr,
+ node->row, node->ext)) {
+ continue;
+ }
- return(err);
- }
+ /* Build the newest version of the index entry */
+ entry = row_build_index_entry(node->row, node->ext,
+ index, heap);
+ if (UNIV_UNLIKELY(!entry)) {
+ /* The server must have crashed in
+ row_upd_clust_rec_by_insert() before
+ the updated externally stored columns (BLOBs)
+ of the new clustered index entry were written. */
+
+ /* The table must be in DYNAMIC or COMPRESSED
+ format. REDUNDANT and COMPACT formats
+ store a local 768-byte prefix of each
+ externally stored column. */
+ ut_a(dict_table_get_format(index->table)
+ >= UNIV_FORMAT_B);
+
+ /* This is only legitimate when
+ rolling back an incomplete transaction
+ after crash recovery. */
+ ut_a(thr_get_trx(thr)->is_recovered);
+
+ /* The server must have crashed before
+ completing the insert of the new
+ clustered index entry and before
+ inserting to the secondary indexes.
+ Because node->row was not yet written
+ to this index, we can ignore it. But
+ we must restore node->undo_row. */
+ } else {
+ /* NOTE that if we updated the fields of a
+ delete-marked secondary index record so that
+ alphabetically they stayed the same, e.g.,
+ 'abc' -> 'aBc', we cannot return to the
+ original values because we do not know them.
+ But this should not cause problems because
+ in row0sel.c, in queries we always retrieve
+ the clustered index record or an earlier
+ version of it, if the secondary index record
+ through which we do the search is
+ delete-marked. */
- mem_heap_empty(heap);
+ err = row_undo_mod_del_mark_or_remove_sec(
+ node, thr, index, entry);
+ if (err != DB_SUCCESS) {
+ break;
}
+ }
- /* We may have to update the delete mark in the
- secondary index record of the previous version of
- the row. We also need to update the fields of
- the secondary index record if we updated its fields
- but alphabetically they stayed the same, e.g.,
- 'abc' -> 'aBc'. */
- entry = row_build_index_entry(node->undo_row,
- node->undo_ext,
- index, heap);
- ut_a(entry);
+ mem_heap_empty(heap);
+ /* We may have to update the delete mark in the
+ secondary index record of the previous version of
+ the row. We also need to update the fields of
+ the secondary index record if we updated its fields
+ but alphabetically they stayed the same, e.g.,
+ 'abc' -> 'aBc'. */
+ entry = row_build_index_entry(node->undo_row,
+ node->undo_ext,
+ index, heap);
+ ut_a(entry);
+ err = row_undo_mod_del_unmark_sec_and_undo_update(
+ BTR_MODIFY_LEAF, thr, index, entry);
+ if (err == DB_FAIL) {
err = row_undo_mod_del_unmark_sec_and_undo_update(
- BTR_MODIFY_LEAF, thr, index, entry);
- if (err == DB_FAIL) {
- err = row_undo_mod_del_unmark_sec_and_undo_update(
- BTR_MODIFY_TREE, thr, index, entry);
- }
-
- if (err != DB_SUCCESS) {
- mem_heap_free(heap);
-
- return(err);
- }
+ BTR_MODIFY_TREE, thr, index, entry);
}
- node->index = dict_table_get_next_index(node->index);
+ if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ break;
+ }
}
mem_heap_free(heap);
- return(DB_SUCCESS);
+ return(err);
}
/***********************************************************//**
@@ -872,16 +854,19 @@ row_undo_mod(
node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
- if (node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
-
+ switch (node->rec_type) {
+ case TRX_UNDO_UPD_EXIST_REC:
err = row_undo_mod_upd_exist_sec(node, thr);
-
- } else if (node->rec_type == TRX_UNDO_DEL_MARK_REC) {
-
+ break;
+ case TRX_UNDO_DEL_MARK_REC:
err = row_undo_mod_del_mark_sec(node, thr);
- } else {
- ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
+ break;
+ case TRX_UNDO_UPD_DEL_REC:
err = row_undo_mod_upd_del_sec(node, thr);
+ break;
+ default:
+ ut_error;
+ err = DB_ERROR;
}
if (err == DB_SUCCESS) {
=== modified file 'storage/innobase/row/row0upd.c'
--- a/storage/innobase/row/row0upd.c revid:marc.alff@stripped
+++ b/storage/innobase/row/row0upd.c revid:vasil.dimov@stripped
@@ -2280,52 +2280,52 @@ row_upd(
}
}
- if (node->state == UPD_NODE_UPDATE_CLUSTERED
- || node->state == UPD_NODE_INSERT_CLUSTERED
- || node->state == UPD_NODE_INSERT_BLOB) {
-
+ switch (node->state) {
+ case UPD_NODE_UPDATE_CLUSTERED:
+ case UPD_NODE_INSERT_CLUSTERED:
+ case UPD_NODE_INSERT_BLOB:
log_free_check();
err = row_upd_clust_step(node, thr);
if (err != DB_SUCCESS) {
- goto function_exit;
+ return(err);
}
}
- if (!node->is_delete && (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ if (node->index == NULL
+ || (!node->is_delete
+ && (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE))) {
- goto function_exit;
+ return(DB_SUCCESS);
}
- while (node->index != NULL) {
-
+ do {
log_free_check();
err = row_upd_sec_step(node, thr);
if (err != DB_SUCCESS) {
- goto function_exit;
+ return(err);
}
node->index = dict_table_get_next_index(node->index);
- }
+ } while (node->index != NULL);
-function_exit:
- if (err == DB_SUCCESS) {
- /* Do some cleanup */
-
- if (node->row != NULL) {
- node->row = NULL;
- node->ext = NULL;
- node->upd_row = NULL;
- node->upd_ext = NULL;
- mem_heap_empty(node->heap);
- }
+ ut_ad(err == DB_SUCCESS);
- node->state = UPD_NODE_UPDATE_CLUSTERED;
+ /* Do some cleanup */
+
+ if (node->row != NULL) {
+ node->row = NULL;
+ node->ext = NULL;
+ node->upd_row = NULL;
+ node->upd_ext = NULL;
+ mem_heap_empty(node->heap);
}
+ node->state = UPD_NODE_UPDATE_CLUSTERED;
+
return(err);
}
=== modified file 'storage/innobase/srv/srv0mon.c'
--- a/storage/innobase/srv/srv0mon.c revid:marc.alff@stripped
+++ b/storage/innobase/srv/srv0mon.c revid:vasil.dimov@stripped
@@ -23,6 +23,7 @@ Database monitor counter interfaces
Created 12/9/2009 Jimmy Yang
*******************************************************/
+#ifndef UNIV_HOTBACKUP
#include "os0file.h"
#include "mach0data.h"
#include "srv0mon.h"
@@ -1520,4 +1521,4 @@ srv_mon_default_on(void)
}
}
}
-
+#endif /* !UNIV_HOTBACKUP */
=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c revid:marc.alff@stripped
+++ b/storage/innobase/srv/srv0srv.c revid:vasil.dimov@stripped
@@ -26,8 +26,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -68,11 +68,9 @@ Created 10/8/1995 Heikki Tuuri
#include "mysql/plugin.h"
#include "mysql/service_thd_wait.h"
-/* This is set to the MySQL server value for this variable. It is only
-needed for FOREIGN KEY definition parsing since FOREIGN KEY names are not
-stored in the server metadata. The server stores and enforces it for
-regular database and table names.*/
-UNIV_INTERN uint srv_lower_case_table_names = 0;
+/* The following counter is incremented whenever there is some user activity
+in the server */
+UNIV_INTERN ulint srv_activity_count = 0;
/* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulint srv_fatal_semaphore_wait_threshold = 600;
=== modified file 'storage/innobase/sync/sync0rw.c'
--- a/storage/innobase/sync/sync0rw.c revid:marc.alff@stripped
+++ b/storage/innobase/sync/sync0rw.c revid:vasil.dimov@stripped
@@ -583,14 +583,14 @@ rw_lock_x_lock_low(
#ifdef UNIV_SYNC_DEBUG
pass,
#endif
- file_name, line);
+ file_name, line);
} else {
/* Decrement failed: relock or failed lock */
if (!pass && lock->recursive
&& os_thread_eq(lock->writer_thread, curr_thread)) {
/* Relock */
- lock->lock_word -= X_LOCK_DECR;
+ lock->lock_word -= X_LOCK_DECR;
} else {
/* Another thread locked before us */
return(FALSE);
=== modified file 'storage/innobase/ut/ut0bh.c'
--- a/storage/innobase/ut/ut0bh.c revid:marc.alff@stripped
+++ b/storage/innobase/ut/ut0bh.c revid:vasil.dimov@stripped
@@ -1,11 +1,6 @@
/***************************************************************************//**
-Copyright (c) 2010, 2011, Oracle Corpn. All Rights Reserved.
-Portions of this file contain modifications contributed and copyrighted by
-Sun Microsystems, Inc. Those modifications are gratefully acknowledged and
-are described briefly in the InnoDB documentation. The contributions by
-Sun Microsystems are incorporated with their permission, and subject to the
-conditions contained in the file COPYING.Sun_Microsystems.
+Copyright (c) 2010, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -16,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
=== modified file 'storage/innobase/ut/ut0ut.c'
--- a/storage/innobase/ut/ut0ut.c revid:marc.alff@stripped
+++ b/storage/innobase/ut/ut0ut.c revid:vasil.dimov@stripped
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2011, Oracle Corpn. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
| Thread |
|---|
| • bzr commit into mysql-trunk branch (vasil.dimov:3333) | vasil.dimov | 28 Apr |