summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
Diffstat (limited to 'innobase')
-rwxr-xr-xinnobase/CMakeLists.txt53
-rw-r--r--innobase/Makefile.am6
-rw-r--r--innobase/btr/Makefile.am9
-rw-r--r--innobase/buf/Makefile.am9
-rw-r--r--innobase/data/Makefile.am9
-rw-r--r--innobase/dict/Makefile.am9
-rw-r--r--innobase/dict/dict0dict.c29
-rw-r--r--innobase/dyn/Makefile.am9
-rw-r--r--innobase/eval/Makefile.am9
-rw-r--r--innobase/fil/Makefile.am9
-rw-r--r--innobase/fsp/Makefile.am9
-rw-r--r--innobase/fut/Makefile.am9
-rw-r--r--innobase/ha/Makefile.am9
-rw-r--r--innobase/ibuf/Makefile.am6
-rw-r--r--innobase/include/Makefile.am6
-rw-r--r--innobase/include/hash0hash.h3
-rw-r--r--innobase/include/row0mysql.h2
-rw-r--r--innobase/include/sync0rw.h14
-rw-r--r--innobase/include/sync0sync.h32
-rw-r--r--innobase/include/sync0sync.ic4
-rw-r--r--innobase/lock/Makefile.am9
-rw-r--r--innobase/log/Makefile.am9
-rw-r--r--innobase/log/log0recv.c10
-rw-r--r--innobase/mach/Makefile.am9
-rw-r--r--innobase/mem/Makefile.am9
-rw-r--r--innobase/mtr/Makefile.am9
-rw-r--r--innobase/os/Makefile.am6
-rw-r--r--innobase/os/os0file.c2
-rw-r--r--innobase/page/Makefile.am9
-rw-r--r--innobase/pars/Makefile.am9
-rw-r--r--innobase/que/Makefile.am9
-rw-r--r--innobase/read/Makefile.am9
-rw-r--r--innobase/rem/Makefile.am9
-rw-r--r--innobase/row/Makefile.am9
-rw-r--r--innobase/row/row0mysql.c11
-rw-r--r--innobase/srv/Makefile.am9
-rw-r--r--innobase/srv/srv0start.c11
-rw-r--r--innobase/sync/Makefile.am9
-rw-r--r--innobase/sync/sync0rw.c14
-rw-r--r--innobase/sync/sync0sync.c32
-rw-r--r--innobase/thr/Makefile.am9
-rw-r--r--innobase/trx/Makefile.am9
-rw-r--r--innobase/trx/trx0roll.c20
-rw-r--r--innobase/trx/trx0trx.c18
-rw-r--r--innobase/usr/Makefile.am9
-rw-r--r--innobase/ut/Makefile.am9
46 files changed, 298 insertions, 224 deletions
diff --git a/innobase/CMakeLists.txt b/innobase/CMakeLists.txt
index c244364a800..21b9210a73e 100755
--- a/innobase/CMakeLists.txt
+++ b/innobase/CMakeLists.txt
@@ -1,41 +1,26 @@
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB)
# Bug#19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C)
-# Removing Win64 compiler optimizations for all innodb files.
+# Removing Win64 compiler optimizations for all innodb/mem/* files.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
- SET_SOURCE_FILES_PROPERTIES(btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
- buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
- data/data0data.c data/data0type.c
- dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
- dyn/dyn0dyn.c
- eval/eval0eval.c eval/eval0proc.c
- fil/fil0fil.c
- fsp/fsp0fsp.c
- fut/fut0fut.c fut/fut0lst.c
- ha/ha0ha.c ha/hash0hash.c
- ibuf/ibuf0ibuf.c
- pars/lexyy.c pars/pars0grm.c pars/pars0opt.c pars/pars0pars.c pars/pars0sym.c
- lock/lock0lock.c
- log/log0log.c log/log0recv.c
- mach/mach0data.c
- mem/mem0mem.c mem/mem0pool.c
- mtr/mtr0log.c mtr/mtr0mtr.c
- os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c
- page/page0cur.c page/page0page.c
- que/que0que.c
- read/read0read.c
- rem/rem0cmp.c rem/rem0rec.c
- row/row0ins.c row/row0mysql.c row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c
- row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c
- srv/srv0que.c srv/srv0srv.c srv/srv0start.c
- sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c
- thr/thr0loc.c
- trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c
- trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
- usr/usr0sess.c
- ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c
+ SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
PROPERTIES COMPILE_FLAGS -Od)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
@@ -71,7 +56,3 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c )
-# (Bug#19424) Removing Win64 compiler optimizations innobase project.
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
- SET_TARGET_PROPERTIES(innobase PROPERTIES COMPILE_FLAGS "/Od")
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
diff --git a/innobase/Makefile.am b/innobase/Makefile.am
index 10e793396d8..82bd44ba207 100644
--- a/innobase/Makefile.am
+++ b/innobase/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2004, 2006 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/innobase/btr/Makefile.am b/innobase/btr/Makefile.am
index ed61facb695..6b09b289cdc 100644
--- a/innobase/btr/Makefile.am
+++ b/innobase/btr/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libbtr.a
libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/buf/Makefile.am b/innobase/buf/Makefile.am
index 3f56c8b02d7..946d5a2e5c2 100644
--- a/innobase/buf/Makefile.am
+++ b/innobase/buf/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libbuf.a
libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/data/Makefile.am b/innobase/data/Makefile.am
index eeb6f129de0..6f9407d40e5 100644
--- a/innobase/data/Makefile.am
+++ b/innobase/data/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libdata.a
libdata_a_SOURCES = data0data.c data0type.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/dict/Makefile.am b/innobase/dict/Makefile.am
index 0034d2f8f1e..15cacca6f58 100644
--- a/innobase/dict/Makefile.am
+++ b/innobase/dict/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,3 +21,6 @@ libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\
dict0mem.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index fffe851bc52..ba03e1f5e41 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -27,6 +27,9 @@ Created 1/8/1996 Heikki Tuuri
#include "que0que.h"
#include "rem0cmp.h"
+/* Implement isspace() in a locale-independent way. (Bug #24299) */
+#define ib_isspace(c) strchr(" \v\f\t\r\n", c)
+
dict_sys_t* dict_sys = NULL; /* the dictionary system */
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
@@ -2406,7 +2409,7 @@ dict_accept(
*success = FALSE;
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -2451,7 +2454,7 @@ dict_scan_id(
*id = NULL;
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -2482,7 +2485,7 @@ dict_scan_id(
len++;
}
} else {
- while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
+ while (!ib_isspace(*ptr) && *ptr != '(' && *ptr != ')'
&& (accept_also_dot || *ptr != '.')
&& *ptr != ',' && *ptr != '\0') {
@@ -2512,12 +2515,12 @@ dict_scan_id(
if (heap && !quote) {
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
latin1, a 'non-breakable space') to the end of a table name.
- But isspace(0xA0) is not true, which confuses our foreign key
- parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
- and 0xA0 are at the end of the string.
+ After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
+ and 0xA0 are at the end of the string, and ib_isspace()
+ does not work for multi-byte UTF-8 characters.
- TODO: we should lex the string using thd->charset_info, and
- my_isspace(). Only after that, convert id names to UTF-8. */
+ In MySQL 5.1 we lex the string using thd->charset_info, and
+ my_isspace(). This workaround is not needed there. */
b = (byte*)(*id);
id_len = strlen((char*) b);
@@ -3006,11 +3009,11 @@ loop:
ut_a(success);
- if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') {
+ if (!ib_isspace(*ptr) && *ptr != '"' && *ptr != '`') {
goto loop;
}
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -3052,7 +3055,7 @@ loop:
goto loop;
}
- if (!isspace(*ptr)) {
+ if (!ib_isspace(*ptr)) {
goto loop;
}
@@ -3140,7 +3143,7 @@ col_loop1:
}
ptr = dict_accept(ptr, "REFERENCES", &success);
- if (!success || !isspace(*ptr)) {
+ if (!success || !ib_isspace(*ptr)) {
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
@@ -3527,7 +3530,7 @@ loop:
ptr = dict_accept(ptr, "DROP", &success);
- if (!isspace(*ptr)) {
+ if (!ib_isspace(*ptr)) {
goto loop;
}
diff --git a/innobase/dyn/Makefile.am b/innobase/dyn/Makefile.am
index ec33a3c18a9..57d9a25e481 100644
--- a/innobase/dyn/Makefile.am
+++ b/innobase/dyn/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libdyn.a
libdyn_a_SOURCES = dyn0dyn.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/eval/Makefile.am b/innobase/eval/Makefile.am
index aebffb91be3..6c2b05d8b7a 100644
--- a/innobase/eval/Makefile.am
+++ b/innobase/eval/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libeval.a
libeval_a_SOURCES = eval0eval.c eval0proc.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/fil/Makefile.am b/innobase/fil/Makefile.am
index dc0baff7d1a..0a85ceb5b86 100644
--- a/innobase/fil/Makefile.am
+++ b/innobase/fil/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libfil.a
libfil_a_SOURCES = fil0fil.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/fsp/Makefile.am b/innobase/fsp/Makefile.am
index edf06bda0d6..7818cdafc1b 100644
--- a/innobase/fsp/Makefile.am
+++ b/innobase/fsp/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,3 +21,6 @@ noinst_LIBRARIES = libfsp.a
libfsp_a_SOURCES = fsp0fsp.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/fut/Makefile.am b/innobase/fut/Makefile.am
index 839fdb1580e..ffe9835a023 100644
--- a/innobase/fut/Makefile.am
+++ b/innobase/fut/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libfut.a
libfut_a_SOURCES = fut0fut.c fut0lst.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/ha/Makefile.am b/innobase/ha/Makefile.am
index 121bafe167d..696cad0b203 100644
--- a/innobase/ha/Makefile.am
+++ b/innobase/ha/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libha.a
libha_a_SOURCES = ha0ha.c hash0hash.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/ibuf/Makefile.am b/innobase/ibuf/Makefile.am
index fb813d38ee5..42adda9a4ef 100644
--- a/innobase/ibuf/Makefile.am
+++ b/innobase/ibuf/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am
index b83aee06680..8a7efad64f9 100644
--- a/innobase/include/Makefile.am
+++ b/innobase/include/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2004-2005 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/innobase/include/hash0hash.h b/innobase/include/hash0hash.h
index 51315e40875..13f46760698 100644
--- a/innobase/include/hash0hash.h
+++ b/innobase/include/hash0hash.h
@@ -18,6 +18,9 @@ typedef struct hash_cell_struct hash_cell_t;
typedef void* hash_node_t;
+/* Fix Bug #13859: symbol collision between imap/mysql */
+#define hash_create hash0_create
+
/*****************************************************************
Creates a hash table with >= n array cells. The actual number
of cells is chosen to be a prime number slightly bigger than n. */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 7d8740db044..9e28fabe491 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri
#include "btr0pcur.h"
#include "trx0types.h"
+extern ibool row_rollback_on_timeout;
+
typedef struct row_prebuilt_struct row_prebuilt_t;
/***********************************************************************
diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
index 741f9500612..4cd26ba1921 100644
--- a/innobase/include/sync0rw.h
+++ b/innobase/include/sync0rw.h
@@ -61,8 +61,12 @@ Creates, or rather, initializes an rw-lock object in a specified memory
location (which must be appropriately aligned). The rw-lock is initialized
to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free
is necessary only if the memory block containing it is freed. */
-#define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__, #L)
-
+#ifdef UNIV_DEBUG
+# define rw_lock_create(L) rw_lock_create_func((L), #L, __FILE__, __LINE__)
+#else /* UNIV_DEBUG */
+# define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__)
+#endif /* UNIV_DEBUG */
+
/*=====================*/
/**********************************************************************
Creates, or rather, initializes an rw-lock object in a specified memory
@@ -74,9 +78,11 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
+#ifdef UNIV_DEBUG
+ const char* cmutex_name, /* in: mutex name */
+#endif /* UNIV_DEBUG */
const char* cfile_name, /* in: file name where created */
- ulint cline, /* in: file line where created */
- const char* cmutex_name); /* in: mutex name */
+ ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
the rw-lock is freed. Removes an rw-lock object from the global list. The
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 9893921c5d2..769c2a98244 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -39,7 +39,11 @@ location (which must be appropriately aligned). The mutex is initialized
in the reset state. Explicit freeing of the mutex with mutex_free is
necessary only if the memory block containing it is freed. */
-#define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__, #M)
+#ifdef UNIV_DEBUG
+# define mutex_create(M) mutex_create_func((M), #M, __FILE__, __LINE__)
+#else
+# define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__)
+#endif
/*===================*/
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
@@ -51,9 +55,11 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
+#ifdef UNIV_DEBUG
+ const char* cmutex_name, /* in: mutex name */
+#endif /* UNIV_DEBUG */
const char* cfile_name, /* in: file name where created */
- ulint cline, /* in: file line where created */
- const char* cmutex_name); /* in: mutex name */
+ ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
the mutex is freed. Removes a mutex object from the mutex list. The mutex
@@ -479,15 +485,17 @@ struct mutex_struct {
ulint cline; /* Line where created */
ulint magic_n;
#ifndef UNIV_HOTBACKUP
- ulong count_using; /* count of times mutex used */
- ulong count_spin_loop; /* count of spin loops */
- ulong count_spin_rounds; /* count of spin rounds */
- ulong count_os_wait; /* count of os_wait */
- ulong count_os_yield; /* count of os_wait */
- ulonglong lspent_time; /* mutex os_wait timer msec */
- ulonglong lmax_spent_time; /* mutex os_wait timer msec */
- const char* cmutex_name;/* mutex name */
- ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */
+ ulong count_os_wait; /* count of os_wait */
+# ifdef UNIV_DEBUG
+ ulong count_using; /* count of times mutex used */
+ ulong count_spin_loop; /* count of spin loops */
+ ulong count_spin_rounds; /* count of spin rounds */
+ ulong count_os_yield; /* count of os_wait */
+ ulonglong lspent_time; /* mutex os_wait timer msec */
+ ulonglong lmax_spent_time; /* mutex os_wait timer msec */
+ const char* cmutex_name;/* mutex name */
+ ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */
+# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
};
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index b3fde61db5e..a32a82d6e8b 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -250,9 +250,9 @@ mutex_enter_func(
/* Note that we do not peek at the value of lock_word before trying
the atomic test_and_set; we could peek, and possibly save time. */
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_using++;
-#endif /* UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
if (!mutex_test_and_set(mutex))
{
diff --git a/innobase/lock/Makefile.am b/innobase/lock/Makefile.am
index 549eb2604e3..4c6caa49853 100644
--- a/innobase/lock/Makefile.am
+++ b/innobase/lock/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = liblock.a
liblock_a_SOURCES = lock0lock.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/log/Makefile.am b/innobase/log/Makefile.am
index 2dbaf93e6d9..a40572a64da 100644
--- a/innobase/log/Makefile.am
+++ b/innobase/log/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = liblog.a
liblog_a_SOURCES = log0log.c log0recv.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index 113d237b535..c1ceb9791f2 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -33,6 +33,7 @@ Created 9/20/1997 Heikki Tuuri
#include "btr0cur.h"
#include "dict0boot.h"
#include "fil0fil.h"
+#include "sync0sync.h"
#ifdef UNIV_HOTBACKUP
/* This is set to FALSE if the backup was originally taken with the
@@ -2969,6 +2970,15 @@ recv_recovery_from_checkpoint_finish(void)
#ifndef UNIV_LOG_DEBUG
recv_sys_free();
#endif
+
+#ifdef UNIV_SYNC_DEBUG
+ /* Wait for a while so that created threads have time to suspend
+ themselves before we switch the latching order checks on */
+ os_thread_sleep(1000000);
+
+ /* Switch latching order checks on in sync0sync.c */
+ sync_order_checks_on = TRUE;
+#endif
if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
/* Rollback the uncommitted transactions which have no user
session */
diff --git a/innobase/mach/Makefile.am b/innobase/mach/Makefile.am
index ce827c8033f..1a59cb3e4d7 100644
--- a/innobase/mach/Makefile.am
+++ b/innobase/mach/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libmach.a
libmach_a_SOURCES = mach0data.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/mem/Makefile.am b/innobase/mem/Makefile.am
index 10b7771b580..598dbb96124 100644
--- a/innobase/mem/Makefile.am
+++ b/innobase/mem/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,3 +22,6 @@ libmem_a_SOURCES = mem0mem.c mem0pool.c
EXTRA_DIST = mem0dbg.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/mtr/Makefile.am b/innobase/mtr/Makefile.am
index 1e93a34ce23..80eb7c907be 100644
--- a/innobase/mtr/Makefile.am
+++ b/innobase/mtr/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libmtr.a
libmtr_a_SOURCES = mtr0mtr.c mtr0log.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am
index 3b09a10efb5..d5c45eba54e 100644
--- a/innobase/os/Makefile.am
+++ b/innobase/os/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 075005c3611..5e5c4b19eb0 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -1718,7 +1718,7 @@ os_file_set_size(
}
/* Print about progress for each 100 MB written */
- if ((current_size + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
+ if ((ib_longlong) (current_size + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
!= current_size / (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, " %lu00",
diff --git a/innobase/page/Makefile.am b/innobase/page/Makefile.am
index 2e260787438..1a5b202a2c9 100644
--- a/innobase/page/Makefile.am
+++ b/innobase/page/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libpage.a
libpage_a_SOURCES = page0page.c page0cur.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/pars/Makefile.am b/innobase/pars/Makefile.am
index 2356f330486..b10796c3d5e 100644
--- a/innobase/pars/Makefile.am
+++ b/innobase/pars/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,3 +22,6 @@ noinst_HEADERS = pars0grm.h
libpars_a_SOURCES = pars0grm.c lexyy.c pars0opt.c pars0pars.c pars0sym.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/que/Makefile.am b/innobase/que/Makefile.am
index d9c046b4f4c..73f3fb07af4 100644
--- a/innobase/que/Makefile.am
+++ b/innobase/que/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libque.a
libque_a_SOURCES = que0que.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/read/Makefile.am b/innobase/read/Makefile.am
index 7edf2a5a2e1..1e56a9716c3 100644
--- a/innobase/read/Makefile.am
+++ b/innobase/read/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libread.a
libread_a_SOURCES = read0read.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/rem/Makefile.am b/innobase/rem/Makefile.am
index e2b2fdaf669..1026172b815 100644
--- a/innobase/rem/Makefile.am
+++ b/innobase/rem/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = librem.a
librem_a_SOURCES = rem0rec.c rem0cmp.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/row/Makefile.am b/innobase/row/Makefile.am
index bd09f9a237d..6c1f960055d 100644
--- a/innobase/row/Makefile.am
+++ b/innobase/row/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,3 +21,6 @@ librow_a_SOURCES = row0ins.c row0mysql.c row0purge.c row0row.c row0sel.c\
row0uins.c row0umod.c row0undo.c row0upd.c row0vers.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index efbb93ba9f5..4bc5f39359c 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri
/* A dummy variable used to fool the compiler */
ibool row_mysql_identically_false = FALSE;
+/* Provide optional 4.x backwards compatibility for 5.0 and above */
+ibool row_rollback_on_timeout = FALSE;
+
/* List of tables we should drop in background. ALTER TABLE in MySQL requires
that the table handler can drop the table in background when there are no
queries to it any more. Protected by the kernel mutex. */
@@ -514,7 +517,9 @@ handle_new_error:
return(TRUE);
} else if (err == DB_DEADLOCK
- || err == DB_LOCK_TABLE_FULL) {
+ || err == DB_LOCK_TABLE_FULL
+ || (err == DB_LOCK_WAIT_TIMEOUT
+ && row_rollback_on_timeout)) {
/* Roll back the whole transaction; this resolution was added
to version 3.23.43 */
@@ -522,6 +527,10 @@ handle_new_error:
} else if (err == DB_OUT_OF_FILE_SPACE
|| err == DB_LOCK_WAIT_TIMEOUT) {
+
+ ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT
+ && row_rollback_on_timeout));
+
if (savept) {
/* Roll back the latest, possibly incomplete
insertion or update */
diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am
index 752683b82b8..e0b5b911b04 100644
--- a/innobase/srv/Makefile.am
+++ b/innobase/srv/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libsrv.a
libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index b41dcbe44cd..5f8707a661c 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1554,17 +1554,6 @@ innobase_start_or_create_for_mysql(void)
srv_was_started = TRUE;
srv_is_being_started = FALSE;
-#ifdef UNIV_DEBUG
- /* Wait a while so that the created threads have time to suspend
- themselves before we switch sync debugging on; otherwise a thread may
- execute mutex_enter() before the checks are on, and mutex_exit() after
- the checks are on, which will cause an assertion failure in sync
- debug. */
-
- os_thread_sleep(3000000);
-#endif
- sync_order_checks_on = TRUE;
-
if (trx_doublewrite == NULL) {
/* Create the doublewrite buffer to a new tablespace */
diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am
index c95955a733b..7cf274b64e8 100644
--- a/innobase/sync/Makefile.am
+++ b/innobase/sync/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libsync.a
libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 050de73db9e..629331d6049 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -89,9 +89,11 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
+#ifdef UNIV_DEBUG
+ const char* cmutex_name, /* in: mutex name */
+#endif /* UNIV_DEBUG */
const char* cfile_name, /* in: file name where created */
- ulint cline, /* in: file line where created */
- const char* cmutex_name) /* in: mutex name */
+ ulint cline) /* in: file line where created */
{
/* If this is the very first time a synchronization
object is created, then the following call initializes
@@ -102,10 +104,10 @@ rw_lock_create_func(
lock->mutex.cfile_name = cfile_name;
lock->mutex.cline = cline;
-#ifndef UNIV_HOTBACKUP
- lock->mutex.cmutex_name = cmutex_name;
- lock->mutex.mutex_type = 1;
-#endif /* !UNIV_HOTBACKUP */
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
+ lock->mutex.cmutex_name = cmutex_name;
+ lock->mutex.mutex_type = 1;
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
rw_lock_set_waiters(lock, 0);
rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 95bf83dce79..25b7a5588d9 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -202,9 +202,11 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
+#ifdef UNIV_DEBUG
+ const char* cmutex_name, /* in: mutex name */
+#endif /* UNIV_DEBUG */
const char* cfile_name, /* in: file name where created */
- ulint cline, /* in: file line where created */
- const char* cmutex_name) /* in: mutex name */
+ ulint cline) /* in: file line where created */
{
#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
mutex_reset_lock_word(mutex);
@@ -223,6 +225,8 @@ mutex_create_func(
mutex->cfile_name = cfile_name;
mutex->cline = cline;
#ifndef UNIV_HOTBACKUP
+ mutex->count_os_wait = 0;
+# ifdef UNIV_DEBUG
mutex->cmutex_name= cmutex_name;
mutex->count_using= 0;
mutex->mutex_type= 0;
@@ -230,8 +234,8 @@ mutex_create_func(
mutex->lmax_spent_time= 0;
mutex->count_spin_loop= 0;
mutex->count_spin_rounds= 0;
- mutex->count_os_wait= 0;
mutex->count_os_yield= 0;
+# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
/* Check that lock_word is aligned; this is important on Intel */
@@ -378,13 +382,13 @@ mutex_spin_wait(
{
ulint index; /* index of the reserved wait cell */
ulint i; /* spin round count */
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
ib_longlong lstart_time = 0, lfinish_time; /* for timing os_wait */
ulint ltime_diff;
ulint sec;
ulint ms;
uint timer_started = 0;
-#endif /* !UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
ut_ad(mutex);
mutex_loop:
@@ -398,10 +402,10 @@ mutex_loop:
memory word. */
spin_loop:
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex_spin_wait_count++;
mutex->count_spin_loop++;
-#endif /* !UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
while (mutex_get_lock_word(mutex) != 0 && i < SYNC_SPIN_ROUNDS)
{
@@ -415,7 +419,7 @@ spin_loop:
if (i == SYNC_SPIN_ROUNDS)
{
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_os_yield++;
if (timed_mutexes == 1 && timer_started==0)
{
@@ -423,7 +427,7 @@ spin_loop:
lstart_time= (ib_longlong)sec * 1000000 + ms;
timer_started = 1;
}
-#endif /* !UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
os_thread_yield();
}
@@ -436,9 +440,9 @@ spin_loop:
mutex_spin_round_count += i;
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
mutex->count_spin_rounds += i;
-#endif /* !UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
if (mutex_test_and_set(mutex) == 0)
{
@@ -522,6 +526,7 @@ Now there is no risk of infinite wait on the event. */
#ifndef UNIV_HOTBACKUP
mutex->count_os_wait++;
+# ifdef UNIV_DEBUG
/*
!!!!! Sometimes os_wait can be called without os_thread_yield
*/
@@ -532,13 +537,14 @@ Now there is no risk of infinite wait on the event. */
lstart_time= (ib_longlong)sec * 1000000 + ms;
timer_started = 1;
}
+# endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
sync_array_wait_event(sync_primary_wait_array, index);
goto mutex_loop;
finish_timing:
-#ifndef UNIV_HOTBACKUP
+#if defined UNIV_DEBUG && !defined UNIV_HOTBACKUP
if (timed_mutexes == 1 && timer_started==1)
{
ut_usectime(&sec, &ms);
@@ -551,7 +557,7 @@ finish_timing:
mutex->lmax_spent_time= ltime_diff;
}
}
-#endif /* !UNIV_HOTBACKUP */
+#endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */
return;
}
diff --git a/innobase/thr/Makefile.am b/innobase/thr/Makefile.am
index 62c39492c07..febcdf3e1a3 100644
--- a/innobase/thr/Makefile.am
+++ b/innobase/thr/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libthr.a
libthr_a_SOURCES = thr0loc.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/trx/Makefile.am b/innobase/trx/Makefile.am
index 9e2b3c398e3..f9722454ef5 100644
--- a/innobase/trx/Makefile.am
+++ b/innobase/trx/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,3 +21,6 @@ libtrx_a_SOURCES = trx0purge.c trx0rec.c trx0roll.c trx0rseg.c\
trx0sys.c trx0trx.c trx0undo.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index fdfb7428129..bf8b9fd1939 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -129,9 +129,27 @@ trx_rollback_for_mysql(
}
trx->op_info = "rollback";
+
+ /* If we are doing the XA recovery of prepared transactions, then
+ the transaction object does not have an InnoDB session object, and we
+ set a dummy session that we use for all MySQL transactions. */
- err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
+ mutex_enter(&kernel_mutex);
+
+ if (trx->sess == NULL) {
+ /* Open a dummy session */
+
+ if (!trx_dummy_sess) {
+ trx_dummy_sess = sess_open();
+ }
+ trx->sess = trx_dummy_sess;
+ }
+
+ mutex_exit(&kernel_mutex);
+
+ err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
+
trx->op_info = "";
return(err);
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 2637b28ef90..4dc826e5947 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -1601,7 +1601,25 @@ trx_commit_for_mysql(
ut_a(trx);
trx->op_info = "committing";
+
+ /* If we are doing the XA recovery of prepared transactions, then
+ the transaction object does not have an InnoDB session object, and we
+ set the dummy session that we use for all MySQL transactions. */
+
+ mutex_enter(&kernel_mutex);
+
+ if (trx->sess == NULL) {
+ /* Open a dummy session */
+
+ if (!trx_dummy_sess) {
+ trx_dummy_sess = sess_open();
+ }
+
+ trx->sess = trx_dummy_sess;
+ }
+ mutex_exit(&kernel_mutex);
+
trx_start_if_not_started(trx);
mutex_enter(&kernel_mutex);
diff --git a/innobase/usr/Makefile.am b/innobase/usr/Makefile.am
index bdcc832a76e..ea485022f71 100644
--- a/innobase/usr/Makefile.am
+++ b/innobase/usr/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libusr.a
libusr_a_SOURCES = usr0sess.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/innobase/ut/Makefile.am b/innobase/ut/Makefile.am
index 2fdbb99e0f3..41ba85f5836 100644
--- a/innobase/ut/Makefile.am
+++ b/innobase/ut/Makefile.am
@@ -1,10 +1,8 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
+# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,3 +20,6 @@ noinst_LIBRARIES = libut.a
libut_a_SOURCES = ut0byte.c ut0dbg.c ut0mem.c ut0rnd.c ut0ut.c
EXTRA_PROGRAMS =
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%