summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tsmith@ramayana.hindu.god>2007-07-31 17:36:19 -0600
committerunknown <tsmith@ramayana.hindu.god>2007-07-31 17:36:19 -0600
commit82fbe7a418f7048496bc95f754d97782a1984e93 (patch)
treee4a69058f978ea7d9c5c6ec1f615a82b87abefd8
parent5713d2e069017b8fbfda9dcf5c3380534e39a52a (diff)
parentd0e8d1ab5401a2cc7ce8f75e15340b67fed6cfbf (diff)
downloadmariadb-git-82fbe7a418f7048496bc95f754d97782a1984e93.tar.gz
Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into ramayana.hindu.god:/home/tsmith/m/bk/maint/jul31/51 mysql-test/r/federated.result: Auto merged mysql-test/t/federated.test: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged storage/federated/ha_federated.h: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged mysql-test/include/mix1.inc: Manual merge mysql-test/r/innodb_mysql.result: Manual merge
-rw-r--r--.bzrignore1
-rw-r--r--CMakeLists.txt38
-rw-r--r--extra/yassl/taocrypt/src/coding.cpp2
-rw-r--r--mysql-test/include/mix1.inc9
-rw-r--r--mysql-test/r/federated.result37
-rw-r--r--mysql-test/r/innodb_mysql.result15
-rw-r--r--mysql-test/r/ssl_8k_key.result2
-rw-r--r--mysql-test/std_data/server8k-cert.pem51
-rw-r--r--mysql-test/std_data/server8k-key.pem99
-rw-r--r--mysql-test/t/federated.test40
-rw-r--r--mysql-test/t/ssl_8k_key.test6
-rw-r--r--mysql-test/t/status.test4
-rw-r--r--scripts/mysqld_safe.sh116
-rw-r--r--sql/CMakeLists.txt4
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/sql_select.cc7
-rw-r--r--sql/sql_table.cc9
-rw-r--r--storage/federated/ha_federated.h1
-rw-r--r--storage/innobase/Makefile.am5
-rw-r--r--storage/innobase/buf/buf0buf.c12
-rw-r--r--storage/innobase/buf/buf0lru.c13
-rw-r--r--storage/innobase/fsp/fsp0fsp.c5
-rw-r--r--storage/innobase/handler/ha_innodb.cc41
-rw-r--r--storage/innobase/include/buf0buf.ic2
-rw-r--r--storage/innobase/include/fsp0fsp.h2
-rw-r--r--storage/innobase/include/lock0iter.h52
-rw-r--r--storage/innobase/include/lock0lock.h14
-rw-r--r--storage/innobase/include/lock0priv.h101
-rw-r--r--storage/innobase/include/lock0priv.ic32
-rw-r--r--storage/innobase/include/mem0mem.ic6
-rw-r--r--storage/innobase/include/page0page.h9
-rw-r--r--storage/innobase/include/row0mysql.h13
-rw-r--r--storage/innobase/include/univ.i16
-rw-r--r--storage/innobase/lock/lock0iter.c90
-rw-r--r--storage/innobase/lock/lock0lock.c64
-rw-r--r--storage/innobase/log/log0recv.c247
-rw-r--r--storage/innobase/mem/mem0mem.c1
-rw-r--r--storage/innobase/mem/mem0pool.c6
-rw-r--r--storage/innobase/os/os0file.c3
-rw-r--r--storage/innobase/page/page0page.c12
-rw-r--r--storage/innobase/rem/rem0rec.c6
-rw-r--r--storage/innobase/row/row0mysql.c22
-rw-r--r--storage/innobase/sync/sync0rw.c18
-rw-r--r--storage/innobase/sync/sync0sync.c1
-rw-r--r--storage/innobase/trx/trx0sys.c11
-rw-r--r--storage/innobase/trx/trx0trx.c12
-rw-r--r--storage/innobase/ut/ut0mem.c2
-rw-r--r--win/README4
-rwxr-xr-xwin/create_manifest.js2
-rwxr-xr-xwin/mysql_manifest.cmake7
50 files changed, 998 insertions, 277 deletions
diff --git a/.bzrignore b/.bzrignore
index 329c5e227ca..d44aefea583 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -5,6 +5,7 @@
*.bb
*.bbg
*.bin
+*.cdf
*.core
*.d
*.da
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bdb1e01612..6395ae17a14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,21 +149,47 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
IF(EMBED_MANIFESTS)
- # Search for the Manifest tool. CMake will first search it's defaults
- # (CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and
- # the system PATH) followed by the listed paths which are the current
- # possible defaults and should be updated when necessary. The custom
- # manifests are designed to be compatible with all mt versions.
+ # Search for the tools (mt, makecat, signtool) necessary for embedding
+ # manifests and signing executables with the MySQL AB authenticode cert.
+ #
+ # CMake will first search it's defaults (CMAKE_FRAMEWORK_PATH,
+ # CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and the system PATH) followed
+ # by the listed paths which are the current possible defaults and should be
+ # updated when necessary.
+ #
+ # The custom manifests are designed to be compatible with all mt versions.
+ # The MySQL AB Authenticode certificate is available only internally.
+ # Others should store a single signing certificate in a local cryptographic
+ # service provider and alter the signtool command as necessary.
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
PATHS
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+ FIND_PROGRAM(HAVE_CATALOG_TOOL NAMES makecat
+ PATHS
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin")
+ FIND_PROGRAM(HAVE_SIGN_TOOL NAMES signtool
+ PATHS
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
+ "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
+
IF(HAVE_MANIFEST_TOOL)
- MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
+ MESSAGE(STATUS "Found Mainfest Tool.")
ELSE(HAVE_MANIFEST_TOOL)
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
ENDIF(HAVE_MANIFEST_TOOL)
+ IF(HAVE_CATALOG_TOOL)
+ MESSAGE(STATUS "Found Catalog Tool.")
+ ELSE(HAVE_CATALOG_TOOL)
+ MESSAGE(FATAL_ERROR "Catalog tool, makecat.exe, can't be found.")
+ ENDIF(HAVE_CATALOG_TOOL)
+ IF(HAVE_SIGN_TOOL)
+ MESSAGE(STATUS "Found Sign Tool. Embedding custom manifests and signing executables.")
+ ELSE(HAVE_SIGN_TOOL)
+ MESSAGE(FATAL_ERROR "Sign tool, signtool.exe, can't be found.")
+ ENDIF(HAVE_SIGN_TOOL)
+
# Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp
index 68055b3aff4..55fe31831e3 100644
--- a/extra/yassl/taocrypt/src/coding.cpp
+++ b/extra/yassl/taocrypt/src/coding.cpp
@@ -184,7 +184,7 @@ void Base64Decoder::Decode()
{
word32 bytes = coded_.size();
word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz);
- plainSz = (plainSz * 3 + 3) / 4;
+ plainSz = ((plainSz * 3) / 4) + 3;
decoded_.New(plainSz);
word32 i = 0;
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 591971a32a4..d8bc4c40bf3 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -898,10 +898,17 @@ DISCONNECT con2;
DROP PROCEDURE p1;
DROP TABLE t1;
+#
+# Bug #28125: ERROR 2013 when adding index.
+#
+create table t1(a text) engine=innodb default charset=utf8;
+insert into t1 values('aaa');
+alter table t1 add index(a(1024));
+show create table t1;
+drop table t1;
--echo End of 5.0 tests
-
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
# UPDATE": if the row is updated, it's like a regular UPDATE:
# LAST_INSERT_ID() is not affected.
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index cfb445e9427..ca936cd5fde 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -1844,6 +1844,43 @@ C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
drop table federated.t1;
drop table federated.t1;
+CREATE TABLE federated.t1 (
+categoryId int(11) NOT NULL AUTO_INCREMENT,
+domainId varchar(745) NOT NULL DEFAULT '',
+categoryName varchar(255) NOT NULL DEFAULT '',
+PRIMARY KEY (categoryId),
+UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+KEY idx_category_domainId (domainId)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE federated.t1 (
+categoryId int(11) NOT NULL AUTO_INCREMENT,
+domainId varchar(745) NOT NULL DEFAULT '',
+categoryName varchar(255) NOT NULL DEFAULT '',
+PRIMARY KEY (categoryId),
+UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+KEY idx_category_domainId (domainId)
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250');
+insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250');
+insert into federated.t1 (domainId, categoryName) values ('a', 'b');
+select categoryId from federated.t1 order by domainId, categoryName;
+categoryId
+1
+2
+3
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+categoryId
+3
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+categoryId
+3
+select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId;
+categoryId
+1
+2
+drop table federated.t1;
+drop table federated.t1;
create table federated.t1 (a int primary key, b varchar(64))
DEFAULT CHARSET=utf8;
create table federated.t1 (a int primary key, b varchar(64))
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 273374d016b..4beb818c1eb 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -755,7 +755,7 @@ drop table t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci;
Warnings:
-Warning 1071 Specified key was too long; max key length is 765 bytes
+Warning 1071 Specified key was too long; max key length is 767 bytes
insert into t1 values('aaa');
drop table t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
@@ -1082,6 +1082,19 @@ CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
+create table t1(a text) engine=innodb default charset=utf8;
+insert into t1 values('aaa');
+alter table t1 add index(a(1024));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+Warning 1071 Specified key was too long; max key length is 767 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text,
+ KEY `a` (`a`(255))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+drop table t1;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,
diff --git a/mysql-test/r/ssl_8k_key.result b/mysql-test/r/ssl_8k_key.result
new file mode 100644
index 00000000000..b33a1d2854f
--- /dev/null
+++ b/mysql-test/r/ssl_8k_key.result
@@ -0,0 +1,2 @@
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem
new file mode 100644
index 00000000000..a0750f9e69e
--- /dev/null
+++ b/mysql-test/std_data/server8k-cert.pem
@@ -0,0 +1,51 @@
+-----BEGIN CERTIFICATE-----
+MIIJHDCCBQQCAQEwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCU0UxEDAOBgNV
+BAgTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMQ0wCwYDVQQLEwRUZXN0MQsw
+CQYDVQQDEwJDQTAeFw0wNzA3MTMwNzU2MjVaFw0xMDA0MDgwNzU2MjVaMFoxCzAJ
+BgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRkwFwYDVQQKFBBNeVNRTCAgIAog
+ICAgIEFCMQ0wCwYDVQQLEwRUZXN0MQ8wDQYDVQQDEwZzZXJ2ZXIwggQiMA0GCSqG
+SIb3DQEBAQUAA4IEDwAwggQKAoIEAQDUFlh/3mwov5YaICFXOdJXgHV/uDkTjXB6
+9oxlipshQaYPX8LDT5vhI3gPciS1Z1sRE2dTcC4Mk2K4LDUIjp3WkeTfFAHZPV3E
+Y+3OH/ftH4N6SEIBTKE4EY6ah0nJtU98M0JhxOh5zHje6zQp1SkBnhEOQYexYRqj
+OtGloZ9RyF0iFAXcyu2Ap14u37l5Yla0cyPzvZqP4mFYlcXwaRfAacJmqMM1vuQv
+Fx1JITUTBugMF3VGZ1F0tw63EIUH/FW/WWncPqvG18na40qlv9ZkBw0FhZeKS8cK
+JIY5y4J30jn/eV8p1lTO7K+ASTuGZWmdRDgjUG0Y9OGuKsPPoaE6ml0HTnMBsBSQ
+fXUq9XkwGt8DTgPioAKHBHjLbILEy4FMYWrlTZlPTzNqyhayec/2T15oDladNSt7
+JpDLpX70UECXFhdEGxsGxtXdKbIBvNm2yT4X2nxW9ItsECjSSgD+94TgGoa8QKDw
+rpmgq+Wqpm54CZ1vN1oqyMUw1sjNEX/iLByHAjSALby2Kffk5cl5mnsR6d/k4jsi
+c3Qsciwkd+rQ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70FkNXLLm/Dy+MjW2qFBtIoBgNptVGp94L1uZS
+amd2XJMcOQ+X9fcH3wAdM3IHGn3NiLf6eTW92JNNA0IN6aNtyVaJKmFJ1JfXOl9r
+ujr4SorRSesaerjIcuzW1u1YE5RlgeI4kizV2/D5kYc=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem
new file mode 100644
index 00000000000..608593a5096
--- /dev/null
+++ b/mysql-test/std_data/server8k-key.pem
@@ -0,0 +1,99 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIISKQIBAAKCBAEA1BZYf95sKL+WGiAhVznSV4B1f7g5E41wevaMZYqbIUGmD1/C
+w0+b4SN4D3IktWdbERNnU3AuDJNiuCw1CI6d1pHk3xQB2T1dxGPtzh/37R+DekhC
+AUyhOBGOmodJybVPfDNCYcToecx43us0KdUpAZ4RDkGHsWEaozrRpaGfUchdIhQF
+3MrtgKdeLt+5eWJWtHMj872aj+JhWJXF8GkXwGnCZqjDNb7kLxcdSSE1EwboDBd1
+RmdRdLcOtxCFB/xVv1lp3D6rxtfJ2uNKpb/WZAcNBYWXikvHCiSGOcuCd9I5/3lf
+KdZUzuyvgEk7hmVpnUQ4I1BtGPThrirDz6GhOppdB05zAbAUkH11KvV5MBrfA04D
+4qAChwR4y2yCxMuBTGFq5U2ZT08zasoWsnnP9k9eaA5WnTUreyaQy6V+9FBAlxYX
+RBsbBsbV3SmyAbzZtsk+F9p8VvSLbBAo0koA/veE4BqGvECg8K6ZoKvlqqZueAmd
+bzdaKsjFMNbIzRF/4iwchwI0gC28tin35OXJeZp7Eenf5OI7InN0LHIsJHfq0Lf/
+FTIUtp7N55Hs/wStxb0ANjLPMSYRS37M1awYZ43BUUzU9vvyjJa9aE+UNV2Si+6l
+V06Wmzy+dSZVQS+Qkh5dUEZH37Kn6nICZHBwavpCo1IhbOJWnYU67zQQl2GufjZA
+NkKiH3TqTcJetv4HRO/+81NboeNL5FSssy/gD5Cz8sD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PBB2ludDEXSpWBqiraynolOT/o52r+taYp9YY2WU3GrhOiV/A1FV
+Nl118xiF6FOFpEeTbhHvy27A8kZEKXgeSs+f4aC0XG9kLVD1CiCbQiqHTDcDS4nV
+O1N1eQxhP81X+YKE4Lgufh07REqYVwtCj2lQcMp73WDyfBLKTEFlmHusoqmT5JCH
+X0BWNjk5Dn1g5h63/lQb+EjNRILBhDFYhrDRDQtw5p0/7IY3AcNKDUHv+XGn
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index efca7f3232d..6597c77e798 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1632,6 +1632,46 @@ drop table federated.t1;
connection slave;
drop table federated.t1;
+#
+# Bug#26909: Specified key was too long; max key length is 255 bytes
+# when creating a table
+#
+connection slave;
+CREATE TABLE federated.t1 (
+ categoryId int(11) NOT NULL AUTO_INCREMENT,
+ domainId varchar(745) NOT NULL DEFAULT '',
+ categoryName varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (categoryId),
+ UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+ KEY idx_category_domainId (domainId)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (
+ categoryId int(11) NOT NULL AUTO_INCREMENT,
+ domainId varchar(745) NOT NULL DEFAULT '',
+ categoryName varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (categoryId),
+ UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
+ KEY idx_category_domainId (domainId)
+ ) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+
+insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250');
+insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250');
+insert into federated.t1 (domainId, categoryName) values ('a', 'b');
+
+select categoryId from federated.t1 order by domainId, categoryName;
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId;
+select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId;
+
+drop table federated.t1;
+
+connection slave;
+drop table federated.t1;
#
# BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE
diff --git a/mysql-test/t/ssl_8k_key.test b/mysql-test/t/ssl_8k_key.test
new file mode 100644
index 00000000000..b4203e68445
--- /dev/null
+++ b/mysql-test/t/ssl_8k_key.test
@@ -0,0 +1,6 @@
+-- source include/have_ssl.inc
+#
+# Bug#29784 YaSSL assertion failure when reading 8k key.
+#
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 1208393aa09..9fd54d4766d 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -22,13 +22,13 @@ connection con2;
lock tables t1 read;
unlock tables;
lock tables t1 read;
-let $ID= `select connection_id()`;
connection con1;
+let $ID= `select connection_id()`;
--send
update t1 set n = 3;
connection con2;
# wait for the other query to start executing
-let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = 0;
+let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = "Locked";
--source include/wait_condition.inc
unlock tables;
connection con1;
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 597bf38a518..e6f7ff7b3cb 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -14,12 +14,17 @@
KILL_MYSQLD=1;
MYSQLD=
niceness=0
-# Default on, unless --log-error is specified (and before options are parsed)
-syslog=2
+# Initial logging status: error log is not open, and not using syslog
+logging=init
+want_syslog=0
+syslog_tag=
user=@MYSQLD_USER@
pid_file=
err_log=
+syslog_tag_mysqld=mysqld
+syslog_tag_mysqld_safe=mysqld_safe
+
trap '' 1 2 3 15 # we shouldn't let anyone kill us
umask 007
@@ -46,7 +51,8 @@ Usage: $0 [OPTIONS]
--nice=NICE Set the scheduling priority of mysqld
--skip-kill-mysqld Don't try to kill stray mysqld processes
--syslog Log messages to syslog with 'logger'
- --skip-syslog Log messages to error log
+ --skip-syslog Log messages to error log (default)
+ --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger'
All other options are passed to the mysqld program.
@@ -54,18 +60,46 @@ EOF
exit 1
}
+my_which ()
+{
+ save_ifs="${IFS-UNSET}"
+ IFS=:
+ for file
+ do
+ for dir in $PATH
+ do
+ if [ -f "$dir/$file" ]
+ then
+ echo "$dir/$file"
+ continue 2
+ fi
+ done
+ return 1 # Failure, didn't find file in path
+ done
+ if [ "$save_ifs" = UNSET ]
+ then
+ unset IFS
+ else
+ IFS="$save_ifs"
+ fi
+ return 0 # Success
+}
+
log_generic () {
priority="$1"
shift
msg="`date +'%y%m%d %H:%M:%S'` mysqld_safe $*"
echo "$msg"
- if [ $syslog -eq 0 ]
- then
- echo "$msg" >> "$err_log"
- else
- logger -i -t mysqld_safe -p "$priority" "$*"
- fi
+ case $logging in
+ init) ;; # Just echo the message, don't save it anywhere
+ file) echo "$msg" >> "$err_log" ;;
+ syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+ " unknown logging method '$logging'" >&2
+ ;;
+ esac
}
log_error () {
@@ -78,15 +112,23 @@ log_notice () {
eval_log_error () {
cmd="$1"
- if [ $syslog -eq 0 ]
- then
- cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1"
- else
- # mysqld often (not always) prefixes messages on stdout with a
- # timestamp in the form of '%y%m%d %H:%M:%S '; this is redundant
- # when logging via syslog, so strip it
- cmd="$cmd 2>&1 | sed -e 's/^[0-9]\{6\} [0-9:]\{8\} *//' | logger -i -t mysqld -p daemon.error"
- fi
+ case $logging in
+ file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;;
+ syslog)
+ # mysqld often prefixes its messages with a timestamp, which is
+ # redundant when logging to syslog (which adds its own timestamp)
+ # However, we don't strip the timestamp with sed here, because
+ # sed buffers output (only GNU sed supports a -u (unbuffered) option)
+ # which means that messages may not get sent to syslog until the
+ # mysqld process quits.
+ cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error"
+ ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+ " unknown logging method '$logging'" >&2
+ ;;
+ esac
+
#echo "Running mysqld: [$cmd]"
eval "$cmd"
}
@@ -138,8 +180,9 @@ parse_arguments() {
--nice=*) niceness="$val" ;;
--open-files-limit=*) open_files="$val" ;;
--skip-kill-mysqld*) KILL_MYSQLD=0 ;;
- --syslog) syslog=1 ;;
- --skip-syslog) syslog=0 ;;
+ --syslog) want_syslog=1 ;;
+ --skip-syslog) want_syslog=0 ;;
+ --syslog-tag=*) syslog_tag="$val" ;;
--timezone=*) TZ="$val"; export TZ; ;;
--help) usage ;;
@@ -252,7 +295,19 @@ parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysq
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Determine what logging facility to use
-if [ -n "$err_log" -o $syslog -eq 0 ]
+
+# Ensure that 'logger' exists, if it's requested
+if [ $want_syslog -eq 1 ]
+then
+ my_which logger > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe."
+ exit 1
+ fi
+fi
+
+if [ -n "$err_log" -o $want_syslog -eq 0 ]
then
if [ -n "$err_log" ]
then
@@ -279,14 +334,25 @@ then
append_arg_to_args "--log-error=$err_log"
- if [ $syslog -eq 1 ]
+ if [ $want_syslog -eq 1 ]
then
# User explicitly asked for syslog, so warn that it isn't used
- log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect. Logging to '$err_log'."
+ log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect."
fi
- # Don't use syslog since syslog and error log don't mix well
- syslog=0
+ # Log to err_log file
+ log_notice "Logging to '$err_log'."
+ logging=file
+else
+ if [ -n "$syslog_tag" ]
+ then
+ # Sanitize the syslog tag
+ syslog_tag=`echo "$syslog_tag" | sed -e 's/[^a-zA-Z0-9_-]/_/g'`
+ syslog_tag_mysqld_safe="${syslog_tag_mysqld_safe}-$syslog_tag"
+ syslog_tag_mysqld="${syslog_tag_mysqld}-$syslog_tag"
+ fi
+ log_notice "Logging to syslog."
+ logging=syslog
fi
USER_OPTION=""
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index a8aa7d70586..c792e10c3af 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -143,6 +143,10 @@ ADD_CUSTOM_COMMAND(
)
ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash)
+# Remove the auto-generated files as part of 'Clean Solution'
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
+
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings)
TARGET_LINK_LIBRARIES(udf_example wsock32)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 6d22047b9db..5e2139acd91 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -6320,7 +6320,8 @@ The minimum value for this variable is 4096.",
(uchar**) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME],
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmp_table_size", OPT_TMP_TABLE_SIZE,
- "If an in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table.",
+ "If an internal in-memory temporary table exceeds this size, MySQL will"
+ " automatically convert it to an on-disk MyISAM table.",
(uchar**) &global_system_variables.tmp_table_size,
(uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL,
REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 668b7e99549..b7757d3e5fc 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13333,7 +13333,8 @@ static int
join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
{
reg1 uint i;
- uint length,blobs,size;
+ uint length, blobs;
+ size_t size;
CACHE_FIELD *copy,**blob_ptr;
JOIN_CACHE *cache;
JOIN_TAB *join_tab;
@@ -13449,7 +13450,7 @@ store_record_in_cache(JOIN_CACHE *cache)
length=cache->length;
if (cache->blobs)
length+=used_blob_length(cache->blob_ptr);
- if ((last_record=(length+cache->length > (uint) (cache->end - pos))))
+ if ((last_record= (length + cache->length > (size_t) (cache->end - pos))))
cache->ptr_record=cache->records;
/*
@@ -13495,7 +13496,7 @@ store_record_in_cache(JOIN_CACHE *cache)
}
}
cache->pos=pos;
- return last_record || (uint) (cache->end -pos) < cache->length;
+ return last_record || (size_t) (cache->end - pos) < cache->length;
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 54b115af19f..33448ea3c5f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2789,6 +2789,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{
@@ -2819,8 +2821,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
{
length= file->max_key_part_length();
- /* Align key length to multibyte char boundary */
- length-= length % sql_field->charset->mbmaxlen;
if (key->type == Key::MULTIPLE)
{
/* not a critical problem */
@@ -2829,6 +2829,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{
@@ -4130,7 +4132,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
goto err;
}
- if (operator_func == &handler::ha_repair)
+ if (operator_func == &handler::ha_repair &&
+ !(check_opt->sql_flags & TT_USEFRM))
{
if ((table->table->file->check_old_types() == HA_ADMIN_NEEDS_ALTER) ||
(table->table->file->ha_check_for_upgrade(check_opt) ==
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index 2aa2fac63f1..40bcf9cc402 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -165,6 +165,7 @@ public:
uint max_supported_keys() const { return MAX_KEY; }
uint max_supported_key_parts() const { return MAX_REF_PARTS; }
uint max_supported_key_length() const { return FEDERATED_MAX_KEY_LENGTH; }
+ uint max_supported_key_part_length() const { return FEDERATED_MAX_KEY_LENGTH; }
/*
Called in test_quick_select to determine if indexes should be used.
Normally, we need to know number of blocks . For federated we need to
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 0b23ae74f9e..30e056d68fb 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -55,7 +55,9 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/ha0ha.ic include/hash0hash.h \
include/hash0hash.ic include/ibuf0ibuf.h \
include/ibuf0ibuf.ic include/ibuf0types.h \
+ include/lock0iter.h \
include/lock0lock.h include/lock0lock.ic \
+ include/lock0priv.h include/lock0priv.ic \
include/lock0types.h include/log0log.h \
include/log0log.ic include/log0recv.h \
include/log0recv.ic include/mach0data.h \
@@ -129,7 +131,8 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.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 lock/lock0lock.c \
+ ibuf/ibuf0ibuf.c lock/lock0iter.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 \
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index c847b8db9e2..469d3ac05d7 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -903,8 +903,7 @@ buf_block_make_young(
/* Note that we read freed_page_clock's without holding any mutex:
this is allowed since the result is used only in heuristics */
- if (buf_pool->freed_page_clock >= block->freed_page_clock
- + 1 + (buf_pool->curr_size / 4)) {
+ if (buf_block_peek_if_too_old(block)) {
mutex_enter(&buf_pool->mutex);
/* There has been freeing activity in the LRU list:
@@ -1648,6 +1647,15 @@ buf_page_init(
block->lock_hash_val = lock_rec_hash(space, offset);
+#ifdef UNIV_DEBUG_VALGRIND
+ if (!space) {
+ /* Silence valid Valgrind warnings about uninitialized
+ data being written to data files. There are some unused
+ bytes on some pages that InnoDB does not initialize. */
+ UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
+
/* Insert into the hash table of file pages */
if (buf_page_hash_get(space, offset)) {
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index 1e27144bdbf..7b49a7641af 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -244,7 +244,15 @@ buf_LRU_search_and_free_block(
frame at all */
if (block->frame) {
+ /* The page was declared uninitialized
+ by buf_LRU_block_remove_hashed_page().
+ We need to flag the contents of the
+ page valid (which it still is) in
+ order to avoid bogus Valgrind
+ warnings. */
+ UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
btr_search_drop_page_hash_index(block->frame);
+ UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
}
ut_a(block->buf_fix_count == 0);
@@ -449,6 +457,7 @@ loop:
mutex_enter(&block->mutex);
block->state = BUF_BLOCK_READY_FOR_USE;
+ UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
mutex_exit(&block->mutex);
@@ -864,6 +873,7 @@ buf_LRU_block_free_non_file_page(
block->state = BUF_BLOCK_NOT_USED;
+ UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
#ifdef UNIV_DEBUG
/* Wipe contents of page to reveal possible stale pointers to it */
memset(block->frame, '\0', UNIV_PAGE_SIZE);
@@ -871,6 +881,8 @@ buf_LRU_block_free_non_file_page(
UT_LIST_ADD_FIRST(free, buf_pool->free, block);
block->in_free_list = TRUE;
+ UNIV_MEM_FREE(block->frame, UNIV_PAGE_SIZE);
+
if (srv_use_awe && block->frame) {
/* Add to the list of mapped pages */
@@ -939,6 +951,7 @@ buf_LRU_block_remove_hashed_page(
buf_page_address_fold(block->space, block->offset),
block);
+ UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
block->state = BUF_BLOCK_REMOVE_HASH;
}
diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
index 78fb55e4ef3..e1074933fe8 100644
--- a/storage/innobase/fsp/fsp0fsp.c
+++ b/storage/innobase/fsp/fsp0fsp.c
@@ -2829,7 +2829,7 @@ will be able to insert new data to the database without running out the
tablespace. Only free extents are taken into account and we also subtract
the safety margin required by the above function fsp_reserve_free_extents. */
-ulint
+ullint
fsp_get_available_space_in_free_extents(
/*====================================*/
/* out: available space in kB */
@@ -2895,7 +2895,8 @@ fsp_get_available_space_in_free_extents(
return(0);
}
- return(((n_free - reserve) * FSP_EXTENT_SIZE)
+ return((ullint)(n_free - reserve)
+ * FSP_EXTENT_SIZE
* (UNIV_PAGE_SIZE / 1024));
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 840a0ec7e3b..ca566f1300e 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4533,17 +4533,16 @@ ha_innobase::position(
/*********************************************************************
If it's a DB_TOO_BIG_RECORD error then set a suitable message to
return to the client.*/
-static
+inline
void
innodb_check_for_record_too_big_error(
/*==================================*/
- dict_table_t* table, /* in: table to check */
- int error) /* in: error code to check */
+ ulint comp, /* in: ROW_FORMAT: nonzero=COMPACT, 0=REDUNDANT */
+ int error) /* in: error code to check */
{
if (error == (int)DB_TOO_BIG_RECORD) {
- ulint max_row_size;
-
- max_row_size = page_get_free_space_of_empty_noninline(table);
+ ulint max_row_size
+ = page_get_free_space_of_empty_noninline(comp) / 2;
my_error(ER_TOO_BIG_ROWSIZE, MYF(0), max_row_size);
}
@@ -4657,9 +4656,7 @@ create_table_def(
error = row_create_table_for_mysql(table, trx);
- /* We need access to the table and so we do the error checking
- and set the error message here, before the error translation.*/
- innodb_check_for_record_too_big_error(table, error);
+ innodb_check_for_record_too_big_error(flags & DICT_TF_COMPACT, error);
error = convert_error_code_to_mysql(error, NULL);
@@ -4783,9 +4780,8 @@ create_index(
sure we don't create too long indexes. */
error = row_create_index_for_mysql(index, trx, field_lengths);
- /* We need access to the table and so we do the error checking
- and set the error message here, before the error translation.*/
- innodb_check_for_record_too_big_error(index->table, error);
+ innodb_check_for_record_too_big_error(form->s->row_type
+ != ROW_TYPE_REDUNDANT, error);
error = convert_error_code_to_mysql(error, NULL);
@@ -4802,6 +4798,8 @@ int
create_clustered_index_when_no_primary(
/*===================================*/
trx_t* trx, /* in: InnoDB transaction handle */
+ ulint comp, /* in: ROW_FORMAT:
+ nonzero=COMPACT, 0=REDUNDANT */
const char* table_name) /* in: table name */
{
dict_index_t* index;
@@ -4810,13 +4808,11 @@ create_clustered_index_when_no_primary(
/* We pass 0 as the space id, and determine at a lower level the space
id where to store the table */
- index = dict_mem_index_create((char*) table_name,
- (char*) "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0);
+ index = dict_mem_index_create(table_name, "GEN_CLUST_INDEX",
+ 0, DICT_CLUSTERED, 0);
error = row_create_index_for_mysql(index, trx, NULL);
- /* We need access to the table and so we do the error checking
- and set the error message here, before the error translation.*/
- innodb_check_for_record_too_big_error(index->table, error);
+ innodb_check_for_record_too_big_error(comp, error);
error = convert_error_code_to_mysql(error, NULL);
@@ -4947,8 +4943,9 @@ ha_innobase::create(
order the rows by their row id which is internally generated
by InnoDB */
- error = create_clustered_index_when_no_primary(trx,
- norm_name);
+ error = create_clustered_index_when_no_primary(
+ trx, form->s->row_type != ROW_TYPE_REDUNDANT,
+ norm_name);
if (error) {
goto cleanup;
}
@@ -5873,9 +5870,9 @@ ha_innobase::update_table_comment(
mutex_enter_noninline(&srv_dict_tmpfile_mutex);
rewind(srv_dict_tmpfile);
- fprintf(srv_dict_tmpfile, "InnoDB free: %lu kB",
- (ulong) fsp_get_available_space_in_free_extents(
- prebuilt->table->space));
+ fprintf(srv_dict_tmpfile, "InnoDB free: %llu kB",
+ fsp_get_available_space_in_free_extents(
+ prebuilt->table->space));
dict_print_info_on_foreign_keys(FALSE, srv_dict_tmpfile,
prebuilt->trx, prebuilt->table);
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index 031bf6c51b4..b077ff0c181 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -28,7 +28,7 @@ buf_block_peek_if_too_old(
buf_block_t* block) /* in: block to make younger */
{
return(buf_pool->freed_page_clock >= block->freed_page_clock
- + 1 + (buf_pool->curr_size / 1024));
+ + 1 + (buf_pool->curr_size / 4));
}
/*************************************************************************
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index d04269fc157..82e95a2e920 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -245,7 +245,7 @@ will be able to insert new data to the database without running out the
tablespace. Only free extents are taken into account and we also subtract
the safety margin required by the above function fsp_reserve_free_extents. */
-ulint
+ullint
fsp_get_available_space_in_free_extents(
/*====================================*/
/* out: available space in kB */
diff --git a/storage/innobase/include/lock0iter.h b/storage/innobase/include/lock0iter.h
new file mode 100644
index 00000000000..d063a360c1f
--- /dev/null
+++ b/storage/innobase/include/lock0iter.h
@@ -0,0 +1,52 @@
+/******************************************************
+Lock queue iterator type and function prototypes.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+#ifndef lock0iter_h
+#define lock0iter_h
+
+#include "univ.i"
+#include "lock0types.h"
+
+typedef struct lock_queue_iterator_struct {
+ lock_t* current_lock;
+ /* In case this is a record lock queue (not table lock queue)
+ then bit_no is the record number within the heap in which the
+ record is stored. */
+ ulint bit_no;
+} lock_queue_iterator_t;
+
+/***********************************************************************
+Initialize lock queue iterator so that it starts to iterate from
+"lock". bit_no specifies the record number within the heap where the
+record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
+1. If the lock is a table lock, thus we have a table lock queue;
+2. If the lock is a record lock and it is a wait lock. In this case
+ bit_no is calculated in this function by using
+ lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
+ of a wait lock. */
+
+void
+lock_queue_iterator_reset(
+/*======================*/
+ lock_queue_iterator_t* iter, /* out: iterator */
+ lock_t* lock, /* in: lock to start from */
+ ulint bit_no);/* in: record number in the
+ heap */
+
+/***********************************************************************
+Gets the previous lock in the lock queue, returns NULL if there are no
+more locks (i.e. the current lock is the first one). The iterator is
+receded (if not-NULL is returned). */
+
+lock_t*
+lock_queue_iterator_get_prev(
+/*=========================*/
+ /* out: previous lock or NULL */
+ lock_queue_iterator_t* iter); /* in/out: iterator */
+
+#endif /* lock0iter_h */
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 6b863e32183..059c459c374 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -519,6 +519,18 @@ lock_is_table_exclusive(
dict_table_t* table, /* in: table */
trx_t* trx); /* in: transaction */
/*************************************************************************
+Checks if a lock request lock1 has to wait for request lock2. */
+
+ibool
+lock_has_to_wait(
+/*=============*/
+ /* out: TRUE if lock1 has to wait for lock2 to be
+ removed */
+ lock_t* lock1, /* in: waiting lock */
+ lock_t* lock2); /* in: another lock; NOTE that it is assumed that this
+ has a lock bit set on the same record as in lock1 if
+ the locks are record locks */
+/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool
@@ -597,7 +609,7 @@ lock_validate(void);
/* out: TRUE if ok */
/*************************************************************************
Return approximate number or record locks (bits set in the bitmap) for
-this transaction. Since delete-marked records ma ybe removed, the
+this transaction. Since delete-marked records maybe removed, the
record count will not be precise. */
ulint
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
new file mode 100644
index 00000000000..7703a2b7def
--- /dev/null
+++ b/storage/innobase/include/lock0priv.h
@@ -0,0 +1,101 @@
+/******************************************************
+Lock module internal structures and methods.
+
+(c) 2007 Innobase Oy
+
+Created July 12, 2007 Vasil Dimov
+*******************************************************/
+
+#ifndef lock0priv_h
+#define lock0priv_h
+
+#ifndef LOCK_MODULE_IMPLEMENTATION
+/* If you need to access members of the structures defined in this
+file, please write appropriate functions that retrieve them and put
+those functions in lock/ */
+#error Do not include lock0priv.h outside of the lock/ module
+#endif
+
+#include "univ.i"
+#include "dict0types.h"
+#include "hash0hash.h"
+#include "trx0types.h"
+#include "ut0lst.h"
+
+/* A table lock */
+typedef struct lock_table_struct lock_table_t;
+struct lock_table_struct {
+ dict_table_t* table; /* database table in dictionary
+ cache */
+ UT_LIST_NODE_T(lock_t)
+ locks; /* list of locks on the same
+ table */
+};
+
+/* Record lock for a page */
+typedef struct lock_rec_struct lock_rec_t;
+struct lock_rec_struct {
+ ulint space; /* space id */
+ ulint page_no; /* page number */
+ ulint n_bits; /* number of bits in the lock
+ bitmap; NOTE: the lock bitmap is
+ placed immediately after the
+ lock struct */
+};
+
+/* Lock struct */
+struct lock_struct {
+ trx_t* trx; /* transaction owning the
+ lock */
+ UT_LIST_NODE_T(lock_t)
+ trx_locks; /* list of the locks of the
+ transaction */
+ ulint type_mode; /* lock type, mode, LOCK_GAP or
+ LOCK_REC_NOT_GAP,
+ LOCK_INSERT_INTENTION,
+ wait flag, ORed */
+ hash_node_t hash; /* hash chain node for a record
+ lock */
+ dict_index_t* index; /* index for a record lock */
+ union {
+ lock_table_t tab_lock;/* table lock */
+ lock_rec_t rec_lock;/* record lock */
+ } un_member;
+};
+
+/*************************************************************************
+Gets the type of a lock. */
+UNIV_INLINE
+ulint
+lock_get_type(
+/*==========*/
+ /* out: LOCK_TABLE or LOCK_REC */
+ const lock_t* lock); /* in: lock */
+
+/**************************************************************************
+Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
+if none found. */
+
+ulint
+lock_rec_find_set_bit(
+/*==================*/
+ /* out: bit index == heap number of the record, or
+ ULINT_UNDEFINED if none found */
+ lock_t* lock); /* in: record lock with at least one bit set */
+
+/*************************************************************************
+Gets the previous record lock set on a record. */
+
+lock_t*
+lock_rec_get_prev(
+/*==============*/
+ /* out: previous lock on the same record, NULL if
+ none exists */
+ lock_t* in_lock,/* in: record lock */
+ ulint heap_no);/* in: heap number of the record */
+
+#ifndef UNIV_NONINL
+#include "lock0priv.ic"
+#endif
+
+#endif /* lock0priv_h */
diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.ic
new file mode 100644
index 00000000000..4bc8397509d
--- /dev/null
+++ b/storage/innobase/include/lock0priv.ic
@@ -0,0 +1,32 @@
+/******************************************************
+Lock module internal inline methods.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+/* This file contains only methods which are used in
+lock/lock0* files, other than lock/lock0lock.c.
+I.e. lock/lock0lock.c contains more internal inline
+methods but they are used only in that file. */
+
+#ifndef LOCK_MODULE_IMPLEMENTATION
+#error Do not include lock0priv.ic outside of the lock/ module
+#endif
+
+/*************************************************************************
+Gets the type of a lock. */
+UNIV_INLINE
+ulint
+lock_get_type(
+/*==========*/
+ /* out: LOCK_TABLE or LOCK_REC */
+ const lock_t* lock) /* in: lock */
+{
+ ut_ad(lock);
+
+ return(lock->type_mode & LOCK_TYPE_MASK);
+}
+
+/* vim: set filetype=c: */
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index cb8fbe92cf0..e59443da73d 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -167,6 +167,8 @@ mem_heap_alloc(
mem_block_set_free(block, free + MEM_SPACE_NEEDED(n));
#ifdef UNIV_MEM_DEBUG
+ UNIV_MEM_ALLOC(buf,
+ n + MEM_FIELD_HEADER_SIZE + MEM_FIELD_TRAILER_SIZE);
/* In the debug version write debugging info to the field */
mem_field_init((byte*)buf, n);
@@ -177,8 +179,10 @@ mem_heap_alloc(
#endif
#ifdef UNIV_SET_MEM_TO_ZERO
+ UNIV_MEM_ALLOC(buf, n);
memset(buf, '\0', n);
#endif
+ UNIV_MEM_ALLOC(buf, n);
return(buf);
}
@@ -369,6 +373,8 @@ mem_heap_free_top(
if ((heap != block) && (mem_block_get_free(block)
== mem_block_get_start(block))) {
mem_heap_block_free(heap, block);
+ } else {
+ UNIV_MEM_FREE((byte*) block + mem_block_get_free(block), n);
}
}
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 833d268c9de..273007c2778 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -531,6 +531,15 @@ page_get_free_space_of_empty(
/* out: free space */
ulint comp) /* in: nonzero=compact page format */
__attribute__((const));
+/*****************************************************************
+Calculates free space if a page is emptied. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: free space */
+ ulint comp) /* in: nonzero=compact page format */
+ __attribute__((const));
/****************************************************************
Returns the sum of the sizes of the records in the record list
excluding the infimum and supremum records. */
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index bda3494073f..1448efe94fe 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -460,19 +460,6 @@ row_check_table_for_mysql(
/* out: DB_ERROR or DB_SUCCESS */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */
-/*************************************************************************
-Get the min of the maximum possible row sizes. */
-
-ulint
-page_get_free_space_of_empty_noninline(
-/*===================================*/
- /* out: The (approx) maximum size
- of a row, this is a conservative
- estimate, since the size can be
- slightly larger depending upon
- the ROW_FORMAT setting.*/
- dict_table_t* table); /* in: table for which max record
- size required.*/
/* A struct describing a place for an individual column in the MySQL
row format which is presented to the table handler in ha_innobase.
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 957baa0391f..ba8e6e56219 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -83,6 +83,8 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */
#if 0
+#define UNIV_DEBUG_VALGRIND /* Enable extra
+ Valgrind instrumentation */
#define UNIV_DEBUG /* Enable ut_ad() assertions */
#define UNIV_LIST_DEBUG /* debug UT_LIST_ macros */
#define UNIV_MEM_DEBUG /* detect memory leaks etc */
@@ -214,6 +216,8 @@ typedef __int64 ib_longlong;
typedef longlong ib_longlong;
#endif
+typedef unsigned long long int ullint;
+
#ifndef __WIN__
#if SIZEOF_LONG != SIZEOF_VOIDP
#error "Error: InnoDB's ulint must be of the same size as void*"
@@ -298,5 +302,17 @@ typedef void* os_thread_ret_t;
#include "ut0dbg.h"
#include "ut0ut.h"
#include "db0err.h"
+#ifdef UNIV_DEBUG_VALGRIND
+# include <valgrind/memcheck.h>
+# define UNIV_MEM_VALID(addr, size) VALGRIND_MAKE_MEM_DEFINED(addr, size)
+# define UNIV_MEM_INVALID(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
+# define UNIV_MEM_FREE(addr, size) VALGRIND_MAKE_MEM_NOACCESS(addr, size)
+# define UNIV_MEM_ALLOC(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
+#else
+# define UNIV_MEM_VALID(addr, size) do {} while(0)
+# define UNIV_MEM_INVALID(addr, size) do {} while(0)
+# define UNIV_MEM_FREE(addr, size) do {} while(0)
+# define UNIV_MEM_ALLOC(addr, size) do {} while(0)
+#endif
#endif
diff --git a/storage/innobase/lock/lock0iter.c b/storage/innobase/lock/lock0iter.c
new file mode 100644
index 00000000000..0afa7019c86
--- /dev/null
+++ b/storage/innobase/lock/lock0iter.c
@@ -0,0 +1,90 @@
+/******************************************************
+Lock queue iterator. Can iterate over table and record
+lock queues.
+
+(c) 2007 Innobase Oy
+
+Created July 16, 2007 Vasil Dimov
+*******************************************************/
+
+#define LOCK_MODULE_IMPLEMENTATION
+
+#include "univ.i"
+#include "lock0iter.h"
+#include "lock0lock.h"
+#include "lock0priv.h"
+#include "ut0dbg.h"
+#include "ut0lst.h"
+
+/***********************************************************************
+Initialize lock queue iterator so that it starts to iterate from
+"lock". bit_no specifies the record number within the heap where the
+record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
+1. If the lock is a table lock, thus we have a table lock queue;
+2. If the lock is a record lock and it is a wait lock. In this case
+ bit_no is calculated in this function by using
+ lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
+ of a wait lock. */
+
+void
+lock_queue_iterator_reset(
+/*======================*/
+ lock_queue_iterator_t* iter, /* out: iterator */
+ lock_t* lock, /* in: lock to start from */
+ ulint bit_no) /* in: record number in the
+ heap */
+{
+ iter->current_lock = lock;
+
+ if (bit_no != ULINT_UNDEFINED) {
+
+ iter->bit_no = bit_no;
+ } else {
+
+ switch (lock_get_type(lock)) {
+ case LOCK_TABLE:
+ iter->bit_no = ULINT_UNDEFINED;
+ break;
+ case LOCK_REC:
+ iter->bit_no = lock_rec_find_set_bit(lock);
+ ut_a(iter->bit_no != ULINT_UNDEFINED);
+ break;
+ default:
+ ut_error;
+ }
+ }
+}
+
+/***********************************************************************
+Gets the previous lock in the lock queue, returns NULL if there are no
+more locks (i.e. the current lock is the first one). The iterator is
+receded (if not-NULL is returned). */
+
+lock_t*
+lock_queue_iterator_get_prev(
+/*=========================*/
+ /* out: previous lock or NULL */
+ lock_queue_iterator_t* iter) /* in/out: iterator */
+{
+ lock_t* prev_lock;
+
+ switch (lock_get_type(iter->current_lock)) {
+ case LOCK_REC:
+ prev_lock = lock_rec_get_prev(
+ iter->current_lock, iter->bit_no);
+ break;
+ case LOCK_TABLE:
+ prev_lock = UT_LIST_GET_PREV(
+ un_member.tab_lock.locks, iter->current_lock);
+ break;
+ default:
+ ut_error;
+ }
+
+ if (prev_lock != NULL) {
+
+ iter->current_lock = prev_lock;
+ }
+
+ return(prev_lock);
+}
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 6f5390145b5..f43752fb5fc 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -6,10 +6,14 @@ The transaction lock system
Created 5/7/1996 Heikki Tuuri
*******************************************************/
+#define LOCK_MODULE_IMPLEMENTATION
+
#include "lock0lock.h"
+#include "lock0priv.h"
#ifdef UNIV_NONINL
#include "lock0lock.ic"
+#include "lock0priv.ic"
#endif
#include "usr0sess.h"
@@ -319,42 +323,6 @@ ibool lock_print_waits = FALSE;
/* The lock system */
lock_sys_t* lock_sys = NULL;
-/* A table lock */
-typedef struct lock_table_struct lock_table_t;
-struct lock_table_struct{
- dict_table_t* table; /* database table in dictionary cache */
- UT_LIST_NODE_T(lock_t)
- locks; /* list of locks on the same table */
-};
-
-/* Record lock for a page */
-typedef struct lock_rec_struct lock_rec_t;
-struct lock_rec_struct{
- ulint space; /* space id */
- ulint page_no; /* page number */
- ulint n_bits; /* number of bits in the lock bitmap */
- /* NOTE: the lock bitmap is placed immediately
- after the lock struct */
-};
-
-/* Lock struct */
-struct lock_struct{
- trx_t* trx; /* transaction owning the lock */
- UT_LIST_NODE_T(lock_t)
- trx_locks; /* list of the locks of the
- transaction */
- ulint type_mode; /* lock type, mode, LOCK_GAP or
- LOCK_REC_NOT_GAP,
- LOCK_INSERT_INTENTION,
- wait flag, ORed */
- hash_node_t hash; /* hash chain node for a record lock */
- dict_index_t* index; /* index for a record lock */
- union {
- lock_table_t tab_lock;/* table lock */
- lock_rec_t rec_lock;/* record lock */
- } un_member;
-};
-
/* We store info on the latest deadlock error to this buffer. InnoDB
Monitor will then fetch it and print */
ibool lock_deadlock_found = FALSE;
@@ -401,20 +369,6 @@ lock_deadlock_recursive(
return LOCK_VICTIM_IS_START */
/*************************************************************************
-Gets the type of a lock. */
-UNIV_INLINE
-ulint
-lock_get_type(
-/*==========*/
- /* out: LOCK_TABLE or LOCK_REC */
- lock_t* lock) /* in: lock */
-{
- ut_ad(lock);
-
- return(lock->type_mode & LOCK_TYPE_MASK);
-}
-
-/*************************************************************************
Gets the nth bit of a record lock. */
UNIV_INLINE
ibool
@@ -611,8 +565,8 @@ UNIV_INLINE
ulint
lock_get_mode(
/*==========*/
- /* out: mode */
- lock_t* lock) /* in: lock */
+ /* out: mode */
+ const lock_t* lock) /* in: lock */
{
ut_ad(lock);
@@ -1017,7 +971,7 @@ lock_rec_has_to_wait(
/*************************************************************************
Checks if a lock request lock1 has to wait for request lock2. */
-static
+
ibool
lock_has_to_wait(
/*=============*/
@@ -1098,7 +1052,7 @@ lock_rec_set_nth_bit(
/**************************************************************************
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
if none found. */
-static
+
ulint
lock_rec_find_set_bit(
/*==================*/
@@ -1390,7 +1344,7 @@ lock_rec_copy(
/*************************************************************************
Gets the previous record lock set on a record. */
-static
+
lock_t*
lock_rec_get_prev(
/*==============*/
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index ab5f42e3a13..ce2fc3ed535 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -57,6 +57,16 @@ ibool recv_needed_recovery = FALSE;
ibool recv_lsn_checks_on = FALSE;
+/* There are two conditions under which we scan the logs, the first
+is normal startup and the second is when we do a recovery from an
+archive.
+This flag is set if we are doing a scan from the last checkpoint during
+startup. If we find log entries that were written after the last checkpoint
+we know that the server was not cleanly shutdown. We must then initialize
+the crash recovery environment before attempting to store these entries in
+the log hash table. */
+ibool recv_log_scan_is_startup_type = FALSE;
+
/* If the following is TRUE, the buffer pool file pages must be invalidated
after recovery and no ibuf operations are allowed; this becomes TRUE if
the log record hash table becomes too full, and log records must be merged
@@ -99,6 +109,16 @@ the recovery failed and the database may be corrupt. */
dulint recv_max_page_lsn;
+/* prototypes */
+
+/***********************************************************
+Initialize crash recovery environment. Can be called iff
+recv_needed_recovery == FALSE. */
+static
+void
+recv_init_crash_recovery(void);
+/*===========================*/
+
/************************************************************
Creates the recovery system. */
@@ -2284,6 +2304,23 @@ recv_scan_log_recs(
if (ut_dulint_cmp(scanned_lsn, recv_sys->scanned_lsn) > 0) {
+ /* We have found more entries. If this scan is
+ of startup type, we must initiate crash recovery
+ environment before parsing these log records. */
+
+ if (recv_log_scan_is_startup_type
+ && !recv_needed_recovery) {
+
+ fprintf(stderr,
+ "InnoDB: Log scan progressed"
+ " past the checkpoint lsn %lu %lu\n",
+ (ulong) ut_dulint_get_high(
+ recv_sys->scanned_lsn),
+ (ulong) ut_dulint_get_low(
+ recv_sys->scanned_lsn));
+ recv_init_crash_recovery();
+ }
+
/* We were able to find more log data: add it to the
parsing buffer if parse_start_lsn is already
non-zero */
@@ -2405,6 +2442,48 @@ recv_group_scan_log_recs(
#endif /* UNIV_DEBUG */
}
+/***********************************************************
+Initialize crash recovery environment. Can be called iff
+recv_needed_recovery == FALSE. */
+static
+void
+recv_init_crash_recovery(void)
+/*==========================*/
+{
+ ut_a(!recv_needed_recovery);
+
+ recv_needed_recovery = TRUE;
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Database was not"
+ " shut down normally!\n"
+ "InnoDB: Starting crash recovery.\n");
+
+ fprintf(stderr,
+ "InnoDB: Reading tablespace information"
+ " from the .ibd files...\n");
+
+ fil_load_single_table_tablespaces();
+
+ /* If we are using the doublewrite method, we will
+ check if there are half-written pages in data files,
+ and restore them from the doublewrite buffer if
+ possible */
+
+ if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
+
+ fprintf(stderr,
+ "InnoDB: Restoring possible"
+ " half-written data pages from"
+ " the doublewrite\n"
+ "InnoDB: buffer...\n");
+ trx_sys_doublewrite_init_or_restore_pages(TRUE);
+ }
+
+}
+
/************************************************************
Recovers from a checkpoint. When this function returns, the database is able
to start processing of new user transactions, but the function
@@ -2532,92 +2611,6 @@ recv_recovery_from_checkpoint_start(
recv_sys->recovered_lsn = checkpoint_lsn;
srv_start_lsn = checkpoint_lsn;
-
- /* NOTE: we always do a 'recovery' at startup, but only if
- there is something wrong we will print a message to the
- user about recovery: */
-
- if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn) != 0
- || ut_dulint_cmp(checkpoint_lsn, min_flushed_lsn) != 0) {
-
- if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn)
- < 0) {
- fprintf(stderr,
- "InnoDB: #########################"
- "#################################\n"
- "InnoDB: "
- "WARNING!\n"
- "InnoDB: The log sequence number"
- " in ibdata files is higher\n"
- "InnoDB: than the log sequence number"
- " in the ib_logfiles! Are you sure\n"
- "InnoDB: you are using the right"
- " ib_logfiles to start up"
- " the database?\n"
- "InnoDB: Log sequence number in"
- " ib_logfiles is %lu %lu, log\n"
- "InnoDB: sequence numbers stamped"
- " to ibdata file headers are between\n"
- "InnoDB: %lu %lu and %lu %lu.\n"
- "InnoDB: #########################"
- "#################################\n",
- (ulong) ut_dulint_get_high(
- checkpoint_lsn),
- (ulong) ut_dulint_get_low(
- checkpoint_lsn),
- (ulong) ut_dulint_get_high(
- min_flushed_lsn),
- (ulong) ut_dulint_get_low(
- min_flushed_lsn),
- (ulong) ut_dulint_get_high(
- max_flushed_lsn),
- (ulong) ut_dulint_get_low(
- max_flushed_lsn));
- }
-
- recv_needed_recovery = TRUE;
-
- ut_print_timestamp(stderr);
-
- fprintf(stderr,
- " InnoDB: Database was not"
- " shut down normally!\n"
- "InnoDB: Starting crash recovery.\n");
-
- fprintf(stderr,
- "InnoDB: Reading tablespace information"
- " from the .ibd files...\n");
-
- fil_load_single_table_tablespaces();
-
- /* If we are using the doublewrite method, we will
- check if there are half-written pages in data files,
- and restore them from the doublewrite buffer if
- possible */
-
- if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
-
- fprintf(stderr,
- "InnoDB: Restoring possible"
- " half-written data pages from"
- " the doublewrite\n"
- "InnoDB: buffer...\n");
- trx_sys_doublewrite_init_or_restore_pages(
- TRUE);
- }
-
- ut_print_timestamp(stderr);
-
- fprintf(stderr,
- " InnoDB: Starting log scan"
- " based on checkpoint at\n"
- "InnoDB: log sequence number %lu %lu.\n",
- (ulong) ut_dulint_get_high(checkpoint_lsn),
- (ulong) ut_dulint_get_low(checkpoint_lsn));
- } else {
- /* Init the doublewrite buffer memory structure */
- trx_sys_doublewrite_init_or_restore_pages(FALSE);
- }
}
contiguous_lsn = ut_dulint_align_down(recv_sys->scanned_lsn,
@@ -2670,6 +2663,8 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group);
}
+ /* Set the flag to publish that we are doing startup scan. */
+ recv_log_scan_is_startup_type = (type == LOG_CHECKPOINT);
while (group) {
old_scanned_lsn = recv_sys->scanned_lsn;
@@ -2691,6 +2686,69 @@ recv_recovery_from_checkpoint_start(
group = UT_LIST_GET_NEXT(log_groups, group);
}
+ /* Done with startup scan. Clear the flag. */
+ recv_log_scan_is_startup_type = FALSE;
+ if (type == LOG_CHECKPOINT) {
+ /* NOTE: we always do a 'recovery' at startup, but only if
+ there is something wrong we will print a message to the
+ user about recovery: */
+
+ if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn) != 0
+ || ut_dulint_cmp(checkpoint_lsn, min_flushed_lsn) != 0) {
+
+ if (ut_dulint_cmp(checkpoint_lsn, max_flushed_lsn)
+ < 0) {
+ fprintf(stderr,
+ "InnoDB: #########################"
+ "#################################\n"
+ "InnoDB: "
+ "WARNING!\n"
+ "InnoDB: The log sequence number"
+ " in ibdata files is higher\n"
+ "InnoDB: than the log sequence number"
+ " in the ib_logfiles! Are you sure\n"
+ "InnoDB: you are using the right"
+ " ib_logfiles to start up"
+ " the database?\n"
+ "InnoDB: Log sequence number in"
+ " ib_logfiles is %lu %lu, log\n"
+ "InnoDB: sequence numbers stamped"
+ " to ibdata file headers are between\n"
+ "InnoDB: %lu %lu and %lu %lu.\n"
+ "InnoDB: #########################"
+ "#################################\n",
+ (ulong) ut_dulint_get_high(
+ checkpoint_lsn),
+ (ulong) ut_dulint_get_low(
+ checkpoint_lsn),
+ (ulong) ut_dulint_get_high(
+ min_flushed_lsn),
+ (ulong) ut_dulint_get_low(
+ min_flushed_lsn),
+ (ulong) ut_dulint_get_high(
+ max_flushed_lsn),
+ (ulong) ut_dulint_get_low(
+ max_flushed_lsn));
+
+
+ }
+
+ if (!recv_needed_recovery) {
+ fprintf(stderr,
+ "InnoDB: The log sequence number"
+ " in ibdata files does not match\n"
+ "InnoDB: the log sequence number"
+ " in the ib_logfiles!\n");
+ recv_init_crash_recovery();
+ }
+
+ }
+ if (!recv_needed_recovery) {
+ /* Init the doublewrite buffer memory structure */
+ trx_sys_doublewrite_init_or_restore_pages(FALSE);
+ }
+ }
+
/* We currently have only one log group */
if (ut_dulint_cmp(group_scanned_lsn, checkpoint_lsn) < 0) {
ut_print_timestamp(stderr);
@@ -2747,20 +2805,9 @@ recv_recovery_from_checkpoint_start(
recv_synchronize_groups(up_to_date_group);
if (!recv_needed_recovery) {
- if (ut_dulint_cmp(checkpoint_lsn, recv_sys->recovered_lsn)
- != 0) {
- fprintf(stderr,
- "InnoDB: Warning: we did not need to do"
- " crash recovery, but log scan\n"
- "InnoDB: progressed past the checkpoint"
- " lsn %lu %lu up to lsn %lu %lu\n",
- (ulong) ut_dulint_get_high(checkpoint_lsn),
- (ulong) ut_dulint_get_low(checkpoint_lsn),
- (ulong) ut_dulint_get_high(
- recv_sys->recovered_lsn),
- (ulong) ut_dulint_get_low(
- recv_sys->recovered_lsn));
- }
+ ut_a(ut_dulint_cmp(checkpoint_lsn,
+ recv_sys->recovered_lsn) == 0);
+
} else {
srv_start_lsn = recv_sys->recovered_lsn;
}
diff --git a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c
index 10b359e8e67..d89a3a55d88 100644
--- a/storage/innobase/mem/mem0mem.c
+++ b/storage/innobase/mem/mem0mem.c
@@ -514,6 +514,7 @@ mem_heap_block_free(
mem_erase_buf((byte*)block, len);
#endif
+ UNIV_MEM_FREE(block, len);
if (init_block) {
/* Do not have to free: do nothing */
diff --git a/storage/innobase/mem/mem0pool.c b/storage/innobase/mem/mem0pool.c
index c010ae61160..27da86a0309 100644
--- a/storage/innobase/mem/mem0pool.c
+++ b/storage/innobase/mem/mem0pool.c
@@ -229,6 +229,8 @@ mem_pool_create(
mem_area_set_size(area, ut_2_exp(i));
mem_area_set_free(area, TRUE);
+ UNIV_MEM_FREE(MEM_AREA_EXTRA_SIZE + (byte*) area,
+ ut_2_exp(i) - MEM_AREA_EXTRA_SIZE);
UT_LIST_ADD_FIRST(free_list, pool->free_list[i], area);
@@ -300,6 +302,7 @@ mem_pool_fill_free_list(
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
area2 = (mem_area_t*)(((byte*)area) + ut_2_exp(i));
+ UNIV_MEM_ALLOC(area2, MEM_AREA_EXTRA_SIZE);
mem_area_set_size(area2, ut_2_exp(i));
mem_area_set_free(area2, TRUE);
@@ -400,6 +403,8 @@ mem_area_alloc(
mutex_exit(&(pool->mutex));
ut_ad(mem_pool_validate(pool));
+ UNIV_MEM_ALLOC(MEM_AREA_EXTRA_SIZE + (byte*)area,
+ ut_2_exp(n) - MEM_AREA_EXTRA_SIZE);
return((void*)(MEM_AREA_EXTRA_SIZE + ((byte*)area)));
}
@@ -482,6 +487,7 @@ mem_area_free(
}
size = mem_area_get_size(area);
+ UNIV_MEM_FREE(ptr, size - MEM_AREA_EXTRA_SIZE);
if (size == 0) {
fprintf(stderr,
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index f496e1127ce..78140cc5ecf 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -456,10 +456,9 @@ os_file_handle_error_no_exit(
#undef USE_FILE_LOCK
#define USE_FILE_LOCK
-#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) || defined(__NETWARE__)
+#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
/* InnoDB Hot Backup does not lock the data files.
* On Windows, mandatory locking is used.
- * On FreeBSD with LinuxThreads, advisory locking does not work properly.
*/
# undef USE_FILE_LOCK
#endif
diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c
index 4212df7a631..543cf9e34eb 100644
--- a/storage/innobase/page/page0page.c
+++ b/storage/innobase/page/page0page.c
@@ -209,6 +209,18 @@ page_set_max_trx_id(
}
}
+/*****************************************************************
+Calculates free space if a page is emptied. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: free space */
+ ulint comp) /* in: nonzero=compact page format */
+{
+ return(page_get_free_space_of_empty(comp));
+}
+
/****************************************************************
Allocates a block of memory from an index page. */
diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c
index 3bc73eca9ea..64f8e2d319c 100644
--- a/storage/innobase/rem/rem0rec.c
+++ b/storage/innobase/rem/rem0rec.c
@@ -753,7 +753,11 @@ rec_convert_dtuple_to_rec_old(
/* Calculate the offset of the origin in the physical record */
rec = buf + rec_get_converted_extra_size(data_size, n_fields);
-
+#ifdef UNIV_DEBUG
+ /* Suppress Valgrind warnings of ut_ad()
+ in mach_write_to_1(), mach_write_to_2() et al. */
+ memset(buf, 0xff, rec - buf + data_size);
+#endif /* UNIV_DEBUG */
/* Store the number of fields */
rec_set_n_fields_old(rec, n_fields);
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 9f88fd8040b..d51b7e1e0b5 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -4059,25 +4059,3 @@ row_check_table_for_mysql(
return(ret);
}
-
-/*************************************************************************
-Get the maximum row size. */
-
-ulint
-page_get_free_space_of_empty_noninline(
-/*===================================*/
- /* out: The (approx) maximum size
- of a row, this is a conservative
- estimate, since the size can be
- slightly larger depending upon
- the ROW_FORMAT setting.*/
- dict_table_t* table) /* in: table for which max record
- size is required.*/
-{
- ibool compact;
-
- compact = dict_table_is_comp(table);
-
- return(page_get_free_space_of_empty(compact) / 2);
-}
-
diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
index 34b45e2c1c3..4db780c8b3f 100644
--- a/storage/innobase/sync/sync0rw.c
+++ b/storage/innobase/sync/sync0rw.c
@@ -15,16 +15,34 @@ Created 9/11/1995 Heikki Tuuri
#include "mem0mem.h"
#include "srv0srv.h"
+/* number of system calls made during shared latching */
ulint rw_s_system_call_count = 0;
+
+/* number of spin waits on rw-latches,
+resulted during shared (read) locks */
ulint rw_s_spin_wait_count = 0;
+
+/* number of OS waits on rw-latches,
+resulted during shared (read) locks */
ulint rw_s_os_wait_count = 0;
+/* number of unlocks (that unlock shared locks),
+set only when UNIV_SYNC_PERF_STAT is defined */
ulint rw_s_exit_count = 0;
+/* number of system calls made during exclusive latching */
ulint rw_x_system_call_count = 0;
+
+/* number of spin waits on rw-latches,
+resulted during exclusive (write) locks */
ulint rw_x_spin_wait_count = 0;
+
+/* number of OS waits on rw-latches,
+resulted during exclusive (write) locks */
ulint rw_x_os_wait_count = 0;
+/* number of unlocks (that unlock exclusive locks),
+set only when UNIV_SYNC_PERF_STAT is defined */
ulint rw_x_exit_count = 0;
/* The global list of rw-locks */
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index 672e1f93aad..bf3f4d1ff20 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -115,6 +115,7 @@ ulint mutex_system_call_count = 0;
/* Number of spin waits on mutexes: for performance monitoring */
+/* round=one iteration of a spin loop */
ulint mutex_spin_round_count = 0;
ulint mutex_spin_wait_count = 0;
ulint mutex_os_wait_count = 0;
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index 307a03bfbc3..144721150b6 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -868,7 +868,16 @@ trx_sysf_create(
trx_sysf_rseg_set_page_no(sys_header, i, FIL_NULL, mtr);
}
- /* The remaining area (up to the page trailer) is uninitialized. */
+ /* The remaining area (up to the page trailer) is uninitialized.
+ Silence Valgrind warnings about it. */
+ UNIV_MEM_VALID(sys_header + (TRX_SYS_RSEGS
+ + TRX_SYS_N_RSEGS * TRX_SYS_RSEG_SLOT_SIZE
+ + TRX_SYS_RSEG_SPACE),
+ (UNIV_PAGE_SIZE - FIL_PAGE_DATA_END
+ - (TRX_SYS_RSEGS
+ + TRX_SYS_N_RSEGS * TRX_SYS_RSEG_SLOT_SIZE
+ + TRX_SYS_RSEG_SPACE))
+ + page - sys_header);
/* Create the first rollback segment in the SYSTEM tablespace */
page_no = trx_rseg_header_create(TRX_SYS_SPACE, ULINT_MAX, &slot_no,
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index 2d5ce0e1c61..b312e008cd2 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -1570,19 +1570,21 @@ trx_commit_for_mysql(
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();
+ mutex_enter(&kernel_mutex);
+
+ if (!trx_dummy_sess) {
+ trx_dummy_sess = sess_open();
+ }
+
+ mutex_exit(&kernel_mutex);
}
trx->sess = trx_dummy_sess;
}
-
- mutex_exit(&kernel_mutex);
trx_start_if_not_started(trx);
diff --git a/storage/innobase/ut/ut0mem.c b/storage/innobase/ut/ut0mem.c
index 4fd515c35e6..b466a5f6872 100644
--- a/storage/innobase/ut/ut0mem.c
+++ b/storage/innobase/ut/ut0mem.c
@@ -162,6 +162,8 @@ retry:
#endif
}
+ UNIV_MEM_ALLOC(ret, n + sizeof(ut_mem_block_t));
+
((ut_mem_block_t*)ret)->size = n + sizeof(ut_mem_block_t);
((ut_mem_block_t*)ret)->magic_n = UT_MEM_MAGIC_N;
diff --git a/win/README b/win/README
index fbcdfd068b8..afa4bd65163 100644
--- a/win/README
+++ b/win/README
@@ -63,7 +63,9 @@ The options right now are:
MYSQL_TCP_PORT=<port> Server port, default 3306
CYBOZU Default character set is UTF8
EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS
- default will be used.
+ default will be used. (Note - This option should only be
+ used by MySQL AB.)
+
So the command line could look like:
diff --git a/win/create_manifest.js b/win/create_manifest.js
index 8569bd508ff..dec8f6e62e2 100755
--- a/win/create_manifest.js
+++ b/win/create_manifest.js
@@ -56,7 +56,7 @@ try
manifest_xml+= "\t<assemblyIdentity name=\'" + app_name + "\'";
manifest_xml+= " version=\'" + app_version + "\'";
manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
- // TOADD - Add publicKeyToken attribute once we have Authenticode key.
+ manifest_xml+= " publicKeyToken=\'02ad33b422233ae3\'";
manifest_xml+= " type=\'win32\' />\r\n";
// Identify the application security requirements.
manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n";
diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake
index 4c88be1d800..0d429e438d6 100755
--- a/win/mysql_manifest.cmake
+++ b/win/mysql_manifest.cmake
@@ -14,7 +14,8 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
ADD_CUSTOM_COMMAND(
TARGET ${_target_name}
POST_BUILD
- COMMAND mt.exe
- ARGS -nologo -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest -outputresource:$(TargetPath)
- COMMENT "Embeds the manifest contents.")
+ COMMAND mt.exe ARGS -nologo -hashupdate -makecdfs -manifest $(IntDir)\\$(TargetFileName).intermediate.manifest -outputresource:$(TargetPath)
+ COMMAND makecat.exe ARGS $(IntDir)\\$(TargetFileName).intermediate.manifest.cdf
+ COMMAND signtool.exe ARGS sign /a /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetPath)
+ COMMENT "Embeds the manifest contents, creates a cryptographic catalog, signs the target with Authenticode certificate.")
ENDMACRO(MYSQL_EMBED_MANIFEST)