mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
merge
This commit is contained in:
commit
aa0b37f493
392 changed files with 8754 additions and 3299 deletions
|
@ -996,6 +996,8 @@ libmysqld/.deps/sql_crypt.Po
|
|||
libmysqld/.deps/sql_cursor.Po
|
||||
libmysqld/.deps/sql_db.Po
|
||||
libmysqld/.deps/sql_delete.Po
|
||||
libmysqld/.deps/sql_truncate.Po
|
||||
libmysqld/.deps/datadict.Po
|
||||
libmysqld/.deps/sql_derived.Po
|
||||
libmysqld/.deps/sql_do.Po
|
||||
libmysqld/.deps/sql_error.Po
|
||||
|
@ -1172,6 +1174,8 @@ libmysqld/sql_cursor.cc
|
|||
libmysqld/sql_cursor.h
|
||||
libmysqld/sql_db.cc
|
||||
libmysqld/sql_delete.cc
|
||||
libmysqld/sql_truncate.cc
|
||||
libmysqld/datadict.cc
|
||||
libmysqld/sql_derived.cc
|
||||
libmysqld/sql_do.cc
|
||||
libmysqld/sql_error.cc
|
||||
|
@ -2062,6 +2066,8 @@ sql/.deps/sql_crypt.Po
|
|||
sql/.deps/sql_cursor.Po
|
||||
sql/.deps/sql_db.Po
|
||||
sql/.deps/sql_delete.Po
|
||||
sql/.deps/sql_truncate.Po
|
||||
sql/.deps/datadict.Po
|
||||
sql/.deps/sql_derived.Po
|
||||
sql/.deps/sql_do.Po
|
||||
sql/.deps/sql_error.Po
|
||||
|
|
|
@ -90,22 +90,19 @@ SSL_LIBRARY=--with-ssl
|
|||
|
||||
if [ "x$warning_mode" != "xpedantic" ]; then
|
||||
# Both C and C++ warnings
|
||||
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
|
||||
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
|
||||
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
|
||||
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
|
||||
|
||||
# For more warnings, uncomment the following line
|
||||
# warnings="$global_warnings -Wshadow"
|
||||
# warnings="$warnings -Wshadow"
|
||||
|
||||
# C warnings
|
||||
c_warnings="$warnings -Wunused-parameter"
|
||||
c_warnings="$warnings"
|
||||
# C++ warnings
|
||||
cxx_warnings="$warnings"
|
||||
cxx_warnings="$warnings -Wno-unused-parameter"
|
||||
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
|
||||
cxx_warnings="$cxx_warnings -Wreorder"
|
||||
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
# Added unless --with-debug=full
|
||||
debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
|
||||
debug_extra_cflags="-O0 -g3 -gdwarf-2"
|
||||
else
|
||||
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
|
||||
c_warnings="$warnings"
|
||||
|
@ -122,7 +119,7 @@ fi
|
|||
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
|
||||
# LINT_INIT(), which is only useful for silencing spurious warnings
|
||||
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
|
||||
valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify "
|
||||
valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify "
|
||||
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
valgrind_configs="--with-valgrind"
|
||||
#
|
||||
|
|
|
@ -1010,7 +1010,7 @@ set_ccache_usage()
|
|||
set_valgrind_flags()
|
||||
{
|
||||
if test "x$valgrind_flag" = "xyes" ; then
|
||||
loc_valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify "
|
||||
loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify "
|
||||
loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
compiler_flags="$compiler_flags $loc_valgrind_flags"
|
||||
with_flags="$with_flags --with-valgrind"
|
||||
|
|
117
BUILD/check-cpu
117
BUILD/check-cpu
|
@ -187,69 +187,76 @@ check_cpu () {
|
|||
cc=$CC
|
||||
fi
|
||||
|
||||
if test "x$compiler" = "x" ; then
|
||||
cc_ver=`$cc --version | sed 1q`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
if test "x$core2" = "xyes" ; then
|
||||
cpu_arg="core2"
|
||||
fi
|
||||
|
||||
if test "x$compiler" != "x" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# check if compiler is gcc and dump its version
|
||||
cc_verno=`$cc -dumpversion 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
set -- `echo $cc_verno | tr '.' ' '`
|
||||
cc_ver="GCC"
|
||||
cc_major=$1
|
||||
cc_minor=$2
|
||||
cc_patch=$3
|
||||
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
|
||||
|
||||
case "$cc_ver--$cc_verno" in
|
||||
*GCC*)
|
||||
# different gcc backends (and versions) have different CPU flags
|
||||
case `gcc -dumpmachine` in
|
||||
i?86-* | x86_64-*)
|
||||
if test "$cc_comp" -lt 304 ; then
|
||||
check_cpu_cflags="-mcpu=${cpu_arg}"
|
||||
elif test "$cc_comp" -ge 402 ; then
|
||||
check_cpu_cflags="-mtune=native"
|
||||
else
|
||||
check_cpu_cflags="-mtune=${cpu_arg}"
|
||||
fi
|
||||
;;
|
||||
ppc-*)
|
||||
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
2.95.*)
|
||||
# GCC 2.95 doesn't expose its name in --version output
|
||||
check_cpu_cflags="-m${cpu_arg}"
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
# now we check whether the compiler really understands the cpu type
|
||||
touch __test.c
|
||||
fi
|
||||
|
||||
while [ "$cpu_arg" ] ; do
|
||||
printf "testing $cpu_arg ... " >&2
|
||||
|
||||
# compile check
|
||||
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
|
||||
if test "x$?" = "x0" ; then
|
||||
echo ok >&2
|
||||
break;
|
||||
fi
|
||||
|
||||
echo failed >&2
|
||||
case "$cc_ver--$cc_verno" in
|
||||
*GCC*)
|
||||
# different gcc backends (and versions) have different CPU flags
|
||||
case `gcc -dumpmachine` in
|
||||
i?86-* | x86_64-*)
|
||||
if test "$cc_comp" -lt 304 ; then
|
||||
check_cpu_cflags="-mcpu=${cpu_arg}"
|
||||
elif test "$cc_comp" -ge 402 ; then
|
||||
check_cpu_cflags="-mtune=native"
|
||||
else
|
||||
check_cpu_cflags="-mtune=${cpu_arg}"
|
||||
fi
|
||||
;;
|
||||
ppc-*)
|
||||
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
2.95.*)
|
||||
# GCC 2.95 doesn't expose its name in --version output
|
||||
check_cpu_cflags="-m${cpu_arg}"
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
# now we check whether the compiler really understands the cpu type
|
||||
touch __test.c
|
||||
|
||||
while [ "$cpu_arg" ] ; do
|
||||
printf "testing $cpu_arg ... " >&2
|
||||
|
||||
# compile check
|
||||
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
|
||||
if test "x$?" = "x0" ; then
|
||||
echo ok >&2
|
||||
break;
|
||||
done
|
||||
rm __test.*
|
||||
fi
|
||||
if test "x$core2" = "xyes" ; then
|
||||
cpu_arg="core2"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo failed >&2
|
||||
check_cpu_cflags=""
|
||||
break;
|
||||
done
|
||||
rm __test.*
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
check_cpu
|
||||
|
|
13
CMakeLists.txt
Executable file → Normal file
13
CMakeLists.txt
Executable file → Normal file
|
@ -36,6 +36,18 @@ SET(CUSTOM_C_FLAGS $ENV{CFLAGS})
|
|||
OPTION(WITH_DEBUG "Use dbug/safemutex" OFF)
|
||||
OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF)
|
||||
|
||||
# Distinguish between community and non-community builds, with the
|
||||
# default being a community build. This does not impact the feature
|
||||
# set that will be compiled in; it's merely provided as a hint to
|
||||
# custom packaging steps.
|
||||
OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON)
|
||||
|
||||
# Use a default manufacturer if no manufacturer was identified.
|
||||
SET(MANUFACTURER_DOCSTRING
|
||||
"Set the entity that appears as the manufacturer of packages that support a manufacturer field.")
|
||||
IF(NOT DEFINED MANUFACTURER)
|
||||
SET(MANUFACTURER "Built from Source" CACHE BOOL ${MANUFACTURER_DOCSTRING})
|
||||
ENDIF()
|
||||
|
||||
# We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug
|
||||
# which turns out to be not trivial, as this involves synchronization
|
||||
|
@ -277,6 +289,7 @@ IF(WIN32)
|
|||
ELSE()
|
||||
SET(CPACK_GENERATOR "TGZ")
|
||||
ENDIF()
|
||||
ADD_SUBDIRECTORY(packaging/WiX)
|
||||
INCLUDE(CPack)
|
||||
IF(UNIX)
|
||||
INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL)
|
||||
|
|
2
client/CMakeLists.txt
Executable file → Normal file
2
client/CMakeLists.txt
Executable file → Normal file
|
@ -33,7 +33,7 @@ IF(UNIX)
|
|||
TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY})
|
||||
ENDIF(UNIX)
|
||||
|
||||
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc)
|
||||
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
|
||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||
TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ extern "C" {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#undef bcmp // Fix problem with new readline
|
||||
#if defined(__WIN__)
|
||||
#include <conio.h>
|
||||
#elif !defined(__NETWARE__)
|
||||
|
|
|
@ -5827,7 +5827,7 @@ int read_command(struct st_command** command_ptr)
|
|||
(struct st_command*) my_malloc(sizeof(*command),
|
||||
MYF(MY_WME|MY_ZEROFILL))) ||
|
||||
insert_dynamic(&q_lines, (uchar*) &command))
|
||||
die(NullS);
|
||||
die("Out of memory");
|
||||
command->type= Q_UNKNOWN;
|
||||
|
||||
read_command_buf[0]= 0;
|
||||
|
@ -6326,7 +6326,7 @@ void init_win_path_patterns()
|
|||
}
|
||||
|
||||
if (insert_dynamic(&patterns, (uchar*) &p))
|
||||
die(NullS);
|
||||
die("Out of memory");
|
||||
|
||||
DBUG_PRINT("info", ("p: %s", p));
|
||||
while (*p)
|
||||
|
@ -9421,8 +9421,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
|
|||
for (i=1 ; i <= found_sets ; i++)
|
||||
{
|
||||
pos=from[found_set[i-1].table_offset];
|
||||
rep_str[i].found= !bcmp((const uchar*) pos,
|
||||
(const uchar*) "\\^", 3) ? 2 : 1;
|
||||
rep_str[i].found= !memcmp(pos, "\\^", 3) ? 2 : 1;
|
||||
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
|
||||
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
|
||||
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
|
||||
|
@ -9550,8 +9549,8 @@ void copy_bits(REP_SET *to,REP_SET *from)
|
|||
|
||||
int cmp_bits(REP_SET *set1,REP_SET *set2)
|
||||
{
|
||||
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
return memcmp(set1->bits, set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9620,17 +9619,15 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
|
|||
|
||||
uint start_at_word(char * pos)
|
||||
{
|
||||
return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) ||
|
||||
!bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0);
|
||||
return (((!memcmp(pos, "\\b",2) && pos[2]) ||
|
||||
!memcmp(pos, "\\^", 2)) ? 1 : 0);
|
||||
}
|
||||
|
||||
uint end_of_word(char * pos)
|
||||
{
|
||||
char * end=strend(pos);
|
||||
return ((end > pos+2 && !bcmp((const uchar*) end-2,
|
||||
(const uchar*) "\\b", 2)) ||
|
||||
(end >= pos+2 && !bcmp((const uchar*) end-2,
|
||||
(const uchar*) "\\$",2))) ? 1 : 0;
|
||||
return ((end > pos+2 && !memcmp(end-2, "\\b", 2)) ||
|
||||
(end >= pos+2 && !memcmp(end-2, "\\$",2))) ? 1 : 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -31,8 +31,7 @@ ENDIF()
|
|||
|
||||
# Create bootstrapper SQL script
|
||||
FILE(WRITE bootstrap.sql "use mysql;\n" )
|
||||
FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql
|
||||
fill_help_tables.sql)
|
||||
FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql)
|
||||
FILE(STRINGS ${CMAKE_SOURCE_DIR}/scripts/${FILENAME} CONTENTS)
|
||||
FOREACH(STR ${CONTENTS})
|
||||
IF(NOT STR MATCHES "@current_hostname")
|
||||
|
@ -40,6 +39,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql
|
|||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDFOREACH()
|
||||
FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
|
||||
FILE(APPEND bootstrap.sql ${CONTENTS})
|
||||
|
||||
|
||||
FILE(REMOVE_RECURSE mysql)
|
||||
|
@ -56,6 +57,7 @@ SET(BOOTSTRAP_COMMAND
|
|||
--lc-messages-dir=${CMAKE_CURRENT_BINARY_DIR}/share
|
||||
--basedir=.
|
||||
--datadir=.
|
||||
--default-storage-engine=MyISAM
|
||||
--loose-skip-innodb
|
||||
--loose-skip-ndbcluster
|
||||
--max_allowed_packet=8M
|
||||
|
@ -78,4 +80,4 @@ EXECUTE_PROCESS (
|
|||
IF(NOT RESULT EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Could not create initial database \n ${OUT} \n ${ERR}")
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
|
0
cmake/install_layout.cmake
Executable file → Normal file
0
cmake/install_layout.cmake
Executable file → Normal file
|
@ -35,15 +35,84 @@ MACRO (INSTALL_DEBUG_SYMBOLS targets)
|
|||
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location})
|
||||
ENDIF()
|
||||
INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION})
|
||||
IF(target STREQUAL "mysqld")
|
||||
SET(comp Server)
|
||||
ELSE()
|
||||
SET(comp Debuginfo)
|
||||
ENDIF()
|
||||
INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp})
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# Installs manpage for given file (either script or executable)
|
||||
#
|
||||
FUNCTION(INSTALL_MANPAGE file)
|
||||
IF(NOT UNIX)
|
||||
RETURN()
|
||||
ENDIF()
|
||||
GET_FILENAME_COMPONENT(file_name "${file}" NAME)
|
||||
SET(GLOB_EXPR
|
||||
${CMAKE_SOURCE_DIR}/man/*${file}man.1*
|
||||
${CMAKE_SOURCE_DIR}/man/*${file}man.8*
|
||||
${CMAKE_BINARY_DIR}/man/*${file}man.1*
|
||||
${CMAKE_BINARY_DIR}/man/*${file}man.8*
|
||||
)
|
||||
IF(MYSQL_DOC_DIR)
|
||||
SET(GLOB_EXPR
|
||||
${MYSQL_DOC_DIR}/man/*${file}man.1*
|
||||
${MYSQL_DOC_DIR}/man/*${file}man.8*
|
||||
${MYSQL_DOC_DIR}/man/*${file}.1*
|
||||
${MYSQL_DOC_DIR}/man/*${file}.8*
|
||||
${GLOB_EXPR}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
FILE(GLOB_RECURSE MANPAGES ${GLOB_EXPR})
|
||||
IF(MANPAGES)
|
||||
LIST(GET MANPAGES 0 MANPAGE)
|
||||
STRING(REPLACE "${file}man.1" "${file}.1" MANPAGE "${MANPAGE}")
|
||||
STRING(REPLACE "${file}man.8" "${file}.8" MANPAGE "${MANPAGE}")
|
||||
IF(MANPAGE MATCHES "${file}.1")
|
||||
SET(SECTION man1)
|
||||
ELSE()
|
||||
SET(SECTION man8)
|
||||
ENDIF()
|
||||
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}")
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
||||
FUNCTION(INSTALL_SCRIPT)
|
||||
CMAKE_PARSE_ARGUMENTS(ARG
|
||||
"DESTINATION;COMPONENT"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
SET(script ${ARG_DEFAULT_ARGS})
|
||||
IF(NOT ARG_DESTINATION)
|
||||
SET(ARG_DESTINATION ${INSTALL_BINDIR})
|
||||
ENDIF()
|
||||
IF(ARG_COMPONENT)
|
||||
SET(COMP COMPONENT ${ARG_COMPONENT})
|
||||
ELSE()
|
||||
SET(COMP)
|
||||
ENDIF()
|
||||
|
||||
INSTALL(FILES
|
||||
${script}
|
||||
DESTINATION ${ARG_DESTINATION}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE
|
||||
OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE ${COMP}
|
||||
)
|
||||
INSTALL_MANPAGE(${script})
|
||||
ENDFUNCTION()
|
||||
|
||||
# Install symbolic link to CMake target.
|
||||
# the link is created in the same directory as target
|
||||
# and extension will be the same as for target file.
|
||||
MACRO(INSTALL_SYMLINK linkname target destination)
|
||||
MACRO(INSTALL_SYMLINK linkname target destination component)
|
||||
IF(UNIX)
|
||||
GET_TARGET_PROPERTY(location ${target} LOCATION)
|
||||
GET_FILENAME_COMPONENT(path ${location} PATH)
|
||||
|
@ -68,7 +137,12 @@ IF(UNIX)
|
|||
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
|
||||
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
|
||||
ENDIF()
|
||||
INSTALL(FILES ${output} DESTINATION ${destination})
|
||||
IF(component)
|
||||
SET(COMP COMPONENT ${component})
|
||||
ELSE()
|
||||
SET(COMP)
|
||||
ENDIF()
|
||||
INSTALL(FILES ${output} DESTINATION ${destination} ${COMP})
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
|
@ -128,13 +202,11 @@ ENDMACRO()
|
|||
|
||||
# Installs targets, also installs pdbs on Windows.
|
||||
#
|
||||
# More stuff can be added later, e.g signing
|
||||
# or pre-link custom targets (one example is creating
|
||||
# version resource for windows executables)
|
||||
#
|
||||
|
||||
FUNCTION(MYSQL_INSTALL_TARGETS)
|
||||
CMAKE_PARSE_ARGUMENTS(ARG
|
||||
"DESTINATION"
|
||||
"DESTINATION;COMPONENT"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
|
@ -146,15 +218,24 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
|
|||
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS")
|
||||
ENDIF()
|
||||
|
||||
# If signing is required, sign executables before installing
|
||||
|
||||
FOREACH(target ${TARGETS})
|
||||
IF(SIGNCODE AND SIGNCODE_ENABLED)
|
||||
# If signing is required, sign executables before installing
|
||||
IF(SIGNCODE AND SIGNCODE_ENABLED)
|
||||
SIGN_TARGET(${target})
|
||||
ENDIF()
|
||||
# For Windows, add version info to executables
|
||||
ADD_VERSION_INFO(${target})
|
||||
# Install man pages on Unix
|
||||
IF(UNIX)
|
||||
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
|
||||
INSTALL_MANPAGE(${target_location})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})
|
||||
IF(ARG_COMPONENT)
|
||||
SET(COMP COMPONENT ${ARG_COMPONENT})
|
||||
ENDIF()
|
||||
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP})
|
||||
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
|
||||
INSTALL_DEBUG_SYMBOLS("${TARGETS}")
|
||||
SET(INSTALL_LOCATION)
|
||||
|
|
|
@ -214,7 +214,7 @@ ENDMACRO()
|
|||
#)
|
||||
MACRO(MERGE_LIBRARIES)
|
||||
CMAKE_PARSE_ARGUMENTS(ARG
|
||||
"EXPORTS;OUTPUT_NAME"
|
||||
"EXPORTS;OUTPUT_NAME;COMPONENT"
|
||||
"STATIC;SHARED;MODULE;NOINSTALL"
|
||||
${ARGN}
|
||||
)
|
||||
|
@ -259,7 +259,10 @@ MACRO(MERGE_LIBRARIES)
|
|||
MESSAGE(FATAL_ERROR "Unknown library type")
|
||||
ENDIF()
|
||||
IF(NOT ARG_NOINSTALL)
|
||||
MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}")
|
||||
IF(ARG_COMPONENT)
|
||||
SET(COMP COMPONENT ${ARG_COMPONENT})
|
||||
ENDIF()
|
||||
MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
|
||||
ENDIF()
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||
ENDMACRO()
|
||||
|
|
|
@ -29,7 +29,7 @@ INCLUDE(cmake_parse_arguments)
|
|||
FUNCTION (MYSQL_ADD_EXECUTABLE)
|
||||
# Pass-through arguments for ADD_EXECUTABLE
|
||||
CMAKE_PARSE_ARGUMENTS(ARG
|
||||
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION"
|
||||
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
|
||||
""
|
||||
${ARGN}
|
||||
)
|
||||
|
@ -43,7 +43,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
|
|||
IF(NOT ARG_EXCLUDE_FROM_ALL)
|
||||
IF(NOT ARG_DESTINATION)
|
||||
SET(ARG_DESTINATION ${INSTALL_BINDIR})
|
||||
ENDIF()
|
||||
IF(ARG_COMPONENT)
|
||||
SET(COMP COMPONENT ${ARG_COMPONENT})
|
||||
ELSEIF(MYSQL_INSTALL_COMPONENT)
|
||||
SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
|
||||
ELSE()
|
||||
SET(COMP COMPONENT Client)
|
||||
ENDIF()
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION})
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
ENDFUNCTION()
|
||||
|
|
|
@ -30,7 +30,6 @@ SET(HAVE_ASM_MSR_H CACHE INTERNAL "")
|
|||
SET(HAVE_BACKTRACE CACHE INTERNAL "")
|
||||
SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "")
|
||||
SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "")
|
||||
SET(HAVE_BCMP CACHE INTERNAL "")
|
||||
SET(HAVE_BFILL CACHE INTERNAL "")
|
||||
SET(HAVE_BMOVE CACHE INTERNAL "")
|
||||
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
# Produce meaningful package name for the binary package
|
||||
# The logic is rather involved with special cases for different OSes
|
||||
INCLUDE(CheckTypeSize)
|
||||
CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP)
|
||||
MACRO(GET_PACKAGE_FILE_NAME Var)
|
||||
IF(NOT VERSION)
|
||||
MESSAGE(FATAL_ERROR
|
||||
|
@ -24,7 +26,8 @@ IF(NOT VERSION)
|
|||
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
|
||||
SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME})
|
||||
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
MESSAGE("SIZEOF_VOIDP=${SIZEOF_VOIDP}")
|
||||
IF(SIZEOF_VOIDP EQUAL 8)
|
||||
SET(64BIT 1)
|
||||
ENDIF()
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ MACRO(MYSQL_ADD_PLUGIN)
|
|||
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
|
||||
# Install dynamic library
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR})
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
|
||||
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
|
|
@ -25,7 +25,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
|
|||
SET(SSL_LIBRARIES yassl taocrypt)
|
||||
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
|
||||
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
|
||||
SET(SSL_DEFINES"-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
|
||||
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
|
||||
CHANGE_SSL_SETTINGS("bundled")
|
||||
#Remove -fno-implicit-templates
|
||||
#(yassl sources cannot be compiled with it)
|
||||
|
|
|
@ -31,4 +31,4 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
|
|||
|
||||
EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt
|
||||
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
|
||||
|
|
139
config.h.cmake
139
config.h.cmake
|
@ -81,6 +81,8 @@
|
|||
#cmakedefine HAVE_SYS_STREAM_H 1
|
||||
#cmakedefine HAVE_SYS_TERMCAP_H 1
|
||||
#cmakedefine HAVE_SYS_TIMEB_H 1
|
||||
#cmakedefine HAVE_SYS_TIMES_H 1
|
||||
#cmakedefine HAVE_SYS_TIME_H 1
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
#cmakedefine HAVE_SYS_UN_H 1
|
||||
#cmakedefine HAVE_SYS_VADVISE_H 1
|
||||
|
@ -88,6 +90,7 @@
|
|||
#cmakedefine HAVE_TERMIOS_H 1
|
||||
#cmakedefine HAVE_TERMIO_H 1
|
||||
#cmakedefine HAVE_TERMCAP_H 1
|
||||
#cmakedefine HAVE_TIME_H 1
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine HAVE_UTIME_H 1
|
||||
#cmakedefine HAVE_VARARGS_H 1
|
||||
|
@ -122,7 +125,6 @@
|
|||
#cmakedefine HAVE_AIOWAIT 1
|
||||
#cmakedefine HAVE_ALARM 1
|
||||
#cmakedefine HAVE_ALLOCA 1
|
||||
#cmakedefine HAVE_BCMP 1
|
||||
#cmakedefine HAVE_BFILL 1
|
||||
#cmakedefine HAVE_BMOVE 1
|
||||
#cmakedefine HAVE_BZERO 1
|
||||
|
@ -261,6 +263,8 @@
|
|||
#cmakedefine HAVE_TEMPNAM 1
|
||||
#cmakedefine HAVE_THR_SETCONCURRENCY 1
|
||||
#cmakedefine HAVE_THR_YIELD 1
|
||||
#cmakedefine HAVE_TIME 1
|
||||
#cmakedefine HAVE_TIMES 1
|
||||
#cmakedefine HAVE_VALLOC 1
|
||||
#define HAVE_VIO_READ_BUFF 1
|
||||
#cmakedefine HAVE_VASPRINTF 1
|
||||
|
@ -295,11 +299,6 @@
|
|||
|
||||
|
||||
/* Types we may use */
|
||||
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
|
||||
#if SIZEOF_CHAR
|
||||
# define HAVE_CHAR 1
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
Special handling required for OSX to support universal binaries that
|
||||
|
@ -310,127 +309,71 @@
|
|||
#else
|
||||
#define SIZEOF_LONG 4
|
||||
#endif
|
||||
#define SIZEOF_VOIDP SIZEOF_LONG
|
||||
#define SIZEOF_CHARP SIZEOF_LONG
|
||||
#define SIZEOF_SIZE_T SIZEOF_LONG
|
||||
#else
|
||||
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
||||
#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@
|
||||
#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@
|
||||
#endif
|
||||
|
||||
#if SIZEOF_LONG
|
||||
# define HAVE_LONG 1
|
||||
#endif
|
||||
|
||||
|
||||
#if SIZEOF_CHARP
|
||||
#define HAVE_CHARP 1
|
||||
#define SIZEOF_VOIDP SIZEOF_CHARP
|
||||
/* No indentation, to fetch the lines from verification scripts */
|
||||
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
||||
#cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@
|
||||
#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@
|
||||
#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@
|
||||
#endif
|
||||
|
||||
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
|
||||
#cmakedefine HAVE_CHAR 1
|
||||
#cmakedefine HAVE_LONG 1
|
||||
#cmakedefine HAVE_CHARP 1
|
||||
#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
|
||||
#if SIZEOF_SHORT
|
||||
# define HAVE_SHORT 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_SHORT 1
|
||||
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
||||
#if SIZEOF_INT
|
||||
# define HAVE_INT 1
|
||||
#endif
|
||||
|
||||
|
||||
#cmakedefine HAVE_INT 1
|
||||
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
|
||||
#if SIZEOF_LONG_LONG
|
||||
# define HAVE_LONG_LONG 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_LONG_LONG 1
|
||||
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
|
||||
#if SIZEOF_OFF_T
|
||||
#define HAVE_OFF_T 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_OFF_T 1
|
||||
#cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@
|
||||
#if SIZEOF_SIGSET_T
|
||||
#define HAVE_SIGSET_T 1
|
||||
#endif
|
||||
|
||||
#if SIZEOF_SIZE_T
|
||||
#define HAVE_SIZE_T 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_SIGSET_T 1
|
||||
#cmakedefine HAVE_SIZE_T 1
|
||||
#cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@
|
||||
#if SIZEOF_UCHAR
|
||||
#define HAVE_UCHAR 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_UCHAR 1
|
||||
#cmakedefine SIZEOF_UINT @SIZEOF_UINT@
|
||||
#if SIZEOF_UINT
|
||||
#define HAVE_UINT 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_UINT 1
|
||||
#cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@
|
||||
#if SIZEOF_ULONG
|
||||
#define HAVE_ULONG 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_ULONG 1
|
||||
#cmakedefine SIZEOF_INT8 @SIZEOF_INT8@
|
||||
#if SIZEOF_INT8
|
||||
#define HAVE_INT8 1
|
||||
#endif
|
||||
#cmakedefine HAVE_INT8 1
|
||||
#cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@
|
||||
#if SIZEOF_UINT8
|
||||
#define HAVE_UINT8 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_UINT8 1
|
||||
#cmakedefine SIZEOF_INT16 @SIZEOF_INT16@
|
||||
#if SIZEOF_INT16
|
||||
# define HAVE_INT16 1
|
||||
#endif
|
||||
#cmakedefine HAVE_INT16 1
|
||||
#cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@
|
||||
#if SIZEOF_UINT16
|
||||
#define HAVE_UINT16 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_UINT16 1
|
||||
#cmakedefine SIZEOF_INT32 @SIZEOF_INT32@
|
||||
#if SIZEOF_INT32
|
||||
#define HAVE_INT32 1
|
||||
#endif
|
||||
#cmakedefine HAVE_INT32 1
|
||||
#cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@
|
||||
#if SIZEOF_UINT32
|
||||
#define HAVE_UINT32 1
|
||||
#endif
|
||||
#cmakedefine HAVE_UINT32 1
|
||||
#cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@
|
||||
#if SIZEOF_U_INT32_T
|
||||
#define HAVE_U_INT32_T 1
|
||||
#endif
|
||||
|
||||
#cmakedefine HAVE_U_INT32_T 1
|
||||
#cmakedefine SIZEOF_INT64 @SIZEOF_INT64@
|
||||
#if SIZEOF_INT64
|
||||
#define HAVE_INT64 1
|
||||
#endif
|
||||
#cmakedefine HAVE_INT64 1
|
||||
#cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@
|
||||
#if SIZEOF_UINT64
|
||||
#define HAVE_UINT64 1
|
||||
#endif
|
||||
#cmakedefine HAVE_UINT64 1
|
||||
#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@
|
||||
#cmakedefine HAVE_BOOL 1
|
||||
|
||||
#cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@
|
||||
|
||||
#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@
|
||||
#if SIZEOF_BOOL
|
||||
#define HAVE_BOOL 1
|
||||
#endif
|
||||
#cmakedefine HAVE_MBSTATE_T
|
||||
|
||||
#define MAX_INDEXES 64
|
||||
|
||||
#cmakedefine QSORT_TYPE_IS_VOID 1
|
||||
#define RETQSORTTYPE void
|
||||
#cmakedefine RETQSORTTYPE @RETQSORTTYPE@
|
||||
|
||||
#cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1
|
||||
#define RETSIGTYPE void
|
||||
#if SIGNAL_RETURN_TYPE_IS_VOID
|
||||
#define VOID_SIGHANDLER 1
|
||||
#endif
|
||||
#cmakedefine RETSIGTYPE @RETSIGTYPE@
|
||||
#cmakedefine VOID_SIGHANDLER 1
|
||||
#define STRUCT_RLIMIT struct rlimit
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
@ -547,7 +490,7 @@
|
|||
#cmakedefine strtoull @strtoull@
|
||||
#cmakedefine vsnprintf @vsnprintf@
|
||||
#if (_MSC_VER > 1310)
|
||||
#define HAVE_SETENV
|
||||
# define HAVE_SETENV
|
||||
#define setenv(a,b,c) _putenv_s(a,b)
|
||||
#endif
|
||||
|
||||
|
@ -575,7 +518,7 @@
|
|||
#cmakedefine FN_NO_CASE_SENSE 1
|
||||
|
||||
#cmakedefine HAVE_CHARSET_armscii8 1
|
||||
#cmakedefine HAVE_CHARSET_ascii
|
||||
#cmakedefine HAVE_CHARSET_ascii 1
|
||||
#cmakedefine HAVE_CHARSET_big5 1
|
||||
#cmakedefine HAVE_CHARSET_cp1250 1
|
||||
#cmakedefine HAVE_CHARSET_cp1251 1
|
||||
|
@ -637,7 +580,7 @@
|
|||
#cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1
|
||||
#cmakedefine WITH_NDBCLUSTER_STORAGE_ENGINE 1
|
||||
#if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY)
|
||||
#define HAVE_NDB_BINLOG 1
|
||||
# define HAVE_NDB_BINLOG 1
|
||||
#endif
|
||||
|
||||
#cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@"
|
||||
|
|
|
@ -90,6 +90,21 @@ ENDIF(WITHOUT_DYNAMIC_PLUGINS)
|
|||
# Large files, common flag
|
||||
SET(_LARGEFILE_SOURCE 1)
|
||||
|
||||
# If finds the size of a type, set SIZEOF_<type> and HAVE_<type>
|
||||
FUNCTION(MY_CHECK_TYPE_SIZE type defbase)
|
||||
CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase})
|
||||
IF(SIZEOF_${defbase})
|
||||
SET(HAVE_${defbase} 1 PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
||||
# Same for structs, setting HAVE_STRUCT_<name> instead
|
||||
FUNCTION(MY_CHECK_STRUCT_SIZE type defbase)
|
||||
CHECK_TYPE_SIZE("struct ${type}" SIZEOF_${defbase})
|
||||
IF(SIZEOF_${defbase})
|
||||
SET(HAVE_STRUCT_${defbase} 1 PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
||||
# Searches function in libraries
|
||||
# if function is found, sets output parameter result to the name of the library
|
||||
|
@ -108,6 +123,7 @@ FUNCTION(MY_SEARCH_LIBS func libs result)
|
|||
CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib})
|
||||
IF(HAVE_${func}_IN_${lib})
|
||||
SET(${result} ${lib} PARENT_SCOPE)
|
||||
SET(HAVE_${result} 1 PARENT_SCOPE)
|
||||
RETURN()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
@ -169,6 +185,7 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H)
|
|||
CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H)
|
||||
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
|
||||
CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
|
||||
CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H)
|
||||
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
|
||||
|
@ -195,7 +212,6 @@ CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)
|
|||
CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H)
|
||||
CHECK_INCLUDE_FILES (sys/dir.h HAVE_SYS_DIR_H)
|
||||
CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H)
|
||||
CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H)
|
||||
CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H)
|
||||
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H)
|
||||
|
@ -235,6 +251,13 @@ CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H)
|
|||
CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H)
|
||||
CHECK_INCLUDE_FILES("stdlib.h;sys/un.h" HAVE_SYS_UN_H)
|
||||
|
||||
IF(HAVE_SYS_STREAM_H)
|
||||
# Needs sys/stream.h on Solaris
|
||||
CHECK_INCLUDE_FILES (sys/stream.h sys/ptem.h HAVE_SYS_PTEM_H)
|
||||
ELSE()
|
||||
CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H)
|
||||
ENDIF()
|
||||
|
||||
# Figure out threading library
|
||||
#
|
||||
FIND_PACKAGE (Threads)
|
||||
|
@ -250,7 +273,6 @@ CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE)
|
|||
CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
|
||||
CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD)
|
||||
CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK)
|
||||
CHECK_FUNCTION_EXISTS (bcmp HAVE_BCMP)
|
||||
CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL)
|
||||
CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE)
|
||||
CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH)
|
||||
|
@ -458,14 +480,11 @@ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
|||
-D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
|
||||
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES signal.h)
|
||||
CHECK_TYPE_SIZE(sigset_t SIZEOF_SIGSET_T)
|
||||
IF(SIZEOF_SIGSET_T)
|
||||
SET(HAVE_SIGSET_T 1)
|
||||
ENDIF()
|
||||
MY_CHECK_TYPE_SIZE(sigset_t SIGSET_T)
|
||||
IF(NOT SIZEOF_SIGSET_T)
|
||||
SET(sigset_t int)
|
||||
ENDIF()
|
||||
CHECK_TYPE_SIZE(mode_t SIZEOF_MODE_T)
|
||||
MY_CHECK_TYPE_SIZE(mode_t MODE_T)
|
||||
IF(NOT SIZEOF_MODE_T)
|
||||
SET(mode_t int)
|
||||
ENDIF()
|
||||
|
@ -478,43 +497,41 @@ ENDIF(HAVE_STDINT_H)
|
|||
IF(NOT APPLE)
|
||||
# Prevent some checks on OSX, they return ambigious results
|
||||
# on universal 32/64 bit binariess
|
||||
CHECK_TYPE_SIZE("char *" SIZEOF_CHARP)
|
||||
CHECK_TYPE_SIZE(long SIZEOF_LONG)
|
||||
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
|
||||
MY_CHECK_TYPE_SIZE("void *" VOIDP)
|
||||
MY_CHECK_TYPE_SIZE("char *" CHARP)
|
||||
MY_CHECK_TYPE_SIZE(long LONG)
|
||||
MY_CHECK_TYPE_SIZE(size_t SIZE_T)
|
||||
ENDIF()
|
||||
CHECK_TYPE_SIZE(char SIZEOF_CHAR)
|
||||
CHECK_TYPE_SIZE(short SIZEOF_SHORT)
|
||||
CHECK_TYPE_SIZE(int SIZEOF_INT)
|
||||
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
||||
MY_CHECK_TYPE_SIZE(char CHAR)
|
||||
MY_CHECK_TYPE_SIZE(short SHORT)
|
||||
MY_CHECK_TYPE_SIZE(int INT)
|
||||
MY_CHECK_TYPE_SIZE("long long" LONG_LONG)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h)
|
||||
CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T)
|
||||
CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR)
|
||||
CHECK_TYPE_SIZE(uint SIZEOF_UINT)
|
||||
CHECK_TYPE_SIZE(ulong SIZEOF_ULONG)
|
||||
CHECK_TYPE_SIZE(int8 SIZEOF_INT8)
|
||||
CHECK_TYPE_SIZE(uint8 SIZEOF_UINT8)
|
||||
CHECK_TYPE_SIZE(int16 SIZEOF_INT16)
|
||||
CHECK_TYPE_SIZE(uint16 SIZEOF_UINT16)
|
||||
CHECK_TYPE_SIZE(int32 SIZEOF_INT32)
|
||||
CHECK_TYPE_SIZE(uint32 SIZEOF_UINT32)
|
||||
CHECK_TYPE_SIZE(u_int32_t SIZEOF_U_INT32_T)
|
||||
CHECK_TYPE_SIZE(int64 SIZEOF_INT64)
|
||||
CHECK_TYPE_SIZE(uint64 SIZEOF_UINT64)
|
||||
MY_CHECK_TYPE_SIZE(off_t OFF_T)
|
||||
MY_CHECK_TYPE_SIZE(uchar UCHAR)
|
||||
MY_CHECK_TYPE_SIZE(uint UINT)
|
||||
MY_CHECK_TYPE_SIZE(ulong ULONG)
|
||||
MY_CHECK_TYPE_SIZE(int8 INT8)
|
||||
MY_CHECK_TYPE_SIZE(uint8 UINT8)
|
||||
MY_CHECK_TYPE_SIZE(int16 INT16)
|
||||
MY_CHECK_TYPE_SIZE(uint16 UINT16)
|
||||
MY_CHECK_TYPE_SIZE(int32 INT32)
|
||||
MY_CHECK_TYPE_SIZE(uint32 UINT32)
|
||||
MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T)
|
||||
MY_CHECK_TYPE_SIZE(int64 INT64)
|
||||
MY_CHECK_TYPE_SIZE(uint64 UINT64)
|
||||
SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h)
|
||||
CHECK_TYPE_SIZE(bool SIZEOF_BOOL)
|
||||
MY_CHECK_TYPE_SIZE(bool BOOL)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
IF(HAVE_SYS_SOCKET_H)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
|
||||
ENDIF(HAVE_SYS_SOCKET_H)
|
||||
CHECK_TYPE_SIZE(socklen_t SIZEOF_SOCKLEN_T)
|
||||
MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
|
||||
IF(HAVE_IEEEFP_H)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES ieeefp.h)
|
||||
CHECK_TYPE_SIZE(fp_except SIZEOF_FP_EXCEPT)
|
||||
IF(SIZEOF_FP_EXCEPT)
|
||||
SET(HAVE_FP_EXCEPT TRUE)
|
||||
ENDIF()
|
||||
MY_CHECK_TYPE_SIZE(fp_except FP_EXCEPT)
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
@ -678,6 +695,7 @@ int main(int ac, char **av) {}
|
|||
" SIGNAL_RETURN_TYPE_IS_VOID)
|
||||
IF(SIGNAL_RETURN_TYPE_IS_VOID)
|
||||
SET(RETSIGTYPE void)
|
||||
SET(VOID_SIGHANDLER 1)
|
||||
ELSE(SIGNAL_RETURN_TYPE_IS_VOID)
|
||||
SET(RETSIGTYPE int)
|
||||
ENDIF(SIGNAL_RETURN_TYPE_IS_VOID)
|
||||
|
@ -777,7 +795,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS)
|
|||
# Assume regular sprintf
|
||||
SET(SPRINTFS_RETURNS_INT 1)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUXX)
|
||||
IF(CMAKE_COMPILER_IS_GNUXX AND HAVE_CXXABI_H)
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <cxxabi.h>
|
||||
int main(int argc, char **argv)
|
||||
|
@ -787,9 +805,6 @@ CHECK_CXX_SOURCE_COMPILES("
|
|||
return 0;
|
||||
}"
|
||||
HAVE_ABI_CXA_DEMANGLE)
|
||||
IF(HAVE_ABI_CXA_DEMANGLE)
|
||||
SET(HAVE_CXXABI_H 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
|
@ -983,14 +998,8 @@ ELSEIF(WIN32)
|
|||
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h)
|
||||
ENDIF()
|
||||
|
||||
CHECK_TYPE_SIZE("struct sockaddr_in6" SIZEOF_SOCKADDR_IN6)
|
||||
CHECK_TYPE_SIZE("struct in6_addr" SIZEOF_IN6_ADDR)
|
||||
IF(SIZEOF_SOCKADDR_IN6)
|
||||
SET(HAVE_STRUCT_SOCKADDR_IN6 1)
|
||||
ENDIF()
|
||||
IF(SIZEOF_IN6_ADDR)
|
||||
SET(HAVE_STRUCT_IN6_ADDR 1)
|
||||
ENDIF()
|
||||
MY_CHECK_STRUCT_SIZE("sockaddr_in6" SOCKADDR_IN6)
|
||||
MY_CHECK_STRUCT_SIZE("in6_addr" IN6_ADDR)
|
||||
|
||||
IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR)
|
||||
SET(HAVE_IPV6 TRUE CACHE INTERNAL "")
|
||||
|
|
|
@ -27,7 +27,7 @@ dnl
|
|||
dnl When changing the major version number please also check the switch
|
||||
dnl statement in mysqlbinlog::check_master_version(). You may also need
|
||||
dnl to update version.c in ndb.
|
||||
AC_INIT([MySQL Server], [5.5.5-m3], [], [mysql])
|
||||
AC_INIT([MySQL Server], [5.5.6-m3], [], [mysql])
|
||||
|
||||
AC_CONFIG_SRCDIR([sql/mysqld.cc])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
@ -2342,7 +2342,7 @@ MYSQL_TYPE_QSORT
|
|||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_VPRINTF
|
||||
|
||||
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
|
||||
AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \
|
||||
chsize cuserid fchmod fcntl \
|
||||
fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
|
||||
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
|
||||
|
|
0
dbug/CMakeLists.txt
Executable file → Normal file
0
dbug/CMakeLists.txt
Executable file → Normal file
2
extra/CMakeLists.txt
Executable file → Normal file
2
extra/CMakeLists.txt
Executable file → Normal file
|
@ -24,6 +24,8 @@ ${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi
|
|||
${CMAKE_SOURCE_DIR}/storage/ndb/include/portlib
|
||||
${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi)
|
||||
|
||||
# Default install component for the files is Server here
|
||||
SET(MYSQL_INSTALL_COMPONENT Server)
|
||||
|
||||
IF(NOT CMAKE_CROSSCOMPILING)
|
||||
ADD_EXECUTABLE(comp_err comp_err.c)
|
||||
|
|
|
@ -665,9 +665,9 @@ static struct message *find_message(struct errors *err, const char *lang,
|
|||
static ha_checksum checksum_format_specifier(const char* msg)
|
||||
{
|
||||
ha_checksum chksum= 0;
|
||||
const char* p= msg;
|
||||
const char* start= 0;
|
||||
int num_format_specifiers= 0;
|
||||
const uchar* p= (const uchar*) msg;
|
||||
const uchar* start= NULL;
|
||||
uint32 num_format_specifiers= 0;
|
||||
while (*p)
|
||||
{
|
||||
|
||||
|
|
|
@ -648,7 +648,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count,
|
|||
for (i=1 ; i <= found_sets ; i++)
|
||||
{
|
||||
pos=from[found_set[i-1].table_offset];
|
||||
rep_str[i].found= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
|
||||
rep_str[i].found= (my_bool) (!memcmp(pos,"\\^",3) ? 2 : 1);
|
||||
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
|
||||
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
|
||||
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
|
||||
|
@ -776,8 +776,8 @@ static void copy_bits(REP_SET *to,REP_SET *from)
|
|||
|
||||
static int cmp_bits(REP_SET *set1,REP_SET *set2)
|
||||
{
|
||||
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
return memcmp(set1->bits, set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -849,14 +849,14 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
|
|||
|
||||
static uint start_at_word(char * pos)
|
||||
{
|
||||
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
|
||||
return (((!memcmp(pos,"\\b",2) && pos[2]) || !memcmp(pos,"\\^",2)) ? 1 : 0);
|
||||
}
|
||||
|
||||
static uint end_of_word(char * pos)
|
||||
{
|
||||
char * end=strend(pos);
|
||||
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
|
||||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
|
||||
return ((end > pos+2 && !memcmp(end-2,"\\b",2)) ||
|
||||
(end >= pos+2 && !memcmp(end-2,"\\$",2))) ?
|
||||
1 : 0;
|
||||
}
|
||||
|
||||
|
|
0
extra/yassl/CMakeLists.txt
Executable file → Normal file
0
extra/yassl/CMakeLists.txt
Executable file → Normal file
|
@ -953,8 +953,9 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info)
|
|||
info->set = true;
|
||||
}
|
||||
}
|
||||
fgets(line,sizeof(line), file); // get blank line
|
||||
begin = ftell(file);
|
||||
// get blank line
|
||||
if (fgets(line, sizeof(line), file))
|
||||
begin = ftell(file);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
0
extra/yassl/taocrypt/CMakeLists.txt
Executable file → Normal file
0
extra/yassl/taocrypt/CMakeLists.txt
Executable file → Normal file
|
@ -51,7 +51,7 @@ public:
|
|||
enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 };
|
||||
|
||||
Blowfish(CipherDir DIR, Mode MODE)
|
||||
: Mode_BASE(BLOCK_SIZE, DIR, MODE) {}
|
||||
: Mode_BASE(BLOCK_SIZE, DIR, MODE), sbox_(pbox_ + ROUNDS + 2) {}
|
||||
|
||||
#ifdef DO_BLOWFISH_ASM
|
||||
void Process(byte*, const byte*, word32);
|
||||
|
@ -62,8 +62,8 @@ private:
|
|||
static const word32 p_init_[ROUNDS + 2];
|
||||
static const word32 s_init_[4 * 256];
|
||||
|
||||
word32 pbox_[ROUNDS + 2];
|
||||
word32 sbox_[4 * 256];
|
||||
word32 pbox_[ROUNDS + 2 + 4 * 256];
|
||||
word32* sbox_;
|
||||
|
||||
void crypt_block(const word32 in[2], word32 out[2]) const;
|
||||
void AsmProcess(const byte* in, byte* out) const;
|
||||
|
|
|
@ -35,10 +35,7 @@
|
|||
|
||||
// Handler for pure virtual functions
|
||||
namespace __Crun {
|
||||
static void pure_error(void)
|
||||
{
|
||||
assert("Pure virtual method called." == "Aborted");
|
||||
}
|
||||
void pure_error(void);
|
||||
} // namespace __Crun
|
||||
|
||||
#endif // __sun
|
||||
|
@ -54,16 +51,7 @@ extern "C" {
|
|||
#else
|
||||
#include "kernelc.hpp"
|
||||
#endif
|
||||
|
||||
/* Disallow inline __cxa_pure_virtual() */
|
||||
static int __cxa_pure_virtual() __attribute__((noinline, used));
|
||||
static int __cxa_pure_virtual()
|
||||
{
|
||||
// oops, pure virtual called!
|
||||
assert(!"Pure virtual method called. Aborted");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __cxa_pure_virtual () __attribute__ ((weak));
|
||||
} // extern "C"
|
||||
|
||||
#endif // __GNUC__ > 2
|
||||
|
|
|
@ -51,7 +51,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
else if (mode_ == CBC)
|
||||
else if (mode_ == CBC) {
|
||||
if (dir_ == ENCRYPTION)
|
||||
while (blocks--) {
|
||||
r_[0] ^= *(word32*)in;
|
||||
|
@ -78,6 +78,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DO_AES_ASM
|
||||
|
|
|
@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
|
|||
|
||||
struct WindowSlider
|
||||
{
|
||||
WindowSlider(const Integer &exp, bool fastNegate,
|
||||
WindowSlider(const Integer &expIn, bool fastNegateIn,
|
||||
unsigned int windowSizeIn=0)
|
||||
: exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn),
|
||||
windowBegin(0), fastNegate(fastNegate), firstTime(true),
|
||||
: exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn),
|
||||
windowBegin(0), fastNegate(fastNegateIn), firstTime(true),
|
||||
finished(false)
|
||||
{
|
||||
if (windowSize == 0)
|
||||
|
|
|
@ -53,7 +53,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
else if (mode_ == CBC)
|
||||
else if (mode_ == CBC) {
|
||||
if (dir_ == ENCRYPTION)
|
||||
while (blocks--) {
|
||||
r_[0] ^= *(word32*)in;
|
||||
|
@ -78,6 +78,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DO_BLOWFISH_ASM
|
||||
|
|
|
@ -283,21 +283,23 @@ DWord() {}
|
|||
word GetHighHalfAsBorrow() const {return 0-halfs_.high;}
|
||||
|
||||
private:
|
||||
struct dword_struct
|
||||
{
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
word low;
|
||||
word high;
|
||||
#else
|
||||
word high;
|
||||
word low;
|
||||
#endif
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
||||
dword whole_;
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
word low;
|
||||
word high;
|
||||
#else
|
||||
word high;
|
||||
word low;
|
||||
#endif
|
||||
} halfs_;
|
||||
struct dword_struct halfs_;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1214,20 +1216,24 @@ public:
|
|||
#define AS1(x) #x ";"
|
||||
#define AS2(x, y) #x ", " #y ";"
|
||||
#define AddPrologue \
|
||||
word res; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"push %%ebx;" /* save this manually, in case of -fPIC */ \
|
||||
"mov %2, %%ebx;" \
|
||||
"mov %3, %%ebx;" \
|
||||
".intel_syntax noprefix;" \
|
||||
"push ebp;"
|
||||
#define AddEpilogue \
|
||||
"pop ebp;" \
|
||||
".att_syntax prefix;" \
|
||||
"pop %%ebx;" \
|
||||
: \
|
||||
"mov %%eax, %0;" \
|
||||
: "=g" (res) \
|
||||
: "c" (C), "d" (A), "m" (B), "S" (N) \
|
||||
: "%edi", "memory", "cc" \
|
||||
);
|
||||
); \
|
||||
return res;
|
||||
|
||||
#define MulPrologue \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
|
|
|
@ -84,12 +84,23 @@ namespace STL = STL_NAMESPACE;
|
|||
|
||||
}
|
||||
|
||||
#if defined(__ICC) || defined(__INTEL_COMPILER)
|
||||
#ifdef __sun
|
||||
|
||||
// Handler for pure virtual functions
|
||||
namespace __Crun {
|
||||
void pure_error() {
|
||||
assert(!"Aborted: pure virtual method called.");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2)
|
||||
|
||||
extern "C" {
|
||||
|
||||
int __cxa_pure_virtual() {
|
||||
assert("Pure virtual method called." == "Aborted");
|
||||
assert(!"Aborted: pure virtual method called.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -166,14 +177,6 @@ word Crop(word value, unsigned int size)
|
|||
|
||||
#ifdef TAOCRYPT_X86ASM_AVAILABLE
|
||||
|
||||
#ifndef _MSC_VER
|
||||
static jmp_buf s_env;
|
||||
static void SigIllHandler(int)
|
||||
{
|
||||
longjmp(s_env, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool HaveCpuId()
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
else if (mode_ == CBC)
|
||||
else if (mode_ == CBC) {
|
||||
if (dir_ == ENCRYPTION)
|
||||
while (blocks--) {
|
||||
r_[0] ^= *(word32*)in;
|
||||
|
@ -82,6 +82,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
|
|||
out += BLOCK_SIZE;
|
||||
in += BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DO_TWOFISH_ASM
|
||||
|
|
|
@ -160,6 +160,11 @@ inline void err_sys(const char* msg)
|
|||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
static int PasswordCallBack(char*, int, int, void*);
|
||||
}
|
||||
|
||||
|
||||
static int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
|
||||
{
|
||||
strncpy(passwd, "12345678", sz);
|
||||
|
|
|
@ -57,7 +57,7 @@ SET(HEADERS
|
|||
${HEADERS_GEN_CONFIGURE}
|
||||
)
|
||||
|
||||
INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR})
|
||||
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
|
||||
INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
|
||||
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h" )
|
||||
|
||||
|
||||
|
|
|
@ -184,12 +184,22 @@ typedef struct st_heap_info
|
|||
|
||||
typedef struct st_heap_create_info
|
||||
{
|
||||
HP_KEYDEF *keydef;
|
||||
ulong max_records;
|
||||
ulong min_records;
|
||||
uint auto_key; /* keynr [1 - maxkey] for auto key */
|
||||
uint auto_key_type;
|
||||
uint keys;
|
||||
uint reclength;
|
||||
ulonglong max_table_size;
|
||||
ulonglong auto_increment;
|
||||
my_bool with_auto_increment;
|
||||
my_bool internal_table;
|
||||
/*
|
||||
TRUE if heap_create should 'pin' the created share by setting
|
||||
open_count to 1. Is only looked at if not internal_table.
|
||||
*/
|
||||
my_bool pin_share;
|
||||
} HP_CREATE_INFO;
|
||||
|
||||
/* Prototypes for heap-functions */
|
||||
|
@ -197,6 +207,7 @@ typedef struct st_heap_create_info
|
|||
extern HP_INFO *heap_open(const char *name, int mode);
|
||||
extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode);
|
||||
extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode);
|
||||
extern void heap_release_share(HP_SHARE *share, my_bool internal_table);
|
||||
extern int heap_close(HP_INFO *info);
|
||||
extern int heap_write(HP_INFO *info,const uchar *buff);
|
||||
extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
|
||||
|
@ -205,9 +216,9 @@ extern int heap_scan_init(HP_INFO *info);
|
|||
extern int heap_scan(register HP_INFO *info, uchar *record);
|
||||
extern int heap_delete(HP_INFO *info,const uchar *buff);
|
||||
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
|
||||
extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
|
||||
uint reclength, ulong max_records, ulong min_records,
|
||||
HP_CREATE_INFO *create_info, HP_SHARE **share);
|
||||
extern int heap_create(const char *name,
|
||||
HP_CREATE_INFO *create_info, HP_SHARE **share,
|
||||
my_bool *created_new_share);
|
||||
extern int heap_delete_table(const char *name);
|
||||
extern void heap_drop_table(HP_INFO *info);
|
||||
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
/* need by my_vsnprintf */
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef _AIX
|
||||
#undef HAVE_BCMP
|
||||
#endif
|
||||
|
||||
/* This is needed for the definitions of bzero... on solaris */
|
||||
#if defined(HAVE_STRINGS_H)
|
||||
#include <strings.h>
|
||||
|
@ -63,14 +59,10 @@
|
|||
/* Unixware 7 */
|
||||
#if !defined(HAVE_BFILL)
|
||||
# define bfill(A,B,C) memset((A),(C),(B))
|
||||
# define bmove_align(A,B,C) memcpy((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_BCMP)
|
||||
# define bcopy(s, d, n) memcpy((d), (s), (n))
|
||||
# define bcmp(A,B,C) memcmp((A),(B),(C))
|
||||
# define bzero(A,B) memset((A),0,(B))
|
||||
# define bmove_align(A,B,C) memcpy((A),(B),(C))
|
||||
#if !defined(bzero) && !defined(HAVE_BZERO)
|
||||
# define bzero(A,B) memset((A),0,(B))
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
@ -116,19 +108,6 @@ extern char NEAR _dig_vec_lower[];
|
|||
extern void bfill(uchar *dst,size_t len,pchar fill);
|
||||
#endif
|
||||
|
||||
#if !defined(bzero) && !defined(HAVE_BZERO)
|
||||
extern void bzero(uchar * dst,size_t len);
|
||||
#endif
|
||||
|
||||
#if !defined(bcmp) && !defined(HAVE_BCMP)
|
||||
extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
|
||||
#endif
|
||||
#ifdef HAVE_purify
|
||||
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
|
||||
#undef bcmp
|
||||
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
|
||||
#endif /* HAVE_purify */
|
||||
|
||||
#ifndef bmove512
|
||||
extern void bmove512(uchar *dst,const uchar *src,size_t len);
|
||||
#endif
|
||||
|
|
|
@ -36,14 +36,14 @@ extern ulong my_time_to_wait_for_lock;
|
|||
#define ALARM_END (void) signal(SIGALRM,alarm_signal); \
|
||||
(void) alarm(alarm_old);
|
||||
#define ALARM_TEST my_have_got_alarm
|
||||
#ifdef DONT_REMEMBER_SIGNAL
|
||||
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
#define ALARM_REINIT (void) alarm(MY_HOW_OFTEN_TO_ALARM); \
|
||||
(void) signal(SIGALRM,my_set_alarm_variable);\
|
||||
my_have_got_alarm=0;
|
||||
#else
|
||||
#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \
|
||||
my_have_got_alarm=0;
|
||||
#endif /* DONT_REMEMBER_SIGNAL */
|
||||
#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
|
||||
#else
|
||||
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
|
||||
#define ALARM_INIT
|
||||
|
|
|
@ -159,22 +159,6 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
|
|||
#define bitmap_set_all(MAP) \
|
||||
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
|
||||
|
||||
/**
|
||||
check, set and clear a bit of interest of an integer.
|
||||
|
||||
If the bit is out of range @retval -1. Otherwise
|
||||
bit_is_set @return 0 or 1 reflecting the bit is set or not;
|
||||
bit_do_set @return 1 (bit is set 1)
|
||||
bit_do_clear @return 0 (bit is cleared to 0)
|
||||
*/
|
||||
|
||||
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
(((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
|
||||
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) |= (ULL(1) << (B)), 1) : -1)
|
||||
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) &= ~(ULL(1) << (B)), 0) : -1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -627,26 +627,34 @@ extern "C" int madvise(void *addr, size_t len, int behav);
|
|||
#endif
|
||||
|
||||
/* Does the system remember a signal handler after a signal ? */
|
||||
#ifndef HAVE_BSD_SIGNALS
|
||||
#define DONT_REMEMBER_SIGNAL
|
||||
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
|
||||
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
#endif
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
||||
#define LINT_INIT(var) var=0 /* No uninitialize-warning */
|
||||
/*
|
||||
Deprecated workaround for false-positive uninitialized variables
|
||||
warnings. Those should be silenced using tool-specific heuristics.
|
||||
|
||||
Enabled by default for g++ due to the bug referenced below.
|
||||
*/
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
|
||||
(defined(__GNUC__) && defined(__cplusplus))
|
||||
#define LINT_INIT(var) var= 0
|
||||
#else
|
||||
#define LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
Suppress uninitialized variable warning without generating code.
|
||||
|
||||
The _cplusplus is a temporary workaround for C++ code pending a fix
|
||||
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
|
||||
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
|
||||
*/
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \
|
||||
!defined(__GNUC__)
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
|
||||
defined(__cplusplus) || !defined(__GNUC__)
|
||||
#define UNINIT_VAR(x) x= 0
|
||||
#else
|
||||
/* GCC specific self-initialization which inhibits the warning. */
|
||||
#define UNINIT_VAR(x) x= x
|
||||
#endif
|
||||
|
||||
|
@ -670,7 +678,6 @@ typedef unsigned short ushort;
|
|||
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
|
||||
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
|
||||
#define test_all_bits(a,b) (((a) & (b)) == (b))
|
||||
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
|
||||
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
||||
|
||||
/* Define some general constants */
|
||||
|
|
|
@ -55,8 +55,6 @@ extern "C" {
|
|||
#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
|
||||
#define MI_NAME_IEXT ".MYI"
|
||||
#define MI_NAME_DEXT ".MYD"
|
||||
/* Max extra space to use when sorting keys */
|
||||
#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
|
||||
|
||||
/* Possible values for myisam_block_size (must be power of 2) */
|
||||
#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
|
||||
|
|
|
@ -53,12 +53,6 @@ enum thr_lock_type { TL_IGNORE=-1,
|
|||
reading/writing to the table.
|
||||
*/
|
||||
TL_WRITE_ALLOW_WRITE,
|
||||
/*
|
||||
Write lock, but allow other threads to read.
|
||||
Used by ALTER TABLE in MySQL to allow readers
|
||||
to use the table until ALTER TABLE is finished.
|
||||
*/
|
||||
TL_WRITE_ALLOW_READ,
|
||||
/*
|
||||
WRITE lock used by concurrent insert. Will allow
|
||||
READ, if one could use concurrent insert on table.
|
||||
|
|
10
libmysql/CMakeLists.txt
Executable file → Normal file
10
libmysql/CMakeLists.txt
Executable file → Normal file
|
@ -152,7 +152,7 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
|
|||
|
||||
# Merge several convenience libraries into one big mysqlclient
|
||||
# and link them together into shared library.
|
||||
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
|
||||
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
|
||||
|
||||
# Visual Studio users need debug static library for debug projects
|
||||
IF(MSVC)
|
||||
|
@ -171,11 +171,11 @@ IF(UNIX)
|
|||
SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR})
|
||||
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT DISABLE_SHARED)
|
||||
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
|
||||
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT SharedLibraries)
|
||||
IF(UNIX)
|
||||
# libtool compatability
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
|
||||
|
@ -209,7 +209,7 @@ IF(NOT DISABLE_SHARED)
|
|||
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
||||
""
|
||||
linkname)
|
||||
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR})
|
||||
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
|
||||
SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
|
||||
LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
|
||||
FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
|
||||
|
@ -218,7 +218,7 @@ IF(NOT DISABLE_SHARED)
|
|||
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
||||
"${ver}"
|
||||
linkname)
|
||||
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR})
|
||||
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
|
|
@ -38,7 +38,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
|
|||
strmake.lo strend.lo \
|
||||
strnlen.lo strfill.lo is_prefix.lo \
|
||||
int2str.lo str2int.lo strinstr.lo strcont.lo \
|
||||
strcend.lo bcmp.lo ctype-latin1.lo \
|
||||
strcend.lo ctype-latin1.lo \
|
||||
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
|
||||
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
|
||||
ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \
|
||||
|
|
|
@ -318,7 +318,7 @@ sig_handler
|
|||
my_pipe_sig_handler(int sig __attribute__((unused)))
|
||||
{
|
||||
DBUG_PRINT("info",("Hit by signal %d",sig));
|
||||
#ifdef DONT_REMEMBER_SIGNAL
|
||||
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
(void) signal(SIGPIPE, my_pipe_sig_handler);
|
||||
#endif
|
||||
}
|
||||
|
@ -2127,7 +2127,12 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
|
|||
stmt->insert_id= mysql->insert_id;
|
||||
if (res)
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
@ -2338,7 +2343,12 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
|
|||
buff, sizeof(buff), (uchar*) 0, 0,
|
||||
1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
return 1;
|
||||
}
|
||||
if ((*mysql->methods->read_rows_from_cursor)(stmt))
|
||||
|
@ -3025,7 +3035,12 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
|||
buff, sizeof(buff), (uchar*) data,
|
||||
length, 1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, &mysql->net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, &mysql->net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
|
@ -4440,7 +4455,12 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
|||
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
|
||||
(uchar*) 0, 0, 1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,8 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
|||
../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc
|
||||
../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc
|
||||
../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc
|
||||
../sql/sql_help.cc ../sql/sql_insert.cc
|
||||
../sql/sql_help.cc ../sql/sql_insert.cc ../sql/datadict.cc
|
||||
../sql/sql_truncate.cc
|
||||
../sql/sql_lex.cc ../sql/keycaches.cc
|
||||
../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
|
||||
../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
|
||||
|
@ -124,7 +125,7 @@ FOREACH(LIB ${LIBS})
|
|||
ENDFOREACH()
|
||||
|
||||
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
|
||||
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
|
||||
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
|
||||
|
||||
# Visual Studio users need debug static library
|
||||
IF(MSVC)
|
||||
|
@ -137,5 +138,6 @@ IF(UNIX)
|
|||
ENDIF()
|
||||
|
||||
IF(MSVC AND NOT DISABLE_SHARED)
|
||||
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
|
||||
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}
|
||||
COMPONENT Embedded)
|
||||
ENDIF()
|
||||
|
|
|
@ -63,7 +63,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||
protocol.cc net_serv.cc opt_range.cc \
|
||||
opt_sum.cc procedure.cc records.cc sql_acl.cc \
|
||||
sql_load.cc discover.cc sql_locale.cc \
|
||||
sql_profile.cc \
|
||||
sql_profile.cc sql_truncate.cc datadict.cc \
|
||||
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
|
||||
sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
|
||||
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
|
||||
|
|
|
@ -634,7 +634,6 @@ void *create_embedded_thd(int client_flag)
|
|||
thd->variables.option_bits |= OPTION_BIG_SELECTS;
|
||||
thd->proc_info=0; // Remove 'login'
|
||||
thd->command=COM_SLEEP;
|
||||
thd->version=refresh_version;
|
||||
thd->set_time();
|
||||
thd->init_for_queries();
|
||||
thd->client_capabilities= client_flag;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
INSTALL(
|
||||
DIRECTORY .
|
||||
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||
COMPONENT Test
|
||||
PATTERN "var/" EXCLUDE
|
||||
PATTERN "lib/My/SafeProcess" EXCLUDE
|
||||
PATTERN "lib/t*" EXCLUDE
|
||||
|
|
|
@ -25,3 +25,44 @@ TRUNCATE TABLE t2;
|
|||
source include/show_binlog_events.inc;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
|
||||
--echo #
|
||||
|
||||
eval CREATE TABLE t1 (a INT) ENGINE=$engine;
|
||||
eval CREATE TABLE t2 (a INT) ENGINE=$engine;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
|
||||
if (`select length('$before_truncate') > 0`) {
|
||||
eval $before_truncate;
|
||||
}
|
||||
|
||||
--echo # Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
|
||||
connect (truncate,localhost,root,,);
|
||||
--echo # Connection: truncate
|
||||
send TRUNCATE TABLE t1;
|
||||
|
||||
connection default;
|
||||
--echo # Connection: default
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COMMIT;
|
||||
|
||||
connection truncate;
|
||||
--echo # Connection: truncate
|
||||
--echo # Reaping TRUNCATE TABLE
|
||||
--reap
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
|
||||
connection default;
|
||||
--echo # Connection: default
|
||||
|
||||
source include/show_binlog_events.inc;
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
# $con_aux2 Name of the second auxiliary connection to be used by this
|
||||
# script.
|
||||
# $statement Statement to be checked.
|
||||
# $restore_table Table which might be modified affected by statement to be
|
||||
# checked and thus needs backing up before its execution
|
||||
# and restoring after it (can be empty).
|
||||
# $restore_table Table which might be modified by statement to be checked
|
||||
# and thus needs backing up before its execution and
|
||||
# restoring after it (can be empty).
|
||||
#
|
||||
# EXAMPLE
|
||||
# lock_sync.test
|
||||
|
@ -25,7 +25,7 @@ set debug_sync= "RESET";
|
|||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
{
|
||||
--eval create table t_backup select * from $restore_table;
|
||||
--eval create temporary table t_backup select * from $restore_table;
|
||||
}
|
||||
|
||||
connection $con_aux1;
|
||||
|
@ -34,19 +34,19 @@ set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
|
|||
|
||||
connection $con_aux2;
|
||||
set debug_sync='now WAIT_FOR parked';
|
||||
--send_eval insert into $table values (0);
|
||||
--send_eval insert into $table (i) values (0);
|
||||
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
connection default;
|
||||
# Wait until concurrent insert is successfully executed while
|
||||
# statement being checked has its tables locked.
|
||||
# We use wait_condition.inc instead of simply executing
|
||||
# We use wait_condition.inc instead of simply reaping
|
||||
# concurrent insert here in order to avoid deadlocks if test
|
||||
# fails and timing out instead.
|
||||
# fails and to time out gracefully instead.
|
||||
let $wait_condition=
|
||||
select count(*) = 0 from information_schema.processlist
|
||||
where info = "insert into $table values (0)";
|
||||
where info = "insert into $table (i) values (0)";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--disable_result_log
|
||||
|
@ -86,7 +86,7 @@ if (`SELECT '$restore_table' <> ''`)
|
|||
{
|
||||
--eval truncate table $restore_table;
|
||||
--eval insert into $restore_table select * from t_backup;
|
||||
drop table t_backup;
|
||||
drop temporary table t_backup;
|
||||
}
|
||||
|
||||
# Clean-up. Reset DEBUG_SYNC facility after use.
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
# $con_aux2 Name of the second auxiliary connection to be used by this
|
||||
# script.
|
||||
# $statement Statement to be checked.
|
||||
# $restore_table Table which might be modified affected by statement to be
|
||||
# checked and thus needs backing up before its execution
|
||||
# and restoring after it (can be empty).
|
||||
# $restore_table Table which might be modified by statement to be checked
|
||||
# and thus needs backing up before its execution and
|
||||
# restoring after it (can be empty).
|
||||
#
|
||||
# EXAMPLE
|
||||
# lock_sync.test
|
||||
|
@ -25,7 +25,7 @@ set debug_sync= "RESET";
|
|||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
{
|
||||
--eval create table t_backup select * from $restore_table;
|
||||
--eval create temporary table t_backup select * from $restore_table;
|
||||
}
|
||||
|
||||
connection $con_aux1;
|
||||
|
@ -34,7 +34,7 @@ set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
|
|||
|
||||
connection $con_aux2;
|
||||
set debug_sync='now WAIT_FOR parked';
|
||||
--send_eval insert into $table values (0);
|
||||
--send_eval insert into $table (i) values (0);
|
||||
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
@ -43,7 +43,7 @@ connection default;
|
|||
# of our statement.
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Table lock" and info = "insert into $table values (0)";
|
||||
where state = "Table lock" and info = "insert into $table (i) values (0)";
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--disable_result_log
|
||||
|
@ -71,7 +71,7 @@ if (`SELECT '$restore_table' <> ''`)
|
|||
{
|
||||
--eval truncate table $restore_table;
|
||||
--eval insert into $restore_table select * from t_backup;
|
||||
drop table t_backup;
|
||||
drop temporary table t_backup;
|
||||
}
|
||||
|
||||
# Clean-up. Reset DEBUG_SYNC facility after use.
|
||||
|
|
|
@ -29,9 +29,9 @@ connection default;
|
|||
# Wait until statement is successfully executed while
|
||||
# all rows in table are X-locked. This means that it
|
||||
# does not acquire any row locks.
|
||||
# We use wait_condition.inc instead of simply executing
|
||||
# We use wait_condition.inc instead of simply reaping
|
||||
# statement here in order to avoid deadlocks if test
|
||||
# fails and timing out instead.
|
||||
# fails and to time out gracefully instead.
|
||||
let $wait_condition=
|
||||
select count(*) = 0 from information_schema.processlist
|
||||
where info = "$statement";
|
||||
|
|
|
@ -65,17 +65,13 @@ let $_diff_table=$diff_table_2;
|
|||
let $_diff_i=2;
|
||||
while ($_diff_i) {
|
||||
|
||||
# Parse out any leading "master:" or "slave:" from the table
|
||||
# specification and connect the appropriate server.
|
||||
let $_diff_conn_master=`SELECT SUBSTR('$_diff_table', 1, 7) = 'master:'`;
|
||||
if ($_diff_conn_master) {
|
||||
let $_diff_table=`SELECT SUBSTR('$_diff_table', 8)`;
|
||||
connection master;
|
||||
}
|
||||
let $_diff_conn_slave=`SELECT SUBSTR('$_diff_table', 1, 6) = 'slave:'`;
|
||||
if ($_diff_conn_slave) {
|
||||
let $_diff_table=`SELECT SUBSTR('$_diff_table', 7)`;
|
||||
connection slave;
|
||||
# Parse out any leading "master:" or "slave:" from the table specification
|
||||
# and connect the appropriate server.
|
||||
let $_pos= `SELECT LOCATE(':', '$_diff_table')`;
|
||||
let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`;
|
||||
if (`SELECT 'XX$_diff_conn' <> 'XX'`) {
|
||||
let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`;
|
||||
connection $_diff_conn;
|
||||
}
|
||||
|
||||
# Sanity-check the input.
|
||||
|
|
|
@ -1351,6 +1351,13 @@ connection con1;
|
|||
SELECT * FROM t1;
|
||||
ROLLBACK;
|
||||
|
||||
--echo # Switch to connection con2
|
||||
connection con2;
|
||||
ROLLBACK;
|
||||
|
||||
--echo # Switch to connection con1
|
||||
connection con1;
|
||||
|
||||
--echo # 2. test for serialized update:
|
||||
|
||||
CREATE TABLE t2 (a INT);
|
||||
|
@ -1435,6 +1442,7 @@ connection con2;
|
|||
--reap
|
||||
SELECT * FROM t1;
|
||||
|
||||
--enable_abort_on_error
|
||||
connection default;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
@ -1556,3 +1564,36 @@ SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
|||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
|
||||
--echo #
|
||||
--echo # Check that a TRUNCATE TABLE statement, needing an exclusive meta
|
||||
--echo # data lock, waits for a shared metadata lock owned by a concurrent
|
||||
--echo # transaction.
|
||||
--echo #
|
||||
|
||||
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
BEGIN;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
--echo # Connection con1
|
||||
connect (con1, localhost, root,,);
|
||||
--send TRUNCATE TABLE t1;
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table' AND info='TRUNCATE TABLE t1';
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
ROLLBACK;
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Reaping TRUNCATE TABLE
|
||||
--reap
|
||||
SELECT * FROM t1;
|
||||
--echo # Disconnect con1
|
||||
disconnect con1;
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
|
|
0
mysql-test/include/parser_bug21114.inc
Executable file → Normal file
0
mysql-test/include/parser_bug21114.inc
Executable file → Normal file
35
mysql-test/include/rpl_diff_tables.inc
Normal file
35
mysql-test/include/rpl_diff_tables.inc
Normal file
|
@ -0,0 +1,35 @@
|
|||
# #############################################################################
|
||||
# Check whether the given table is consistent between different master and
|
||||
# slaves
|
||||
#
|
||||
# Usage:
|
||||
# --let $diff_table= test.t1
|
||||
# --let $diff_server_list= master, slave, slave2
|
||||
# --source include/rpl_diff_tables.inc
|
||||
# #############################################################################
|
||||
|
||||
if (`SELECT "XX$diff_table" = "XX"`)
|
||||
{
|
||||
--die diff_table is null.
|
||||
}
|
||||
|
||||
--let $_servers= master, slave
|
||||
if (`SELECT "XX$diff_server_list" <> "XX"`)
|
||||
{
|
||||
--let $_servers= $diff_server_list
|
||||
}
|
||||
|
||||
--let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
|
||||
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
|
||||
connection $_master;
|
||||
while (`SELECT "XX$_servers" <> "XX"`)
|
||||
{
|
||||
--let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
|
||||
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
|
||||
|
||||
--sync_slave_with_master $_slave
|
||||
--let $diff_table_1= $_master:$diff_table
|
||||
--let $diff_table_2= $_slave:$diff_table
|
||||
--source include/diff_tables.inc
|
||||
connection $_slave;
|
||||
}
|
0
mysql-test/include/show_msg.inc
Executable file → Normal file
0
mysql-test/include/show_msg.inc
Executable file → Normal file
0
mysql-test/include/show_msg80.inc
Executable file → Normal file
0
mysql-test/include/show_msg80.inc
Executable file → Normal file
0
mysql-test/lib/My/Handles.pm
Executable file → Normal file
0
mysql-test/lib/My/Handles.pm
Executable file → Normal file
|
@ -13,15 +13,20 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
SET(INSTALL_ARGS
|
||||
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess"
|
||||
COMPONENT Test
|
||||
)
|
||||
|
||||
IF (WIN32)
|
||||
ADD_EXECUTABLE(my_safe_process safe_process_win.cc)
|
||||
ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc)
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS})
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(my_safe_process safe_process.cc)
|
||||
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
|
||||
ENDIF()
|
||||
|
||||
INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
|
||||
INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
|
||||
IF(WIN32)
|
||||
INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
|
||||
INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
|
||||
ENDIF()
|
||||
INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
|
||||
INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test)
|
||||
|
|
0
mysql-test/lib/My/SafeProcess/safe_kill_win.cc
Executable file → Normal file
0
mysql-test/lib/My/SafeProcess/safe_kill_win.cc
Executable file → Normal file
|
@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
|
|||
signal(SIGCHLD, handle_signal);
|
||||
signal(SIGABRT, handle_abort);
|
||||
|
||||
sprintf(safe_process_name, "safe_process[%d]", own_pid);
|
||||
sprintf(safe_process_name, "safe_process[%ld]", (long) own_pid);
|
||||
|
||||
message("Started");
|
||||
|
||||
|
|
0
mysql-test/lib/My/SafeProcess/safe_process_win.cc
Executable file → Normal file
0
mysql-test/lib/My/SafeProcess/safe_process_win.cc
Executable file → Normal file
|
@ -41,6 +41,12 @@ our $opt_with_ndbcluster_only;
|
|||
our $defaults_file;
|
||||
our $defaults_extra_file;
|
||||
our $quick_collect;
|
||||
# Set to 1 if you want the tests to override
|
||||
# default storage engine settings, and use MyISAM
|
||||
# as default. (temporary option used in connection
|
||||
# with the change of default storage engine to InnoDB)
|
||||
our $default_myisam= 1;
|
||||
|
||||
|
||||
sub collect_option {
|
||||
my ($opt, $value)= @_;
|
||||
|
@ -591,6 +597,9 @@ sub optimize_cases {
|
|||
my $default_engine=
|
||||
mtr_match_prefix($opt, "--default-storage-engine=");
|
||||
|
||||
# Allow use of uppercase, convert to all lower case
|
||||
$default_engine =~ tr/A-Z/a-z/;
|
||||
|
||||
if (defined $default_engine){
|
||||
|
||||
#print " $tinfo->{name}\n";
|
||||
|
@ -948,10 +957,12 @@ sub collect_one_test_case {
|
|||
return $tinfo unless $do_innodb_plugin;
|
||||
}
|
||||
}
|
||||
else
|
||||
elsif ($default_myisam)
|
||||
{
|
||||
push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
|
||||
push(@{$tinfo->{'slave_opt'}}, "--loose-skip-innodb");
|
||||
# This is a temporary fix to allow non-innodb tests to run even if
|
||||
# the default storage engine is innodb.
|
||||
push(@{$tinfo->{'master_opt'}}, "--default-storage-engine=MyISAM");
|
||||
push(@{$tinfo->{'slave_opt'}}, "--default-storage-engine=MyISAM");
|
||||
}
|
||||
|
||||
if ( $tinfo->{'need_binlog'} )
|
||||
|
|
|
@ -944,6 +944,7 @@ sub command_line_setup {
|
|||
'timestamp' => \&report_option,
|
||||
'timediff' => \&report_option,
|
||||
'max-connections=i' => \$opt_max_connections,
|
||||
'default-myisam!' => \&collect_option,
|
||||
|
||||
'help|h' => \$opt_usage,
|
||||
'list-options' => \$opt_list_options,
|
||||
|
@ -2843,7 +2844,6 @@ sub mysql_install_db {
|
|||
mtr_add_arg($args, "--bootstrap");
|
||||
mtr_add_arg($args, "--basedir=%s", $install_basedir);
|
||||
mtr_add_arg($args, "--datadir=%s", $install_datadir);
|
||||
mtr_add_arg($args, "--loose-innodb=OFF");
|
||||
mtr_add_arg($args, "--loose-skip-falcon");
|
||||
mtr_add_arg($args, "--loose-skip-ndbcluster");
|
||||
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
|
||||
|
@ -5560,7 +5560,9 @@ Misc options
|
|||
timediff With --timestamp, also print time passed since
|
||||
*previous* test started
|
||||
max-connections=N Max number of open connection to server in mysqltest
|
||||
|
||||
default-myisam Set default storage engine to MyISAM for non-innodb
|
||||
tests. This is needed after switching default storage
|
||||
engine to InnoDB.
|
||||
HERE
|
||||
exit(1);
|
||||
|
||||
|
|
|
@ -12749,6 +12749,14 @@ ERROR HY000: Can't find file: 't1' (errno: 2)
|
|||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
#
|
||||
# Ensure that TRUNCATE fails for non-empty archive tables.
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=ARCHIVE;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
TRUNCATE TABLE t1;
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#46565 - repair of partition fail for archive engine
|
||||
#
|
||||
# Installing corrupted table files for t1.
|
||||
|
|
0
mysql-test/r/bug46080.result
Executable file → Normal file
0
mysql-test/r/bug46080.result
Executable file → Normal file
|
@ -25,7 +25,7 @@ DROP TABLE t1;
|
|||
# MySQL Bug#39200: optimize table does not recognize
|
||||
# ROW_FORMAT=COMPRESSED
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ROW_FORMAT=compressed;
|
||||
CREATE TABLE t1 (a INT) ROW_FORMAT=compressed, ENGINE=MyISAM;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
|
272
mysql-test/r/commit.result
Normal file
272
mysql-test/r/commit.result
Normal file
|
@ -0,0 +1,272 @@
|
|||
#
|
||||
# Bug#20837 Apparent change of isolation level
|
||||
# during transaction
|
||||
#
|
||||
# Bug#53343 completion_type=1, COMMIT/ROLLBACK
|
||||
# AND CHAIN don't preserve the isolation
|
||||
# level
|
||||
connection default;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
CREATE TABLE t1 (s1 INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
ERROR 25001: Transaction isolation level can't be changed while a transaction is in progress
|
||||
COMMIT;
|
||||
SET @@autocommit=0;
|
||||
COMMIT;
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
START TRANSACTION;
|
||||
SELECT @@tx_isolation;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
Should be REPEATABLE READ
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
SELECT @@tx_isolation;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
Should be REPEATABLE READ
|
||||
INSERT INTO t1 VALUES (-1);
|
||||
SELECT @@tx_isolation;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
Should be REPEATABLE READ
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
connection con1
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
COMMIT;
|
||||
connection default
|
||||
We should not be able to read the '1000'
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
COMMIT;
|
||||
Now, the '1000' should appear.
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
1000
|
||||
COMMIT;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
connection default
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
connection con1
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1001);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
|
||||
COUNT(*)
|
||||
1
|
||||
Should be 1
|
||||
COMMIT AND CHAIN;
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1002);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
|
||||
COUNT(*)
|
||||
1
|
||||
Should be 1
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
1000
|
||||
1001
|
||||
1002
|
||||
DELETE FROM t1 WHERE s1 >= 1000;
|
||||
COMMIT;
|
||||
connection default
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
connection con1
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1001);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
|
||||
COUNT(*)
|
||||
1
|
||||
Should be 1
|
||||
ROLLBACK AND CHAIN;
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1002);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
|
||||
COUNT(*)
|
||||
1
|
||||
Should be 1
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
1001
|
||||
1002
|
||||
DELETE FROM t1 WHERE s1 >= 1000;
|
||||
COMMIT;
|
||||
SET @@completion_type=1;
|
||||
connection default
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
connection con1
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1001);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
Should see 1001
|
||||
COMMIT AND NO CHAIN;
|
||||
default transaction is now in REPEATABLE READ
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1002);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
1002
|
||||
Should see 1001 and 1002
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1003);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
1002
|
||||
Should see 1001 and 1002, but NOT 1003
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
1001
|
||||
1002
|
||||
1003
|
||||
DELETE FROM t1 WHERE s1 >= 1000;
|
||||
COMMIT AND NO CHAIN;
|
||||
SET @@completion_type=0;
|
||||
COMMIT;
|
||||
connection default
|
||||
SET @@completion_type=1;
|
||||
COMMIT AND NO CHAIN;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
connection con1
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1001);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
Should see 1001
|
||||
ROLLBACK AND NO CHAIN;
|
||||
default transaction is now in REPEATABLE READ
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1002);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
1002
|
||||
Should see 1001 and 1002
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1003);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1 WHERE s1 >= 1000;
|
||||
s1
|
||||
1001
|
||||
1002
|
||||
Should see 1001 and 1002, but NOT 1003
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
1001
|
||||
1002
|
||||
1003
|
||||
DELETE FROM t1 WHERE s1 >= 1000;
|
||||
COMMIT AND NO CHAIN;
|
||||
SET @@completion_type=0;
|
||||
COMMIT;
|
||||
connection default
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1
|
||||
2
|
||||
-1
|
||||
Should get same result as above (i.e should not read '1000')
|
||||
COMMIT;
|
||||
DELETE FROM t1 WHERE s1 >= 1000;
|
||||
COMMIT;
|
||||
SET @@completion_type=1;
|
||||
COMMIT AND NO CHAIN;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
START TRANSACTION;
|
||||
TRUNCATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1000
|
||||
Should read '1000'
|
||||
connection con1
|
||||
INSERT INTO t1 VALUES (1001);
|
||||
COMMIT;
|
||||
connection default
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
1000
|
||||
Should only read the '1000' as this transaction is now in REP READ
|
||||
COMMIT AND NO CHAIN;
|
||||
SET @@completion_type=0;
|
||||
COMMIT AND NO CHAIN;
|
||||
SET @autocommit=1;
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of test cases for Bug#20837
|
||||
#
|
|
@ -99,6 +99,14 @@ create table t1 (`` int);
|
|||
ERROR 42000: Incorrect column name ''
|
||||
create table t1 (i int, index `` (i));
|
||||
ERROR 42000: Incorrect index name ''
|
||||
create table t1 (i int);
|
||||
lock tables t1 read;
|
||||
create table t2 (j int);
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
create temporary table t2 (j int);
|
||||
drop temporary table t2;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
create table t1 (a int auto_increment not null primary key, B CHAR(20));
|
||||
insert into t1 (b) values ("hello"),("my"),("world");
|
||||
create table t2 (key (b)) select * from t1;
|
||||
|
@ -377,6 +385,17 @@ ERROR 42S01: Table 't3' already exists
|
|||
drop table t1, t2, t3;
|
||||
drop table t3;
|
||||
drop database mysqltest;
|
||||
create table t1 (i int);
|
||||
create table t2 (j int);
|
||||
lock tables t1 read;
|
||||
create table t3 like t1;
|
||||
ERROR HY000: Table 't3' was not locked with LOCK TABLES
|
||||
create temporary table t3 like t1;
|
||||
drop temporary table t3;
|
||||
create temporary table t3 like t2;
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
unlock tables;
|
||||
drop tables t1, t2;
|
||||
SET SESSION storage_engine="heap";
|
||||
SELECT @@storage_engine;
|
||||
@@storage_engine
|
||||
|
@ -2033,3 +2052,39 @@ ID
|
|||
3
|
||||
DROP TABLE t1;
|
||||
DROP TEMPORARY TABLE t2;
|
||||
#
|
||||
# Bug #22909 "Using CREATE ... LIKE is possible to create field
|
||||
# with invalid default value"
|
||||
#
|
||||
# Altough original bug report suggests to use older version of MySQL
|
||||
# for producing .FRM with invalid defaults we use sql_mode to achieve
|
||||
# the same effect.
|
||||
drop tables if exists t1, t2;
|
||||
# Attempt to create table with invalid default should fail in normal mode
|
||||
create table t1 (dt datetime default '2008-02-31 00:00:00');
|
||||
ERROR 42000: Invalid default value for 'dt'
|
||||
set @old_mode= @@sql_mode;
|
||||
set @@sql_mode='ALLOW_INVALID_DATES';
|
||||
# The same should be possible in relaxed mode
|
||||
create table t1 (dt datetime default '2008-02-31 00:00:00');
|
||||
set @@sql_mode= @old_mode;
|
||||
# In normal mode attempt to create copy of table with invalid
|
||||
# default should fail
|
||||
create table t2 like t1;
|
||||
ERROR 42000: Invalid default value for 'dt'
|
||||
set @@sql_mode='ALLOW_INVALID_DATES';
|
||||
# But should work in relaxed mode
|
||||
create table t2 like t1;
|
||||
# Check that table definitions match
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`dt` datetime DEFAULT '2008-02-31 00:00:00'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`dt` datetime DEFAULT '2008-02-31 00:00:00'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
set @@sql_mode= @old_mode;
|
||||
drop tables t1, t2;
|
||||
|
|
0
mysql-test/r/ctype_eucjpms.result
Executable file → Normal file
0
mysql-test/r/ctype_eucjpms.result
Executable file → Normal file
|
@ -157,3 +157,13 @@ Error 1051 Unknown table 't1'
|
|||
# --
|
||||
# -- End of Bug#37431.
|
||||
# --
|
||||
#
|
||||
# Bug#54282 Crash in MDL_context::upgrade_shared_lock_to_exclusive
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
LOCK TABLE t1 WRITE;
|
||||
DROP TABLE t1, t1;
|
||||
ERROR 42000: Not unique table/alias: 't1'
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -48,5 +48,40 @@ Got one of the listed errors
|
|||
SET SESSION debug=DEFAULT;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#41660: Sort-index_merge for non-first join table may require
|
||||
# O(#scans) memory
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
CREATE TABLE t2 (a INT, b INT, filler CHAR(100), KEY(a), KEY(b));
|
||||
INSERT INTO t2 SELECT 1000, 1000, 'filler' FROM t1 A, t1 B, t1 C;
|
||||
INSERT INTO t2 VALUES (1, 1, 'data');
|
||||
# the example query uses LEFT JOIN only for the sake of being able to
|
||||
# demonstrate the issue with a very small dataset. (left outer join
|
||||
# disables the use of join buffering, so we get the second table
|
||||
# re-scanned for every record in the outer table. if we used inner join,
|
||||
# we would need to have thousands of records and/or more columns in both
|
||||
# tables so that the join buffer is filled and re-scans are triggered).
|
||||
SET SESSION debug = '+d,only_one_Unique_may_be_created';
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x x x x x x x
|
||||
x x x x x x x x x Using sort_union(a,b); Using where
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
|
||||
a a b filler
|
||||
0 1 1 data
|
||||
1 1 1 data
|
||||
2 1 1 data
|
||||
3 1 1 data
|
||||
4 1 1 data
|
||||
5 1 1 data
|
||||
6 1 1 data
|
||||
7 1 1 data
|
||||
8 1 1 data
|
||||
9 1 1 data
|
||||
SET SESSION debug = DEFAULT;
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
|
|
|
@ -750,4 +750,24 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#54477: Crash on IN / CASE with NULL arguments
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
SELECT 1 IN (NULL, a) FROM t1;
|
||||
1 IN (NULL, a)
|
||||
1
|
||||
NULL
|
||||
SELECT a IN (a, a) FROM t1 GROUP BY a WITH ROLLUP;
|
||||
a IN (a, a)
|
||||
1
|
||||
1
|
||||
NULL
|
||||
SELECT CASE a WHEN a THEN a END FROM t1 GROUP BY a WITH ROLLUP;
|
||||
CASE a WHEN a THEN a END
|
||||
1
|
||||
2
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -169,3 +169,17 @@ select 'andre%' like 'andre
|
|||
select _cp1251'andre%' like convert('andreÊ%' using cp1251) escape 'Ê';
|
||||
_cp1251'andre%' like convert('andreÊ%' using cp1251) escape 'Ê'
|
||||
1
|
||||
End of 4.1 tests
|
||||
#
|
||||
# Bug #54575: crash when joining tables with unique set column
|
||||
#
|
||||
CREATE TABLE t1(a SET('a') NOT NULL, UNIQUE KEY(a));
|
||||
CREATE TABLE t2(b INT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES ();
|
||||
Warnings:
|
||||
Warning 1364 Field 'a' doesn't have a default value
|
||||
INSERT INTO t2 VALUES (1), (2), (3);
|
||||
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -1681,6 +1681,16 @@ COUNT(*)
|
|||
DROP USER nonpriv;
|
||||
DROP TABLE db1.t1;
|
||||
DROP DATABASE db1;
|
||||
|
||||
Bug#54422 query with = 'variables'
|
||||
|
||||
CREATE TABLE variables(f1 INT);
|
||||
SELECT COLUMN_DEFAULT, TABLE_NAME
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables';
|
||||
COLUMN_DEFAULT TABLE_NAME
|
||||
NULL variables
|
||||
DROP TABLE variables;
|
||||
End of 5.1 tests.
|
||||
#
|
||||
# Additional test for WL#3726 "DDL locking for all metadata objects"
|
||||
|
|
|
@ -178,8 +178,7 @@ end|
|
|||
# 1.1 Simple SELECT statement.
|
||||
#
|
||||
# No locks are necessary as this statement won't be written
|
||||
# to the binary log and thanks to how MyISAM works SELECT
|
||||
# will see version of the table prior to concurrent insert.
|
||||
# to the binary log and InnoDB supports snapshots.
|
||||
Success: 'select * from t1' doesn't take row locks on 't1'.
|
||||
#
|
||||
# 1.2 Multi-UPDATE statement.
|
||||
|
@ -484,7 +483,7 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes sh
|
|||
# row locks on the data it reads.
|
||||
Success: 'call p2(@a)' doesn't take row locks on 't1'.
|
||||
#
|
||||
# 5.2 Function that modifes data and uses CALL,
|
||||
# 5.2 Function that modifies data and uses CALL,
|
||||
# which reads a table through SELECT.
|
||||
#
|
||||
# Since a call to such function is written to the binary
|
||||
|
@ -562,3 +561,68 @@ drop view v1, v2;
|
|||
drop procedure p1;
|
||||
drop procedure p2;
|
||||
drop table t1, t2, t3, t4, t5;
|
||||
#
|
||||
# Test for bug#51263 "Deadlock between transactional SELECT
|
||||
# and ALTER TABLE ... REBUILD PARTITION".
|
||||
#
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (i int auto_increment not null primary key) engine=innodb;
|
||||
create table t2 (i int) engine=innodb;
|
||||
insert into t1 values (1), (2), (3), (4), (5);
|
||||
begin;
|
||||
# Acquire SR metadata lock on t1 and LOCK_S row-locks on its rows.
|
||||
insert into t2 select count(*) from t1;
|
||||
# Switching to connection 'con1'.
|
||||
# Sending:
|
||||
alter table t1 add column j int;
|
||||
# Switching to connection 'default'.
|
||||
# Wait until ALTER is blocked because it tries to upgrade SNW
|
||||
# metadata lock to X lock.
|
||||
# It should not be blocked during copying data to new version of
|
||||
# table as it acquires LOCK_S locks on rows of old version, which
|
||||
# are compatible with locks acquired by connection 'con1'.
|
||||
# The below statement will deadlock because it will try to acquire
|
||||
# SW lock on t1, which will conflict with ALTER's SNW lock. And
|
||||
# ALTER will be waiting for this connection to release its SR lock.
|
||||
# This deadlock should be detected by an MDL subsystem and this
|
||||
# statement should be aborted with an appropriate error.
|
||||
insert into t1 values (6);
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
# Unblock ALTER TABLE.
|
||||
commit;
|
||||
# Switching to connection 'con1'.
|
||||
# Reaping ALTER TABLE.
|
||||
# Switching to connection 'default'.
|
||||
#
|
||||
# Now test for scenario in which bug was reported originally.
|
||||
#
|
||||
drop tables t1, t2;
|
||||
create table t1 (i int auto_increment not null primary key) engine=innodb
|
||||
partition by hash (i) partitions 4;
|
||||
create table t2 (i int) engine=innodb;
|
||||
insert into t1 values (1), (2), (3), (4), (5);
|
||||
begin;
|
||||
# Acquire SR metadata lock on t1.
|
||||
select * from t1;
|
||||
i
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
# Switching to connection 'con1'.
|
||||
# Sending:
|
||||
alter table t1 rebuild partition p0;
|
||||
# Switching to connection 'default'.
|
||||
# Wait until ALTER is blocked because of active SR lock.
|
||||
# The below statement should succeed as transaction
|
||||
# has SR metadata lock on t1 and only going to read
|
||||
# rows from it.
|
||||
insert into t2 select count(*) from t1;
|
||||
# Unblock ALTER TABLE.
|
||||
commit;
|
||||
# Switching to connection 'con1'.
|
||||
# Reaping ALTER TABLE.
|
||||
# Switching to connection 'default'.
|
||||
# Clean-up.
|
||||
drop tables t1, t2;
|
||||
|
|
|
@ -511,7 +511,7 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't
|
|||
# strong locks on the data it reads.
|
||||
Success: 'call p2(@a)' allows concurrent inserts into 't1'.
|
||||
#
|
||||
# 5.2 Function that modifes data and uses CALL,
|
||||
# 5.2 Function that modifies data and uses CALL,
|
||||
# which reads a table through SELECT.
|
||||
#
|
||||
# Since a call to such function is written to the binary
|
||||
|
|
0
mysql-test/r/lowercase_mixed_tmpdir_innodb.result
Executable file → Normal file
0
mysql-test/r/lowercase_mixed_tmpdir_innodb.result
Executable file → Normal file
|
@ -330,9 +330,9 @@ select column_name from information_schema.columns where
|
|||
table_schema='test' and table_name='t1';
|
||||
column_name
|
||||
c1
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
# Disable result log to make test robust against
|
||||
# effects of concurrent insert.
|
||||
select * from t1;
|
||||
insert into t1 values (1);
|
||||
# Check that SNW lock is not compatible with SW lock.
|
||||
# Again we use ALTER TABLE which fails after opening
|
||||
|
@ -1765,6 +1765,7 @@ drop tables t1, t2;
|
|||
# locking subsystem.
|
||||
#
|
||||
drop tables if exists t0, t1, t2, t3, t4, t5;
|
||||
set debug_sync= 'RESET';
|
||||
create table t1 (i int);
|
||||
create table t2 (j int);
|
||||
create table t3 (k int);
|
||||
|
@ -1943,6 +1944,98 @@ commit;
|
|||
# Reap ALTER TABLE ... RENAME.
|
||||
drop table t2;
|
||||
#
|
||||
# Test that in situation when MDL subsystem detects a deadlock
|
||||
# but it turns out that it can be resolved by backing-off locks
|
||||
# acquired by one of participating transactions (which is
|
||||
# possible when one of transactions consists only of currently
|
||||
# executed statement, e.g. in autocommit mode) no error is
|
||||
# reported.
|
||||
#
|
||||
create table t1 (i int);
|
||||
create table t2 (j int);
|
||||
# Ensure that the below SELECT stops once it has acquired metadata
|
||||
# lock on table 't2'.
|
||||
set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
|
||||
# Sending:
|
||||
select * from t2, t1;
|
||||
#
|
||||
# Switching to connection 'deadlock_con1'.
|
||||
# Wait till SELECT acquires MDL on 't2' and starts waiting for signal.
|
||||
set debug_sync= 'now WAIT_FOR locked';
|
||||
# Sending:
|
||||
lock tables t1 write, t2 write;
|
||||
#
|
||||
# Switching to connection 'deadlock_con2'.
|
||||
# Wait until LOCK TABLES acquires SNRW lock on 't1' and is blocked
|
||||
# while trying to acquire SNRW lock on 't1'.
|
||||
# Resume SELECT execution, this should eventually unblock LOCK TABLES.
|
||||
set debug_sync= 'now SIGNAL finish';
|
||||
#
|
||||
# Switching to connection 'deadlock_con1'.
|
||||
# Reaping LOCK TABLES.
|
||||
unlock tables;
|
||||
#
|
||||
# Switching to connection 'default'.
|
||||
# Reaping SELECT. It succeed and not report ER_LOCK_DEADLOCK error.
|
||||
j i
|
||||
drop tables t1, t2;
|
||||
#
|
||||
# Test coverage for situation in which a race has happened
|
||||
# during deadlock detection process which led to unwarranted
|
||||
# ER_LOCK_DEADLOCK error.
|
||||
#
|
||||
create table t1 (i int);
|
||||
# Ensure that ALTER waits once it has acquired SNW lock.
|
||||
set debug_sync='after_open_table_mdl_shared SIGNAL parked1 WAIT_FOR go1';
|
||||
# Sending:
|
||||
alter table t1 add column j int;
|
||||
#
|
||||
# Switching to connection 'deadlock_con1'.
|
||||
# Wait till ALTER acquires SNW lock and stops.
|
||||
set debug_sync='now WAIT_FOR parked1';
|
||||
# Ensure that INSERT is paused once it detects that there is
|
||||
# a conflicting metadata lock so it has to wait, but before
|
||||
# deadlock detection is run.
|
||||
set debug_sync='mdl_acquire_lock_wait SIGNAL parked2 WAIT_FOR go2';
|
||||
# Sending:
|
||||
insert into t1 values ();
|
||||
#
|
||||
# Switching to connection 'deadlock_con2'.
|
||||
# Wait till INSERT is paused.
|
||||
set debug_sync='now WAIT_FOR parked2';
|
||||
# Resume ALTER execution. Eventually it will release its
|
||||
# metadata lock and INSERT's request for SW lock will be
|
||||
# satisified.
|
||||
set debug_sync='now SIGNAL go1';
|
||||
#
|
||||
# Switching to connection 'default'.
|
||||
# Reaping ALTER TABLE.
|
||||
# Add a new request for SNW lock to waiting graph.
|
||||
# Sending:
|
||||
alter table t1 drop column j;
|
||||
#
|
||||
# Switching to connection 'deadlock_con2'.
|
||||
# Wait until ALTER is blocked.
|
||||
# Resume INSERT so it can start deadlock detection.
|
||||
#
|
||||
# At this point there is a discrepancy between the fact that INSERT's
|
||||
# SW lock is already satisfied, but INSERT's connection is still
|
||||
# marked as waiting for it. Looking for a loop in waiters graph
|
||||
# without additional checks has detected a deadlock (INSERT waits
|
||||
# for SW lock; which is not granted because of pending SNW lock from
|
||||
# ALTER; which waits for active SW lock from INSERT). Since requests
|
||||
# for SW and SNW locks have same weight ALTER was selected as a victim
|
||||
# and ended with ER_LOCK_DEADLOCK error.
|
||||
set debug_sync='now SIGNAL go2';
|
||||
#
|
||||
# Switching to connection 'deadlock_con1'.
|
||||
# Reaping INSERT.
|
||||
#
|
||||
# Switching to connection 'default'.
|
||||
# Reaping ALTER. It should succeed and not produce ER_LOCK_DEADLOCK.
|
||||
drop table t1;
|
||||
set debug_sync= 'RESET';
|
||||
#
|
||||
# Test for bug #46748 "Assertion in MDL_context::wait_for_locks()
|
||||
# on INSERT + CREATE TRIGGER".
|
||||
#
|
||||
|
@ -2175,7 +2268,7 @@ alter table t1 add column e int, rename to t2;;
|
|||
#
|
||||
# Switching to connection 'default'.
|
||||
set debug_sync='now WAIT_FOR alter_table_locked';
|
||||
set debug_sync='before_open_table_wait_refresh SIGNAL alter_go';
|
||||
set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
|
||||
# The below statement should get ER_LOCK_DEADLOCK error
|
||||
# (i.e. it should not allow ALTER to proceed, and then
|
||||
# fail due to 't1' changing its name to 't2').
|
||||
|
@ -2382,6 +2475,45 @@ commit;
|
|||
set debug_sync= 'RESET';
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
|
||||
#
|
||||
# Ensure that a acquired lock is not given up due to a conflict.
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
# Connection: con1
|
||||
SET debug_sync='lock_table_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
SET debug_sync='now WAIT_FOR parked_truncate';
|
||||
# Connection: con2
|
||||
SET debug_sync='after_open_table_ignore_flush SIGNAL parked_show WAIT_FOR go_show';
|
||||
SHOW FIELDS FROM t1;
|
||||
# Connection: default
|
||||
SET debug_sync='now WAIT_FOR parked_show';
|
||||
# Connection: con3
|
||||
SET debug_sync='after_flush_unlock SIGNAL parked_flush WAIT_FOR go_flush';
|
||||
FLUSH TABLES t1;
|
||||
# Connection: default
|
||||
SET debug_sync='now WAIT_FOR parked_flush';
|
||||
SET debug_sync='now SIGNAL go_truncate';
|
||||
# Connection: con1
|
||||
# Reaping...
|
||||
# Connection: default
|
||||
SET debug_sync= 'now SIGNAL go_show';
|
||||
# Connection: con2 (SHOW FIELDS FROM t1)
|
||||
# Reaping...
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
# Connection: default
|
||||
SET debug_sync= 'now SIGNAL go_flush';
|
||||
# Connection: con3 (FLUSH TABLES t1)
|
||||
# Reaping...
|
||||
# Connection: default
|
||||
SET debug_sync= 'RESET';
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#52856 concurrent show columns or show full columns causes a crash!!!
|
||||
#
|
||||
CREATE TABLE t1(a CHAR(255));
|
||||
|
|
|
@ -2699,4 +2699,23 @@ LOCK TABLE m1 WRITE;
|
|||
ALTER TABLE m1 ADD INDEX (c1);
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE m1, t1;
|
||||
#
|
||||
# Test for bug #37371 "CREATE TABLE LIKE merge loses UNION parameter"
|
||||
#
|
||||
drop tables if exists t1, m1, m2;
|
||||
create table t1 (i int) engine=myisam;
|
||||
create table m1 (i int) engine=mrg_myisam union=(t1) insert_method=first;
|
||||
create table m2 like m1;
|
||||
# Table definitions should match
|
||||
show create table m1;
|
||||
Table Create Table
|
||||
m1 CREATE TABLE `m1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`)
|
||||
show create table m2;
|
||||
Table Create Table
|
||||
m2 CREATE TABLE `m2` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`t1`)
|
||||
drop tables m1, m2, t1;
|
||||
End of 6.0 tests
|
||||
|
|
|
@ -746,7 +746,7 @@ connect-timeout 10
|
|||
console FALSE
|
||||
date-format %Y-%m-%d
|
||||
datetime-format %Y-%m-%d %H:%i:%s
|
||||
default-storage-engine MyISAM
|
||||
default-storage-engine InnoDB
|
||||
default-time-zone (No default value)
|
||||
default-week-format 0
|
||||
delay-key-write ON
|
||||
|
|
|
@ -750,7 +750,7 @@ connect-timeout 10
|
|||
console FALSE
|
||||
date-format %Y-%m-%d
|
||||
datetime-format %Y-%m-%d %H:%i:%s
|
||||
default-storage-engine MyISAM
|
||||
default-storage-engine InnoDB
|
||||
default-time-zone (No default value)
|
||||
default-week-format 0
|
||||
delay-key-write ON
|
||||
|
|
|
@ -47,3 +47,48 @@
|
|||
+----------+--------+
|
||||
| 4 | 4 |
|
||||
+----------+--------+
|
||||
# Bug#46527 "COMMIT AND CHAIN RELEASE does not make sense"
|
||||
#
|
||||
COMMIT AND CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
COMMIT AND NO CHAIN RELEASE;
|
||||
COMMIT RELEASE;
|
||||
COMMIT CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN RELEASE' at line 1
|
||||
COMMIT NO CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN RELEASE' at line 1
|
||||
COMMIT AND NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
COMMIT AND RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
COMMIT NO RELEASE;
|
||||
COMMIT CHAIN NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN NO RELEASE' at line 1
|
||||
COMMIT NO CHAIN NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN NO RELEASE' at line 1
|
||||
COMMIT AND RELEASE CHAIN;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE CHAIN' at line 1
|
||||
COMMIT AND NO CHAIN NO RELEASE;
|
||||
ROLLBACK AND CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
ROLLBACK AND NO CHAIN RELEASE;
|
||||
ROLLBACK RELEASE;
|
||||
ROLLBACK CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN RELEASE' at line 1
|
||||
ROLLBACK NO CHAIN RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN RELEASE' at line 1
|
||||
ROLLBACK AND NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
ROLLBACK AND RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE' at line 1
|
||||
ROLLBACK NO RELEASE;
|
||||
ROLLBACK CHAIN NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN NO RELEASE' at line 1
|
||||
ROLLBACK NO CHAIN NO RELEASE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHAIN NO RELEASE' at line 1
|
||||
ROLLBACK AND RELEASE CHAIN;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELEASE CHAIN' at line 1
|
||||
ROLLBACK AND NO CHAIN NO RELEASE;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
|
|
|
@ -266,12 +266,12 @@ engine = x
|
|||
partition by key (a);
|
||||
Warnings:
|
||||
Warning 1286 Unknown storage engine 'x'
|
||||
Warning 1266 Using storage engine MyISAM for table 't1'
|
||||
Warning 1266 Using storage engine InnoDB for table 't1'
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a) */
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
|
|
|
@ -18,6 +18,7 @@ set autocommit=0;
|
|||
update t1 set a=10 where a=5;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
commit;
|
||||
set session transaction isolation level read committed;
|
||||
update t1 set a=10 where a=5;
|
||||
select * from t1 where a=2 for update;
|
||||
|
@ -64,6 +65,7 @@ a b
|
|||
# Switch to connection con2
|
||||
UPDATE t1 SET b = 21 WHERE a = 1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
ROLLBACK;
|
||||
# Switch to connection con1
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
|
@ -99,6 +101,7 @@ a b
|
|||
SELECT * FROM t1;
|
||||
a b
|
||||
1 init+con1+con2
|
||||
COMMIT;
|
||||
# Switch to connection con1
|
||||
# 3. test for updated key column:
|
||||
TRUNCATE t1;
|
||||
|
|
|
@ -695,11 +695,11 @@ REPEATABLE-READ
|
|||
set transaction isolation level read committed;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
READ-COMMITTED
|
||||
REPEATABLE-READ
|
||||
set transaction isolation level serializable;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
SERIALIZABLE
|
||||
REPEATABLE-READ
|
||||
set @@tx_isolation=default;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
|
|
|
@ -55,14 +55,15 @@ t2
|
|||
t4
|
||||
drop table t2, t4;
|
||||
End of 4.1 tests
|
||||
#
|
||||
# Bug#14959: "ALTER TABLE isn't able to rename a view"
|
||||
# Bug#53976: "ALTER TABLE RENAME is allowed on views
|
||||
# (not documented, broken)"
|
||||
#
|
||||
create table t1(f1 int);
|
||||
create view v1 as select * from t1;
|
||||
alter table v1 rename to v2;
|
||||
alter table v1 rename to v2;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
rename table v2 to v1;
|
||||
rename table v2 to v1;
|
||||
ERROR 42S01: Table 'v1' already exists
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -4856,4 +4856,19 @@ a b c
|
|||
SELECT * FROM t1 WHERE 102 < c;
|
||||
a b c
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #54459: Assertion failed: param.sort_length,
|
||||
# file .\filesort.cc, line 149 (part II)
|
||||
#
|
||||
CREATE TABLE t1(a ENUM('') NOT NULL);
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -59,30 +59,31 @@ SET DEBUG_SYNC= 'RESET';
|
|||
#
|
||||
# Bug #48246 assert in close_thread_table
|
||||
#
|
||||
CREATE TABLE t0 (b INTEGER);
|
||||
CREATE TABLE t1 (a INTEGER);
|
||||
CREATE FUNCTION f1(b INTEGER) RETURNS INTEGER RETURN 1;
|
||||
CREATE PROCEDURE p1() SELECT COUNT(f1(a)) FROM t1;
|
||||
CREATE PROCEDURE p1() SELECT COUNT(f1(a)) FROM t1, t0;
|
||||
INSERT INTO t0 VALUES(1);
|
||||
INSERT INTO t1 VALUES(1), (2);
|
||||
# Connection 2
|
||||
CALL p1();
|
||||
COUNT(f1(a))
|
||||
2
|
||||
# Connection default
|
||||
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR called';
|
||||
# Sending:
|
||||
CREATE TABLE t1 (a INTEGER);
|
||||
# Connection 2
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR locked';
|
||||
SET DEBUG_SYNC= 'before_open_table_wait_refresh SIGNAL called WAIT_FOR created';
|
||||
# This call used to cause an assertion. MDL locking conflict will
|
||||
# cause back-off and retry. A variable indicating if a prelocking list
|
||||
# exists, used to be not reset properly causing an eventual assert.
|
||||
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked_t1 WAIT_FOR go_for_t0';
|
||||
# This call used to cause an assertion. MDL deadlock with upcoming
|
||||
# LOCK TABLES statement will cause back-off and retry.
|
||||
# A variable indicating if a prelocking list exists, used to be not
|
||||
# reset properly causing an eventual assert.
|
||||
# Sending:
|
||||
CALL p1();
|
||||
# Connection default
|
||||
# Reaping: CREATE TABLE t1 (a INTEGER)
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
SET DEBUG_SYNC= 'now SIGNAL created';
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR locked_t1';
|
||||
# Issue LOCK TABLES statement which will enter in MDL deadlock
|
||||
# with CALL statement and as result will cause it to perform
|
||||
# back-off and retry.
|
||||
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL go_for_t0';
|
||||
LOCK TABLES t0 WRITE, t1 WRITE;
|
||||
UNLOCK TABLES;
|
||||
# Connection 2
|
||||
# Reaping: CALL p1()
|
||||
COUNT(f1(a))
|
||||
|
@ -90,5 +91,5 @@ COUNT(f1(a))
|
|||
# Connection default
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLES t0, t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
|
|
@ -4988,3 +4988,20 @@ t1_id total_amount
|
|||
DROP TABLE t3;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #52711: Segfault when doing EXPLAIN SELECT with
|
||||
# union...order by (select... where...)
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10), FULLTEXT KEY a (a));
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2 (b INT);
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
# Should not crash
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 UNION SELECT * FROM t2
|
||||
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
|
||||
# Should not crash
|
||||
SELECT * FROM t2 UNION SELECT * FROM t2
|
||||
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -99,7 +99,7 @@ LOCK TABLE t1 WRITE;
|
|||
SELECT * FROM v1;
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
TRUNCATE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
SELECT * FROM v1;
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
UNLOCK TABLES;
|
||||
|
@ -107,7 +107,7 @@ LOCK TABLE t1 WRITE, t2 WRITE;
|
|||
SELECT * FROM v1;
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
TRUNCATE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
SELECT * FROM v1;
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
UNLOCK TABLES;
|
||||
|
@ -117,7 +117,7 @@ c1
|
|||
1
|
||||
3
|
||||
TRUNCATE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
SELECT * FROM v1;
|
||||
c1
|
||||
1
|
||||
|
@ -129,7 +129,7 @@ c1
|
|||
1
|
||||
3
|
||||
TRUNCATE v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
SELECT * FROM v1;
|
||||
c1
|
||||
1
|
||||
|
|
|
@ -18,13 +18,15 @@ TRUNCATE TABLE t1;
|
|||
SET DEBUG_SYNC='now WAIT_FOR waiting';
|
||||
KILL QUERY @id;
|
||||
#
|
||||
# connection default
|
||||
ERROR 70100: Query execution was interrupted
|
||||
UNLOCK TABLES;
|
||||
#
|
||||
# connection con1
|
||||
# Release shared metadata lock by closing HANDLER.
|
||||
HANDLER t1 CLOSE;
|
||||
#
|
||||
# connection default
|
||||
ERROR 70100: Query execution was interrupted
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
|
@ -64,10 +66,15 @@ TRUNCATE TABLE t1;
|
|||
# connection con1
|
||||
SET DEBUG_SYNC='now WAIT_FOR waiting';
|
||||
KILL QUERY @id;
|
||||
COMMIT;
|
||||
#
|
||||
# connection default
|
||||
ERROR 70100: Query execution was interrupted
|
||||
#
|
||||
# connection con1
|
||||
# Release SW lock by committing transaction.
|
||||
COMMIT;
|
||||
#
|
||||
# connection default
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
|
|
|
@ -3954,6 +3954,7 @@ drop procedure p;
|
|||
CREATE TABLE t1 (a INT);
|
||||
CREATE VIEW v1 AS SELECT a FROM t1;
|
||||
ALTER TABLE v1;
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
|
|
|
@ -2,65 +2,65 @@ SET BINLOG_FORMAT=MIXED;
|
|||
RESET MASTER;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 2*a WHERE a > 1;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = a * a WHERE a > 3;
|
||||
COMMIT;
|
||||
SET BINLOG_FORMAT=STATEMENT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 1*a WHERE a > 1;
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 2*a WHERE a > 2;
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 3*a WHERE a > 3;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 4*a WHERE a > 4;
|
||||
COMMIT;
|
||||
SET BINLOG_FORMAT=MIXED;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 1*a WHERE a > 1;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 2*a WHERE a > 2;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 3*a WHERE a > 3;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 4*a WHERE a > 4;
|
||||
COMMIT;
|
||||
SET BINLOG_FORMAT=ROW;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 1*a WHERE a > 1;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 2*a WHERE a > 2;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 3*a WHERE a > 3;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 4*a WHERE a > 4;
|
||||
COMMIT;
|
||||
show binlog events from <binlog_start>;
|
||||
|
|
0
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
Executable file → Normal file
0
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue