diff options
90 files changed, 864 insertions, 289 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c63fe3e42f2..c24eeefe5a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,81 @@ MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF) +include(CheckCSourceCompiles) +include(CheckCXXSourceCompiles) +# We need some extra FAIL_REGEX patterns +# Note that CHECK_C_SOURCE_COMPILES is a misnomer, it will also link. +MACRO (MY_CHECK_C_COMPILER_FLAG FLAG RESULT) + SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") + CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} + FAIL_REGEX "argument unused during compilation" + FAIL_REGEX "unsupported .*option" + FAIL_REGEX "unknown .*option" + FAIL_REGEX "unrecognized .*option" + FAIL_REGEX "ignoring unknown option" + FAIL_REGEX "[Ww]arning: [Oo]ption" + ) + SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") +ENDMACRO() + +MACRO (MY_CHECK_CXX_COMPILER_FLAG FLAG RESULT) + SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") + CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} + FAIL_REGEX "argument unused during compilation" + FAIL_REGEX "unsupported .*option" + FAIL_REGEX "unknown .*option" + FAIL_REGEX "unrecognized .*option" + FAIL_REGEX "ignoring unknown option" + FAIL_REGEX "[Ww]arning: [Oo]ption" + ) + SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") +ENDMACRO() + +OPTION(WITH_ASAN "Enable address sanitizer" OFF) +IF (WITH_ASAN) + # gcc 4.8.1 and new versions of clang + MY_CHECK_C_COMPILER_FLAG("-fsanitize=address" HAVE_C_FSANITIZE) + MY_CHECK_CXX_COMPILER_FLAG("-fsanitize=address" HAVE_CXX_FSANITIZE) + + IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE) + # We switch on basic optimization also for debug builds. + # With optimization we may get some warnings, so we switch off -Werror + SET(CMAKE_C_FLAGS_DEBUG + "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -O1 -Wno-error -fPIC") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO + "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=address -fPIC") + SET(CMAKE_CXX_FLAGS_DEBUG + "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -O1 -Wno-error -fPIC") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=address -fPIC") + SET(WITH_ASAN_OK 1) + ELSE() + # older versions of clang + MY_CHECK_C_COMPILER_FLAG("-faddress-sanitizer" HAVE_C_FADDRESS) + MY_CHECK_CXX_COMPILER_FLAG("-faddress-sanitizer" HAVE_CXX_FFADDRESS) + + IF(HAVE_C_FADDRESS AND HAVE_CXX_FFADDRESS) + # We switch on basic optimization also for debug builds. + SET(CMAKE_C_FLAGS_DEBUG + "${CMAKE_C_FLAGS_DEBUG} -faddress-sanitizer -O1 -fPIC") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO + "${CMAKE_C_FLAGS_RELWITHDEBINFO} -faddress-sanitizer -fPIC") + SET(CMAKE_CXX_FLAGS_DEBUG + "${CMAKE_CXX_FLAGS_DEBUG} -faddress-sanitizer -O1 -fPIC") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -faddress-sanitizer -fPIC") + SET(WITH_ASAN_OK 1) + ENDIF() + ENDIF() + + IF(NOT WITH_ASAN_OK) + MESSAGE(FATAL_ERROR "Do not know how to enable address sanitizer") + ENDIF() +ENDIF() + + OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) IF(ENABLE_DEBUG_SYNC) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index 36d7ade66a7..b0680d92a1b 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -1,5 +1,5 @@ -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,7 +34,10 @@ ENDFOREACH() # Ensure we have clean build for shared libraries # without unresolved symbols -SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +# Not supported with AddressSanitizer +IF(NOT WITH_ASAN) + SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +ENDIF() # 64 bit file offset support flag SET(_FILE_OFFSET_BITS 64) diff --git a/configure.cmake b/configure.cmake index 9476b876b4c..0bd7bbe38a1 100644 --- a/configure.cmake +++ b/configure.cmake @@ -147,6 +147,10 @@ IF(UNIX) SET(CMAKE_REQUIRED_LIBRARIES ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO}) + # Need explicit pthread for gcc -fsanitize=address + IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=") + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread) + ENDIF() IF(CMAKE_REQUIRED_LIBRARIES) LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt index b8432f06ac6..94a336c53dc 100644 --- a/extra/yassl/CMakeLists.txt +++ b/extra/yassl/CMakeLists.txt @@ -37,4 +37,9 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES}) RESTRICT_SYMBOL_EXPORTS(yassl) +INSTALL_DEBUG_SYMBOLS(yassl) +IF(MSVC) + INSTALL_DEBUG_TARGET(yassl DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt index 10ed614445e..9f1f2a102da 100644 --- a/extra/yassl/taocrypt/CMakeLists.txt +++ b/extra/yassl/taocrypt/CMakeLists.txt @@ -36,3 +36,8 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES}) RESTRICT_SYMBOL_EXPORTS(taocrypt) +INSTALL_DEBUG_SYMBOLS(taocrypt) +IF(MSVC) + INSTALL_DEBUG_TARGET(taocrypt DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + diff --git a/include/my_check_opt.h b/include/my_check_opt.h new file mode 100644 index 00000000000..abd4f4a96a7 --- /dev/null +++ b/include/my_check_opt.h @@ -0,0 +1,73 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +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 Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#ifndef _my_check_opt_h +#define _my_check_opt_h + +#ifdef __cplusplus +extern "C" { +#endif + +/* + All given definitions needed for MyISAM storage engine: + myisamchk.c or/and ha_myisam.cc or/and micheck.c + Some definitions are needed by the MySQL parser. +*/ + +#define T_AUTO_INC (1UL << 0) +#define T_AUTO_REPAIR (1UL << 1) +#define T_BACKUP_DATA (1UL << 2) +#define T_CALC_CHECKSUM (1UL << 3) +#define T_CHECK (1UL << 4) +#define T_CHECK_ONLY_CHANGED (1UL << 5) +#define T_CREATE_MISSING_KEYS (1UL << 6) +#define T_DESCRIPT (1UL << 7) +#define T_DONT_CHECK_CHECKSUM (1UL << 8) +#define T_EXTEND (1UL << 9) +#define T_FAST (1UL << 10) +#define T_FORCE_CREATE (1UL << 11) +#define T_FORCE_UNIQUENESS (1UL << 12) +#define T_INFO (1UL << 13) +/** CHECK TABLE...MEDIUM (the default) */ +#define T_MEDIUM (1UL << 14) +/** CHECK TABLE...QUICK */ +#define T_QUICK (1UL << 15) +#define T_READONLY (1UL << 16) +#define T_REP (1UL << 17) +#define T_REP_BY_SORT (1UL << 18) +#define T_REP_PARALLEL (1UL << 19) +#define T_RETRY_WITHOUT_QUICK (1UL << 20) +#define T_SAFE_REPAIR (1UL << 21) +#define T_SILENT (1UL << 22) +#define T_SORT_INDEX (1UL << 23) +#define T_SORT_RECORDS (1UL << 24) +#define T_STATISTICS (1UL << 25) +#define T_UNPACK (1UL << 26) +#define T_UPDATE_STATE (1UL << 27) +#define T_VERBOSE (1UL << 28) +#define T_VERY_SILENT (1UL << 29) +#define T_WAIT_FOREVER (1UL << 30) +#define T_WRITE_LOOP (1UL << 31) +#define T_ZEROFILL (1ULL << 32) +#define T_ZEROFILL_KEEP_LSN (1ULL << 33) +/** If repair should not bump create_rename_lsn */ +#define T_NO_CREATE_RENAME_LSN (1ULL << 33) + +#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/myisam.h b/include/myisam.h index 83402fe660f..cbb5229dd8b 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -28,7 +28,7 @@ extern "C" { #include "my_compare.h" #include <myisamchk.h> #include <mysql/plugin.h> - +#include <my_check_opt.h> /* Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details */ @@ -311,7 +311,6 @@ typedef struct st_mi_bit_buff uint error; } MI_BIT_BUFF; - typedef struct st_sort_info { /* sync things */ diff --git a/include/myisamchk.h b/include/myisamchk.h index 19c2bf47ddb..a09e53eb387 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -27,45 +27,6 @@ #ifndef _myisamchk_h #define _myisamchk_h -#define T_AUTO_INC 1 -#define T_AUTO_REPAIR 2 /* QQ to be removed */ -#define T_BACKUP_DATA 4 -#define T_CALC_CHECKSUM 8 -#define T_CHECK 16 -#define T_CHECK_ONLY_CHANGED 32 -#define T_CREATE_MISSING_KEYS 64 -#define T_DESCRIPT 128 -#define T_DONT_CHECK_CHECKSUM 256 -#define T_EXTEND 512 -#define T_FAST (1L << 10) -#define T_FORCE_CREATE (1L << 11) -#define T_FORCE_UNIQUENESS (1L << 12) -#define T_INFO (1L << 13) -#define T_MEDIUM (1L << 14) -#define T_QUICK (1L << 15) -#define T_READONLY (1L << 16) -#define T_REP (1L << 17) -#define T_REP_BY_SORT (1L << 18) -#define T_REP_PARALLEL (1L << 19) -#define T_RETRY_WITHOUT_QUICK (1L << 20) -#define T_SAFE_REPAIR (1L << 21) -#define T_SILENT (1L << 22) -#define T_SORT_INDEX (1L << 23) -#define T_SORT_RECORDS (1L << 24) -#define T_STATISTICS (1L << 25) -#define T_UNPACK (1L << 26) -#define T_UPDATE_STATE (1L << 27) -#define T_VERBOSE (1L << 28) -#define T_VERY_SILENT (1L << 29) -#define T_WAIT_FOREVER (1L << 30) -#define T_WRITE_LOOP ((ulong) 1L << 31) -#define T_ZEROFILL ((ulonglong) 1L << 32) -#define T_ZEROFILL_KEEP_LSN ((ulonglong) 1L << 33) -/** If repair should not bump create_rename_lsn */ -#define T_NO_CREATE_RENAME_LSN ((ulonglong) 1L << 33) - -#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL) - /* Flags used by xxxxchk.c or/and ha_xxxx.cc that are NOT passed to xxxcheck.c follows: diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 0bad5934659..980f92888a0 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -332,8 +332,10 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIB MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development) # Visual Studio users need debug static library for debug projects +INSTALL_DEBUG_SYMBOLS(clientlib) IF(MSVC) INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug) + INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() IF(UNIX) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index e4c839ce705..ff4bc960acb 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -15,6 +15,7 @@ main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_tim rpl.rpl_innodb_bug28430 # Bug#11754425 rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun +rpl.rpl_spec_variables @solaris # Bug #17337114 2013-08-20 Luis Soares failing on pb2 with timeout for 'CHECK WARNINGS' sys_vars.max_sp_recursion_depth_func @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc index 094e84537db..983851adfcd 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -150,10 +150,9 @@ if (`SELECT HEX(@commands) = HEX('configure')`) } # -# Drops tables and synchronizes master and slave. Note that temporary -# tables are not explitcily dropped as they will be dropped while -# closing the connection. +# Drops tables and synchronizes master and slave. # + if (`SELECT HEX(@commands) = HEX('clean')`) { connection master; @@ -162,10 +161,15 @@ if (`SELECT HEX(@commands) = HEX('clean')`) DROP TABLE IF EXISTS nt_xx_1; + DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; + DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; + --let $n= $tot_table while ($n) { --eval DROP TABLE IF EXISTS nt_$n + --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n + --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --dec $n } diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test index c0ec5299cfd..865c97cf95d 100644 --- a/mysql-test/extra/rpl_tests/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -113,7 +113,7 @@ FLUSH LOGS; --echo -------- switch to master -------- connection master; FLUSH LOGS; - +DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; DROP DATABASE mysqltest1; --echo End of 5.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test index 17d949a7790..e7a78f36efc 100644 --- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test @@ -41,6 +41,9 @@ reset slave; source include/start_slave.inc; sync_with_master; show status like 'slave_open_temp_tables'; +connection master; +drop temporary table if exists t1; +sync_slave_with_master; # #Bug#34654 RESET SLAVE does not clear LAST_IO_Err* diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 6c1a3513324..7cca74d52f0 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -78,5 +78,7 @@ BEGIN -- verify that no plugin changed its disabled/enabled state SELECT * FROM INFORMATION_SCHEMA.PLUGINS; + show status like 'slave_open_temp_tables'; + END|| diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc new file mode 100644 index 00000000000..c047b5bc499 --- /dev/null +++ b/mysql-test/include/search_pattern_in_file.inc @@ -0,0 +1,66 @@ +# Purpose: +# Simple search with Perl for a pattern in some file. +# +# The advantages compared to thinkable auxiliary constructs using the +# mysqltest language and SQL are: +# 1. We do not need a running MySQL server. +# 2. SQL causes "noise" during debugging and increases the size of logs. +# Perl code does not disturb at all. +# +# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set +# before sourcing this routine. +# +# In case of +# - SEARCH_FILE and/or SEARCH_PATTERN is not set +# - SEARCH_FILE cannot be opened +# - SEARCH_FILE does not contain SEARCH_PATTERN +# the test will abort immediate. +# MTR will report something like +# .... +# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 +# main.1st [ pass ] 3 +# innodb.innodb_page_size [ fail ] +# Test ended at 2011-11-11 18:15:58 +# +# CURRENT_TEST: innodb.innodb_page_size +# # ERROR: The file '<name>' does not contain the expected pattern <pattern> +# mysqltest: In included file "./include/search_pattern_in_file.inc": +# included from ./include/search_pattern_in_file.inc at line 36: +# At line 25: command "perl" failed with error 255. my_errno=175 +# +# The result from queries just before the failure was: +# ... +# - saving '<some path>' to '<some path>' +# main.1st [ pass ] 2 +# +# Typical use case (check invalid server startup options): +# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; +# --error 0,1 +# --remove_file $error_log +# let SEARCH_FILE= $error_log; +# # Stop the server +# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +# --exec echo "wait" > $restart_file +# --shutdown_server 10 +# --source include/wait_until_disconnected.inc +# +# --error 1 +# --exec $MYSQLD_CMD <whatever wrong setting> > $error_log 2>&1 +# # The server restart aborts +# let SEARCH_PATTERN= \[ERROR\] Aborting; +# --source include/search_pattern_in_file.inc +# +# Created: 2011-11-11 mleich +# + +perl; + use strict; + my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set"; + my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set"; + open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n"); + read(FILE, my $file_content, 50000, 0); + close(FILE); + if ( not $file_content =~ m{$search_pattern} ) { + die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n"); + } +EOF diff --git a/mysql-test/r/perror.result b/mysql-test/r/perror.result index 74842b77ba1..30a56840b1b 100644 --- a/mysql-test/r/perror.result +++ b/mysql-test/r/perror.result @@ -1,6 +1,6 @@ Illegal error code: 10000 MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d -MySQL error code 1076 (ER_READY): %s: ready for connections. -Version: '%s' socket: '%s' port: %d +MySQL error code 1408 (ER_STARTUP): %s: ready for connections. +Version: '%s' socket: '%s' port: %d %s MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" or dump/reload to fix it! MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu) diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index 63d557ca5a4..940484a34e7 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -256,7 +256,7 @@ handler t1 read a=(1); a b handler t1 read a next; a b -16 ccc +14 aaa handler t1 close; handler t1 open; prepare stmt from 'handler t1 read a=(?) limit ?,?'; @@ -563,7 +563,7 @@ HANDLER t1 READ `primary` = (1, 1000); no1 no2 HANDLER t1 READ `primary` NEXT; no1 no2 -2 8 +2 6 DROP TABLE t1; create table t1 (c1 int); insert into t1 values (14397); diff --git a/mysql-test/suite/innodb/r/innodb_bug13510739.result b/mysql-test/suite/innodb/r/innodb_bug13510739.result index 8aa4323eeb0..e1e6e27239c 100644 --- a/mysql-test/suite/innodb/r/innodb_bug13510739.result +++ b/mysql-test/suite/innodb/r/innodb_bug13510739.result @@ -6,5 +6,5 @@ HANDLER bug13510739 READ `primary` = (2); c HANDLER bug13510739 READ `primary` NEXT; c -4 +3 DROP TABLE bug13510739; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index d57a52a2362..4d7dbdbd6a6 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result index 6bafbb32897..40a38ee8592 100644 --- a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result +++ b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result @@ -15,4 +15,7 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS t master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp +DROP TEMPORARY TABLE tmp; +DROP TEMPORARY TABLE tmp1; +DROP TEMPORARY TABLE tmp2; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result new file mode 100644 index 00000000000..573517d6af8 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +SET @debug_saved= @@GLOBAL.DEBUG_DBUG; +CREATE TABLE t (i INT); +SET GLOBAL DEBUG_DBUG= "d,wait_after_binlog_EOF"; +INSERT INTO t VALUES (1); +INSERT INTO t VALUES (2); +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; +include/diff_tables.inc [master:t,slave:t] +SET @@GLOBAL.DEBUG_DBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result index f24f34fa0bf..5a258647b07 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result @@ -43,4 +43,5 @@ t5 CREATE TABLE `t5` ( `created` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2,t3,t5; +drop temporary table t4; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result index 761ff2f8e98..57c947c9333 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result @@ -1554,8 +1554,14 @@ master-bin.000001 # Query # # COMMIT SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index f10e30c698d..166ef3c8726 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -98,6 +98,7 @@ count(*) 91 unlock tables; drop table if exists t1,t2,t3,t4; +drop temporary table temp_table; End of 4.1 tests show binlog events in 'non existing_binlog_file'; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result index 88754e2cf8c..a55c8e2a2bc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result @@ -1619,8 +1619,14 @@ master-bin.000001 # Query # # COMMIT SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 41fe0b1a9f3..1cf70ba7e67 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -23,6 +23,7 @@ include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +drop temporary table if exists t1; include/stop_slave.inc reset slave; include/check_slave_no_error.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index 80a3240021a..2401fda52f9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -48,6 +48,7 @@ select (@id := id) - id from t2; 0 kill @id; drop table t2; +drop temporary table t3; Got one of the listed errors include/wait_for_slave_sql_error_and_skip.inc [errno=1927] select count(*) from t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result index 42f16a4c175..08b318fbb43 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result @@ -1604,8 +1604,14 @@ master-bin.000001 # Query # # ROLLBACK SET @commands= 'clean'; DROP TABLE IF EXISTS tt_xx_1; DROP TABLE IF EXISTS nt_xx_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_xx_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_xx_1; DROP TABLE IF EXISTS nt_2; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; DROP TABLE IF EXISTS nt_1; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; DROP TABLE IF EXISTS tt_2; DROP TABLE IF EXISTS tt_1; SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result index 0e9531317b9..6f54b232e71 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result @@ -79,6 +79,7 @@ COUNT(*) FLUSH LOGS; -------- switch to master -------- FLUSH LOGS; +DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2; DROP DATABASE mysqltest1; End of 5.1 tests # diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index b1473c937a1..e5870cec2c9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -23,6 +23,7 @@ include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +drop temporary table if exists t1; include/stop_slave.inc reset slave; include/check_slave_no_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test index e1fd7abb47f..3107fdfaaa9 100644 --- a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test +++ b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test @@ -38,4 +38,8 @@ CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; source include/show_binlog_events.inc; +DROP TEMPORARY TABLE tmp; +DROP TEMPORARY TABLE tmp1; +DROP TEMPORARY TABLE tmp2; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test new file mode 100644 index 00000000000..3a4a24e1762 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -0,0 +1,51 @@ +# +# Whenever the mysql_binlog_send method (dump thread) reaches the +# end of file when reading events from the binlog, before checking +# if it should wait for more events, there was a test to check if +# the file being read was still active, i.e, it was the last known +# binlog. However, it was possible that something was written to +# the binary log and then a rotation would happen, after EOF was +# detected and before the check for active was performed. In this +# case, the end of the binary log would not be read by the dump +# thread, and this would cause the slave to lose updates. +# +# This test verifies that the problem has been fixed. It waits +# during this window while forcing a rotation in the binlog. +# +--source include/have_debug.inc +--source include/master-slave.inc + +--connection master + +SET @debug_saved= @@GLOBAL.DEBUG_DBUG; + +CREATE TABLE t (i INT); + +# When reaching the EOF the dump thread will wait before deciding if +# it should move to a new binlong file. +SET GLOBAL DEBUG_DBUG= "d,wait_after_binlog_EOF"; + +INSERT INTO t VALUES (1); + +--sleep 1 + +# A insert and a rotate happens before the decision +INSERT INTO t VALUES (2); +FLUSH LOGS; + +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; + +--sync_slave_with_master + +# All the rows should be sent to the slave. +--let $diff_tables=master:t,slave:t +--source include/diff_tables.inc + +##Clean up +--connection master + +SET @@GLOBAL.DEBUG_DBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; + +DROP TABLE t; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test index c5b821ca906..f4a1615a20f 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test @@ -44,6 +44,7 @@ show create table t3; show create table t5; connection master; drop table t2,t3,t5; +drop temporary table t4; sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 393623888ec..b4cfb4eb224 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -176,6 +176,7 @@ unlock tables; #clean up connection master; drop table if exists t1,t2,t3,t4; +drop temporary table temp_table; sync_slave_with_master; --echo End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test index 16f89123d75..d25decf9383 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -91,8 +91,8 @@ connection master1; sleep 3; select (@id := id) - id from t2; kill @id; -# We don't drop t3 as this is a temporary table drop table t2; +drop temporary table t3; connection master; # The get_lock function causes warning for unsafe statement. --disable_warnings diff --git a/mysql-test/suite/sys_vars/t/identity_func.test b/mysql-test/suite/sys_vars/t/identity_func.test index 6f7b6bac18e..ff93607a2cd 100644 --- a/mysql-test/suite/sys_vars/t/identity_func.test +++ b/mysql-test/suite/sys_vars/t/identity_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - #################### mysql-test\t\identity_func.test ########################## # # # Variable Name: identity # diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test index 082507efd07..89c1c80a6dc 100644 --- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test +++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ################# mysql-test\t\innodb_autoinc_lock_mode_func.test ############ # # # Variable Name: innodb_autoinc_lock_mode # diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_func.test b/mysql-test/suite/sys_vars/t/last_insert_id_func.test index bb3adbc1c64..2309c539bd9 100644 --- a/mysql-test/suite/sys_vars/t/last_insert_id_func.test +++ b/mysql-test/suite/sys_vars/t/last_insert_id_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ################# mysql-test\t\last_insert_id_func.test ####################### # # # Variable Name: last_insert_id # diff --git a/mysql-test/suite/sys_vars/t/storage_engine_basic.test b/mysql-test/suite/sys_vars/t/storage_engine_basic.test index 2d1e94e6620..964166daae7 100644 --- a/mysql-test/suite/sys_vars/t/storage_engine_basic.test +++ b/mysql-test/suite/sys_vars/t/storage_engine_basic.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ############## mysql-test\t\storage_engine_basic.test ################## # # # # diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test index 3a78d46e527..7072de6b086 100644 --- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test +++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test @@ -1,9 +1,3 @@ ---source include/not_windows_embedded.inc -# remove this when -# Bug#53947 InnoDB: Assertion failure in thread 4224 in file -# .\sync\sync0sync.c line 324 -# is fixed - ############# mysql-test\t\tx_isolation_func.test ####################################### # # # Variable Name: tx_isolation # diff --git a/mysql-test/t/perror.test b/mysql-test/t/perror.test index 2b9907c0542..69f1cb3257e 100644 --- a/mysql-test/t/perror.test +++ b/mysql-test/t/perror.test @@ -27,7 +27,7 @@ enable_query_log; --exec $MY_PERROR 1062 2>&1 # test errors that contain characters to escape in the text. ---exec $MY_PERROR 1076 2>&1 +--exec $MY_PERROR 1408 2>&1 --exec $MY_PERROR 1459 2>&1 --exec $MY_PERROR 1461 2>&1 diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index f90ad0e7aaf..e0f2de4a61b 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -87,3 +87,7 @@ ADD_EXECUTABLE(thr_lock thr_lock.c) TARGET_LINK_LIBRARIES(thr_lock mysys) SET_TARGET_PROPERTIES(thr_lock PROPERTIES COMPILE_FLAGS "-DMAIN") +INSTALL_DEBUG_SYMBOLS(mysys) +IF(MSVC) + INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 250dc5064a9..c447c4b44a1 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -467,7 +467,7 @@ process_flags: { register int iarg; size_t length2; - char buff[17]; + char buff[32]; iarg = va_arg(args, int); if (*fmt == 'd') @@ -502,7 +502,7 @@ process_flags: { register long iarg; size_t length2; - char buff[17]; + char buff[32]; iarg = va_arg(args, long); if (*++fmt == 'd') diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index 752dc15304e..65688838316 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -70,10 +70,10 @@ Installed
</Custom>
</InstallExecuteSequence>
- <InstallUISequence>
+ <InstallUISequence>
<!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
<AppSearch After="FindRelatedProducts"/>
- </InstallUISequence>
+ </InstallUISequence>
<!-- Find previous installation -->
<Property Id="INSTALLDIR">
@@ -83,31 +83,43 @@ Name="InstallLocation"
Type="raw" />
</Property>
- <Property Id="OLDERVERSION">
- <RegistrySearch Id="FindOlderVersion"
- Root="HKLM"
- Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
- Name="DisplayVersion"
- Type="raw" />
- </Property>
- <Property Id="DATADIR">
+ <?if @Platform@ != "x64" ?>
+ <Property Id="OLDERVERSION">
+ <RegistrySearch Id="FindOlderVersion"
+ Root="HKLM"
+ Win64 = "no"
+ Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
+ Name="DisplayVersion"
+ Type="raw" />
+ </Property>
+ <?else ?>
+ <Property Id="OLDERVERSION">
+ <RegistrySearch Id="FindOlderVersion"
+ Root="HKLM"
+ Win64 = "yes"
+ Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"
+ Name="DisplayVersion"
+ Type="raw" />
+ </Property>
+ <?endif ?>
+ <Property Id="DATADIR">
<RegistrySearch Id="FindDataDir"
Root="HKLM"
Key="SOFTWARE\MySQL AB\[ProductName]"
Name="DataLocation"
Type="raw" />
</Property>
- <Property Id="INSTALLDIR2">
+ <Property Id="INSTALLDIR2">
<RegistrySearch Id="FindInstallLocation2"
Root="HKLM"
Key="SOFTWARE\MySQL AB\[ProductName]"
Name="Location"
Type="raw" />
</Property>
- <CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" />
- <InstallUISequence>
- <Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom>
- </InstallUISequence>
+ <CustomAction Id="SetInstallDir2" Property="INSTALLDIR" Value="[INSTALLDIR2]" />
+ <InstallUISequence>
+ <Custom Action="SetInstallDir2" After="AppSearch">INSTALLDIR2</Custom>
+ </InstallUISequence>
<!-- UI -->
diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh index 3fcbd5c1234..34aed51048f 100644 --- a/packaging/rpm-uln/mysql.spec.sh +++ b/packaging/rpm-uln/mysql.spec.sh @@ -858,7 +858,9 @@ fi %files -n mysql-server%{product_suffix} -f release/support-files/plugins.files %defattr(-,root,root) %doc release/support-files/*.cnf -%doc %{_datadir}/info/mysql.info* +%if 0%{?commercial} + %doc %{_datadir}/info/mysql.info* +%endif %doc %{src_dir}/Docs/ChangeLog %doc %{src_dir}/Docs/INFO_SRC* %doc release/Docs/INFO_BIN* @@ -981,6 +983,9 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Tue Nov 05 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> +- Removed non gpl file mysql.info from community packages + * Wed Jul 10 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - Removed directory /usr/share/mysql/solaris/postinstall-solaris to resolve build error diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 23e35c59281..625f7448945 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -478,13 +478,17 @@ void ReplSemiSyncMaster::remove_slave() lock(); rpl_semi_sync_master_clients--; - /* If user has chosen not to wait if no semi-sync slave available - and the last semi-sync slave exits, turn off semi-sync on master - immediately. - */ - if (!rpl_semi_sync_master_wait_no_slave && - rpl_semi_sync_master_clients == 0) - switch_off(); + /* Only switch off if semi-sync is enabled and is on */ + if (getMasterEnabled() && is_on()) + { + /* If user has chosen not to wait if no semi-sync slave available + and the last semi-sync slave exits, turn off semi-sync on master + immediately. + */ + if (!rpl_semi_sync_master_wait_no_slave && + rpl_semi_sync_master_clients == 0) + switch_off(); + } unlock(); } @@ -883,10 +887,7 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet, * target, do not request replies from the slave. */ if (!getMasterEnabled() || !is_semi_sync_slave()) - { - sync = false; return 0; - } function_enter(kWho); @@ -894,15 +895,12 @@ int ReplSemiSyncMaster::updateSyncHeader(unsigned char *packet, /* This is the real check inside the mutex. */ if (!getMasterEnabled()) - { - sync = false; - goto l_end; - } + goto l_end; // sync= false at this point in time if (is_on()) { /* semi-sync is ON */ - sync = false; /* No sync unless a transaction is involved. */ + /* sync= false; No sync unless a transaction is involved. */ if (reply_file_name_inited_) { diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt index a24f6b267f6..f3d3e54958e 100644 --- a/plugin/win_auth_client/CMakeLists.txt +++ b/plugin/win_auth_client/CMakeLists.txt @@ -31,4 +31,8 @@ IF(WIN32) LINK_LIBRARIES Secur32 MODULE_ONLY COMPONENT SharedLibraries) + #INSTALL_DEBUG_SYMBOLS(auth_win_client) + #IF(MSVC) + # INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) + #ENDIF() ENDIF(WIN32) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index cd4cfc858d8..13aeef6bac0 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -220,7 +220,6 @@ INSTALL_SCRIPT( ) ENDIF() - SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) SET(bindir ${prefix}/${INSTALL_BINDIR}) diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index a222d22b670..18d2de500a7 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -24,8 +24,7 @@ -- Get the hostname, if the hostname has any wildcard character like "_" or "%" -- add escape character in front of wildcard character to convert "_" or "%" to -- a plain character -SET @get_hostname= @@hostname; -SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname; +SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; -- Fill "db" table with default grants for anyone to @@ -41,11 +40,11 @@ DROP TABLE tmp_db; -- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE @current_hostname != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; +INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index c2d63f12399..2860cb1f8de 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -633,6 +633,8 @@ INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now( INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; DROP TABLE tmp_proxies_priv; +# Convering the host name to lower case for existing users +UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above diff --git a/sql-common/client.c b/sql-common/client.c index 19d09e1bcfb..913dab75fda 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -4201,6 +4201,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) mysql->options.methods_to_use= option; break; case MYSQL_SET_CLIENT_IP: + my_free(mysql->options.client_ip); mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); break; case MYSQL_SECURE_AUTH: diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index feda3460c9f..cdb8690ba62 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1345,7 +1345,8 @@ bool ha_partition::is_crashed() const int ha_partition::prepare_new_partition(TABLE *tbl, HA_CREATE_INFO *create_info, handler *file, const char *part_name, - partition_element *p_elem) + partition_element *p_elem, + uint disable_non_uniq_indexes) { int error; DBUG_ENTER("prepare_new_partition"); @@ -1371,6 +1372,7 @@ int ha_partition::prepare_new_partition(TABLE *tbl, if ((error= file->ha_open(tbl, part_name, m_mode, m_open_test_lock))) goto error_open; DBUG_PRINT("info", ("partition %s opened", part_name)); + /* Note: if you plan to add another call that may return failure, better to do it before external_lock() as cleanup_new_partition() @@ -1381,6 +1383,9 @@ int ha_partition::prepare_new_partition(TABLE *tbl, goto error_external_lock; DBUG_PRINT("info", ("partition %s external locked", part_name)); + if (disable_non_uniq_indexes) + file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE); + DBUG_RETURN(0); error_external_lock: (void) file->ha_close(); @@ -1658,6 +1663,14 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, on them to prepare them for copy phase and also for later close calls */ + + /* + Before creating new partitions check whether indexes are disabled + in the partitions. + */ + + uint disable_non_uniq_indexes = indexes_are_disabled(); + i= 0; part_count= 0; part_it.rewind(); @@ -1692,11 +1705,13 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, if ((error= prepare_new_partition(table, create_info, new_file_array[part], (const char *)part_name_buff, - sub_elem))) + sub_elem, + disable_non_uniq_indexes))) { cleanup_new_partition(part_count); DBUG_RETURN(error); } + m_added_file[part_count++]= new_file_array[part]; } while (++j < num_subparts); } @@ -1709,11 +1724,13 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, if ((error= prepare_new_partition(table, create_info, new_file_array[i], (const char *)part_name_buff, - part_elem))) + part_elem, + disable_non_uniq_indexes))) { cleanup_new_partition(part_count); DBUG_RETURN(error); } + m_added_file[part_count++]= new_file_array[i]; } } diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 7941c1ce581..cec377b9e29 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -269,7 +269,8 @@ private: void cleanup_new_partition(uint part_count); int prepare_new_partition(TABLE *table, HA_CREATE_INFO *create_info, handler *file, const char *part_name, - partition_element *p_elem); + partition_element *p_elem, + uint disable_non_uniq_indexes); /* delete_table, rename_table and create uses very similar logic which is packed into this routine. diff --git a/sql/handler.cc b/sql/handler.cc index e6981689d19..2e038be0092 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4906,8 +4906,10 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) "", 0, "DISABLED", 8) ? 1 : 0; } else + { result= db_type->show_status && db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0; + } } /* diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 1c51ffaeea6..fc0d3beeea3 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2009, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify @@ -2888,7 +2888,9 @@ String *Item_func_conv::val_str(String *str) int to_base= (int) args[2]->val_int(); int err; + // Note that abs(INT_MIN) is undefined. if (args[0]->null_value || args[1]->null_value || args[2]->null_value || + from_base == INT_MIN || to_base == INT_MIN || abs(to_base) > 36 || abs(to_base) < 2 || abs(from_base) > 36 || abs(from_base) < 2 || !(res->length())) { diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 092531c1c9e..092c9728d47 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1579,8 +1579,12 @@ void Item_sum_count::clear() bool Item_sum_count::add() { - if (!args[0]->maybe_null || !args[0]->is_null()) - count++; + for (uint i=0; i<arg_count; i++) + { + if (args[i]->maybe_null && args[i]->is_null()) + return 0; + } + count++; return 0; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 113234d3106..73686a2fd0c 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5955,9 +5955,7 @@ int Intvar_log_event::do_apply_event(Relay_log_info const *rli) switch (type) { case LAST_INSERT_ID_EVENT: - thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 1; - thd->first_successful_insert_id_in_prev_stmt_for_binlog= - thd->first_successful_insert_id_in_prev_stmt= val; + thd->first_successful_insert_id_in_prev_stmt= val; DBUG_PRINT("info",("last_insert_id_event: %ld", (long) val)); break; case INSERT_ID_EVENT: diff --git a/sql/net_serv.cc b/sql/net_serv.cc index e0a0d5b75cf..4b78492c857 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify diff --git a/sql/opt_range.cc b/sql/opt_range.cc index dbaec28b8df..66bd287d86a 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -10340,15 +10340,16 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { KEY *table_key=quick->head->key_info+quick->index; flag=EQ_RANGE; - if ((table_key->flags & HA_NOSAME) && key->part == table_key->key_parts-1) + if ((table_key->flags & HA_NOSAME) && + key_tree->part == table_key->key_parts-1) { - if (!(table_key->flags & HA_NULL_PART_KEY) || - !null_part_in_key(key, - param->min_key, - (uint) (tmp_min_key - param->min_key))) - flag|= UNIQUE_RANGE; - else - flag|= NULL_RANGE; + if ((table_key->flags & HA_NULL_PART_KEY) && + null_part_in_key(key, + param->min_key, + (uint) (tmp_min_key - param->min_key))) + flag|= NULL_RANGE; + else + flag|= UNIQUE_RANGE; } } } @@ -10378,7 +10379,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, } /* - Return 1 if there is only one range and this uses the whole primary key + Return 1 if there is only one range and this uses the whole unique key */ bool QUICK_RANGE_SELECT::unique_key_range() diff --git a/sql/set_var.cc b/sql/set_var.cc index 7c3cec38601..2179f50d266 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -216,7 +216,6 @@ uchar *sys_var::global_value_ptr(THD *thd, LEX_STRING *base) bool sys_var::check(THD *thd, set_var *var) { - do_deprecated_warning(thd); if ((var->value && do_check(thd, var)) || (on_check && on_check(this, thd, var))) { @@ -592,6 +591,7 @@ err: int set_var::check(THD *thd) { + var->do_deprecated_warning(thd); if (var->is_readonly()) { my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->name.str, "read only"); diff --git a/sql/set_var.h b/sql/set_var.h index 205812e8822..2b3a376488b 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -140,6 +140,7 @@ public: return (option.id != -1) && ((flags & PARSE_EARLY) == parse_flags) && insert_dynamic(array, (uchar*)&option); } + void do_deprecated_warning(THD *thd); private: virtual bool do_check(THD *thd, set_var *var) = 0; @@ -153,7 +154,7 @@ private: virtual void global_save_default(THD *thd, set_var *var) = 0; virtual bool session_update(THD *thd, set_var *var) = 0; virtual bool global_update(THD *thd, set_var *var) = 0; - void do_deprecated_warning(THD *thd); + protected: /** A pointer to a value of the variable for SHOW. diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 0ce09e3fcd0..665d5b2724f 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -492,6 +492,7 @@ void lex_start(THD *thd) lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc; lex->select_lex.group_list.empty(); lex->select_lex.order_list.empty(); + lex->select_lex.gorder_list.empty(); lex->duplicates= DUP_ERROR; lex->ignore= 0; lex->spname= NULL; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index eb48e2be48b..357bd8efc27 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -5106,6 +5106,8 @@ that are reorganised. } else if (alter_info->flags & ALTER_REBUILD_PARTITION) { + set_engine_all_partitions(tab_part_info, + tab_part_info->default_engine_type); if (set_part_state(alter_info, tab_part_info, PART_CHANGED)) { my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD"); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ad1e291a9d7..e948813584d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -880,7 +880,7 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array, if (param->state == Item_param::NO_VALUE) DBUG_RETURN(1); - if (param->limit_clause_param) + if (param->limit_clause_param && param->state != Item_param::INT_VALUE) { param->set_int(param->val_int(), MY_INT64_NUM_DECIMAL_DIGITS); param->item_type= Item::INT_ITEM; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 9526933933f..5b4d4fdb4eb 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. - Copyright (c) 2012, Monty Program Ab +/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. + Copyright (c) 2012, 2014, SkySQL 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 @@ -1769,9 +1769,13 @@ static Sys_var_charptr Sys_socket( static Sys_var_ulong Sys_thread_concurrency( "thread_concurrency", "Permits the application to give the threads system a hint for " - "the desired number of threads that should be run at the same time", + "the desired number of threads that should be run at the same time." + "This variable has no effect, and is deprecated. " + "It will be removed in a future release.", READ_ONLY GLOBAL_VAR(concurrency), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1)); + VALID_RANGE(1, 512), DEFAULT(DEFAULT_CONCURRENCY), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED("")); static Sys_var_ulonglong Sys_thread_stack( "thread_stack", "The stack size for each thread", diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 81a482e2854..7762907b6aa 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -61,6 +61,7 @@ Created 10/16/1994 Heikki Tuuri #include "row0upd.h" #include "trx0rec.h" #include "trx0roll.h" /* trx_is_recv() */ +#include "trx0undo.h" #include "que0que.h" #include "row0row.h" #include "srv0srv.h" @@ -1631,7 +1632,7 @@ btr_cur_upd_lock_and_undo( /***********************************************************//** Writes a redo log record of updating a record in-place. */ -UNIV_INLINE +UNIV_INTERN void btr_cur_update_in_place_log( /*========================*/ @@ -1659,18 +1660,30 @@ btr_cur_update_in_place_log( return; } - /* The code below assumes index is a clustered index: change index to - the clustered index if we are updating a secondary index record (or we - could as well skip writing the sys col values to the log in this case - because they are not needed for a secondary index record update) */ - - index = dict_table_get_first_index(index->table); + /* For secondary indexes, we could skip writing the dummy system fields + to the redo log but we have to change redo log parsing of + MLOG_REC_UPDATE_IN_PLACE/MLOG_COMP_REC_UPDATE_IN_PLACE or we have to add + new redo log record. For now, just write dummy sys fields to the redo + log if we are updating a secondary index record. + */ mach_write_to_1(log_ptr, flags); log_ptr++; - log_ptr = row_upd_write_sys_vals_to_log(index, trx, roll_ptr, log_ptr, - mtr); + if (dict_index_is_clust(index)) { + log_ptr = row_upd_write_sys_vals_to_log( + index, trx, roll_ptr, log_ptr, mtr); + } else { + /* Dummy system fields for a secondary index */ + /* TRX_ID Position */ + log_ptr += mach_write_compressed(log_ptr, 0); + /* ROLL_PTR */ + trx_write_roll_ptr(log_ptr, 0); + log_ptr += DATA_ROLL_PTR_LEN; + /* TRX_ID */ + log_ptr += mach_ull_write_compressed(log_ptr, 0); + } + mach_write_to_2(log_ptr, page_offset(rec)); log_ptr += 2; diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c index 0cfdf138bad..09b3715e096 100644 --- a/storage/innobase/btr/btr0pcur.c +++ b/storage/innobase/btr/btr0pcur.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -110,7 +110,7 @@ btr_pcur_store_position( page_t* page; ulint offs; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); block = btr_pcur_get_block(cursor); @@ -124,7 +124,6 @@ btr_pcur_store_position( ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_S_FIX) || mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); - ut_a(cursor->latch_mode != BTR_NO_LATCHES); if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) { /* It must be an empty index tree; NOTE that in this case @@ -235,21 +234,12 @@ btr_pcur_restore_position_func( ut_ad(mtr); ut_ad(mtr->state == MTR_ACTIVE); + ut_ad(cursor->old_stored == BTR_PCUR_OLD_STORED); + ut_ad(cursor->pos_state == BTR_PCUR_WAS_POSITIONED + || cursor->pos_state == BTR_PCUR_IS_POSITIONED); index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor)); - if (UNIV_UNLIKELY(cursor->old_stored != BTR_PCUR_OLD_STORED) - || UNIV_UNLIKELY(cursor->pos_state != BTR_PCUR_WAS_POSITIONED - && cursor->pos_state != BTR_PCUR_IS_POSITIONED)) { - ut_print_buf(stderr, cursor, sizeof(btr_pcur_t)); - putc('\n', stderr); - if (cursor->trx_if_known) { - trx_print(stderr, cursor->trx_if_known, 0); - } - - ut_error; - } - if (UNIV_UNLIKELY (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE || cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE)) { @@ -273,14 +263,14 @@ btr_pcur_restore_position_func( if (UNIV_LIKELY(latch_mode == BTR_SEARCH_LEAF) || UNIV_LIKELY(latch_mode == BTR_MODIFY_LEAF)) { - /* Try optimistic restoration */ + /* Try optimistic restoration. */ - if (UNIV_LIKELY(buf_page_optimistic_get( - latch_mode, - cursor->block_when_stored, - cursor->modify_clock, - file, line, mtr))) { + if (buf_page_optimistic_get(latch_mode, + cursor->block_when_stored, + cursor->modify_clock, + file, line, mtr)) { cursor->pos_state = BTR_PCUR_IS_POSITIONED; + cursor->latch_mode = latch_mode; buf_block_dbg_add_level( btr_pcur_get_block(cursor), @@ -292,9 +282,6 @@ btr_pcur_restore_position_func( const rec_t* rec; const ulint* offsets1; const ulint* offsets2; -#endif /* UNIV_DEBUG */ - cursor->latch_mode = latch_mode; -#ifdef UNIV_DEBUG rec = btr_pcur_get_rec(cursor); heap = mem_heap_create(256); @@ -312,7 +299,13 @@ btr_pcur_restore_position_func( #endif /* UNIV_DEBUG */ return(TRUE); } - + /* This is the same record as stored, + may need to be adjusted for BTR_PCUR_BEFORE/AFTER, + depending on search mode and direction. */ + if (btr_pcur_is_on_user_rec(cursor)) { + cursor->pos_state + = BTR_PCUR_IS_POSITIONED_OPTIMISTIC; + } return(FALSE); } } @@ -414,7 +407,7 @@ btr_pcur_move_to_next_page( buf_block_t* next_block; page_t* next_page; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(btr_pcur_is_after_last_on_page(cursor)); @@ -469,7 +462,6 @@ btr_pcur_move_backward_from_page( ulint latch_mode; ulint latch_mode2; - ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); ut_ad(btr_pcur_is_before_first_on_page(cursor)); ut_ad(!btr_pcur_is_before_first_in_tree(cursor, mtr)); diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index c3f64046da0..546794be26c 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -36,6 +36,11 @@ UNIV_INTERN dict_index_t* dict_ind_redundant; /** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */ UNIV_INTERN dict_index_t* dict_ind_compact; +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG +/** Flag to control insert buffer debugging. */ +UNIV_INTERN uint ibuf_debug; +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + #ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "data0type.h" @@ -4480,6 +4485,8 @@ dict_update_statistics( dict_index_t* index; ulint sum_of_index_sizes = 0; + DBUG_EXECUTE_IF("skip_innodb_statistics", return;); + if (table->ibd_file_missing) { ut_print_timestamp(stderr); fprintf(stderr, @@ -4520,6 +4527,12 @@ dict_update_statistics( continue; } +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG + if (ibuf_debug && !dict_index_is_clust(index)) { + goto fake_statistics; + } +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + if (UNIV_LIKELY (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 3a19a730126..700d1404193 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -3531,7 +3531,7 @@ fil_load_single_table_tablespace( if (check_msg) { fprintf(stderr, - "InnoDB: Error: %s in file %s", + "InnoDB: Error: %s in file %s\n", check_msg, filepath); goto func_exit; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 9c16cf73952..e8a355358cc 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -53,6 +53,7 @@ this program; if not, write to the Free Software Foundation, Inc., #include <innodb_priv.h> #include <mysql/psi/psi.h> #include <my_sys.h> +#include <my_check_opt.h> #ifdef _WIN32 #include <io.h> @@ -7884,6 +7885,10 @@ ha_innobase::records_in_range( /* There exists possibility of not being able to find requested index due to inconsistency between MySQL and InoDB dictionary info. Necessary message should have been printed in innobase_get_index() */ + if (prebuilt->table->ibd_file_missing) { + n_rows = HA_POS_ERROR; + goto func_exit; + } if (UNIV_UNLIKELY(!index)) { n_rows = HA_POS_ERROR; goto func_exit; @@ -8612,8 +8617,7 @@ int ha_innobase::check( /*===============*/ THD* thd, /*!< in: user thread handle */ - HA_CHECK_OPT* check_opt) /*!< in: check options, currently - ignored */ + HA_CHECK_OPT* check_opt) /*!< in: check options */ { dict_index_t* index; ulint n_rows; @@ -8670,11 +8674,6 @@ ha_innobase::check( do additional check */ prebuilt->table->corrupted = FALSE; - /* Enlarge the fatal lock wait timeout during CHECK TABLE. */ - mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION; - mutex_exit(&kernel_mutex); - for (index = dict_table_get_first_index(prebuilt->table); index != NULL; index = dict_table_get_next_index(index)) { @@ -8687,20 +8686,41 @@ ha_innobase::check( /* If this is an index being created, break */ if (*index->name == TEMP_INDEX_PREFIX) { - break; - } else if (!btr_validate_index(index, prebuilt->trx)) { - is_ok = FALSE; + continue; + } + if (!(check_opt->flags & T_QUICK)) { + /* Enlarge the fatal lock wait timeout during + CHECK TABLE. */ + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold += + SRV_SEMAPHORE_WAIT_EXTENSION; + mutex_exit(&kernel_mutex); + + ibool valid = TRUE; + valid = btr_validate_index(index, prebuilt->trx); + + /* Restore the fatal lock wait timeout after + CHECK TABLE. */ + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold -= + SRV_SEMAPHORE_WAIT_EXTENSION; + mutex_exit(&kernel_mutex); + + if (!valid) { + is_ok = FALSE; - innobase_format_name( - index_name, sizeof index_name, - prebuilt->index->name, TRUE); + innobase_format_name( + index_name, sizeof index_name, + index->name, TRUE); + push_warning_printf(thd, + MYSQL_ERROR::WARN_LEVEL_WARN, + ER_NOT_KEYFILE, + "InnoDB: The B-tree of" + " index %s is corrupted.", + index_name); - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_NOT_KEYFILE, - "InnoDB: The B-tree of" - " index %s is corrupted.", - index_name); - continue; + continue; + } } /* Instead of invoking change_active_index(), set up @@ -8804,21 +8824,17 @@ ha_innobase::check( /* Restore the original isolation level */ prebuilt->trx->isolation_level = old_isolation_level; - /* We validate also the whole adaptive hash index for all tables - at every CHECK TABLE */ +#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG + /* We validate the whole adaptive hash index for all tables + at every CHECK TABLE only when QUICK flag is not present. */ - if (!btr_search_validate()) { + if (!(check_opt->flags & T_QUICK) && !btr_search_validate()) { push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_NOT_KEYFILE, "InnoDB: The adaptive hash index is corrupted."); is_ok = FALSE; } - - /* Restore the fatal lock wait timeout after CHECK TABLE. */ - mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION; - mutex_exit(&kernel_mutex); - +#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */ prebuilt->trx->op_info = ""; if (thd_kill_level(user_thd)) { my_error(ER_QUERY_INTERRUPTED, MYF(0)); @@ -9672,7 +9688,7 @@ innodb_show_status( const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; - bool res; + bool ret_val; DBUG_ENTER("innodb_show_status"); DBUG_ASSERT(hton == innodb_hton_ptr); @@ -9737,13 +9753,13 @@ innodb_show_status( mutex_exit(&srv_monitor_file_mutex); - res= stat_print(thd, innobase_hton_name, - (uint) strlen(innobase_hton_name), - STRING_WITH_LEN(""), str, flen); + ret_val= stat_print(thd, innobase_hton_name, + (uint) strlen(innobase_hton_name), + STRING_WITH_LEN(""), str, flen); my_free(str); - DBUG_RETURN(res); + DBUG_RETURN(ret_val); } /************************************************************************//** diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 306cdefc304..d22fc8b9962 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -193,11 +193,6 @@ access order rules. */ /** Operations that can currently be buffered. */ UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_ALL; -#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG -/** Flag to control insert buffer debugging. */ -UNIV_INTERN uint ibuf_debug; -#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - /** The insert buffer control structure */ UNIV_INTERN ibuf_t* ibuf = NULL; @@ -2649,6 +2644,12 @@ ibuf_contract_ext( return(0); } +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG + if (ibuf_debug) { + return(0); + } +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + ibuf_mtr_start(&mtr); /* Open a cursor to a randomly chosen leaf of the tree, at a random @@ -4016,6 +4017,24 @@ updated_in_place: to btr_cur_update_in_place(). */ row_upd_rec_in_place(rec, index, offsets, update, page_zip); + + /* Log the update in place operation. During recovery + MLOG_COMP_REC_UPDATE_IN_PLACE/MLOG_REC_UPDATE_IN_PLACE + expects trx_id, roll_ptr for secondary indexes. So we + just write dummy trx_id(0), roll_ptr(0) */ + btr_cur_update_in_place_log(BTR_KEEP_SYS_FLAG, rec, + index, update, + NULL, 0, mtr); + DBUG_EXECUTE_IF( + "crash_after_log_ibuf_upd_inplace", + log_buffer_flush_to_disk(); + fprintf(stderr, + "InnoDB: Wrote log record for ibuf " + "update in place operation\n"); + DBUG_SUICIDE(); + ); + + goto updated_in_place; } diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 283a6eec852..78637ea7295 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -636,6 +636,21 @@ btr_cur_set_deleted_flag_for_ibuf( uncompressed */ ibool val, /*!< in: value to set */ mtr_t* mtr); /*!< in/out: mini-transaction */ + +/***********************************************************//** +Writes a redo log record of updating a record in-place. */ +UNIV_INTERN +void +btr_cur_update_in_place_log( +/*========================*/ + ulint flags, /*!< in: flags */ + rec_t* rec, /*!< in: record */ + dict_index_t* index, /*!< in: index where cursor positioned */ + const upd_t* update, /*!< in: update vector */ + trx_t* trx, /*!< in: transaction */ + roll_ptr_t roll_ptr, /*!< in: roll ptr */ + mtr_t* mtr); /*!< in: mtr */ + /*######################################################################*/ /** In the pessimistic delete, if the page data size drops below this diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index 4312f73ca4a..d9ce02283d7 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -447,6 +447,27 @@ btr_pcur_move_to_prev_on_page( /*==========================*/ btr_pcur_t* cursor);/*!< in/out: persistent cursor */ +/** Position state of persistent B-tree cursor. */ +enum pcur_pos_t { + /** The persistent cursor is not positioned. */ + BTR_PCUR_NOT_POSITIONED = 0, + /** The persistent cursor was previously positioned. + TODO: currently, the state can be BTR_PCUR_IS_POSITIONED, + though it really should be BTR_PCUR_WAS_POSITIONED, + because we have no obligation to commit the cursor with + mtr; similarly latch_mode may be out of date. This can + lead to problems if btr_pcur is not used the right way; + all current code should be ok. */ + BTR_PCUR_WAS_POSITIONED, + /** The persistent cursor is positioned by optimistic get to the same + record as it was positioned at. Not used for rel_pos == BTR_PCUR_ON. + It may need adjustment depending on previous/current search direction + and rel_pos. */ + BTR_PCUR_IS_POSITIONED_OPTIMISTIC, + /** The persistent cursor is positioned by index search. + Or optimistic get for rel_pos == BTR_PCUR_ON. */ + BTR_PCUR_IS_POSITIONED +}; /* The persistent B-tree cursor structure. This is used mainly for SQL selects, updates, and deletes. */ @@ -480,10 +501,8 @@ struct btr_pcur_struct{ ib_uint64_t modify_clock; /*!< the modify clock value of the buffer block when the cursor position was stored */ - ulint pos_state; /*!< see TODO note below! - BTR_PCUR_IS_POSITIONED, - BTR_PCUR_WAS_POSITIONED, - BTR_PCUR_NOT_POSITIONED */ + enum pcur_pos_t pos_state; /*!< btr_pcur_store_position() and + btr_pcur_restore_position() state. */ ulint search_mode; /*!< PAGE_CUR_G, ... */ trx_t* trx_if_known; /*!< the transaction, if we know it; otherwise this field is not defined; @@ -499,21 +518,6 @@ struct btr_pcur_struct{ is not NULL */ }; -#define BTR_PCUR_IS_POSITIONED 1997660512 /* TODO: currently, the state - can be BTR_PCUR_IS_POSITIONED, - though it really should be - BTR_PCUR_WAS_POSITIONED, - because we have no obligation - to commit the cursor with - mtr; similarly latch_mode may - be out of date. This can - lead to problems if btr_pcur - is not used the right way; - all current code should be - ok. */ -#define BTR_PCUR_WAS_POSITIONED 1187549791 -#define BTR_PCUR_NOT_POSITIONED 1328997689 - #define BTR_PCUR_OLD_STORED 908467085 #define BTR_PCUR_OLD_NOT_STORED 122766467 diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic index 696dfc728dc..647e8d0cde9 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -379,7 +379,7 @@ btr_pcur_commit_specify_mtr( btr_pcur_t* pcur, /*!< in: persistent cursor */ mtr_t* mtr) /*!< in: mtr to commit */ { - ut_a(pcur->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); pcur->latch_mode = BTR_NO_LATCHES; diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index 0ee68101ee7..081dc88435e 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -188,8 +188,6 @@ UNIV_INTERN ibool btr_search_validate(void); /*======================*/ -#else -# define btr_search_validate() TRUE #endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */ /** The search info struct in an index */ diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h index 330e6a25114..22407e2408e 100644 --- a/storage/innobase/include/dict0types.h +++ b/storage/innobase/include/dict0types.h @@ -63,4 +63,9 @@ typedef enum dict_err_ignore dict_err_ignore_t; #define TEMP_TABLE_PREFIX "#sql" #define TEMP_TABLE_PATH_PREFIX "/" TEMP_TABLE_PREFIX +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG +/** Flag to control insert buffer debugging. */ +extern uint ibuf_debug; +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + #endif diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index 7fa077d5c8f..b34d06ffde3 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -63,11 +63,6 @@ typedef enum { /** Operations that can currently be buffered. */ extern ibuf_use_t ibuf_use; -#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG -/** Flag to control insert buffer debugging. */ -extern uint ibuf_debug; -#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - /** The insert buffer control structure */ extern ibuf_t* ibuf; diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 5524272d811..b0e5e9bda3b 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -809,6 +809,8 @@ struct log_struct{ later; this is advanced when a flush operation is completed to all the log groups */ + volatile ibool is_extending; /*!< this is set to true during extend + the log buffer size */ ib_uint64_t written_to_some_lsn; /*!< first log sequence number not yet written to any log group; for this to diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index 8bae95f0a5d..eacee12a2d4 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -213,6 +213,85 @@ log_buf_pool_get_oldest_modification(void) return(lsn); } +/** Extends the log buffer. +@param[in] len requested minimum size in bytes */ +static +void +log_buffer_extend( + ulint len) +{ + ulint move_start; + ulint move_end; + byte tmp_buf[OS_FILE_LOG_BLOCK_SIZE]; + + mutex_enter(&(log_sys->mutex)); + + while (log_sys->is_extending) { + /* Another thread is trying to extend already. + Needs to wait for. */ + mutex_exit(&(log_sys->mutex)); + + log_buffer_flush_to_disk(); + + mutex_enter(&(log_sys->mutex)); + + if (srv_log_buffer_size > len / UNIV_PAGE_SIZE) { + /* Already extended enough by the others */ + mutex_exit(&(log_sys->mutex)); + return; + } + } + + log_sys->is_extending = TRUE; + + while (log_sys->n_pending_writes != 0 + || ut_calc_align_down(log_sys->buf_free, + OS_FILE_LOG_BLOCK_SIZE) + != ut_calc_align_down(log_sys->buf_next_to_write, + OS_FILE_LOG_BLOCK_SIZE)) { + /* Buffer might have >1 blocks to write still. */ + mutex_exit(&(log_sys->mutex)); + + log_buffer_flush_to_disk(); + + mutex_enter(&(log_sys->mutex)); + } + + move_start = ut_calc_align_down( + log_sys->buf_free, + OS_FILE_LOG_BLOCK_SIZE); + move_end = log_sys->buf_free; + + /* store the last log block in buffer */ + ut_memcpy(tmp_buf, log_sys->buf + move_start, + move_end - move_start); + + log_sys->buf_free -= move_start; + log_sys->buf_next_to_write -= move_start; + + /* reallocate log buffer */ + srv_log_buffer_size = len / UNIV_PAGE_SIZE + 1; + mem_free(log_sys->buf_ptr); + log_sys->buf_ptr = mem_alloc(LOG_BUFFER_SIZE + OS_FILE_LOG_BLOCK_SIZE); + log_sys->buf = ut_align(log_sys->buf_ptr, OS_FILE_LOG_BLOCK_SIZE); + log_sys->buf_size = LOG_BUFFER_SIZE; + memset(log_sys->buf, '\0', LOG_BUFFER_SIZE); + log_sys->max_buf_free = log_sys->buf_size / LOG_BUF_FLUSH_RATIO + - LOG_BUF_FLUSH_MARGIN; + + /* restore the last log block */ + ut_memcpy(log_sys->buf, tmp_buf, move_end - move_start); + + ut_ad(log_sys->is_extending); + log_sys->is_extending = FALSE; + + mutex_exit(&(log_sys->mutex)); + + fprintf(stderr, + "InnoDB: innodb_log_buffer_size was extended to %lu.\n", + LOG_BUFFER_SIZE); +} + /************************************************************//** Opens the log for log_write_low. The log must be closed with log_close and released with log_release. @@ -233,11 +312,39 @@ log_reserve_and_open( ulint count = 0; #endif /* UNIV_DEBUG */ - ut_a(len < log->buf_size / 2); + if (len >= log->buf_size / 2) { + DBUG_EXECUTE_IF("ib_log_buffer_is_short_crash", + DBUG_SUICIDE();); + + /* log_buffer is too small. try to extend instead of crash. */ + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Warning: " + "The transaction log size is too large" + " for innodb_log_buffer_size (%lu >= %lu / 2). " + "Trying to extend it.\n", + len, LOG_BUFFER_SIZE); + + log_buffer_extend((len + 1) * 2); + } loop: mutex_enter(&(log->mutex)); ut_ad(!recv_no_log_write); + if (log->is_extending) { + + mutex_exit(&(log->mutex)); + + /* Log buffer size is extending. Writing up to the next block + should wait for the extending finished. */ + + os_thread_sleep(100000); + + ut_ad(++count < 50); + + goto loop; + } + /* Calculate an upper limit for the space the string may take in the log buffer */ @@ -788,6 +895,7 @@ log_init(void) log_sys->buf = ut_align(log_sys->buf_ptr, OS_FILE_LOG_BLOCK_SIZE); log_sys->buf_size = LOG_BUFFER_SIZE; + log_sys->is_extending = FALSE; memset(log_sys->buf, '\0', LOG_BUFFER_SIZE); diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 518eba975ab..b8336f88532 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3095,48 +3095,78 @@ sel_restore_position_for_mysql( mtr_t* mtr) /*!< in: mtr; CAUTION: may commit mtr temporarily! */ { - ibool success; - ulint relative_position; - - relative_position = pcur->rel_pos; + ibool success; success = btr_pcur_restore_position(latch_mode, pcur, mtr); *same_user_rec = success; - if (relative_position == BTR_PCUR_ON) { - if (success) { - return(FALSE); - } - - if (moves_up) { - btr_pcur_move_to_next(pcur, mtr); - } - - return(TRUE); + ut_ad(!success || pcur->rel_pos == BTR_PCUR_ON); +#ifdef UNIV_DEBUG + if (pcur->pos_state == BTR_PCUR_IS_POSITIONED_OPTIMISTIC) { + ut_ad(pcur->rel_pos == BTR_PCUR_BEFORE + || pcur->rel_pos == BTR_PCUR_AFTER); + } else { + ut_ad(pcur->pos_state == BTR_PCUR_IS_POSITIONED); + ut_ad((pcur->rel_pos == BTR_PCUR_ON) + == btr_pcur_is_on_user_rec(pcur)); } +#endif - if (relative_position == BTR_PCUR_AFTER - || relative_position == BTR_PCUR_AFTER_LAST_IN_TREE) { + /* The position may need be adjusted for rel_pos and moves_up. */ - if (moves_up) { + switch (pcur->rel_pos) { + case BTR_PCUR_ON: + if (!success && moves_up) { +next: + btr_pcur_move_to_next(pcur, mtr); return(TRUE); } - - if (btr_pcur_is_on_user_rec(pcur)) { + return(!success); + case BTR_PCUR_AFTER_LAST_IN_TREE: + case BTR_PCUR_BEFORE_FIRST_IN_TREE: + return(TRUE); + case BTR_PCUR_AFTER: + /* positioned to record after pcur->old_rec. */ + pcur->pos_state = BTR_PCUR_IS_POSITIONED; +prev: + if (btr_pcur_is_on_user_rec(pcur) && !moves_up) { btr_pcur_move_to_prev(pcur, mtr); } - return(TRUE); + case BTR_PCUR_BEFORE: + /* For non optimistic restoration: + The position is now set to the record before pcur->old_rec. + + For optimistic restoration: + The position also needs to take the previous search_mode into + consideration. */ + + switch (pcur->pos_state) { + case BTR_PCUR_IS_POSITIONED_OPTIMISTIC: + pcur->pos_state = BTR_PCUR_IS_POSITIONED; + if (pcur->search_mode == PAGE_CUR_GE) { + /* Positioned during Greater or Equal search + with BTR_PCUR_BEFORE. Optimistic restore to + the same record. If scanning for lower then + we must move to previous record. + This can happen with: + HANDLER READ idx a = (const); + HANDLER READ idx PREV; */ + goto prev; + } + return(TRUE); + case BTR_PCUR_IS_POSITIONED: + if (moves_up && btr_pcur_is_on_user_rec(pcur)) { + goto next; + } + return(TRUE); + case BTR_PCUR_WAS_POSITIONED: + case BTR_PCUR_NOT_POSITIONED: + break; + } } - - ut_ad(relative_position == BTR_PCUR_BEFORE - || relative_position == BTR_PCUR_BEFORE_FIRST_IN_TREE); - - if (moves_up && btr_pcur_is_on_user_rec(pcur)) { - btr_pcur_move_to_next(pcur, mtr); - } - + ut_ad(0); return(TRUE); } @@ -4120,6 +4150,14 @@ wrong_offs: btr_pcur_store_position(pcur, &mtr); + /* The found record was not a match, but may be used + as NEXT record (index_next). Set the relative position + to BTR_PCUR_BEFORE, to reflect that the position of + the persistent cursor is before the found/stored row + (pcur->old_rec). */ + ut_ad(pcur->rel_pos == BTR_PCUR_ON); + pcur->rel_pos = BTR_PCUR_BEFORE; + err = DB_RECORD_NOT_FOUND; /* ut_print_name(stderr, index->name); fputs(" record not found 3\n", stderr); */ @@ -4159,6 +4197,14 @@ wrong_offs: btr_pcur_store_position(pcur, &mtr); + /* The found record was not a match, but may be used + as NEXT record (index_next). Set the relative position + to BTR_PCUR_BEFORE, to reflect that the position of + the persistent cursor is before the found/stored row + (pcur->old_rec). */ + ut_ad(pcur->rel_pos == BTR_PCUR_ON); + pcur->rel_pos = BTR_PCUR_BEFORE; + err = DB_RECORD_NOT_FOUND; /* ut_print_name(stderr, index->name); fputs(" record not found 4\n", stderr); */ @@ -4736,6 +4782,7 @@ normal_return: if (prebuilt->n_fetch_cached > 0) { row_sel_pop_cached_row_for_mysql(buf, prebuilt); + DEBUG_SYNC_C("row_search_cached_row"); err = DB_SUCCESS; } diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index b7bd08d8bb7..3be4465c71e 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -45,6 +45,7 @@ #include "ma_blockrec.h" #include "trnman.h" #include "ma_key_recover.h" +#include <my_check_opt.h> #include <stdarg.h> #include <my_getopt.h> diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h index 3ac8cdb5e38..241bc7c2739 100644 --- a/storage/maria/ma_check_standalone.h +++ b/storage/maria/ma_check_standalone.h @@ -13,6 +13,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <my_check_opt.h> + /* almost every standalone maria program will need it */ void _mi_report_crashed(void *file __attribute__((unused)), const char *message __attribute__((unused)), diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index 0f3fb0f8a1e..5e42ebc8d5d 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -29,6 +29,7 @@ #include "ma_key_recover.h" #include "ma_recovery_util.h" #include "hash.h" +#include <my_check_opt.h> struct st_trn_for_recovery /* used only in the REDO phase */ { diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index e1e7b323683..95454d88308 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -19,6 +19,7 @@ */ #include "ma_fulltext.h" +#include <my_check_opt.h> #if defined(MSDOS) || defined(__WIN__) #include <fcntl.h> #else diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c index 05a5aefb4f4..57c958b4b6d 100644 --- a/storage/maria/maria_chk.c +++ b/storage/maria/maria_chk.c @@ -21,6 +21,7 @@ #include <m_ctype.h> #include <stdarg.h> #include <my_getopt.h> +#include <my_check_opt.h> #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 2747374058d..18fae59d394 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -32,3 +32,8 @@ ENDIF() # Avoid dependencies on perschema data defined in mysys ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H) ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES}) + +INSTALL_DEBUG_SYMBOLS(strings) +IF(MSVC) + INSTALL_DEBUG_TARGET(strings DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 8fd15ebddb2..ef54101cf7f 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -501,7 +501,7 @@ static size_t my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), do { NEXT_CMP_VALUE(src, p, pass, value, (int)srclen); - if (totlen <= len) + if (totlen < len) dest[totlen] = value; totlen++; } while (value) ; diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 800b333a5cf..d8de3a41e7f 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1058,7 +1058,9 @@ echo "=====" >> $STATUS_HISTORY %doc release/Docs/INFO_BIN* %doc release/support-files/my-*.cnf +%if 0%{?commercial} %doc %attr(644, root, root) %{_infodir}/mysql.info* +%endif %doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1* %doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1* @@ -1215,6 +1217,9 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog +* Wed Oct 30 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> +- Removed non gpl file docs/mysql.info from community packages + * Mon Sep 09 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - Updated logic to get the correct count of PID files diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt index e61281a43d8..bf811a0de9b 100644 --- a/vio/CMakeLists.txt +++ b/vio/CMakeLists.txt @@ -20,3 +20,8 @@ ADD_DEFINITIONS(${SSL_DEFINES}) SET(VIO_SOURCES vio.c viosocket.c viossl.c viosslfactories.c) ADD_CONVENIENCE_LIBRARY(vio ${VIO_SOURCES}) TARGET_LINK_LIBRARIES(vio ${LIBSOCKET}) + +INSTALL_DEBUG_SYMBOLS(vio) +IF(MSVC) + INSTALL_DEBUG_TARGET(vio DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt index 68799947e44..bcfacea4b0b 100644 --- a/zlib/CMakeLists.txt +++ b/zlib/CMakeLists.txt @@ -23,3 +23,8 @@ SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio. ADD_CONVENIENCE_LIBRARY(zlib ${ZLIB_SOURCES}) RESTRICT_SYMBOL_EXPORTS(zlib) +INSTALL_DEBUG_SYMBOLS(zlib) +IF(MSVC) + INSTALL_DEBUG_TARGET(zlib DESTINATION ${INSTALL_LIBDIR}/debug) +ENDIF() + |