Skip to content

Commit

Permalink
10.0-monty merge
Browse files Browse the repository at this point in the history
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
  • Loading branch information
Sergei Golubchik committed Jul 21, 2013
2 parents 5f6380a + c1d6a2d commit b7b5f6f
Show file tree
Hide file tree
Showing 1,378 changed files with 124,559 additions and 47,549 deletions.
3 changes: 1 addition & 2 deletions BUILD/SETUP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind"
#
# Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
debug_cflags="$debug_cflags -DSAFE_MUTEX -DSAFEMALLOC"
debug_cflags="-DEXTRA_DEBUG -DSAFE_MUTEX -DSAFEMALLOC"
error_inject="--with-error-inject "
#
# Base C++ flags for all builds
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ INCLUDE(cpack_rpm)

# Add macros
INCLUDE(character_sets)
INCLUDE(cpu_info)
INCLUDE(zlib)
INCLUDE(libevent)
INCLUDE(ssl)
INCLUDE(readline)
INCLUDE(libutils)
Expand Down Expand Up @@ -204,7 +206,7 @@ ENDFOREACH()

# Add safemutex for debug configurations, except on Windows
# (safemutex has never worked on Windows)
IF(NOT WIN32)
IF(NOT WIN32 AND NOT WITH_INNODB_MEMCACHED)
FOREACH(LANG C CXX)
SET(CMAKE_${LANG}_FLAGS_DEBUG "${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFE_MUTEX")
ENDFOREACH()
Expand Down Expand Up @@ -256,10 +258,12 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)

# Add bundled or system zlib.
MYSQL_CHECK_ZLIB_WITH_COMPRESS()
# Optionally add bundled yassl/taocrypt or system openssl.
# Add bundled yassl/taocrypt or system openssl.
MYSQL_CHECK_SSL()
# Add readline or libedit.
MYSQL_CHECK_READLINE()
# Add libevent
MYSQL_CHECK_LIBEVENT()

#
# Setup maintainer mode options. Platform checks are
Expand Down Expand Up @@ -297,6 +301,7 @@ ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(mysys_ssl)
ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(extra)
Expand Down
7 changes: 2 additions & 5 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ Short time TODO:
- add support for host_error()
- Enable performance_schema.host_cache in scripts/mysql_system_tables.sql

- Add full support for automatic timestamp.
(remove timestamp handling from ha_write())
- Timour is working on this

- Add Sys_my_bind_addr(); Needed for perfschema

- Add support for format_section_buff in unireg.cc and table.cc

- mysql_socket_shutdown() was removed from vio/viosocket.cc.
It was replaced with inline function in include/mysql/psi/mysql_socket.h
but this doesn't call DisconnectEx(). We should check if we need to
Expand All @@ -60,4 +58,3 @@ Sergei's notes:
rpl_slave.cc
XXX in mysql_client_test
net_serv.cc

6 changes: 5 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/mysys_ssl
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/libmysql
Expand All @@ -25,6 +26,9 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)

## We will need libeay32.dll and ssleay32.dll when running client executables.
COPY_OPENSSL_DLLS(copy_openssl_client)

ADD_DEFINITIONS(${SSL_DEFINES})
MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc
${CMAKE_SOURCE_DIR}/sql/sql_string.cc)
Expand Down Expand Up @@ -78,7 +82,7 @@ ENDIF(WIN32)
ADD_EXECUTABLE(async_example async_example.c)
TARGET_LINK_LIBRARIES(async_example mysqlclient)

SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin async_example
PROPERTIES HAS_CXX TRUE)

ADD_DEFINITIONS(-DHAVE_DLOPEN)
Expand Down
13 changes: 7 additions & 6 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3504,9 +3504,9 @@ print_table_data(MYSQL_RES *result)
{
uint length= column_names ? field->name_length : 0;
if (quick)
length=max(length,field->length);
length= MY_MAX(length,field->length);
else
length=max(length,field->max_length);
length= MY_MAX(length,field->max_length);
if (length < 4 && !IS_NOT_NULL(field->flags))
length=4; // Room for "NULL"
field->max_length=length;
Expand All @@ -3526,8 +3526,8 @@ print_table_data(MYSQL_RES *result)
field->name,
field->name + name_length);
uint display_length= field->max_length + name_length - numcells;
tee_fprintf(PAGER, " %-*s |",(int) min(display_length,
MAX_COLUMN_LENGTH),
tee_fprintf(PAGER, " %-*s |",(int) MY_MIN(display_length,
MAX_COLUMN_LENGTH),
field->name);
num_flag[off]= IS_NUM(field->type);
}
Expand Down Expand Up @@ -3616,9 +3616,9 @@ static int get_field_disp_length(MYSQL_FIELD *field)
uint length= column_names ? field->name_length : 0;

if (quick)
length= max(length, field->length);
length= MY_MAX(length, field->length);
else
length= max(length, field->max_length);
length= MY_MAX(length, field->max_length);

if (length < 4 && !IS_NOT_NULL(field->flags))
length= 4; /* Room for "NULL" */
Expand All @@ -3634,6 +3634,7 @@ static int get_field_disp_length(MYSQL_FIELD *field)
@returns The max number of characters in any row of this result
*/

static int get_result_width(MYSQL_RES *result)
{
unsigned int len= 0;
Expand Down
2 changes: 1 addition & 1 deletion client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int extract_variable_from_show(DYNAMIC_STRING* ds, char* value)
if ((value_end= strchr(value_start, '\n')) == NULL)
return 1; /* Unexpected result */

len= (size_t) min(FN_REFLEN, value_end-value_start);
len= (size_t) MY_MIN(FN_REFLEN, value_end-value_start);
strncpy(value, value_start, len);
value[len]= '\0';
return 0;
Expand Down
3 changes: 2 additions & 1 deletion client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#include <sys/stat.h>
#include <mysql.h>
#include <sql_common.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#include <welcome_copyright_notice.h>
#include <my_rnd.h>

#define ADMIN_VERSION "9.1"
#define MAX_MYSQL_VAR 512
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
my_off_t length,tmp;
for (length= start_position_mot ; length > 0 ; length-=tmp)
{
tmp=min(length,sizeof(buff));
tmp= MY_MIN(length,sizeof(buff));
if (my_b_read(file, buff, (uint) tmp))
{
error("Failed reading from file.");
Expand Down
4 changes: 2 additions & 2 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,8 @@ static int handle_request_for_tables(char *tables, uint length)

org= ptr= strmov(strmov(query, op), " TABLE ");
ptr= fix_table_name(ptr, tables);
strmake(table_name_buff, org, min((int) sizeof(table_name_buff)-1,
(int) (ptr - org)));
strmake(table_name_buff, org, MY_MIN((int) sizeof(table_name_buff)-1,
(int) (ptr - org)));
table_name= table_name_buff;
ptr= strxmov(ptr, " ", options, NullS);
query_length= (uint) (ptr - query);
Expand Down
4 changes: 2 additions & 2 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6485,9 +6485,9 @@ int read_line(char *buf, int size)
}
else if ((c == '{' &&
(!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
(uchar*) buf, min(5, p - buf), 0) ||
(uchar*) buf, MY_MIN(5, p - buf), 0) ||
!my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
(uchar*) buf, min(2, p - buf), 0))))
(uchar*) buf, MY_MIN(2, p - buf), 0))))
{
/* Only if and while commands can be terminated by { */
*p++= c;
Expand Down
20 changes: 20 additions & 0 deletions cmake/configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ sub check_compiler
$cmakeargs = $cmakeargs." -DWITH_ZLIB=system";
next;
}
if($option =~ /with-libevent=/)
{
$cmakeargs = $cmakeargs." -DWITH_LIBEVENT=system";
next;
}
if($option =~ /with-libevent/)
{
$cmakeargs = $cmakeargs." -DWITH_LIBEVENT=bundled";
next;
}
if($option =~ /with-ssl=/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=yes";
Expand Down Expand Up @@ -237,6 +247,16 @@ sub check_compiler
print("configure.pl : ignoring $option\n");
next;
}
if ($option =~ /with-client-ldflags/)
{
print("configure.pl : ignoring $option\n");
next;
}
if ($option =~ /with-mysqld-ldflags=/)
{
print("configure.pl : ignoring $option\n");
next;
}

$option = uc($option);
$option =~ s/-/_/g;
Expand Down
30 changes: 30 additions & 0 deletions cmake/cpu_info.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2009, 2011, 2012 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 St, Fifth Floor, Boston, MA 02110-1301 USA

# Symbols with information about the CPU.

FIND_PROGRAM(GETCONF getconf)
MARK_AS_ADVANCED(GETCONF)

IF(GETCONF)
EXECUTE_PROCESS(
COMMAND ${GETCONF} LEVEL1_DCACHE_LINESIZE
OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
)
ENDIF()
IF(CPU_LEVEL1_DCACHE_LINESIZE AND CPU_LEVEL1_DCACHE_LINESIZE GREATER 0)
ELSE()
SET(CPU_LEVEL1_DCACHE_LINESIZE 64)
ENDIF()
89 changes: 89 additions & 0 deletions cmake/libevent.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright (C) 2011 Oracle and/or its affiliates. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

MACRO (MYSQL_USE_BUNDLED_LIBEVENT)
SET(LIBEVENT_LIBRARY event)
SET(LIBEVENT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libevent)
SET(LIBEVENT_FOUND TRUE)
SET(WITH_LIBEVENT "bundled" CACHE STRING "Use bundled libevent")
ADD_SUBDIRECTORY(libevent)
GET_TARGET_PROPERTY(src libevent SOURCES)
FOREACH(file ${src})
SET(LIBEVENT_SOURCES ${LIBEVENT_SOURCES} ${CMAKE_SOURCE_DIR}/libevent/${file})
ENDFOREACH()
ENDMACRO()

# MYSQL_CHECK_LIBEVENT
#
# Provides the following configure options:
# WITH_LIBEVENT_BUNDLED
# If this is set,we use bindled libevent
# If this is not set,search for system libevent.
# if system libevent is not found, use bundled copy
# LIBEVENT_LIBRARIES, LIBEVENT_INCLUDE_DIR and LIBEVENT_SOURCES
# are set after this macro has run

MACRO (MYSQL_CHECK_LIBEVENT)

IF (NOT WITH_LIBEVENT)
SET(WITH_LIBEVENT "bundled" CACHE STRING "By default use bundled libevent on this platform")
ENDIF()

IF(WITH_LIBEVENT STREQUAL "bundled")
MYSQL_USE_BUNDLED_LIBEVENT()
ELSEIF(WITH_LIBEVENT STREQUAL "system" OR WITH_LIBEVENT STREQUAL "yes")
SET(LIBEVENT_FIND_QUIETLY TRUE)

IF (NOT LIBEVENT_INCLUDE_PATH)
set(LIBEVENT_INCLUDE_PATH /usr/local/include /opt/local/include)
ENDIF()

find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LIBEVENT_INCLUDE_PATH})

if (NOT LIBEVENT_INCLUDE_DIR)
MESSAGE(SEND_ERROR "Cannot find appropriate event.h in /usr/local/include or /opt/local/include. Use bundled libevent")
endif()

IF (NOT LIBEVENT_LIB_PATHS)
set(LIBEVENT_LIB_PATHS /usr/local/lib /opt/local/lib)
ENDIF()

find_library(LIBEVENT_LIB event PATHS ${LIBEVENT_LIB_PATHS})

if (NOT LIBEVENT_LIB)
MESSAGE(SEND_ERROR "Cannot find appropriate event lib in /usr/local/lib or /opt/local/lib. Use bundled libevent")
endif()

IF (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR)
set(LIBEVENT_FOUND TRUE)
set(LIBEVENT_LIBS ${LIBEVENT_LIB})
ELSE()
set(LIBEVENT_FOUND FALSE)
ENDIF()

IF(LIBEVENT_FOUND)
SET(LIBEVENT_SOURCES "")
SET(LIBEVENT_LIBRARIES ${LIBEVENT_LIBS})
SET(LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIR})
SET(LIBEVENT_DEFINES "-DHAVE_LIBEVENT")
ELSE()
IF(WITH_LIBEVENT STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for libevent. Use bundled libevent")
ENDIF()
MYSQL_USE_BUNDLED_LIBEVENT()
ENDIF()

ENDIF()
ENDMACRO()
25 changes: 13 additions & 12 deletions cmake/libutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -304,20 +304,22 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result)
SET(${result} ${ret} PARENT_SCOPE)
ENDFUNCTION()

MACRO(RESTRICT_SYMBOL_EXPORTS target)
SET(VISIBILITY_HIDDEN_FLAG)
SET(VISIBILITY_HIDDEN_FLAG)

IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
ENDIF()

IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ENDIF()

# We try to hide the symbols in yassl/zlib to avoid name clashes with
# other libraries like openssl.
FUNCTION(RESTRICT_SYMBOL_EXPORTS target)
IF(VISIBILITY_HIDDEN_FLAG)
GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
IF(NOT COMPILE_FLAGS)
Expand All @@ -327,5 +329,4 @@ MACRO(RESTRICT_SYMBOL_EXPORTS target)
SET_TARGET_PROPERTIES(${target} PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} ${VISIBILITY_HIDDEN_FLAG}")
ENDIF()

ENDMACRO()
ENDFUNCTION()
4 changes: 0 additions & 4 deletions cmake/os/Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ IF(MSVC)
STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
ENDFOREACH()

# Remove support for exceptions
FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_INIT)
STRING(REPLACE "/EHsc" "" "${flag}" "${${flag}}")
ENDFOREACH()

# Fix CMake's predefined huge stack size
FOREACH(type EXE SHARED MODULE)
Expand Down

0 comments on commit b7b5f6f

Please sign in to comment.