diff options
251 files changed, 5055 insertions, 4906 deletions
diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh index 668d6a81b5c..5d7c317f86f 100644 --- a/BUILD/cmake_configure.sh +++ b/BUILD/cmake_configure.sh @@ -18,7 +18,7 @@ # MA 02110-1301, USA # Ensure cmake and perl are there -cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no +cmake --help >/dev/null 2>&1 || HAVE_CMAKE=no perl --version >/dev/null 2>&1 || HAVE_PERL=no scriptdir=`dirname $0` if test "$HAVE_CMAKE" = "no" diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d06f40d393..0584492def3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -# Avoid warnings in higher versions -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6) - CMAKE_POLICY(VERSION 2.8) -endif() +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) # explicitly set the policy to OLD # (cannot use NEW, not everyone is on cmake-2.8.12 yet) @@ -40,12 +36,6 @@ MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) -# 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. IF(NOT DEFINED MANUFACTURER) SET(MANUFACTURER "Built from Source" CACHE STRING @@ -140,6 +130,7 @@ IF (NOT CPACK_GENERATOR) ENDIF(WIN32) ENDIF(NOT CPACK_GENERATOR) +INCLUDE(misc) INCLUDE(mysql_version) INCLUDE(cpack_source_ignore_files) INCLUDE(install_layout) @@ -170,13 +161,11 @@ IF(DISABLE_SHARED) SET(WITHOUT_DYNAMIC_PLUGINS 1) ENDIF() OPTION(ENABLED_PROFILING "Enable profiling" ON) -OPTION(CYBOZU "" OFF) OPTION(WITHOUT_SERVER "Build only the client library and clients" OFF) IF(UNIX) OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) ENDIF() OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) -MARK_AS_ADVANCED(CYBOZU) OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF) @@ -235,9 +224,6 @@ MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG) OPTION(ENABLED_LOCAL_INFILE "If we should should enable LOAD DATA LOCAL by default" ${IF_WIN}) -OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF) -MARK_AS_ADVANCED(WITH_FAST_MUTEXES) - OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) IF (WITH_INNODB_DISALLOW_WRITES) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") @@ -252,10 +238,6 @@ FOREACH(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL) SET(CMAKE_${LANG}_FLAGS_${BUILD_TYPE} "${CMAKE_${LANG}_FLAGS_${BUILD_TYPE}} -DDBUG_OFF") ENDIF() - IF(WITH_FAST_MUTEXES) - SET(CMAKE_${LANG}_FLAGS_${BUILD_TYPE} - "${CMAKE_${LANG}_FLAGS_${BUILD_TYPE}} -DMY_PTHREAD_FASTMUTEX=1") - ENDIF() ENDFOREACH() ENDFOREACH() @@ -441,8 +423,8 @@ CONFIGURE_FILE( IF(DEB) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.1.files.in - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.1.files) + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files.in + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files) ENDIF(DEB) # Handle the "INFO_*" files. @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 -MYSQL_VERSION_MINOR=1 -MYSQL_VERSION_PATCH=12 +MYSQL_VERSION_MINOR=2 +MYSQL_VERSION_PATCH=0 MYSQL_VERSION_EXTRA= diff --git a/client/mysql.cc b/client/mysql.cc index 29e39b6adcb..c4dbe21a465 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1921,7 +1921,7 @@ static int get_options(int argc, char **argv) connect_flag|= CLIENT_IGNORE_SPACE; if (opt_progress_reports) - connect_flag|= CLIENT_PROGRESS; + connect_flag|= CLIENT_PROGRESS_OBSOLETE; return(0); } @@ -3452,7 +3452,6 @@ static char *fieldflags2str(uint f) { ff2s_check_flag(NUM); ff2s_check_flag(PART_KEY); ff2s_check_flag(GROUP); - ff2s_check_flag(UNIQUE); ff2s_check_flag(BINCMP); ff2s_check_flag(ON_UPDATE_NOW); #undef ff2s_check_flag @@ -4639,10 +4638,10 @@ sql_real_connect(char *host,char *database,char *user,char *password, mysql.reconnect= debug_info_flag; // We want to know if this happens /* - CLIENT_PROGRESS is set only if we requsted it in mysql_real_connect() - and the server also supports it + CLIENT_PROGRESS_OBSOLETE is set only if we requested it in + mysql_real_connect() and the server also supports it */ - if (mysql.client_flag & CLIENT_PROGRESS) + if (mysql.client_flag & CLIENT_PROGRESS_OBSOLETE) mysql_options(&mysql, MYSQL_PROGRESS_CALLBACK, (void*) report_progress); #else mysql.reconnect= 1; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index bb0dd4040af..59912d0c91d 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2449,9 +2449,6 @@ end: return retval; } -/* Used in sql_alloc(). Inited and freed in main() */ -MEM_ROOT s_mem_root; - int main(int argc, char** argv) { char **defaults_argv; @@ -2464,7 +2461,6 @@ int main(int argc, char** argv) my_init_time(); // for time functions tzset(); // set tzname - init_alloc_root(&s_mem_root, 16384, 0, MYF(0)); if (load_defaults("my", load_groups, &argc, &argv)) exit(1); @@ -2581,7 +2577,6 @@ int main(int argc, char** argv) my_fclose(result_file, MYF(0)); cleanup(); free_annotate_event(); - free_root(&s_mem_root, MYF(0)); free_defaults(defaults_argv); my_free_open_file_info(); load_processor.destroy(); @@ -2602,11 +2597,6 @@ err: } -void *sql_alloc(size_t size) -{ - return alloc_root(&s_mem_root, size); -} - struct encryption_service_st encryption_handler= { 0, 0, 0, 0, 0, 0, 0 diff --git a/cmake/cat.cmake b/cmake/cat.cmake deleted file mode 100644 index 1ffe2ecfa1d..00000000000 --- a/cmake/cat.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2009 Sun Microsystems, Inc. -# Use is subject to license terms. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Concatenate files -# -# Parameters : -# IN - input files (list) -# OUT - output file -FILE(WRITE ${OUT} "") -FOREACH(FILENAME ${IN}) - FILE(READ ${FILENAME} CONTENTS) - FILE(APPEND ${OUT} "${CONTENTS}") -ENDFOREACH() - - diff --git a/cmake/check_compiler_flag.cmake b/cmake/check_compiler_flag.cmake index 303d5d8d3c8..8192f077344 100644 --- a/cmake/check_compiler_flag.cmake +++ b/cmake/check_compiler_flag.cmake @@ -15,7 +15,7 @@ SET(fail_patterns ) MACRO (MY_CHECK_C_COMPILER_FLAG flag) - STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_C_${flag}") + STRING(REGEX REPLACE "[-,= ]" "_" result "have_C_${flag}") SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${result} @@ -24,7 +24,7 @@ MACRO (MY_CHECK_C_COMPILER_FLAG flag) ENDMACRO() MACRO (MY_CHECK_CXX_COMPILER_FLAG flag) - STRING(REGEX REPLACE "[-,= ]" "_" result "HAVE_CXX_${flag}") + STRING(REGEX REPLACE "[-,= ]" "_" result "have_CXX_${flag}") SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result} @@ -42,7 +42,7 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag) MY_CHECK_CXX_COMPILER_FLAG(${flag}) STRING(REGEX REPLACE "[-,= ]" "_" result "${flag}") FOREACH(lang C CXX) - IF (HAVE_${lang}_${result}) + IF (have_${lang}_${result}) IF(ARGN) FOREACH(type ${ARGN}) SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE) diff --git a/cmake/check_minimal_version.cmake b/cmake/check_minimal_version.cmake deleted file mode 100644 index d96c6a93418..00000000000 --- a/cmake/check_minimal_version.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2009 Sun Microsystems, Inc. -# Use is subject to license terms. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# This is a helper script is used to check for the minimal required version -# It helps to decide whether to use autoconf based configure or cmake's -# configure -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) diff --git a/cmake/cmake_parse_arguments.cmake b/cmake/cmake_parse_arguments.cmake deleted file mode 100644 index 487fe2bacd9..00000000000 --- a/cmake/cmake_parse_arguments.cmake +++ /dev/null @@ -1,47 +0,0 @@ - -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Handy macro to parse macro arguments -MACRO(MYSQL_PARSE_ARGUMENTS prefix arg_names option_names) - SET(DEFAULT_ARGS) - FOREACH(arg_name ${arg_names}) - SET(${prefix}_${arg_name}) - ENDFOREACH(arg_name) - FOREACH(option ${option_names}) - SET(${prefix}_${option} FALSE) - ENDFOREACH(option) - - SET(current_arg_name DEFAULT_ARGS) - SET(current_arg_list) - FOREACH(arg ${ARGN}) - SET(larg_names ${arg_names}) - LIST(FIND larg_names "${arg}" is_arg_name) - IF (is_arg_name GREATER -1) - SET(${prefix}_${current_arg_name} ${current_arg_list}) - SET(current_arg_name ${arg}) - SET(current_arg_list) - ELSE (is_arg_name GREATER -1) - SET(loption_names ${option_names}) - LIST(FIND loption_names "${arg}" is_option) - IF (is_option GREATER -1) - SET(${prefix}_${arg} TRUE) - ELSE (is_option GREATER -1) - SET(current_arg_list ${current_arg_list} ${arg}) - ENDIF (is_option GREATER -1) - ENDIF (is_arg_name GREATER -1) - ENDFOREACH(arg) - SET(${prefix}_${current_arg_name} ${current_arg_list}) -ENDMACRO()
\ No newline at end of file diff --git a/cmake/compile_flags.cmake b/cmake/compile_flags.cmake deleted file mode 100644 index b39bf7b79d6..00000000000 --- a/cmake/compile_flags.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -## ADD_COMPILE_FLAGS(<source files> COMPILE_FLAGS <flags>) -MACRO(ADD_COMPILE_FLAGS) - SET(FILES "") - SET(FLAGS "") - SET(COMPILE_FLAGS_SEEN) - FOREACH(ARG ${ARGV}) - IF(ARG STREQUAL "COMPILE_FLAGS") - SET(COMPILE_FLAGS_SEEN 1) - ELSEIF(COMPILE_FLAGS_SEEN) - LIST(APPEND FLAGS ${ARG}) - ELSE() - LIST(APPEND FILES ${ARG}) - ENDIF() - ENDFOREACH() - FOREACH(FILE ${FILES}) - FOREACH(FLAG ${FLAGS}) - GET_SOURCE_FILE_PROPERTY(PROP ${FILE} COMPILE_FLAGS) - IF(NOT PROP) - SET(PROP ${FLAG}) - ELSE() - SET(PROP "${PROP} ${FLAG}") - ENDIF() - SET_SOURCE_FILES_PROPERTIES( - ${FILE} PROPERTIES COMPILE_FLAGS "${PROP}" - ) - ENDFOREACH() - ENDFOREACH() -ENDMACRO() diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake index 0654fa38388..2627e6cb697 100644 --- a/cmake/cpack_source_ignore_files.cmake +++ b/cmake/cpack_source_ignore_files.cmake @@ -39,7 +39,6 @@ scripts/mysql_fix_extensions$ scripts/mysql_install_db$ scripts/mysql_secure_installation$ scripts/mysql_setpermission$ -scripts/mysql_zap$ scripts/mysqlaccess$ scripts/mysqld_multi$ scripts/mysqld_safe$ diff --git a/cmake/ctest.cmake b/cmake/ctest.cmake index 08852a366f6..5bc1ce5f832 100644 --- a/cmake/ctest.cmake +++ b/cmake/ctest.cmake @@ -1,12 +1,12 @@ -INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +INCLUDE(CMakeParseArguments) MACRO(MY_ADD_TEST name) ADD_TEST(${name} ${name}-t) ENDMACRO() -MACRO (MY_ADD_TESTS) - MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;EXT" "" ${ARGN}) +MACRO(MY_ADD_TESTS) + CMAKE_PARSE_ARGUMENTS(ARG "" "EXT" "LINK_LIBRARIES" ${ARGN}) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/unittest/mytap) @@ -15,7 +15,7 @@ MACRO (MY_ADD_TESTS) SET(ARG_EXT "c") ENDIF() - FOREACH(name ${ARG_DEFAULT_ARGS}) + FOREACH(name ${ARG_UNPARSED_ARGUMENTS}) ADD_EXECUTABLE(${name}-t "${name}-t.${ARG_EXT}") TARGET_LINK_LIBRARIES(${name}-t mytap ${ARG_LINK_LIBRARIES}) MY_ADD_TEST(${name}) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 00edcc737ce..17ee3c61554 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -13,12 +13,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +INCLUDE(CMakeParseArguments) FUNCTION (INSTALL_DEBUG_SYMBOLS) IF(MSVC) - MYSQL_PARSE_ARGUMENTS(ARG + CMAKE_PARSE_ARGUMENTS(ARG + "" "COMPONENT;INSTALL_LOCATION" "" ${ARGN} @@ -30,7 +30,7 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS) IF(NOT ARG_INSTALL_LOCATION) SET(ARG_INSTALL_LOCATION lib) ENDIF() - SET(targets ${ARG_DEFAULT_ARGS}) + SET(targets ${ARG_UNPARSED_ARGUMENTS}) FOREACH(target ${targets}) GET_TARGET_PROPERTY(type ${target} TYPE) GET_TARGET_PROPERTY(location ${target} LOCATION) @@ -109,13 +109,14 @@ FUNCTION(INSTALL_MANPAGE file) ENDFUNCTION() FUNCTION(INSTALL_SCRIPT) - MYSQL_PARSE_ARGUMENTS(ARG + CMAKE_PARSE_ARGUMENTS(ARG + "" "DESTINATION;COMPONENT" "" ${ARGN} ) - SET(script ${ARG_DEFAULT_ARGS}) + SET(script ${ARG_UNPARSED_ARGUMENTS}) IF(NOT ARG_DESTINATION) SET(ARG_DESTINATION ${INSTALL_BINDIR}) ENDIF() @@ -131,8 +132,8 @@ ENDFUNCTION() FUNCTION(INSTALL_DOCUMENTATION) - MYSQL_PARSE_ARGUMENTS(ARG "COMPONENT" "" ${ARGN}) - SET(files ${ARG_DEFAULT_ARGS}) + CMAKE_PARSE_ARGUMENTS(ARG "" "COMPONENT" "" ${ARGN}) + SET(files ${ARG_UNPARSED_ARGUMENTS}) IF(NOT ARG_COMPONENT) SET(ARG_COMPONENT Server) ENDIF() @@ -211,8 +212,8 @@ IF(WIN32) ENDIF() MACRO(SIGN_TARGET) - MYSQL_PARSE_ARGUMENTS(ARG "COMPONENT" "" ${ARGN}) - SET(target ${ARG_DEFAULT_ARGS}) + CMAKE_PARSE_ARGUMENTS(ARG "" "COMPONENT" "" ${ARGN}) + SET(target ${ARG_UNPARSED_ARGUMENTS}) IF(ARG_COMPONENT) SET(comp COMPONENT ${ARG_COMPONENT}) ELSE() @@ -247,8 +248,9 @@ ENDMACRO() # FUNCTION(MYSQL_INSTALL_TARGETS) - MYSQL_PARSE_ARGUMENTS(ARG - "DESTINATION;COMPONENT" + CMAKE_PARSE_ARGUMENTS(ARG + "" + "DESTINATION;COMPONENT" "" ${ARGN} ) @@ -258,7 +260,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS) MESSAGE(FATAL_ERROR "COMPONENT argument required") ENDIF() - SET(TARGETS ${ARG_DEFAULT_ARGS}) + SET(TARGETS ${ARG_UNPARSED_ARGUMENTS}) IF(NOT TARGETS) MESSAGE(FATAL_ERROR "Need target list for MYSQL_INSTALL_TARGETS") ENDIF() @@ -266,10 +268,9 @@ FUNCTION(MYSQL_INSTALL_TARGETS) MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS") ENDIF() - FOREACH(target ${TARGETS}) # If signing is required, sign executables before installing - IF(SIGNCODE) + IF(SIGNCODE) SIGN_TARGET(${target} ${COMP}) ENDIF() # Install man pages on Unix @@ -292,7 +293,8 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug FUNCTION(INSTALL_DEBUG_TARGET target) - MYSQL_PARSE_ARGUMENTS(ARG + CMAKE_PARSE_ARGUMENTS(ARG + "" "DESTINATION;RENAME;PDB_DESTINATION;COMPONENT" "" ${ARGN} diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 5125b9482cd..bcba924dfa8 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -57,7 +57,7 @@ IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LI SET(_SKIP_PIC 1) ENDIF() -INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +INCLUDE(CMakeParseArguments) # CREATE_EXPORT_FILE (VAR target api_functions) # Internal macro, used to create source file for shared libraries that # otherwise consists entirely of "convenience" libraries. On Windows, @@ -218,13 +218,14 @@ ENDMACRO() # [OUTPUT_NAME output_name] #) MACRO(MERGE_LIBRARIES) - MYSQL_PARSE_ARGUMENTS(ARG - "EXPORTS;OUTPUT_NAME;COMPONENT;VERSION;SOVERSION" + CMAKE_PARSE_ARGUMENTS(ARG "STATIC;SHARED;MODULE;NOINSTALL" + "OUTPUT_NAME;COMPONENT;VERSION;SOVERSION" + "EXPORTS" ${ARGN} ) - LIST(GET ARG_DEFAULT_ARGS 0 TARGET) - SET(LIBS ${ARG_DEFAULT_ARGS}) + LIST(GET ARG_UNPARSED_ARGUMENTS 0 TARGET) + SET(LIBS ${ARG_UNPARSED_ARGUMENTS}) LIST(REMOVE_AT LIBS 0) IF(ARG_STATIC) IF (NOT ARG_OUTPUT_NAME) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 367b78afd0d..bb7c8862dc7 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -16,7 +16,7 @@ # Common warning flags for GCC, G++, Clang and Clang++ SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wno-init-self") MY_CHECK_C_COMPILER_FLAG("-Wvla") # Requires GCC 4.3+ or Clang -IF(HAVE_C__Wvla) +IF(have_C__Wvla) SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla") ENDIF() diff --git a/cmake/misc.cmake b/cmake/misc.cmake new file mode 100644 index 00000000000..c87fc41e8e3 --- /dev/null +++ b/cmake/misc.cmake @@ -0,0 +1,6 @@ +FUNCTION(MESSAGE_ONCE id out) + IF(NOT __msg1_${id} STREQUAL "${out}") + MESSAGE(STATUS "${out}") + ENDIF() + SET(__msg1_${id} "${out}" CACHE INTERNAL "") +ENDFUNCTION() diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index 0c93fb179f5..c8027eeea51 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -24,21 +24,37 @@ # - add version resource # - instruct CPack to do autenticode signing if SIGNCODE is set -INCLUDE(cmake_parse_arguments) +INCLUDE(CMakeParseArguments) FUNCTION (MYSQL_ADD_EXECUTABLE) # Pass-through arguments for ADD_EXECUTABLE - MYSQL_PARSE_ARGUMENTS(ARG - "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" + CMAKE_PARSE_ARGUMENTS(ARG + "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL" + "DESTINATION;COMPONENT" "" ${ARGN} ) - LIST(GET ARG_DEFAULT_ARGS 0 target) - LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) + LIST(GET ARG_UNPARSED_ARGUMENTS 0 target) + LIST(REMOVE_AT ARG_UNPARSED_ARGUMENTS 0) - SET(sources ${ARG_DEFAULT_ARGS}) + SET(sources ${ARG_UNPARSED_ARGUMENTS}) ADD_VERSION_INFO(${target} EXECUTABLE sources) - ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) + IF (ARG_WIN32) + SET(WIN32 WIN32) + ELSE() + UNSET(WIN32) + ENDIF() + IF (ARG_MACOSX_BUNDLE) + SET(MACOSX_BUNDLE MACOSX_BUNDLE) + ELSE() + UNSET(MACOSX_BUNDLE) + ENDIF() + IF (ARG_EXCLUDE_FROM_ALL) + SET(EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL) + ELSE() + UNSET(EXCLUDE_FROM_ALL) + ENDIF() + ADD_EXECUTABLE(${target} ${WIN32} ${MACOSX_BUNDLE} ${EXCLUDE_FROM_ALL} ${sources}) # tell CPack where to install IF(NOT ARG_EXCLUDE_FROM_ALL) IF(NOT ARG_DESTINATION) diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 07a8085a411..e8c46c1888a 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -22,8 +22,6 @@ IF(MSVC) SET(BFD_H_EXISTS 0 CACHE INTERNAL "") SET(HAVE_ACCESS 1 CACHE INTERNAL "") -SET(HAVE_AIO_H CACHE INTERNAL "") -SET(HAVE_AIO_READ CACHE INTERNAL "") SET(HAVE_ALARM CACHE INTERNAL "") SET(HAVE_ALLOCA_H CACHE INTERNAL "") SET(HAVE_ARPA_INET_H CACHE INTERNAL "") @@ -32,56 +30,41 @@ SET(HAVE_BACKTRACE CACHE INTERNAL "") SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "") SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "") SET(HAVE_BFILL CACHE INTERNAL "") -SET(HAVE_BMOVE CACHE INTERNAL "") SET(HAVE_BSD_SIGNALS CACHE INTERNAL "") -SET(HAVE_BSEARCH 1 CACHE INTERNAL "") SET(HAVE_BSS_START CACHE INTERNAL "") -SET(HAVE_BZERO CACHE INTERNAL "") -SET(HAVE_CHOWN CACHE INTERNAL "") SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "") SET(HAVE_COMPRESS CACHE INTERNAL "") SET(HAVE_CRYPT CACHE INTERNAL "") SET(HAVE_CRYPT_H CACHE INTERNAL "") SET(HAVE_CUSERID CACHE INTERNAL "") -SET(HAVE_CXX_NEW 1 CACHE INTERNAL "") SET(HAVE_DECL_MADVISE CACHE INTERNAL "") -SET(HAVE_DIRECTIO CACHE INTERNAL "") SET(HAVE_DIRENT_H CACHE INTERNAL "") SET(HAVE_DLERROR CACHE INTERNAL "") SET(HAVE_DLFCN_H CACHE INTERNAL "") SET(HAVE_DLOPEN CACHE INTERNAL "") -SET(HAVE_DOPRNT CACHE INTERNAL "") SET(HAVE_EXECINFO_H CACHE INTERNAL "") SET(HAVE_FCHMOD CACHE INTERNAL "") SET(HAVE_FCNTL CACHE INTERNAL "") SET(HAVE_FCNTL_H 1 CACHE INTERNAL "") SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "") -SET(HAVE_FCONVERT CACHE INTERNAL "") SET(HAVE_FDATASYNC CACHE INTERNAL "") SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "") SET(HAVE_FEDISABLEEXCEPT CACHE INTERNAL "") SET(HAVE_FENV_H CACHE INTERNAL "") SET(HAVE_FESETROUND CACHE INTERNAL "") -SET(HAVE_FGETLN CACHE INTERNAL "") SET(HAVE_FINITE CACHE INTERNAL "") SET(HAVE_FINITE_IN_MATH_H CACHE INTERNAL "") -SET(HAVE_FLOATINGPOINT_H CACHE INTERNAL "") SET(HAVE_FLOAT_H 1 CACHE INTERNAL "") -SET(HAVE_FLOCKFILE CACHE INTERNAL "") SET(HAVE_FNMATCH_H CACHE INTERNAL "") -SET(HAVE_FPSETMASK CACHE INTERNAL "") SET(HAVE_FPU_CONTROL_H CACHE INTERNAL "") SET(HAVE_FSEEKO CACHE INTERNAL "") SET(HAVE_FSYNC CACHE INTERNAL "") SET(HAVE_FTIME 1 CACHE INTERNAL "") SET(HAVE_FTRUNCATE CACHE INTERNAL "") -SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") SET(HAVE_GETIFADDRS CACHE INTERNAL "") SET(HAVE_GETCWD 1 CACHE INTERNAL "") SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") SET(HAVE_GETHRTIME CACHE INTERNAL "") -SET(HAVE_GETLINE CACHE INTERNAL "") -SET(HAVE_GETNAMEINFO CACHE INTERNAL "") SET(HAVE_GETPAGESIZE CACHE INTERNAL "") SET(HAVE_GETPASS CACHE INTERNAL "") SET(HAVE_GETPASSPHRASE CACHE INTERNAL "") @@ -102,18 +85,12 @@ SET(HAVE_IPPROTO_IPV6 CACHE INTERNAL "") SET(HAVE_IPV6 TRUE CACHE INTERNAL "") SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "") SET(HAVE_ISINF CACHE INTERNAL "") -SET(HAVE_ISSETUGID CACHE INTERNAL "") -SET(HAVE_GETUID CACHE INTERNAL "") -SET(HAVE_GETEUID CACHE INTERNAL "") -SET(HAVE_GETGID CACHE INTERNAL "") -SET(HAVE_GETEGID CACHE INTERNAL "") SET(HAVE_LANGINFO_H CACHE INTERNAL "") SET(HAVE_LDIV 1 CACHE INTERNAL "") SET(HAVE_LIMITS_H 1 CACHE INTERNAL "") SET(HAVE_LOCALE_H 1 CACHE INTERNAL "") SET(HAVE_LOCALTIME_R 1 CACHE INTERNAL "") SET(HAVE_LOG2 CACHE INTERNAL "") -SET(HAVE_LONGJMP 1 CACHE INTERNAL "") SET(HAVE_LRAND48 CACHE INTERNAL "") SET(HAVE_LSTAT CACHE INTERNAL "") SET(HAVE_MADVISE CACHE INTERNAL "") @@ -141,8 +118,6 @@ SET(HAVE_PAM_APPL_H CACHE INTERNAL "") SET(HAVE_POLL_H CACHE INTERNAL "") SET(HAVE_POPEN CACHE INTERNAL "") SET(HAVE_POLL CACHE INTERNAL "") -SET(HAVE_PORT_CREATE CACHE INTERNAL "") -SET(HAVE_PORT_H CACHE INTERNAL "") SET(HAVE_POSIX_FALLOCATE CACHE INTERNAL "") SET(HAVE_POSIX_SIGNALS CACHE INTERNAL "") SET(HAVE_PREAD CACHE INTERNAL "") @@ -152,12 +127,10 @@ SET(HAVE_PTHREAD_ATTR_GETSTACKSIZE CACHE INTERNAL "") SET(HAVE_PTHREAD_ATTR_SETSCOPE CACHE INTERNAL "") SET(HAVE_PTHREAD_ATTR_SETSTACKSIZE CACHE INTERNAL "") SET(HAVE_PTHREAD_CONDATTR_CREATE CACHE INTERNAL "") -SET(HAVE_PTHREAD_CONDATTR_SETCLOCK CACHE INTERNAL "") SET(HAVE_PTHREAD_INIT CACHE INTERNAL "") SET(HAVE_PTHREAD_KEY_DELETE CACHE INTERNAL "") SET(HAVE_PTHREAD_RWLOCK_RDLOCK CACHE INTERNAL "") SET(HAVE_PTHREAD_SIGMASK CACHE INTERNAL "") -SET(HAVE_PTHREAD_THREADMASK CACHE INTERNAL "") SET(HAVE_PTHREAD_YIELD_NP CACHE INTERNAL "") SET(HAVE_PTHREAD_YIELD_ZERO_ARG CACHE INTERNAL "") SET(HAVE_PUTENV 1 CACHE INTERNAL "") @@ -167,27 +140,16 @@ SET(HAVE_READDIR_R CACHE INTERNAL "") SET(HAVE_READLINK CACHE INTERNAL "") SET(HAVE_READ_REAL_TIME CACHE INTERNAL "") SET(HAVE_REALPATH CACHE INTERNAL "") -SET(HAVE_REGCOMP CACHE INTERNAL "") SET(HAVE_RENAME 1 CACHE INTERNAL "") -SET(HAVE_RE_COMP CACHE INTERNAL "") SET(HAVE_RINT CACHE INTERNAL "") SET(HAVE_RWLOCK_INIT CACHE INTERNAL "") SET(HAVE_SCHED_H CACHE INTERNAL "") SET(HAVE_SCHED_YIELD CACHE INTERNAL "") SET(HAVE_SELECT 1 CACHE INTERNAL "") SET(HAVE_SELECT_H CACHE INTERNAL "") -SET(HAVE_SEMAPHORE_H CACHE INTERNAL "") SET(HAVE_SETENV CACHE INTERNAL "") -SET(HAVE_SETFD CACHE INTERNAL "") SET(HAVE_SETLOCALE 1 CACHE INTERNAL "") -SET(HAVE_SHMAT CACHE INTERNAL "") -SET(HAVE_SHMCTL CACHE INTERNAL "") -SET(HAVE_SHMDT CACHE INTERNAL "") -SET(HAVE_SHMGET CACHE INTERNAL "") SET(HAVE_SIGACTION CACHE INTERNAL "") -SET(HAVE_SIGADDSET CACHE INTERNAL "") -SET(HAVE_SIGEMPTYSET CACHE INTERNAL "") -SET(HAVE_SIGHOLD CACHE INTERNAL "") SET(HAVE_SIGINT 1 CACHE INTERNAL "") SET(HAVE_SIGPIPE CACHE INTERNAL "") SET(HAVE_SIGQUIT CACHE INTERNAL "") @@ -195,9 +157,6 @@ SET(HAVE_SIGSET CACHE INTERNAL "") SET(HAVE_SIGTERM 1 CACHE INTERNAL "") SET(HAVE_SIGTHREADMASK CACHE INTERNAL "") SET(HAVE_SIGWAIT CACHE INTERNAL "") -SET(HAVE_SIZEOF_BOOL FALSE CACHE INTERNAL "") -SET(HAVE_SIZEOF_CHAR TRUE CACHE INTERNAL "") -SET(SIZEOF_CHAR 1 CACHE INTERNAL "") SET(HAVE_SIZEOF_CHARP TRUE CACHE INTERNAL "") SET(SIZEOF_CHARP ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "") SET(HAVE_SIZEOF_IN6_ADDR TRUE CACHE INTERNAL "") @@ -214,13 +173,10 @@ SET(SIZEOF_LONG_LONG 8 CACHE INTERNAL "") SET(HAVE_SIZEOF_MODE_T FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_OFF_T TRUE CACHE INTERNAL "") SET(SIZEOF_OFF_T 4 CACHE INTERNAL "") -SET(HAVE_SIZEOF_SHORT TRUE CACHE INTERNAL "") -SET(SIZEOF_SHORT 2 CACHE INTERNAL "") SET(HAVE_SIZEOF_SIGSET_T FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_SIZE_T TRUE CACHE INTERNAL "") SET(SIZEOF_SIZE_T ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "") SET(HAVE_SIZEOF_SOCKADDR_IN6 TRUE CACHE INTERNAL "") -SET(HAVE_SIZEOF_SOCKLEN_T FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_UCHAR FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_UINT FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_UINT16 FALSE CACHE INTERNAL "") @@ -228,7 +184,6 @@ SET(HAVE_SIZEOF_UINT32 FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_UINT64 FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_UINT8 FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "") -SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "") SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "") SET(HAVE_SLEEP CACHE INTERNAL "") SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "") @@ -241,30 +196,20 @@ SET(HAVE_STDLIB_H 1 CACHE INTERNAL "") SET(HAVE_STPCPY CACHE INTERNAL "") SET(HAVE_STRCASECMP CACHE INTERNAL "") SET(HAVE_STRCOLL 1 CACHE INTERNAL "") -SET(HAVE_STRDUP 1 CACHE INTERNAL "") SET(HAVE_STRERROR 1 CACHE INTERNAL "") SET(HAVE_STRINGS_H CACHE INTERNAL "") SET(HAVE_STRING_H 1 CACHE INTERNAL "") -SET(HAVE_STRLCAT CACHE INTERNAL "") -SET(HAVE_STRLCPY CACHE INTERNAL "") -SET(HAVE_STRNCASECMP CACHE INTERNAL "") SET(HAVE_STRNDUP CACHE INTERNAL "") IF(MSVC_VERSION GREATER 1310) SET(HAVE_STRNLEN 1 CACHE INTERNAL "") ENDIF() SET(HAVE_STRPBRK 1 CACHE INTERNAL "") -SET(HAVE_STRSEP CACHE INTERNAL "") -SET(HAVE_STRSIGNAL CACHE INTERNAL "") -SET(HAVE_STRSTR 1 CACHE INTERNAL "") SET(HAVE_STRTOK_R CACHE INTERNAL "") -SET(HAVE_STRTOL 1 CACHE INTERNAL "") SET(HAVE_STRTOLL CACHE INTERNAL "") SET(HAVE_STRTOUL 1 CACHE INTERNAL "") SET(HAVE_STRTOULL CACHE INTERNAL "") -SET(HAVE_SVR3_SIGNALS CACHE INTERNAL "") SET(HAVE_SYNCH_H CACHE INTERNAL "") SET(HAVE_SYSENT_H CACHE INTERNAL "") -SET(HAVE_SYS_CDEFS_H CACHE INTERNAL "") SET(HAVE_SYS_DIR_H CACHE INTERNAL "") SET(HAVE_SYS_EVENT_H CACHE INTERNAL "") SET(HAVE_SYS_ERRLIST CACHE INTERNAL "") @@ -285,7 +230,6 @@ SET(HAVE_SYS_SOCKIO_H CACHE INTERNAL "") SET(HAVE_SYS_SOCKET_H CACHE INTERNAL "") SET(HAVE_SYS_STAT_H 1 CACHE INTERNAL "") SET(HAVE_SYS_STREAM_H CACHE INTERNAL "") -SET(HAVE_SYS_TERMCAP_H CACHE INTERNAL "") SET(HAVE_SYS_TIMEB_H 1 CACHE INTERNAL "") SET(HAVE_SYS_TIMES_H CACHE INTERNAL "") SET(HAVE_SYS_TIME_H CACHE INTERNAL "") @@ -310,10 +254,8 @@ SET(HAVE_TIME_H 1 CACHE INTERNAL "") SET(HAVE_TZNAME 1 CACHE INTERNAL "") SET(HAVE_UNISTD_H CACHE INTERNAL "") SET(HAVE_UTIME_H CACHE INTERNAL "") -SET(HAVE_VALLOC CACHE INTERNAL "") SET(HAVE_VARARGS_H 1 CACHE INTERNAL "") SET(HAVE_VASPRINTF CACHE INTERNAL "") -SET(HAVE_VPRINTF 1 CACHE INTERNAL "") IF(MSVC_VERSION GREATER 1310) SET(HAVE_VSNPRINTF 1 CACHE INTERNAL "") ENDIF() @@ -334,9 +276,6 @@ IF(MSVC_VERSION GREATER 1310) SET(HAVE_strtok_s 1 CACHE INTERNAL "") ENDIF() SET(STDC_HEADERS CACHE 1 INTERNAL "") -SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") -SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") -SET(STRUCT_DIRENT_HAS_D_NAMLEN CACHE INTERNAL "") SET(TIME_WITH_SYS_TIME CACHE INTERNAL "") SET(TIME_T_UNSIGNED 1 CACHE INTERNAL "") SET(TIOCSTAT_IN_SYS_IOCTL CACHE INTERNAL "") @@ -354,18 +293,16 @@ SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") SET(HAVE_ASM_TERMBITS_H CACHE INTERNAL "") SET(HAVE_TERMBITS_H CACHE INTERNAL "") -SET(HAVE_VIS_H CACHE INTERNAL "") SET(HAVE_WCHAR_H 1 CACHE INTERNAL "") SET(HAVE_WCTYPE_H 1 CACHE INTERNAL "") SET(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP CACHE INTERNAL "") SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "") SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "") -SET(HAVE_VALGRIND CACHE INTERNAL "") +SET(HAVE_VALGRIND_MEMCHECK_H CACHE INTERNAL "") SET(HAVE_EVENT_H CACHE INTERNAL "") SET(HAVE_LINUX_UNISTD_H CACHE INTERNAL "") SET(HAVE_SYS_UTSNAME_H CACHE INTERNAL "") SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "") -SET(HAVE_UCONTEXT_H CACHE INTERNAL "") SET(HAVE_SOCKPEERCRED CACHE INTERNAL "") SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "") SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "") diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index cd02bcfc4be..8bc9df973c0 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -14,8 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +INCLUDE(CMakeParseArguments) # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN # [STORAGE_ENGINE] @@ -29,9 +28,10 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) # [DEPENDENCIES target1...targetN] MACRO(MYSQL_ADD_PLUGIN) - MYSQL_PARSE_ARGUMENTS(ARG - "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" + CMAKE_PARSE_ARGUMENTS(ARG "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT" + "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" + "LINK_LIBRARIES;DEPENDENCIES" ${ARGN} ) @@ -42,8 +42,8 @@ MACRO(MYSQL_ADD_PLUGIN) ${SSL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - LIST(GET ARG_DEFAULT_ARGS 0 plugin) - SET(SOURCES ${ARG_DEFAULT_ARGS}) + LIST(GET ARG_UNPARSED_ARGUMENTS 0 plugin) + SET(SOURCES ${ARG_UNPARSED_ARGUMENTS}) LIST(REMOVE_AT SOURCES 0) STRING(TOUPPER ${plugin} plugin) STRING(TOLOWER ${plugin} target) diff --git a/cmake/readline.cmake b/cmake/readline.cmake index f570c91c1b5..1bd669fd605 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -27,25 +27,11 @@ MACRO (MYSQL_CHECK_MULTIBYTE) SET(HAVE_MBSTATE_T 1) ENDIF() ENDIF() - - CHECK_C_SOURCE_COMPILES(" - #include <langinfo.h> - int main(int ac, char **av) - { - char *cs = nl_langinfo(CODESET); - return 0; - }" - HAVE_LANGINFO_CODESET) CHECK_FUNCTION_EXISTS(mbrlen HAVE_MBRLEN) - CHECK_FUNCTION_EXISTS(mbscmp HAVE_MBSCMP) CHECK_FUNCTION_EXISTS(mbsrtowcs HAVE_MBSRTOWCS) - CHECK_FUNCTION_EXISTS(wcrtomb HAVE_WCRTOMB) CHECK_FUNCTION_EXISTS(mbrtowc HAVE_MBRTOWC) - CHECK_FUNCTION_EXISTS(wcscoll HAVE_WCSCOLL) - CHECK_FUNCTION_EXISTS(wcsdup HAVE_WCSDUP) CHECK_FUNCTION_EXISTS(wcwidth HAVE_WCWIDTH) - CHECK_FUNCTION_EXISTS(wctype HAVE_WCTYPE) CHECK_FUNCTION_EXISTS(iswlower HAVE_ISWLOWER) CHECK_FUNCTION_EXISTS(iswupper HAVE_ISWUPPER) CHECK_FUNCTION_EXISTS(towlower HAVE_TOWLOWER) @@ -60,13 +46,7 @@ MACRO (MYSQL_CHECK_MULTIBYTE) SET(CMAKE_EXTRA_INCLUDE_FILES wctype.h) CHECK_TYPE_SIZE(wctype_t SIZEOF_WCTYPE_T) - IF(SIZEOF_WCTYPE_T) - SET(HAVE_WCTYPE_T 1) - ENDIF() CHECK_TYPE_SIZE(wint_t SIZEOF_WINT_T) - IF(SIZEOF_WINT_T) - SET(HAVE_WINT_T 1) - ENDIF() SET(CMAKE_EXTRA_INCLUDE_FILES) ENDMACRO() @@ -87,15 +67,12 @@ MACRO (FIND_CURSES) IF(CURSES_HAVE_CURSES_H) SET(HAVE_CURSES_H 1 CACHE INTERNAL "") - ELSEIF(CURSES_HAVE_NCURSES_H) - SET(HAVE_NCURSES_H 1 CACHE INTERNAL "") ENDIF() IF(CMAKE_SYSTEM_NAME MATCHES "HP") # CMake uses full path to library /lib/libcurses.sl # On Itanium, it results into architecture mismatch+ # the library is for PA-RISC SET(CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE) - SET(CURSES_CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE) ENDIF() IF(CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index b699a3b493f..0173cf026f1 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -70,6 +70,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL) SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file}) ENDFOREACH() + MESSAGE_ONCE(SSL_LIBRARIES "SSL_LIBRARIES = ${SSL_LIBRARIES}") ENDMACRO() # MYSQL_CHECK_SSL @@ -140,7 +141,7 @@ MACRO (MYSQL_CHECK_SSL) NAMES openssl/applink.c HINTS ${OPENSSL_ROOT_DIR}/include ) - MESSAGE(STATUS "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}") + MESSAGE_ONCE(OPENSSL_APPLINK_C "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}") ENDIF() # On mac this list is <.dylib;.so;.a> @@ -187,12 +188,11 @@ MACRO (MYSQL_CHECK_SSL) "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" ) - - MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") - MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}") - MESSAGE(STATUS "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}") - MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}") - MESSAGE(STATUS "SSL_LIBRARIES = ${SSL_LIBRARIES}") + MESSAGE_ONCE(OPENSSL_INCLUDE_DIR "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") + MESSAGE_ONCE(OPENSSL_LIBRARIES "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}") + MESSAGE_ONCE(CRYPTO_LIBRARY "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}") + MESSAGE_ONCE(OPENSSL_MAJOR_VERSION "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}") + MESSAGE_ONCE(SSL_LIBRARIES "SSL_LIBRARIES = ${SSL_LIBRARIES}") SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) SET(SSL_INTERNAL_INCLUDE_DIRS "") SET(SSL_DEFINES "-DHAVE_OPENSSL") diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index b0161cf9114..e6094c7c5bc 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -65,7 +65,7 @@ MACRO(CHECK_SYSTEMD) SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start") ENDIF() - MESSAGE(STATUS "Systemd features enabled") + MESSAGE_ONCE(systemd "Systemd features enabled") ELSE() UNSET(LIBSYSTEMD) UNSET(HAVE_SYSTEMD) @@ -73,7 +73,7 @@ MACRO(CHECK_SYSTEMD) UNSET(HAVE_SYSTEMD_SD_LISTEN_FDS) UNSET(HAVE_SYSTEMD_SD_NOTIFY) UNSET(HAVE_SYSTEMD_SD_NOTIFYF) - MESSAGE(STATUS "Systemd features not enabled") + MESSAGE_ONCE(systemd "Systemd features not enabled") IF(WITH_SYSTEMD STREQUAL "yes") MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=YES however no dependencies installed/found") ENDIF() diff --git a/config.h.cmake b/config.h.cmake index ce6f14723b8..43c8f735ff5 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -20,15 +20,12 @@ #cmakedefine STDC_HEADERS 1 #cmakedefine _GNU_SOURCE 1 #cmakedefine HAVE_ALLOCA_H 1 -#cmakedefine HAVE_AIO_H 1 #cmakedefine HAVE_ARPA_INET_H 1 #cmakedefine HAVE_ASM_MSR_H 1 #cmakedefine HAVE_ASM_TERMBITS_H 1 -#cmakedefine HAVE_BSEARCH 1 #cmakedefine HAVE_CRYPT_H 1 #cmakedefine HAVE_CURSES_H 1 #cmakedefine HAVE_BFD_H 1 -#cmakedefine HAVE_NCURSES_H 1 #cmakedefine HAVE_NDIR_H 1 #cmakedefine HAVE_DIRENT_H 1 #cmakedefine HAVE_DLFCN_H 1 @@ -36,7 +33,6 @@ #cmakedefine HAVE_FCNTL_H 1 #cmakedefine HAVE_FENV_H 1 #cmakedefine HAVE_FLOAT_H 1 -#cmakedefine HAVE_FLOATINGPOINT_H 1 #cmakedefine HAVE_FNMATCH_H 1 #cmakedefine HAVE_FPU_CONTROL_H 1 #cmakedefine HAVE_GRP_H 1 @@ -53,7 +49,6 @@ #cmakedefine HAVE_NETINET_IN_H 1 #cmakedefine HAVE_PATHS_H 1 #cmakedefine HAVE_POLL_H 1 -#cmakedefine HAVE_PORT_H 1 #cmakedefine HAVE_PWD_H 1 #cmakedefine HAVE_SCHED_H 1 #cmakedefine HAVE_SELECT_H 1 @@ -64,11 +59,9 @@ #cmakedefine HAVE_STRINGS_H 1 #cmakedefine HAVE_STRING_H 1 #cmakedefine HAVE_STDINT_H 1 -#cmakedefine HAVE_SEMAPHORE_H 1 #cmakedefine HAVE_SYNCH_H 1 #cmakedefine HAVE_SYSENT_H 1 #cmakedefine HAVE_SYS_DIR_H 1 -#cmakedefine HAVE_SYS_CDEFS_H 1 #cmakedefine HAVE_SYS_FILE_H 1 #cmakedefine HAVE_SYS_FPU_H 1 #cmakedefine HAVE_SYS_IOCTL_H 1 @@ -88,7 +81,6 @@ #cmakedefine HAVE_SYS_STAT_H 1 #cmakedefine HAVE_SYS_STREAM_H 1 #cmakedefine HAVE_SYS_SYSCALL_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 @@ -106,20 +98,11 @@ #cmakedefine HAVE_UNISTD_H 1 #cmakedefine HAVE_UTIME_H 1 #cmakedefine HAVE_VARARGS_H 1 -#cmakedefine HAVE_VIS_H 1 #cmakedefine HAVE_SYS_UTIME_H 1 #cmakedefine HAVE_SYS_WAIT_H 1 #cmakedefine HAVE_SYS_PARAM_H 1 /* Libraries */ -#cmakedefine HAVE_LIBPTHREAD 1 -#cmakedefine HAVE_LIBM 1 -#cmakedefine HAVE_LIBDL 1 -#cmakedefine HAVE_LIBRT 1 -#cmakedefine HAVE_LIBSOCKET 1 -#cmakedefine HAVE_LIBNSL 1 -#cmakedefine HAVE_LIBCRYPT 1 -#cmakedefine HAVE_LIBMTMALLOC 1 #cmakedefine HAVE_LIBWRAP 1 #cmakedefine HAVE_SYSTEMD 1 /* Does "struct timespec" have a "sec" and "nsec" field? */ @@ -136,43 +119,33 @@ #cmakedefine FIONREAD_IN_SYS_FILIO 1 /* Functions we may want to use. */ +#cmakedefine HAVE_ACCEPT4 1 #cmakedefine HAVE_ACCESS 1 #cmakedefine HAVE_AIOWAIT 1 #cmakedefine HAVE_ALARM 1 #cmakedefine HAVE_ALLOCA 1 #cmakedefine HAVE_BFILL 1 -#cmakedefine HAVE_BMOVE 1 -#cmakedefine HAVE_BZERO 1 #cmakedefine HAVE_INDEX 1 -#cmakedefine HAVE_CHOWN 1 #cmakedefine HAVE_CLOCK_GETTIME 1 #cmakedefine HAVE_CRYPT 1 #cmakedefine HAVE_CUSERID 1 -#cmakedefine HAVE_CXX_NEW 1 -#cmakedefine HAVE_DIRECTIO 1 #cmakedefine HAVE_DLERROR 1 #cmakedefine HAVE_DLOPEN 1 -#cmakedefine HAVE_DOPRNT 1 #cmakedefine HAVE_FCHMOD 1 #cmakedefine HAVE_FCNTL 1 -#cmakedefine HAVE_FCONVERT 1 #cmakedefine HAVE_FDATASYNC 1 #cmakedefine HAVE_DECL_FDATASYNC 1 #cmakedefine HAVE_FEDISABLEEXCEPT 1 #cmakedefine HAVE_FESETROUND 1 #cmakedefine HAVE_FINITE 1 #cmakedefine HAVE_FP_EXCEPT 1 -#cmakedefine HAVE_FPSETMASK 1 #cmakedefine HAVE_FSEEKO 1 #cmakedefine HAVE_FSYNC 1 #cmakedefine HAVE_FTIME 1 -#cmakedefine HAVE_GETADDRINFO 1 #cmakedefine HAVE_GETIFADDRS 1 #cmakedefine HAVE_GETCWD 1 #cmakedefine HAVE_GETHOSTBYADDR_R 1 #cmakedefine HAVE_GETHRTIME 1 -#cmakedefine HAVE_GETLINE 1 -#cmakedefine HAVE_GETNAMEINFO 1 #cmakedefine HAVE_GETPAGESIZE 1 #cmakedefine HAVE_GETPASS 1 #cmakedefine HAVE_GETPASSPHRASE 1 @@ -186,11 +159,6 @@ #cmakedefine gmtime_r @gmtime_r@ #cmakedefine HAVE_IN_ADDR_T 1 #cmakedefine HAVE_INITGROUPS 1 -#cmakedefine HAVE_ISSETUGID 1 -#cmakedefine HAVE_GETUID 1 -#cmakedefine HAVE_GETEUID 1 -#cmakedefine HAVE_GETGID 1 -#cmakedefine HAVE_GETEGID 1 #cmakedefine HAVE_ISNAN 1 #cmakedefine HAVE_ISINF 1 #cmakedefine HAVE_LARGE_PAGE_OPTION 1 @@ -198,7 +166,6 @@ #cmakedefine HAVE_LRAND48 1 #cmakedefine HAVE_LOCALTIME_R 1 #cmakedefine HAVE_LOG2 1 -#cmakedefine HAVE_LONGJMP 1 #cmakedefine HAVE_LSTAT 1 #cmakedefine HAVE_MEMALIGN 1 /* #cmakedefine HAVE_MLOCK 1 see Bug#54662 */ @@ -206,7 +173,6 @@ #cmakedefine HAVE_NL_LANGINFO 1 #cmakedefine HAVE_MADVISE 1 #cmakedefine HAVE_DECL_MADVISE 1 -#cmakedefine HAVE_DECL_TGOTO 1 #cmakedefine HAVE_DECL_MHA_MAPSIZE_VA 1 #cmakedefine HAVE_MALLINFO 1 #cmakedefine HAVE_MEMCPY 1 @@ -217,10 +183,8 @@ #cmakedefine HAVE_MMAP64 1 #cmakedefine HAVE_PERROR 1 #cmakedefine HAVE_POLL 1 -#cmakedefine HAVE_PORT_CREATE 1 #cmakedefine HAVE_POSIX_FALLOCATE 1 #cmakedefine HAVE_LINUX_FALLOC_H 1 -#cmakedefine HAVE_FALLOCATE 1 #cmakedefine HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE 1 #cmakedefine HAVE_PREAD 1 #cmakedefine HAVE_PAUSE_INSTRUCTION 1 @@ -230,26 +194,17 @@ #cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 #cmakedefine HAVE_PTHREAD_ATTR_GETGUARDSIZE 1 #cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 -#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1 -#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1 -#cmakedefine HAVE_PTHREAD_CONDATTR_SETCLOCK 1 -#cmakedefine HAVE_PTHREAD_KEY_DELETE 1 #cmakedefine HAVE_PTHREAD_KEY_DELETE 1 #cmakedefine HAVE_PTHREAD_KILL 1 #cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1 -#cmakedefine HAVE_PTHREAD_SETPRIO_NP 1 -#cmakedefine HAVE_PTHREAD_SETSCHEDPARAM 1 #cmakedefine HAVE_PTHREAD_SIGMASK 1 -#cmakedefine HAVE_PTHREAD_THREADMASK 1 #cmakedefine HAVE_PTHREAD_YIELD_NP 1 #cmakedefine HAVE_PTHREAD_YIELD_ZERO_ARG 1 #cmakedefine PTHREAD_ONCE_INITIALIZER @PTHREAD_ONCE_INITIALIZER@ #cmakedefine HAVE_PUTENV 1 -#cmakedefine HAVE_RE_COMP 1 -#cmakedefine HAVE_REGCOMP 1 #cmakedefine HAVE_READDIR_R 1 #cmakedefine HAVE_READLINK 1 #cmakedefine HAVE_REALPATH 1 @@ -258,15 +213,10 @@ #cmakedefine HAVE_RWLOCK_INIT 1 #cmakedefine HAVE_SCHED_YIELD 1 #cmakedefine HAVE_SELECT 1 -#cmakedefine HAVE_SETFD 1 #cmakedefine HAVE_SETENV 1 #cmakedefine HAVE_SETLOCALE 1 #cmakedefine HAVE_SETUPTERM 1 -#cmakedefine HAVE_SIGADDSET 1 -#cmakedefine HAVE_SIGEMPTYSET 1 -#cmakedefine HAVE_SIGHOLD 1 #cmakedefine HAVE_SIGSET 1 -#cmakedefine HAVE_SIGSET_T 1 #cmakedefine HAVE_SIGACTION 1 #cmakedefine HAVE_SIGTHREADMASK 1 #cmakedefine HAVE_SIGWAIT 1 @@ -275,38 +225,26 @@ #cmakedefine HAVE_STPCPY 1 #cmakedefine HAVE_STRERROR 1 #cmakedefine HAVE_STRCOLL 1 -#cmakedefine HAVE_STRSIGNAL 1 -#cmakedefine HAVE_STRLCPY 1 -#cmakedefine HAVE_STRLCAT 1 -#cmakedefine HAVE_FGETLN 1 #cmakedefine HAVE_STRNLEN 1 #cmakedefine HAVE_STRPBRK 1 -#cmakedefine HAVE_STRSEP 1 -#cmakedefine HAVE_STRSTR 1 #cmakedefine HAVE_STRTOK_R 1 -#cmakedefine HAVE_STRTOL 1 #cmakedefine HAVE_STRTOLL 1 #cmakedefine HAVE_STRTOUL 1 #cmakedefine HAVE_STRTOULL 1 -#cmakedefine HAVE_SHMAT 1 -#cmakedefine HAVE_SHMCTL 1 -#cmakedefine HAVE_SHMDT 1 -#cmakedefine HAVE_SHMGET 1 #cmakedefine HAVE_TELL 1 #cmakedefine HAVE_TEMPNAM 1 #cmakedefine HAVE_THR_SETCONCURRENCY 1 #cmakedefine HAVE_THR_YIELD 1 #cmakedefine HAVE_TIME 1 #cmakedefine HAVE_TIMES 1 +#cmakedefine HAVE_UCONTEXT 1 #cmakedefine HAVE_VALLOC 1 #cmakedefine HAVE_VIDATTR 1 #define HAVE_VIO_READ_BUFF 1 #cmakedefine HAVE_VASPRINTF 1 -#cmakedefine HAVE_VPRINTF 1 #cmakedefine HAVE_VSNPRINTF 1 #cmakedefine HAVE_FTRUNCATE 1 #cmakedefine HAVE_TZNAME 1 -#cmakedefine HAVE_AIO_READ 1 /* Symbols we may use */ #cmakedefine HAVE_SYS_ERRLIST 1 /* used by stacktrace functions */ @@ -315,25 +253,18 @@ #cmakedefine HAVE_BACKTRACE_SYMBOLS 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1 #cmakedefine HAVE_PRINTSTACK 1 -#cmakedefine HAVE_STRUCT_SOCKADDR_IN6 1 -#cmakedefine HAVE_STRUCT_IN6_ADDR 1 -#cmakedefine HAVE_NETINET_IN6_H 1 #cmakedefine HAVE_IPV6 1 #cmakedefine ss_family @ss_family@ #cmakedefine HAVE_SOCKADDR_IN_SIN_LEN 1 #cmakedefine HAVE_SOCKADDR_IN6_SIN6_LEN 1 -#cmakedefine HAVE_TIMESPEC_TS_SEC 1 -#cmakedefine STRUCT_DIRENT_HAS_D_INO 1 -#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1 #cmakedefine STRUCT_TIMESPEC_HAS_TV_SEC 1 #cmakedefine STRUCT_TIMESPEC_HAS_TV_NSEC 1 -#cmakedefine SPRINTF_RETURNS_INT 1 #define USE_MB 1 #define USE_MB_IDENT 1 /* this means that valgrind headers and macros are available */ -#cmakedefine HAVE_VALGRIND 1 +#cmakedefine HAVE_VALGRIND_MEMCHECK_H 1 /* this means WITH_VALGRIND - we change some code paths for valgrind */ #cmakedefine HAVE_valgrind 1 @@ -360,21 +291,14 @@ #cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ #endif -#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ -#define HAVE_CHAR 1 #define HAVE_LONG 1 #define HAVE_CHARP 1 -#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ -#define HAVE_SHORT 1 #cmakedefine SIZEOF_INT @SIZEOF_INT@ #define HAVE_INT 1 #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ #cmakedefine HAVE_LONG_LONG 1 #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ #cmakedefine HAVE_OFF_T 1 -#cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ -#cmakedefine HAVE_SIGSET_T 1 -#cmakedefine HAVE_SIZE_T 1 #cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ #cmakedefine HAVE_UCHAR 1 #cmakedefine SIZEOF_UINT @SIZEOF_UINT@ @@ -393,14 +317,10 @@ #cmakedefine HAVE_INT32 1 #cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@ #cmakedefine HAVE_UINT32 1 -#cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@ -#cmakedefine HAVE_U_INT32_T 1 #cmakedefine SIZEOF_INT64 @SIZEOF_INT64@ #cmakedefine HAVE_INT64 1 #cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@ #cmakedefine HAVE_UINT64 1 -#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ -#cmakedefine HAVE_BOOL 1 #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ @@ -411,7 +331,6 @@ #cmakedefine QSORT_TYPE_IS_VOID 1 #cmakedefine RETQSORTTYPE @RETQSORTTYPE@ -#cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1 #cmakedefine RETSIGTYPE @RETSIGTYPE@ #cmakedefine VOID_SIGHANDLER 1 #cmakedefine HAVE_SIGHANDLER_T 1 @@ -441,30 +360,19 @@ #cmakedefine HAVE_WCHAR_H 1 #cmakedefine HAVE_LANGINFO_H 1 #cmakedefine HAVE_MBRLEN 1 -#cmakedefine HAVE_MBSCMP 1 #cmakedefine HAVE_MBSRTOWCS 1 -#cmakedefine HAVE_WCRTOMB 1 #cmakedefine HAVE_MBRTOWC 1 -#cmakedefine HAVE_WCSCOLL 1 -#cmakedefine HAVE_WCSDUP 1 #cmakedefine HAVE_WCWIDTH 1 -#cmakedefine HAVE_WCTYPE 1 #cmakedefine HAVE_ISWLOWER 1 #cmakedefine HAVE_ISWUPPER 1 #cmakedefine HAVE_TOWLOWER 1 #cmakedefine HAVE_TOWUPPER 1 #cmakedefine HAVE_ISWCTYPE 1 #cmakedefine HAVE_WCHAR_T 1 -#cmakedefine HAVE_WCTYPE_T 1 -#cmakedefine HAVE_WINT_T 1 #cmakedefine HAVE_STRCASECMP 1 -#cmakedefine HAVE_STRNCASECMP 1 -#cmakedefine HAVE_STRDUP 1 -#cmakedefine HAVE_LANGINFO_CODESET 1 #cmakedefine HAVE_TCGETATTR 1 -#cmakedefine HAVE_FLOCKFILE 1 #cmakedefine HAVE_WEAK_SYMBOL 1 #cmakedefine HAVE_ABI_CXA_DEMANGLE 1 @@ -472,6 +380,7 @@ #cmakedefine HAVE_POSIX_SIGNALS 1 #cmakedefine HAVE_BSD_SIGNALS 1 + #cmakedefine HAVE_SVR3_SIGNALS 1 #cmakedefine HAVE_V7_SIGNALS 1 #cmakedefine HAVE_ERR_remove_thread_state 1 @@ -546,7 +455,6 @@ #cmakedefine ENABLED_LOCAL_INFILE 1 #cmakedefine ENABLED_PROFILING 1 #cmakedefine EXTRA_DEBUG 1 -#cmakedefine CYBOZU 1 #cmakedefine USE_SYMDIR 1 /* Character sets and collations */ @@ -555,7 +463,6 @@ #cmakedefine USE_MB 1 #cmakedefine USE_MB_IDENT 1 -#cmakedefine USE_STRCOLL 1 /* This should mean case insensitive file system */ #cmakedefine FN_NO_CASE_SENSE 1 @@ -616,12 +523,8 @@ Important storage engines (those that really need define WITH_<ENGINE>_STORAGE_ENGINE for the whole server) */ -#cmakedefine WITH_MYISAM_STORAGE_ENGINE 1 -#cmakedefine WITH_MYISAMMRG_STORAGE_ENGINE 1 -#cmakedefine WITH_HEAP_STORAGE_ENGINE 1 #cmakedefine WITH_INNOBASE_STORAGE_ENGINE 1 #cmakedefine WITH_XTRADB_STORAGE_ENGINE 1 -#cmakedefine WITH_CSV_STORAGE_ENGINE 1 #cmakedefine WITH_PARTITION_STORAGE_ENGINE 1 #cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1 #cmakedefine WITH_ARIA_STORAGE_ENGINE 1 diff --git a/configure.cmake b/configure.cmake index 203f49c1a0d..b0c2a07ced1 100644 --- a/configure.cmake +++ b/configure.cmake @@ -172,7 +172,6 @@ INCLUDE (CheckIncludeFileCXX) CHECK_INCLUDE_FILES ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H) 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 (dirent.h HAVE_DIRENT_H) @@ -181,7 +180,6 @@ CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H) CHECK_INCLUDE_FILES (fenv.h HAVE_FENV_H) CHECK_INCLUDE_FILES (float.h HAVE_FLOAT_H) -CHECK_INCLUDE_FILES (floatingpoint.h HAVE_FLOATINGPOINT_H) CHECK_INCLUDE_FILES (fpu_control.h HAVE_FPU_CONTROL_H) CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H) CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H) @@ -197,12 +195,10 @@ CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H) CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H) CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H) CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H) -CHECK_INCLUDE_FILES (port.h HAVE_PORT_H) CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H) CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H) CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H) CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) -CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H) CHECK_INCLUDE_FILES ("sys/types.h;sys/dir.h" HAVE_SYS_DIR_H) CHECK_INCLUDE_FILES ("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) CHECK_INCLUDE_FILES (sys/ndir.h HAVE_SYS_NDIR_H) @@ -214,7 +210,6 @@ CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILES (string.h HAVE_STRING_H) CHECK_INCLUDE_FILES (synch.h HAVE_SYNCH_H) CHECK_INCLUDE_FILES (sysent.h HAVE_SYSENT_H) -CHECK_INCLUDE_FILES (sys/cdefs.h HAVE_SYS_CDEFS_H) CHECK_INCLUDE_FILES (sys/file.h HAVE_SYS_FILE_H) CHECK_INCLUDE_FILES (sys/fpu.h HAVE_SYS_FPU_H) CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H) @@ -229,7 +224,6 @@ CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H) CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H) CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H) CHECK_INCLUDE_FILES (sys/syscall.h HAVE_SYS_SYSCALL_H) -CHECK_INCLUDE_FILES (sys/termcap.h HAVE_SYS_TERMCAP_H) CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H) CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H) CHECK_INCLUDE_FILES (termbits.h HAVE_TERMBITS_H) @@ -247,7 +241,6 @@ CHECK_INCLUDE_FILES (sys/vadvise.h HAVE_SYS_VADVISE_H) 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) -CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H) CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H) @@ -276,7 +269,7 @@ FIND_PACKAGE (Threads) FUNCTION(MY_CHECK_PTHREAD_ONCE_INIT) MY_CHECK_C_COMPILER_FLAG("-Werror") - IF(NOT HAVE_C__Werror) + IF(NOT have_C__Werror) RETURN() ENDIF() SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") @@ -323,7 +316,6 @@ ENDIF() CHECK_FUNCTION_EXISTS (accept4 HAVE_ACCEPT4) CHECK_FUNCTION_EXISTS (access HAVE_ACCESS) #CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT) -CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ) CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM) SET(HAVE_ALLOCA 1) CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE) @@ -331,35 +323,25 @@ 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 (bfill HAVE_BFILL) -CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE) -CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH) CHECK_FUNCTION_EXISTS (index HAVE_INDEX) -CHECK_FUNCTION_EXISTS (bzero HAVE_BZERO) CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME) CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID) -CHECK_FUNCTION_EXISTS (directio HAVE_DIRECTIO) -CHECK_FUNCTION_EXISTS (_doprnt HAVE_DOPRNT) -CHECK_FUNCTION_EXISTS (flockfile HAVE_FLOCKFILE) CHECK_FUNCTION_EXISTS (ftruncate HAVE_FTRUNCATE) -CHECK_FUNCTION_EXISTS (getline HAVE_GETLINE) CHECK_FUNCTION_EXISTS (compress HAVE_COMPRESS) CHECK_FUNCTION_EXISTS (crypt HAVE_CRYPT) CHECK_FUNCTION_EXISTS (dlerror HAVE_DLERROR) CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN) CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD) CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL) -CHECK_FUNCTION_EXISTS (fconvert HAVE_FCONVERT) CHECK_FUNCTION_EXISTS (fdatasync HAVE_FDATASYNC) CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_DECL_FDATASYNC) CHECK_FUNCTION_EXISTS (fesetround HAVE_FESETROUND) CHECK_FUNCTION_EXISTS (fedisableexcept HAVE_FEDISABLEEXCEPT) -CHECK_FUNCTION_EXISTS (fpsetmask HAVE_FPSETMASK) CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC) CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD) CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R) CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME) -CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO) CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS) CHECK_FUNCTION_EXISTS (getpassphrase HAVE_GETPASSPHRASE) CHECK_FUNCTION_EXISTS (getpwnam HAVE_GETPWNAM) @@ -370,14 +352,8 @@ CHECK_FUNCTION_EXISTS (getrusage HAVE_GETRUSAGE) CHECK_FUNCTION_EXISTS (getwd HAVE_GETWD) CHECK_FUNCTION_EXISTS (gmtime_r HAVE_GMTIME_R) CHECK_FUNCTION_EXISTS (initgroups HAVE_INITGROUPS) -CHECK_FUNCTION_EXISTS (issetugid HAVE_ISSETUGID) -CHECK_FUNCTION_EXISTS (getuid HAVE_GETUID) -CHECK_FUNCTION_EXISTS (geteuid HAVE_GETEUID) -CHECK_FUNCTION_EXISTS (getgid HAVE_GETGID) -CHECK_FUNCTION_EXISTS (getegid HAVE_GETEGID) CHECK_FUNCTION_EXISTS (ldiv HAVE_LDIV) CHECK_FUNCTION_EXISTS (localtime_r HAVE_LOCALTIME_R) -CHECK_FUNCTION_EXISTS (longjmp HAVE_LONGJMP) CHECK_FUNCTION_EXISTS (lstat HAVE_LSTAT) CHECK_FUNCTION_EXISTS (madvise HAVE_MADVISE) CHECK_FUNCTION_EXISTS (mallinfo HAVE_MALLINFO) @@ -390,9 +366,7 @@ CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP) CHECK_FUNCTION_EXISTS (mmap64 HAVE_MMAP64) CHECK_FUNCTION_EXISTS (perror HAVE_PERROR) CHECK_FUNCTION_EXISTS (poll HAVE_POLL) -CHECK_FUNCTION_EXISTS (port_create HAVE_PORT_CREATE) CHECK_FUNCTION_EXISTS (posix_fallocate HAVE_POSIX_FALLOCATE) -CHECK_FUNCTION_EXISTS (fallocate HAVE_FALLOCATE) CHECK_FUNCTION_EXISTS (pread HAVE_PREAD) CHECK_FUNCTION_EXISTS (pthread_attr_create HAVE_PTHREAD_ATTR_CREATE) CHECK_FUNCTION_EXISTS (pthread_attr_getstacksize HAVE_PTHREAD_ATTR_GETSTACKSIZE) @@ -400,65 +374,42 @@ CHECK_FUNCTION_EXISTS (pthread_attr_setscope HAVE_PTHREAD_ATTR_SETSCOPE) CHECK_FUNCTION_EXISTS (pthread_attr_getguardsize HAVE_PTHREAD_ATTR_GETGUARDSIZE) CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE) CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE) -CHECK_FUNCTION_EXISTS (pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK) CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE) CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK) CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK) -CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK) CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP) CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV) CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R) CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK) -CHECK_FUNCTION_EXISTS (re_comp HAVE_RE_COMP) -CHECK_FUNCTION_EXISTS (regcomp HAVE_REGCOMP) CHECK_FUNCTION_EXISTS (realpath HAVE_REALPATH) CHECK_FUNCTION_EXISTS (rename HAVE_RENAME) CHECK_FUNCTION_EXISTS (rwlock_init HAVE_RWLOCK_INIT) CHECK_FUNCTION_EXISTS (sched_yield HAVE_SCHED_YIELD) CHECK_FUNCTION_EXISTS (setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS (setlocale HAVE_SETLOCALE) -CHECK_FUNCTION_EXISTS (setfd HAVE_SETFD) CHECK_FUNCTION_EXISTS (sigaction HAVE_SIGACTION) CHECK_FUNCTION_EXISTS (sigthreadmask HAVE_SIGTHREADMASK) CHECK_FUNCTION_EXISTS (sigwait HAVE_SIGWAIT) -CHECK_FUNCTION_EXISTS (sigaddset HAVE_SIGADDSET) -CHECK_FUNCTION_EXISTS (sigemptyset HAVE_SIGEMPTYSET) -CHECK_FUNCTION_EXISTS (sighold HAVE_SIGHOLD) CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET) CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP) CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF) CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY) CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL) CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR) -CHECK_FUNCTION_EXISTS (strlcpy HAVE_STRLCPY) CHECK_FUNCTION_EXISTS (strnlen HAVE_STRNLEN) -CHECK_FUNCTION_EXISTS (strlcat HAVE_STRLCAT) -CHECK_FUNCTION_EXISTS (strsignal HAVE_STRSIGNAL) -CHECK_FUNCTION_EXISTS (fgetln HAVE_FGETLN) CHECK_FUNCTION_EXISTS (strpbrk HAVE_STRPBRK) -CHECK_FUNCTION_EXISTS (strstr HAVE_STRSTR) CHECK_FUNCTION_EXISTS (strtok_r HAVE_STRTOK_R) -CHECK_FUNCTION_EXISTS (strtol HAVE_STRTOL) CHECK_FUNCTION_EXISTS (strtoll HAVE_STRTOLL) CHECK_FUNCTION_EXISTS (strtoul HAVE_STRTOUL) CHECK_FUNCTION_EXISTS (strtoull HAVE_STRTOULL) CHECK_FUNCTION_EXISTS (strcasecmp HAVE_STRCASECMP) -CHECK_FUNCTION_EXISTS (strncasecmp HAVE_STRNCASECMP) -CHECK_FUNCTION_EXISTS (strdup HAVE_STRDUP) -CHECK_FUNCTION_EXISTS (shmat HAVE_SHMAT) -CHECK_FUNCTION_EXISTS (shmctl HAVE_SHMCTL) -CHECK_FUNCTION_EXISTS (shmdt HAVE_SHMDT) -CHECK_FUNCTION_EXISTS (shmget HAVE_SHMGET) CHECK_FUNCTION_EXISTS (tell HAVE_TELL) CHECK_FUNCTION_EXISTS (tempnam HAVE_TEMPNAM) CHECK_FUNCTION_EXISTS (thr_setconcurrency HAVE_THR_SETCONCURRENCY) CHECK_FUNCTION_EXISTS (thr_yield HAVE_THR_YIELD) CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF) -CHECK_FUNCTION_EXISTS (vprintf HAVE_VPRINTF) -CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC) CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN) -CHECK_FUNCTION_EXISTS (chown HAVE_CHOWN) CHECK_FUNCTION_EXISTS (nl_langinfo HAVE_NL_LANGINFO) IF(HAVE_SYS_EVENT_H) @@ -569,7 +520,6 @@ ENDIF(HAVE_STDINT_H) SET(HAVE_VOIDP 1) SET(HAVE_CHARP 1) SET(HAVE_LONG 1) -SET(HAVE_SIZE_T 1) IF(NOT APPLE) MY_CHECK_TYPE_SIZE("void *" VOIDP) @@ -578,7 +528,6 @@ MY_CHECK_TYPE_SIZE(long LONG) MY_CHECK_TYPE_SIZE(size_t SIZE_T) ENDIF() -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) @@ -593,17 +542,14 @@ 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) MY_CHECK_TYPE_SIZE(time_t TIME_T) SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) -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) -MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_IEEEFP_H) @@ -626,23 +572,6 @@ int main() }" TIME_T_UNSIGNED) - -CHECK_C_SOURCE_COMPILES(" -#ifdef _WIN32 -#include <winsock2.h> -#include <ws2tcpip.h> -#else -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> -#endif -int main() -{ - getaddrinfo( 0, 0, 0, 0); - return 0; -}" -HAVE_GETADDRINFO) - CHECK_C_SOURCE_COMPILES(" #ifdef _WIN32 #include <winsock2.h> @@ -862,21 +791,6 @@ IF(NOT HAVE_POSIX_SIGNALS) sigsetmask(mask); sigblock(mask); sigpause(mask); }" HAVE_BSD_SIGNALS) - IF (NOT HAVE_BSD_SIGNALS) - CHECK_C_SOURCE_COMPILES(" - #include <signal.h> - void foo() { } - int main(int ac, char **av) - { - int mask = sigmask(SIGINT); - sigset(SIGINT, foo); sigrelse(SIGINT); - sighold(SIGINT); sigpause(SIGINT); - }" - HAVE_SVR3_SIGNALS) - IF (NOT HAVE_SVR3_SIGNALS) - SET(HAVE_V7_SIGNALS 1) - ENDIF(NOT HAVE_SVR3_SIGNALS) - ENDIF(NOT HAVE_BSD_SIGNALS) ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf @@ -924,8 +838,8 @@ CHECK_CXX_SOURCE_COMPILES(" #include <new> int main() { - char *c = new char; - return 0; + char *c = new char; + return 0; }" HAVE_CXX_NEW ) @@ -1010,7 +924,7 @@ IF(WITH_VALGRIND) ENDIF() CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" - HAVE_VALGRIND) + HAVE_VALGRIND_MEMCHECK_H) #-------------------------------------------------------------------- # Check for IPv6 support diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index f304e984b54..6f4109515e6 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -37,8 +37,11 @@ if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1 then # Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting # packages by snipped in rules file - MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.1" + MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.2" sed -i -e "/\\\${MAYBE_LIBCRACK}/d" debian/control + # Remove package entry from control file completely so that + # resulting Debian source package will actually be buildable + sed -i -e "/Package: mariadb-cracklib-password-check/,+6d" debian/control else MAYBE_LIBCRACK='libcrack2-dev (>= 2.9.0),' sed -i -e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" debian/control diff --git a/debian/changelog b/debian/changelog index 4d0d74b12c4..31ba0ab81cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mariadb-10.2 (10.2.0) unstable; urgency=low + + * Initial release. + + -- Otto Kekäläinen <otto@mariadb.org> Sat, 14 Nov 2015 21:26:45 +0200 + mariadb-10.1 (10.1.0) unstable; urgency=low * Initial release. diff --git a/debian/control b/debian/control index 91e5fff32c2..2e706e6b548 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: mariadb-10.1 +Source: mariadb-10.2 Section: database Priority: optional Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net> @@ -128,7 +128,7 @@ Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf) This package includes files needed by all versions of the client library (e.g. /etc/mysql/conf.d/mariadb.cnf). -Package: mariadb-client-core-10.1 +Package: mariadb-client-core-10.2 Architecture: any Depends: libmariadbclient18 (>= ${source:Version}), mariadb-common (>= ${source:Version}), @@ -139,11 +139,13 @@ Provides: mysql-client-core, mysql-client-core-5.5, mysql-client-core-5.6, virtual-mysql-client-core -Conflicts: mariadb-client-10.0, +Conflicts: mariadb-client-10.1, + mariadb-client-10.0, mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mariadb-client-5.5, + mariadb-client-core-10.1, mariadb-client-core-10.0, mariadb-client-core-5.1, mariadb-client-core-5.2, @@ -157,11 +159,13 @@ Conflicts: mariadb-client-10.0, mysql-client-core-5.5, mysql-client-core-5.6, virtual-mysql-client-core -Replaces: mariadb-client-10.0, +Replaces: mariadb-client-10.1, + mariadb-client-10.0, mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mariadb-client-5.5, + mariadb-client-core-10.1, mariadb-client-core-10.0, mariadb-client-core-5.1, mariadb-client-core-5.2, @@ -183,13 +187,13 @@ Description: MariaDB database core client binaries . This package includes the core client files, as used by Akonadi. -Package: mariadb-client-10.1 +Package: mariadb-client-10.2 Architecture: any Depends: debianutils (>=1.6), libdbd-mysql-perl (>= 1.2202), libdbi-perl, libmariadbclient18 (>= ${source:Version}), - mariadb-client-core-10.1 (>= ${source:Version}), + mariadb-client-core-10.2 (>= ${source:Version}), mariadb-common, ${misc:Depends}, ${perl:Depends}, @@ -202,6 +206,7 @@ Provides: mysql-client, mysql-client-5.6, virtual-mysql-client Conflicts: mariadb-client (<< ${source:Version}), + mariadb-client-10.1, mariadb-client-10.0, mariadb-client-5.1, mariadb-client-5.2, @@ -214,6 +219,7 @@ Conflicts: mariadb-client (<< ${source:Version}), mysql-client-5.6, virtual-mysql-client Replaces: mariadb-client (<< ${source:Version}), + mariadb-client-10.1, mariadb-client-10.0, mariadb-client-5.1, mariadb-client-5.2, @@ -234,7 +240,7 @@ Description: MariaDB database client binaries This package includes the client binaries and the additional tools innotop and mysqlreport. -Package: mariadb-server-core-10.1 +Package: mariadb-server-core-10.2 Architecture: any Depends: libmariadbclient18 (>= ${binary:Version}), mariadb-common (>= ${source:Version}), @@ -245,7 +251,8 @@ Provides: mysql-server-core, mysql-server-core-5.5, mysql-server-core-5.6, virtual-mysql-server-core -Conflicts: mariadb-server-core-10.0, +Conflicts: mariadb-server-core-10.1, + mariadb-server-core-10.0, mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.3, @@ -256,7 +263,8 @@ Conflicts: mariadb-server-core-10.0, mysql-server-core-5.5, mysql-server-core-5.6, virtual-mysql-server-core -Replaces: mariadb-server-core-10.0, +Replaces: mariadb-server-core-10.1, + mariadb-server-core-10.0, mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.3, @@ -275,20 +283,22 @@ Description: MariaDB database core server files . This package includes the core server files, as used by Akonadi. -Package: mariadb-test-10.1 +Package: mariadb-test-10.2 Architecture: any -Depends: mariadb-client-10.1 (= ${binary:Version}), - mariadb-server-10.1 (= ${binary:Version}) +Depends: mariadb-client-10.2 (= ${binary:Version}), + mariadb-server-10.2 (= ${binary:Version}) Suggests: patch Conflicts: mariadb-galera-server-5.5 (<< 5.5.33), mariadb-server-5.5 (<< 5.5.33), mariadb-test (<< ${source:Version}), + mariadb-test-10.1, mariadb-test-10.0, mariadb-test-5.1, mariadb-test-5.2, mariadb-test-5.3, virtual-mysql-testsuite Replaces: mariadb-test (<< ${source:Version}), + mariadb-test-10.1, mariadb-test-10.0, mariadb-test-5.1, mariadb-test-5.2, @@ -303,7 +313,7 @@ Description: MariaDB database regression test suite . This package includes the regression test suite. -Package: mariadb-server-10.1 +Package: mariadb-server-10.2 Architecture: any Suggests: mailx, mariadb-test, netcat-openbsd, socat, tinyca Recommends: libhtml-template-perl @@ -318,8 +328,8 @@ Depends: bsdutils, libdbi-perl, lsb-base (>= 3.0-10), lsof, - mariadb-client-10.1 (>= ${source:Version}), - mariadb-server-core-10.1 (>= ${binary:Version}), + mariadb-client-10.2 (>= ${source:Version}), + mariadb-server-core-10.2 (>= ${binary:Version}), passwd, perl (>= 5.6), psmisc, @@ -329,6 +339,7 @@ Depends: bsdutils, ${shlibs:Depends} Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), + mariadb-server-10.1, mariadb-server-10.0, mariadb-server-5.1, mariadb-server-5.2, @@ -346,6 +357,7 @@ Conflicts: mariadb-server (<< ${source:Version}), Replaces: libmariadbclient-dev (<< 5.5.0), libmariadbclient16 (<< 5.3.4), mariadb-server (<< ${source:Version}), + mariadb-server-10.1, mariadb-server-10.0, mariadb-server-5.1, mariadb-server-5.2, @@ -370,10 +382,10 @@ Description: MariaDB database server binaries Package: mariadb-server Architecture: all -Depends: mariadb-server-10.1 (= ${source:Version}), ${misc:Depends} +Depends: mariadb-server-10.2 (= ${source:Version}), ${misc:Depends} Description: MariaDB database server (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of - mariadb-server (currently mariadb-server-10.1), as determined by the MariaDB + mariadb-server (currently mariadb-server-10.2), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you need. That will install the version recommended by the package maintainers. @@ -385,26 +397,26 @@ Description: MariaDB database server (metapackage depending on the latest versio Package: mariadb-client Architecture: all -Depends: mariadb-client-10.1 (= ${source:Version}), ${misc:Depends} +Depends: mariadb-client-10.2 (= ${source:Version}), ${misc:Depends} Description: MariaDB database client (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of - mariadb-client (currently mariadb-client-10.1), as determined by the MariaDB + mariadb-client (currently mariadb-client-10.2), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you want, as this is the one considered to be in the best shape. Package: mariadb-test Architecture: all -Depends: mariadb-test-10.1 (= ${source:Version}), ${misc:Depends} +Depends: mariadb-test-10.2 (= ${source:Version}), ${misc:Depends} Description: MariaDB database regression test suite (metapackage for the latest version) This is an empty package that depends on the current "best" version of - mariadb-test (currently mariadb-test-10.1), as determined by the MariaDB + mariadb-test (currently mariadb-test-10.2), as determined by the MariaDB maintainers. -Package: mariadb-connect-engine-10.1 +Package: mariadb-connect-engine-10.2 Architecture: any -Depends: libxml2, mariadb-server-10.1, unixODBC +Depends: libxml2, mariadb-server-10.2, unixODBC Build-Depends: libxml2-dev, - mariadb-server-10.1, + mariadb-server-10.2, unixODBC-dev, ${misc:Depends}, ${shlibs:Depends} @@ -414,18 +426,18 @@ Description: Connect storage engine for MariaDB other interesting features. This package contains the Connect plugin for MariaDB. -Package: mariadb-oqgraph-engine-10.1 +Package: mariadb-oqgraph-engine-10.2 Architecture: any -Depends: libjudydebian1, mariadb-server-10.1, ${misc:Depends}, ${shlibs:Depends} +Depends: libjudydebian1, mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} Description: OQGraph storage engine for MariaDB The OQGraph engine is a computation engine plugin for handling hierarchies (trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL. This package contains the OQGraph plugin for MariaDB. -Package: mariadb-cracklib-password-check-10.1 +Package: mariadb-cracklib-password-check-10.2 Section: database Architecture: any -Depends: libcrack2 (>= 2.9.0), mariadb-server-10.1 +Depends: libcrack2 (>= 2.9.0), mariadb-server-10.2 Description: CrackLib Password Validation Plugin for MariaDB This password validation plugin uses cracklib to allow only sufficiently secure (as defined by cracklib) user passwords in MariaDB. diff --git a/debian/mariadb-client-10.1.README.Debian b/debian/mariadb-client-10.2.README.Debian index b245638f9c9..b245638f9c9 100644 --- a/debian/mariadb-client-10.1.README.Debian +++ b/debian/mariadb-client-10.2.README.Debian diff --git a/debian/mariadb-client-10.1.dirs b/debian/mariadb-client-10.2.dirs index ceda5922c5d..ceda5922c5d 100644 --- a/debian/mariadb-client-10.1.dirs +++ b/debian/mariadb-client-10.2.dirs diff --git a/debian/mariadb-client-10.1.docs b/debian/mariadb-client-10.2.docs index 21446855f51..21446855f51 100644 --- a/debian/mariadb-client-10.1.docs +++ b/debian/mariadb-client-10.2.docs diff --git a/debian/mariadb-client-10.1.files b/debian/mariadb-client-10.2.files index e6033952c26..95e788dc8d8 100644 --- a/debian/mariadb-client-10.1.files +++ b/debian/mariadb-client-10.2.files @@ -2,7 +2,6 @@ usr/bin/innochecksum usr/bin/innotop usr/bin/mysqlaccess usr/bin/mysqladmin -usr/bin/mysqlbug usr/bin/mysqldump usr/bin/mysqldumpslow usr/bin/mysql_find_rows @@ -15,7 +14,6 @@ usr/bin/mysql_waitpid usr/share/man/man1/innotop.1 usr/share/man/man1/mysqlaccess.1 usr/share/man/man1/mysqladmin.1 -usr/share/man/man1/mysqlbug.1 usr/share/man/man1/mysqldump.1 usr/share/man/man1/mysqldumpslow.1 usr/share/man/man1/mysql_find_rows.1 diff --git a/debian/mariadb-client-10.1.links b/debian/mariadb-client-10.2.links index 0b86e87f2e9..0b86e87f2e9 100644 --- a/debian/mariadb-client-10.1.links +++ b/debian/mariadb-client-10.2.links diff --git a/debian/mariadb-client-10.1.menu b/debian/mariadb-client-10.2.menu index 1378555c423..1378555c423 100644 --- a/debian/mariadb-client-10.1.menu +++ b/debian/mariadb-client-10.2.menu diff --git a/debian/mariadb-client-core-10.1.files b/debian/mariadb-client-core-10.2.files index a2781309439..a2781309439 100644 --- a/debian/mariadb-client-core-10.1.files +++ b/debian/mariadb-client-core-10.2.files diff --git a/debian/mariadb-connect-engine-10.1.files b/debian/mariadb-connect-engine-10.2.files index 0b042607c36..0b042607c36 100644 --- a/debian/mariadb-connect-engine-10.1.files +++ b/debian/mariadb-connect-engine-10.2.files diff --git a/debian/mariadb-cracklib-password-check-10.1.files b/debian/mariadb-cracklib-password-check-10.2.files index 3fe06639703..3fe06639703 100644 --- a/debian/mariadb-cracklib-password-check-10.1.files +++ b/debian/mariadb-cracklib-password-check-10.2.files diff --git a/debian/mariadb-oqgraph-engine-10.1.files b/debian/mariadb-oqgraph-engine-10.2.files index f67b0cd9d13..f67b0cd9d13 100644 --- a/debian/mariadb-oqgraph-engine-10.1.files +++ b/debian/mariadb-oqgraph-engine-10.2.files diff --git a/debian/mariadb-server-10.1.README.Debian b/debian/mariadb-server-10.2.README.Debian index be2e33d705d..be2e33d705d 100644 --- a/debian/mariadb-server-10.1.README.Debian +++ b/debian/mariadb-server-10.2.README.Debian diff --git a/debian/mariadb-server-10.1.config b/debian/mariadb-server-10.2.config index 162017caf71..162017caf71 100644 --- a/debian/mariadb-server-10.1.config +++ b/debian/mariadb-server-10.2.config diff --git a/debian/mariadb-server-10.1.dirs b/debian/mariadb-server-10.2.dirs index 64b49db4af9..037d669e833 100644 --- a/debian/mariadb-server-10.1.dirs +++ b/debian/mariadb-server-10.2.dirs @@ -5,6 +5,6 @@ usr/bin usr/sbin usr/share/man/man8 usr/share/mysql -usr/share/doc/mariadb-server-10.1 +usr/share/doc/mariadb-server-10.2 var/run/mysqld var/lib/mysql-upgrade diff --git a/debian/mariadb-server-10.1.files.in b/debian/mariadb-server-10.2.files.in index 3b143c5c9cf..eaabbb53dca 100644 --- a/debian/mariadb-server-10.1.files.in +++ b/debian/mariadb-server-10.2.files.in @@ -21,7 +21,7 @@ usr/lib/mysql/plugin/sql_errlog.so usr/lib/mysql/plugin/wsrep_info.so usr/lib/libhsclient.so.* etc/apparmor.d/usr.sbin.mysqld -usr/share/apport/package-hooks/source_mariadb-10.1.py +usr/share/apport/package-hooks/source_mariadb-10.2.py etc/mysql/debian-start etc/mysql/conf.d/mysqld_safe_syslog.cnf usr/bin/msql2mysql @@ -42,7 +42,6 @@ usr/bin/mysql_secure_installation usr/bin/mysql_setpermission usr/bin/mysql_tzinfo_to_sql usr/bin/mysql_upgrade -usr/bin/mysql_zap usr/bin/mysqlbinlog usr/bin/mysqld_multi usr/bin/mysqld_safe @@ -56,9 +55,9 @@ usr/bin/wsrep_sst_mysqldump usr/bin/wsrep_sst_rsync usr/bin/wsrep_sst_xtrabackup usr/bin/wsrep_sst_xtrabackup-v2 -usr/share/doc/mariadb-server-10.1/mysqld.sym.gz -usr/share/doc/mariadb-server-10.1/INFO_SRC -usr/share/doc/mariadb-server-10.1/INFO_BIN +usr/share/doc/mariadb-server-10.2/mysqld.sym.gz +usr/share/doc/mariadb-server-10.2/INFO_SRC +usr/share/doc/mariadb-server-10.2/INFO_BIN usr/share/man/man1/msql2mysql.1 usr/share/man/man1/myisamchk.1 usr/share/man/man1/myisam_ftdump.1 @@ -74,7 +73,6 @@ usr/share/man/man1/mysql_install_db.1 usr/share/man/man1/mysql_secure_installation.1 usr/share/man/man1/mysql_setpermission.1 usr/share/man/man1/mysql_upgrade.1 -usr/share/man/man1/mysql_zap.1 usr/share/man/man1/perror.1 usr/share/man/man1/replace.1 usr/share/man/man1/resolveip.1 diff --git a/debian/mariadb-server-10.1.logcheck.ignore.paranoid b/debian/mariadb-server-10.2.logcheck.ignore.paranoid index 00cc5c3e29d..00cc5c3e29d 100644 --- a/debian/mariadb-server-10.1.logcheck.ignore.paranoid +++ b/debian/mariadb-server-10.2.logcheck.ignore.paranoid diff --git a/debian/mariadb-server-10.1.logcheck.ignore.server b/debian/mariadb-server-10.2.logcheck.ignore.server index 37f25cb01ea..a0b4792ecda 100644 --- a/debian/mariadb-server-10.1.logcheck.ignore.server +++ b/debian/mariadb-server-10.2.logcheck.ignore.server @@ -19,7 +19,7 @@ mysqld_safe\[[0-9]+\]: ended$ mysqld_safe\[[0-9]+\]: http://www.mysql.com$ mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$ mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$ -mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$ +mysqld_safe\[[0-9]+\]: Please report any problems at http://mariadb.org/jira$ mysqld_safe\[[0-9]+\]: See the manual for more instructions.$ mysqld_safe\[[0-9]+\]: started$ mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at https://order.mysql.com$ diff --git a/debian/mariadb-server-10.1.logcheck.ignore.workstation b/debian/mariadb-server-10.2.logcheck.ignore.workstation index 37f25cb01ea..a0b4792ecda 100644 --- a/debian/mariadb-server-10.1.logcheck.ignore.workstation +++ b/debian/mariadb-server-10.2.logcheck.ignore.workstation @@ -19,7 +19,7 @@ mysqld_safe\[[0-9]+\]: ended$ mysqld_safe\[[0-9]+\]: http://www.mysql.com$ mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$ mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$ -mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$ +mysqld_safe\[[0-9]+\]: Please report any problems at http://mariadb.org/jira$ mysqld_safe\[[0-9]+\]: See the manual for more instructions.$ mysqld_safe\[[0-9]+\]: started$ mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at https://order.mysql.com$ diff --git a/debian/mariadb-server-10.1.mysql-server.logrotate b/debian/mariadb-server-10.2.mysql-server.logrotate index 789ad353e43..789ad353e43 100644 --- a/debian/mariadb-server-10.1.mysql-server.logrotate +++ b/debian/mariadb-server-10.2.mysql-server.logrotate diff --git a/debian/mariadb-server-10.1.mysql.init b/debian/mariadb-server-10.2.mysql.init index 9e098b4d87c..ba92317c1cd 100644 --- a/debian/mariadb-server-10.1.mysql.init +++ b/debian/mariadb-server-10.2.mysql.init @@ -152,7 +152,7 @@ case "${1:-''}" in if ! mysqld_status check_dead warn; then log_end_msg 1 - log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.1/README.Debian.gz!" + log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.2/README.Debian.gz!" exit -1 else log_end_msg 0 diff --git a/debian/mariadb-server-10.1.postinst b/debian/mariadb-server-10.2.postinst index 63b7c0c0be2..50b1000a26a 100644 --- a/debian/mariadb-server-10.1.postinst +++ b/debian/mariadb-server-10.2.postinst @@ -131,7 +131,7 @@ EOF db_set mysql-server/postrm_remove_database false || true # To avoid downgrades. - touch $mysql_statedir/debian-10.1.flag + touch $mysql_statedir/debian-10.2.flag ## On every reconfiguration the maintenance user is recreated. # diff --git a/debian/mariadb-server-10.1.postrm b/debian/mariadb-server-10.2.postrm index 7cee5150ef9..7cee5150ef9 100644 --- a/debian/mariadb-server-10.1.postrm +++ b/debian/mariadb-server-10.2.postrm diff --git a/debian/mariadb-server-10.1.preinst b/debian/mariadb-server-10.2.preinst index 1df01b2dcee..ee0723ea85d 100644 --- a/debian/mariadb-server-10.1.preinst +++ b/debian/mariadb-server-10.2.preinst @@ -46,7 +46,7 @@ stop_server() { ################################ main() ########################## -this_version=10.1 +this_version=10.2 # Safe the user from stupidities. show_downgrade_warning=0 diff --git a/debian/mariadb-server-10.1.prerm b/debian/mariadb-server-10.2.prerm index 03e9ea37420..03e9ea37420 100644 --- a/debian/mariadb-server-10.1.prerm +++ b/debian/mariadb-server-10.2.prerm diff --git a/debian/mariadb-server-10.1.py b/debian/mariadb-server-10.2.py index fe5029d056c..7881029a24c 100644 --- a/debian/mariadb-server-10.1.py +++ b/debian/mariadb-server-10.2.py @@ -1,4 +1,4 @@ -'''apport package hook for mariadb-10.1 +'''apport package hook for mariadb-10.2 (c) 2009 Canonical Ltd. Author: Mathias Gug <mathias.gug@canonical.com> @@ -20,7 +20,7 @@ def _add_my_conf_files(report, filename): continue def add_info(report): - attach_conffiles(report, 'mariadb-server-10.1', conffiles=None) + attach_conffiles(report, 'mariadb-server-10.2', conffiles=None) key = 'Logs' + path_to_key('/var/log/daemon.log') report[key] = "" for line in read_file('/var/log/daemon.log').split('\n'): diff --git a/debian/mariadb-server-10.1.templates b/debian/mariadb-server-10.2.templates index f64dd02d7bd..50eee893659 100644 --- a/debian/mariadb-server-10.1.templates +++ b/debian/mariadb-server-10.2.templates @@ -7,7 +7,7 @@ # Even minor modifications require translation updates and such # changes should be coordinated with translators and reviewers. -Template: mariadb-server-10.1/really_downgrade +Template: mariadb-server-10.2/really_downgrade Type: boolean Default: false _Description: Really proceed with downgrade? @@ -73,7 +73,7 @@ _Description: Unable to set password for the MariaDB "root" user . You should check the account's password after the package installation. . - Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file + Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for more information. Template: mysql-server/password_mismatch diff --git a/debian/mariadb-server-core-10.1.files b/debian/mariadb-server-core-10.2.files index 5c60ca5ec67..5c60ca5ec67 100644 --- a/debian/mariadb-server-core-10.1.files +++ b/debian/mariadb-server-core-10.2.files diff --git a/debian/mariadb-test-10.1.dirs b/debian/mariadb-test-10.2.dirs index 1a488d98195..1a488d98195 100644 --- a/debian/mariadb-test-10.1.dirs +++ b/debian/mariadb-test-10.2.dirs diff --git a/debian/mariadb-test-10.1.files b/debian/mariadb-test-10.2.files index dbb551a9407..dbb551a9407 100644 --- a/debian/mariadb-test-10.1.files +++ b/debian/mariadb-test-10.2.files diff --git a/debian/mariadb-test-10.1.links b/debian/mariadb-test-10.2.links index 082680fe5ed..082680fe5ed 100644 --- a/debian/mariadb-test-10.1.links +++ b/debian/mariadb-test-10.2.links diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in index 029c650fe7a..be16669a512 100644 --- a/debian/po/POTFILES.in +++ b/debian/po/POTFILES.in @@ -1 +1 @@ -[type: gettext/rfc822deb] mariadb-server-10.1.templates +[type: gettext/rfc822deb] mariadb-server-10.2.templates diff --git a/debian/po/ar.po b/debian/po/ar.po index c9009069ee5..387086d51ca 100644 --- a/debian/po/ar.po +++ b/debian/po/ar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: templates\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-05-01 13:04+0300\n" "Last-Translator: Ossama M. Khayat <okhayat@yahoo.com>\n" @@ -27,19 +27,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "هل Ùعلاً تريد التثبيط؟" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "هناك مل٠مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -52,7 +52,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -62,13 +62,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "ملاØظة هامة لمستخدمي NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -76,7 +76,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -88,13 +88,13 @@ msgstr "عليك أيضاً أن تقوم بالتأكد من صلاØيات Ù…Ø #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "إزالة جميع قواعد بيانات MariaDBØŸ" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -102,7 +102,7 @@ msgstr "الدليل /var/lib/mysql الذي ÙŠØتوي قواعد بيانات #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -113,13 +113,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "تشغيل خادم MariaDB عند الإقلاع؟" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -129,13 +129,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -145,7 +145,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -153,7 +153,7 @@ msgstr "إن ترك الØقل Ùارغاً، Ùلن يتم تغيير كلمة #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MariaDB \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -161,13 +161,13 @@ msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص ب #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "تعذر تعيين كلمة مرور للمستخدم \"root\" الخاص بـMariaDB." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +179,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -188,27 +188,27 @@ msgstr "يجب عليك التØقق من كلمة مرور الØساب عقب #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"الرجاء قراءة المل٠/usr/share/doc/mariadb-server-10.1/README.Debian للمزيد من " +"الرجاء قراءة المل٠/usr/share/doc/mariadb-server-10.2/README.Debian للمزيد من " "المعلومات." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/ca.po b/debian/po/ca.po index 7c7d2210834..6f82d771279 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2004-01-31 19:20GMT\n" "Last-Translator: Aleix Badia i Bosch <abadia@ica.es>\n" @@ -17,19 +17,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -37,7 +37,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -45,7 +45,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -53,7 +53,7 @@ msgstr "Nota important pels usuaris de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -61,7 +61,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -69,13 +69,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -83,7 +83,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -92,7 +92,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "Should MySQL start on boot?" msgid "Start the MariaDB server on boot?" @@ -100,7 +100,7 @@ msgstr "Voleu que el MariaDB s'iniciï a l'arrencada ?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy msgid "" "The MariaDB server can be launched automatically at boot time or manually " @@ -112,13 +112,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -126,25 +126,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -153,27 +153,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -207,13 +207,13 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "El MySQL només s'instal·la en cas de tenir un nom d'ordinador central que " #~ "no sigui numèric i que es pugui resoldre a través del fitxer /etc/hosts. " #~ "Ex. si l'ordre \"hostname\" retorna \"myhostname\", llavors hi ha d'haver " -#~ "una línia com la següent \"10.1.0.1 myhostname\"." +#~ "una línia com la següent \"10.2.0.1 myhostname\"." #, fuzzy #~ msgid "" diff --git a/debian/po/cs.po b/debian/po/cs.po index f3ae24b1e8c..cf30159d179 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-05-01 13:01+0200\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" @@ -26,19 +26,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Opravdu pokraÄovat v degradaci?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -51,7 +51,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -61,13 +61,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Důležitá poznámka pro uživatele NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -75,7 +75,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -88,13 +88,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Odstranit vÅ¡echny MariaDB databáze?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -104,7 +104,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -116,13 +116,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Spustit MariaDB server pÅ™i startu systému?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -132,13 +132,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nové heslo MariaDB uživatele \"root\":" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -148,7 +148,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -156,7 +156,7 @@ msgstr "Ponecháte-li pole prázdné, heslo se nezmÄ›nÃ." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -164,13 +164,13 @@ msgstr "Nové heslo MariaDB uživatele \"root\":" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Nelze nastavit heslo MariaDB uživatele \"root\"" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -182,7 +182,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -191,26 +191,26 @@ msgstr "Po instalaci balÃku byste mÄ›li heslo ověřit." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"VÃce informacà naleznete v /usr/share/doc/mariadb-server-10.1/README.Debian." +"VÃce informacà naleznete v /usr/share/doc/mariadb-server-10.2/README.Debian." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -298,13 +298,13 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "MySQL se nainstaluje pouze v pÅ™ÃpadÄ›, že použÃváte nenumerické jméno " #~ "poÄÃtaÄe, které se dá pÅ™eložit pÅ™es soubor /etc/hosts. NapÅ™. když pÅ™Ãkaz " #~ "\"hostname\" vrátà \"diamond\", tak v /etc/hosts musà existovat obdobný " -#~ "řádek jako \"10.1.0.1 diamond\"." +#~ "řádek jako \"10.2.0.1 diamond\"." #~ msgid "" #~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " diff --git a/debian/po/da.po b/debian/po/da.po index d68b8575d72..917465943af 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-05-30 22:41+0200\n" "Last-Translator: Claus Hindsgaul <claus.hindsgaul@gmail.com>\n" @@ -27,20 +27,20 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Ønsker du virkelig at fortsætte nedgraderingen?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" "Der er en fil med navnet /var/lib/mysql/debian-*.flag på dette system." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -54,7 +54,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -64,13 +64,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Vigtig oplysning til NIS/YP-brugere" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -78,7 +78,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -91,13 +91,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Fjern alle MariaDB-databaser?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -107,7 +107,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -119,13 +119,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Start MariaDB-serveren under systemopstart?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -135,13 +135,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Ny adgangskode for MariaDB's \"root\"-bruger:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -151,7 +151,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -159,7 +159,7 @@ msgstr "Hvis du lader dette felt stå tomt, vil adgangskoden ikke blive ændret." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -167,13 +167,13 @@ msgstr "Ny adgangskode for MariaDB's \"root\"-bruger:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Kunne ikke sætte adgangskoden for MariaDB's \"root\"-bruger" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -186,33 +186,33 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "Du bør tjekke kontoens adgangskode efter pakkeinstallationen." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Se filen /usr/share/doc/mariadb-server-10.1/README.Debian for yderligere " +"Se filen /usr/share/doc/mariadb-server-10.2/README.Debian for yderligere " "oplysninger." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -324,12 +324,12 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "MySQL vil kun blive installeret, hvis du har et ikke-numerisk værtsnavn, " #~ "som kan slås op i filen /ets/hosts. Hvis f.eks. kommandoen \"hostname\" " -#~ "svarer med \"mitvaertsnavn\", skal du have en linje a'la \"10.1.0.1 " +#~ "svarer med \"mitvaertsnavn\", skal du have en linje a'la \"10.2.0.1 " #~ "mitvaertsnavn\" i /etc/hosts." #~ msgid "" diff --git a/debian/po/de.po b/debian/po/de.po index 6147b55903e..c39c1abeb8f 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1_5.1.37-1_de\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-08-27 22:41+0200\n" "Last-Translator: Thomas Mueller <thomas.mueller@tmit.eu>\n" @@ -29,13 +29,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Möchten Sie wirklich eine ältere Version einspielen?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" "Auf diesem System existiert eine Datei mit dem Namen /var/lib/mysql/debian-*." @@ -43,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -53,7 +53,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -63,13 +63,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -79,7 +79,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -89,13 +89,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Alle MariaDB-Datenbanken entfernen?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -105,7 +105,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -117,13 +117,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Soll der MariaDB-Server automatisch beim Booten starten?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -133,13 +133,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Neues Passwort für den MariaDB »root«-Benutzer:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -149,25 +149,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "Wenn dieses Feld freigelassen wird, wird das Passwort nicht geändert." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Wiederholen Sie das Passwort für den MariaDB-»root«-Benutzer:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Konnte für den MariaDB-»root«-Benutzer kein Passwort setzen" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -180,7 +180,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "Sie sollten das Passwort des administrativen Benutzers nach der " @@ -188,13 +188,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" "Für weitere Informationen lesen Sie /usr/share/doc/mariadb-server-5.1/README." @@ -202,13 +202,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Passwort-Eingabefehler" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" "Die beiden von Ihnen eingegebenen Passwörter sind nicht identisch. Bitte " diff --git a/debian/po/es.po b/debian/po/es.po index e76c173a9f5..cb3d101460b 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -40,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1_5.0.24-3\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-05-28 22:21+0200\n" "Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n" @@ -52,20 +52,20 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "¿Desea realmente continuar con la desactualización?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" "Existe un archivo con el nombre /var/lib/mysql/debian-*.flag en este sistema." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -79,7 +79,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -89,13 +89,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para los usuarios de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -103,7 +103,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -117,13 +117,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "¿Desea eliminar todas las bases de datos MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -133,7 +133,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -145,13 +145,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "¿DeberÃa ejecutarse el servidor MariaDB al iniciarse el sistema?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -161,13 +161,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nueva contraseña para el usuario «root» de MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -177,7 +177,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -185,7 +185,7 @@ msgstr "No se modificará la contraseña si deja el espacio en blanco." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -193,13 +193,13 @@ msgstr "Nueva contraseña para el usuario «root» de MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "No se pudo fijar la contraseña para el usuario «root» de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -212,7 +212,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "DeberÃa comprobar la contraseña de la cuenta después de la instalación del " @@ -220,27 +220,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Consulte /usr/share/doc/mariadb-server-10.1/README.Debian para más " +"Consulte /usr/share/doc/mariadb-server-10.2/README.Debian para más " "información." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -341,13 +341,13 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "Sólo se instalará MySQL si tiene un nombre de equipo que no sea una " #~ "dirección IP y pueda resolverse a través del archivo /etc/hosts. Por " #~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá " -#~ "existir una lÃnea «10.1.0.1 MiNombreEquipo» en dicho archivo." +#~ "existir una lÃnea «10.2.0.1 MiNombreEquipo» en dicho archivo." #~ msgid "" #~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " diff --git a/debian/po/eu.po b/debian/po/eu.po index 8f1ae0c8ecd..3b538bb074e 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: eu\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-07-29 11:59+0200\n" "Last-Translator: Piarres Beobide <pi@beobide.net>\n" @@ -20,19 +20,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Benetan bertsio zaharragora itzuli nahi duzu?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -46,7 +46,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -70,7 +70,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -84,13 +84,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Ezabatu MariaDB datubase guztiak?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -99,7 +99,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -111,13 +111,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Abioan MariaDB zerbitzaria abiarazi?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -127,13 +127,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "MariaDB \"root\" erabiltzailearen pasahitz berria:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -143,7 +143,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -151,19 +151,19 @@ msgstr "Eremua hau zurian utziaz gero ez da pasahitza aldatuko." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Errepikatu MariaDB \"root\" erabiltzailearen pasahitza:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Ezin da MariaDB \"root\" erabiltzailearen pasahitza ezarri" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,34 +175,34 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "Kontuaren pasahitza egiaztatu beharko zenuke paketea instalatu aurretik." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Mesedez irakurri /usr/share/doc/mariadb-server-10.1/README.Debian fitxategia " +"Mesedez irakurri /usr/share/doc/mariadb-server-10.2/README.Debian fitxategia " "xehetasun gehiagorako." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Pasahitz sarrera errorea" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Idatzi dituzun bi pasahitzak ez dira berdina. Mesedez saiatu berriz." diff --git a/debian/po/fr.po b/debian/po/fr.po index 98d6740b7e2..2c29513ac0a 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: fr\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-08-08 14:56+0200\n" "Last-Translator: Christian Perrier <bubulle@debian.org>\n" @@ -22,19 +22,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Faut-il vraiment revenir à la version précédente ?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Un fichier /var/lib/mysql/debian-*.flag est présent sur ce système." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -44,7 +44,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -52,13 +52,13 @@ msgstr "Il n'est pas garanti que cette version puisse en utiliser les données." #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Note importante pour les utilisateurs NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -68,7 +68,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -78,13 +78,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Faut-il supprimer toutes les bases de données MariaDB ?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -94,7 +94,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -105,13 +105,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Faut-il lancer MariaDB au démarrage ?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -121,13 +121,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nouveau mot de passe du superutilisateur de MariaDB :" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -137,26 +137,26 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Confirmation du mot de passe du superutilisateur de MariaDB :" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" "Impossible de changer le mot de passe de l'utilisateur « root » de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -168,7 +168,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "Vous devriez vérifier le mot de passe de ce compte après l'installation du " @@ -176,27 +176,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Veuillez consulter le fichier /usr/share/doc/mysql-server-10.1/README.Debian " +"Veuillez consulter le fichier /usr/share/doc/mysql-server-10.2/README.Debian " "pour plus d'informations." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Erreur de saisie du mot de passe" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" "Le mot de passe et sa confirmation ne sont pas identiques. Veuillez " diff --git a/debian/po/gl.po b/debian/po/gl.po index 122e4091c16..8b0dca67223 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-04-20 09:44+0200\n" "Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n" @@ -17,19 +17,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "¿Quere pasar a unha versión anterior?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Neste sistema hai un ficheiro chamado /var/lib/mysql/debian-*.flag." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -43,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -53,13 +53,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para os usuarios de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -67,7 +67,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -81,13 +81,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "¿Eliminar tódalas bases de datos de MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -97,7 +97,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -109,13 +109,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "¿Iniciar o servidor MariaDB co ordenador?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -125,13 +125,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Novo contrasinal para o usuario \"root\" de MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -141,7 +141,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -149,7 +149,7 @@ msgstr "Se deixa o campo en branco, non se ha cambiar o contrasinal." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -157,13 +157,13 @@ msgstr "Novo contrasinal para o usuario \"root\" de MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Non se puido establecer o contrasinal do usuario \"root\" de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,7 +175,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -184,27 +184,27 @@ msgstr "DeberÃa comprobar o contrasinal da conta trala instalación do paquete. #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Consulte o ficheiro /usr/share/doc/mariadb-server-10.1/README.Debian para " +"Consulte o ficheiro /usr/share/doc/mariadb-server-10.2/README.Debian para " "máis información." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/it.po b/debian/po/it.po index 459099cbc6a..076f03c9b75 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37 italian debconf templates\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-08-08 11:03+0200\n" "Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n" @@ -18,20 +18,20 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Procedere realmente con l'abbassamento di versione?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" "Su questo sistema esiste un file con nome /var/lib/mysql/debian-*.flag." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -41,7 +41,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -51,13 +51,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante per gli utenti NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -67,7 +67,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -77,13 +77,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Eliminare tutti i database MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -93,7 +93,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -105,13 +105,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Lanciare il server MariaDB all'avvio?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -121,13 +121,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nuova password per l'utente «root» di MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -137,25 +137,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "Se questo campo è lasciato vuoto, la password non viene cambiata." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Ripetere la password per l'utente «root» di MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Impossibile impostare la password per l'utente «root» di MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -168,34 +168,34 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "Al termine dell'installazione si deve verificare la password dell'account." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" "Per maggiori informazioni si consulti il file /usr/share/doc/mariadb-" -"server-10.1/README.Debian." +"server-10.2/README.Debian." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Errore di inserimento della password" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Le due password inserite sono diverse. Riprovare." diff --git a/debian/po/ja.po b/debian/po/ja.po index c1087266eaf..30b54ff447d 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37-1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-09-01 08:25+0900\n" "Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n" @@ -27,13 +27,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "本当ã«ãƒ€ã‚¦ãƒ³ã‚°ãƒ¬ãƒ¼ãƒ‰ã‚’実行ã—ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" "ã“ã®ã‚·ã‚¹ãƒ†ãƒ ã«ã¯ /var/lib/mysql/debian-*.flag ã¨ã„ã†åå‰ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒå˜åœ¨ã—ã¦" @@ -41,7 +41,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -51,7 +51,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -61,13 +61,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "NIS/YP ユーザã¸ã®é‡è¦ãªæ³¨æ„" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -77,7 +77,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -85,13 +85,13 @@ msgstr "/var/lib/mysql ã®æ‰€æœ‰è€…権é™ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹å¿…è¦ã‚‚ã‚ã‚Šã¾ #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "ã™ã¹ã¦ã® MariaDB データベースを削除ã—ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -101,7 +101,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -113,13 +113,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "MariaDB をシステム起動時ã«é–‹å§‹ã—ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -129,13 +129,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "MariaDB ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -145,25 +145,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "ã“ã®å€¤ã‚’空ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸå ´åˆã¯ã€ãƒ‘スワードã¯å¤‰æ›´ã•ã‚Œã¾ã›ã‚“。" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "MariaDB ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "MariaDB ã® \"root\" ユーザã®ãƒ‘スワードをè¨å®šã§ãã¾ã›ã‚“" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,33 +175,33 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" "パッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«å¾Œã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã®ãƒ‘スワードを確èªã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"詳細㯠/usr/share/doc/mariadb-server-10.1/README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。" +"詳細㯠/usr/share/doc/mariadb-server-10.2/README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "パスワード入力エラー" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "入力ã•ã‚ŒãŸäºŒã¤ã®ãƒ‘スワードãŒä¸€è‡´ã—ã¾ã›ã‚“。å†å…¥åŠ›ã—ã¦ãã ã•ã„。" diff --git a/debian/po/nb.po b/debian/po/nb.po index 992684fa3e1..c3230913e01 100644 --- a/debian/po/nb.po +++ b/debian/po/nb.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql_nb\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-02-18 12:13+0100\n" "Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n" @@ -19,7 +19,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "Do you really want to downgrade?" msgid "Really proceed with downgrade?" @@ -27,13 +27,13 @@ msgstr "Er du sikker pÃ¥ at du vil nedgradere?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " @@ -50,7 +50,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -58,7 +58,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -66,7 +66,7 @@ msgstr "Viktig merknad for NIS/YP-brukere!" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -74,7 +74,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -96,7 +96,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 #, fuzzy #| msgid "" #| "The script is about to remove the data directory /var/lib/mysql. If it is " @@ -113,7 +113,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "Should MySQL start on boot?" msgid "Start the MariaDB server on boot?" @@ -121,7 +121,7 @@ msgstr "Skal MariaDB startes ved maskinoppstart?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "The MySQL can start automatically on boot time or only if you manually " @@ -135,7 +135,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -143,7 +143,7 @@ msgstr "Nytt passord for MariaDBs «root»-bruker:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -157,13 +157,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -171,7 +171,7 @@ msgstr "Nytt passord for MariaDBs «root»-bruker:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -179,7 +179,7 @@ msgstr "Klarer ikke angi passord for MariaDBs «root»-bruker" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -198,27 +198,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/nl.po b/debian/po/nl.po index 82864ed8456..900fcaa5822 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.30-1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2006-02-19 10:20+0100\n" "Last-Translator: Thijs Kinkhorst <thijs@debian.org>\n" @@ -18,7 +18,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "Do you really want to downgrade?" msgid "Really proceed with downgrade?" @@ -26,13 +26,13 @@ msgstr "Wilt u echt een oude versie herstellen?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " @@ -50,7 +50,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -58,7 +58,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -66,7 +66,7 @@ msgstr "Belangrijke opmerking voor gebruikers van NIS/YP!" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -74,7 +74,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -96,7 +96,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 #, fuzzy #| msgid "" #| "The script is about to remove the data directory /var/lib/mysql. If it is " @@ -114,7 +114,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "Should MySQL start on boot?" msgid "Start the MariaDB server on boot?" @@ -122,7 +122,7 @@ msgstr "Moet MariaDB starten als de computer start?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "The MySQL can start automatically on boot time or only if you manually " @@ -136,7 +136,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -144,7 +144,7 @@ msgstr "Nieuw wachtwoord voor de MariaDB \"root\"-gebruiker:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -158,13 +158,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -172,7 +172,7 @@ msgstr "Nieuw wachtwoord voor de MariaDB \"root\"-gebruiker:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -180,7 +180,7 @@ msgstr "Kan het wachtwoord voor de MariaDB \"root\"-gebruiker niet instellen" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -199,27 +199,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/pt.po b/debian/po/pt.po index 0c35c038b70..d612b83f943 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-05-05 21:01+0100\n" "Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n" @@ -18,19 +18,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Deseja mesmo fazer downgrade?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Existe um ficheiro chamado /var/lib/mysql/debian-*.flag neste sistema." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -44,7 +44,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -54,13 +54,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para utilizadores de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -68,7 +68,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -81,13 +81,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Remover todas as bases de dados MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -97,7 +97,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -109,13 +109,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Iniciar o servidor MariaDB no arranque?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -125,13 +125,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nova palavra-passe para o utilizador \"root\" do MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -141,7 +141,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -150,7 +150,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -158,7 +158,7 @@ msgstr "Nova palavra-passe para o utilizador \"root\" do MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" "Não foi possÃvel definir a palavra-passe para o utilizador \"root\" do " @@ -166,7 +166,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +179,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -189,27 +189,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" "Para mais informação por favor leia o ficheiro /usr/share/doc/mariadb-" -"server-10.1/README.Debian." +"server-10.2/README.Debian." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index a0b4cdbfbfb..46ffefb8259 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2007-04-21 15:59-0300\n" "Last-Translator: André LuÃs Lopes <andrelop@debian.org>\n" @@ -21,19 +21,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Realmente proceder com o rebaixamento de versão?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Um arquivo de nome /var/lib/mysql/debian-*.flag existe no sistema." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "Such file is an indication that a mariadb-server package with a higher " @@ -47,7 +47,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -57,13 +57,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Aviso importante para usuários NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -71,7 +71,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -84,13 +84,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Remover todas as bases de dados do MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -100,7 +100,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -112,13 +112,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Iniciar o servidor MariaDB junto a inicialização da máquina?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -128,13 +128,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nova senha para o usuário \"root\" do MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -144,7 +144,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -152,7 +152,7 @@ msgstr "Caso este campo seja deixado em branco, a senha não sera mudada." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -160,13 +160,13 @@ msgstr "Nova senha para o usuário \"root\" do MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "ImpossÃvel definir senha para o usuário \"root\" do MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +179,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -188,27 +188,27 @@ msgstr "Você deverá checar a senha dessa conta após a instalação deste paco #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Por favor, leia o arquivo /usr/share/doc/mariadb-server-10.1/README.Debian " +"Por favor, leia o arquivo /usr/share/doc/mariadb-server-10.2/README.Debian " "para maiores informações." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -308,13 +308,13 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "O MySQL será instalado somente caso você possua um nome de host NÃO " #~ "NUMÉRICO que possa ser resolvido através do arquivo /etc/hosts, ou seja, " #~ "caso o comando \"hostname\" retorne \"myhostname\", uma linha como " -#~ "\"10.1.0.1 myhostname\" deverá existir no arquivo /etc/hosts." +#~ "\"10.2.0.1 myhostname\" deverá existir no arquivo /etc/hosts." #~ msgid "" #~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " diff --git a/debian/po/ro.po b/debian/po/ro.po index ceefecc8a1b..c960e3d2eb4 100644 --- a/debian/po/ro.po +++ b/debian/po/ro.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: po-debconf://mysql-dfsg\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2006-12-20 21:27+0200\n" "Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n" @@ -19,7 +19,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "Do you really want to downgrade?" msgid "Really proceed with downgrade?" @@ -27,13 +27,13 @@ msgstr "SunteÅ£i sigur că doriÅ£i să instalaÅ£i o versiune mai veche?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 #, fuzzy #| msgid "" #| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " @@ -50,7 +50,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -58,7 +58,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -66,7 +66,7 @@ msgstr "Notă importantă pentru utilizatorii NIS/YP!" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -74,7 +74,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -96,7 +96,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 #, fuzzy #| msgid "" #| "The script is about to remove the data directory /var/lib/mysql. If it is " @@ -113,7 +113,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "Should MySQL start on boot?" msgid "Start the MariaDB server on boot?" @@ -121,7 +121,7 @@ msgstr "DoriÅ£i ca MariaDB să pornească la initializarea sistemului?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "The MySQL can start automatically on boot time or only if you manually " @@ -135,7 +135,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -143,7 +143,7 @@ msgstr "Noua parolă pentru utilizatorul „root†al MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -157,13 +157,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -171,7 +171,7 @@ msgstr "Noua parolă pentru utilizatorul „root†al MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -179,7 +179,7 @@ msgstr "Nu s-a putut stabili parola pentru utilizatorul „root†al MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -198,27 +198,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/ru.po b/debian/po/ru.po index 5136933159b..096e9babe09 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37-1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-08-06 20:27+0400\n" "Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" @@ -32,19 +32,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "ДейÑтвительно уÑтановить более Ñтарую верÑию?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "Ð’ ÑиÑтеме найден файл /var/lib/mysql/debian-*.flag." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -54,7 +54,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -64,13 +64,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -80,7 +80,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -88,13 +88,13 @@ msgstr "Также проверьте права доÑтупа и Ð²Ð»Ð°Ð´ÐµÐ»Ñ #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Удалить вÑе базы данных MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -103,7 +103,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -115,13 +115,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "ЗапуÑкать MariaDB при загрузке ÑиÑтемы?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -131,13 +131,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Ðовый пароль Ð´Ð»Ñ MariaDB Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\":" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -147,25 +147,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "ЕÑли оÑтавить поле пуÑтым, то пароль изменён не будет." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Повторите ввод Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð´Ð»Ñ MariaDB Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ \"root\":" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Ðевозможно задать пароль MariaDB пользователю \"root\"" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -177,32 +177,32 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "Проверьте пароль учётной запиÑи поÑле уÑтановки пакета." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"ПодробноÑти Ñм. в файле /usr/share/doc/mariadb-server-10.1/README.Debian." +"ПодробноÑти Ñм. в файле /usr/share/doc/mariadb-server-10.2/README.Debian." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Ошибка ввода паролÑ" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Два введённых Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ðµ одинаковы. Повторите ввод." diff --git a/debian/po/sv.po b/debian/po/sv.po index 0cd512a252b..522403a049e 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2009-09-08 21:42+0100\n" "Last-Translator: Martin Bagge <brother@bsnet.se>\n" @@ -21,19 +21,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "Vill du verkligen genomföra nedgraderingen?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "En fil med namnet /var/lib/mysql/debian-*.flag hittades i systemet." #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -43,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -53,13 +53,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "Viktig information för NIS/YP-användare" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -69,7 +69,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -79,13 +79,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Ta bort alla MariaDB-databaser?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -95,7 +95,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -107,13 +107,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "Ska MariaDB startas vid systemets uppstart?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -123,13 +123,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nytt lösenord för MariaDBs \"root\"-användare:" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -139,25 +139,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "Om detta fält lämnas tom kommer lösenordet inte att ändras." #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Repetera lösenordet för MariaDBs \"root\"-användare:" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Kunde inte sätta lösenord för MariaDBs \"root\"-användare" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -170,33 +170,33 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "Du bör kontrollera kontots lösenord efter installationen av paketet." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 #, fuzzy #| msgid "" -#| "Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +#| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " #| "more information." msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"Läs filen /usr/share/doc/mariadb-server-10.1/README.Debian för mer " +"Läs filen /usr/share/doc/mariadb-server-10.2/README.Debian för mer " "information." #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "Fel vid inmatning av lösenord" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "De tvÃ¥ lösenorden du angav stämde inte överrens. Prova igen." diff --git a/debian/po/templates.pot b/debian/po/templates.pot index c164f1f4811..7032c34bc20 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" @@ -19,19 +19,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -39,7 +39,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -47,13 +47,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "Important note for NIS/YP users" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -61,7 +61,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -69,13 +69,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -83,7 +83,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -92,13 +92,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "Start the MariaDB server on boot?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "The MariaDB server can be launched automatically at boot time or manually " "with the '/etc/init.d/mysql start' command." @@ -106,13 +106,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -120,25 +120,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -147,26 +147,26 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/tr.po b/debian/po/tr.po index 814341a6bc2..81c20ba3b3e 100644 --- a/debian/po/tr.po +++ b/debian/po/tr.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" -"Report-Msgid-Bugs-To: mariadb-10.1@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" "POT-Creation-Date: 2012-01-12 13:08+0100\n" "PO-Revision-Date: 2004-06-05 08:53+0300\n" "Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n" @@ -18,19 +18,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "Really proceed with downgrade?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "Such a file is an indication that a mariadb-server package with a higher " "version has been installed previously." @@ -38,7 +38,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:2001 +#: ../mariadb-server-10.2.templates:2001 msgid "" "There is no guarantee that the version you're currently installing will be " "able to use the current databases." @@ -46,7 +46,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -54,7 +54,7 @@ msgstr "NIS/YP kullanıcıları için önemli not!" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -62,7 +62,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.1.templates:3001 +#: ../mariadb-server-10.2.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -70,13 +70,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -84,7 +84,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:4001 +#: ../mariadb-server-10.2.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " @@ -93,7 +93,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "Should MySQL start on boot?" msgid "Start the MariaDB server on boot?" @@ -101,7 +101,7 @@ msgstr "MariaDB açılış sırasında baÅŸlatılsın mı?" #. Type: boolean #. Description -#: ../mariadb-server-10.1.templates:5001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy msgid "" "The MariaDB server can be launched automatically at boot time or manually " @@ -113,13 +113,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -127,25 +127,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:6001 +#: ../mariadb-server-10.2.templates:6001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.1.templates:7001 +#: ../mariadb-server-10.2.templates:7001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -154,27 +154,27 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:8001 +#: ../mariadb-server-10.2.templates:8001 msgid "" -"Please read the /usr/share/doc/mariadb-server-10.1/README.Debian file for " +"Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.1.templates:9001 +#: ../mariadb-server-10.2.templates:9001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" @@ -206,12 +206,12 @@ msgstr "" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " #~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " -#~ "returns \"myhostname\" then there must be a line like \"10.1.0.1 " +#~ "returns \"myhostname\" then there must be a line like \"10.2.0.1 " #~ "myhostname\"." #~ msgstr "" #~ "MySQL sadece /etc/hosts dosyası yoluyla çözülebilir NUMERÄ°K OLMAYAN bir " #~ "makine adına sahipseniz kurulacaktır. ÖrneÄŸin, eÄŸer \"hostname\" komutu " -#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.1.0.1 makinem\" " +#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.2.0.1 makinem\" " #~ "gibi bir satır olmalıdır." #, fuzzy diff --git a/debian/rules b/debian/rules index 1c824626dca..7f134af24a8 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ export DH_VERBOSE=1 export DEB_BUILD_HARDENING=1 -PACKAGE=mariadb-10.1 +PACKAGE=mariadb-10.2 include /usr/share/dpatch/dpatch.make @@ -163,37 +163,37 @@ install: build # mariadb-server install -m 0755 $(BUILDDIR)/scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe - mkdir -p $(TMP)/usr/share/doc/mariadb-server-10.1/examples + mkdir -p $(TMP)/usr/share/doc/mariadb-server-10.2/examples # We have a sane my.cnf, cruft not needed (remove my-*.cnf and config-*.cnf) - # $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mariadb-server-10.1/examples/ + # $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mariadb-server-10.2/examples/ rm -vf $(TMP)/usr/share/mysql/my-*.cnf \ $(TMP)/usr/share/mysql/config-*.cnf \ $(TMP)/usr/share/mysql/mi_test_all* \ $(TMP)/usr/share/mysql/mysql-log-rotate \ $(TMP)/usr/share/mysql/mysql.server \ $(TMP)/usr/share/mysql/binary-configure - nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mariadb-server-10.1/mysqld.sym.gz + nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mariadb-server-10.2/mysqld.sym.gz install -m 0755 debian/additions/echo_stderr $(TMP)/usr/share/mysql/ install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/ install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/ - install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_SRC - install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_BIN + install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.2/INFO_SRC + install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.2/INFO_BIN # mariadb-test mv $(TMP)/usr/mysql-test $(TMP)/usr/share/mysql - # For 5.0 -> 10.1 transition + # For 5.0 -> 10.2 transition d=$(TMP)/usr/share/mysql-common/internal-use-only/; \ mkdir -p $$d; \ - cp debian/mariadb-server-10.1.mysql.init $$d/_etc_init.d_mysql; \ - cp debian/mariadb-server-10.1.mysql-server.logrotate $$d/_etc_logrotate.d_mysql-server; \ + cp debian/mariadb-server-10.2.mysql.init $$d/_etc_init.d_mysql; \ + cp debian/mariadb-server-10.2.mysql-server.logrotate $$d/_etc_logrotate.d_mysql-server; \ cp debian/additions/debian-start $$d/_etc_mysql_debian-start; # install AppArmor profile install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld # install Apport hook - install -D -m 644 debian/mariadb-server-10.1.py $(TMP)/usr/share/apport/package-hooks/source_mariadb-10.1.py + install -D -m 644 debian/mariadb-server-10.2.py $(TMP)/usr/share/apport/package-hooks/source_mariadb-10.2.py autorm=debian/autorm-file; \ rm -f $$autorm; \ @@ -241,12 +241,12 @@ binary-arch: build install dh_installexamples -a dh_installmenu -a dh_installlogrotate -a --name mysql-server - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.1 mariadb.service; fi - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.1 mariadb@.service; fi + if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.2 mariadb.service; fi + if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.2 mariadb@.service; fi # Start mysql in runlevel 19 before 20 where apache, proftpd etc gets # started which might depend on a running database server. dh_installinit -a --name=mysql -- defaults 19 21 - if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.1 --restart-after-upgrade mariadb.service; fi + if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.2 --restart-after-upgrade mariadb.service; fi dh_installcron -a --name mysql-server dh_installman -a dh_installinfo -a diff --git a/include/decimal.h b/include/decimal.h index 2adeb824318..39d617ae08d 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -51,7 +51,7 @@ int decimal2longlong(const decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); int decimal2double(const decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); -int decimal_actual_fraction(decimal_t *from); +int decimal_actual_fraction(const decimal_t *from); int decimal2bin(const decimal_t *from, uchar *to, int precision, int scale); int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); diff --git a/include/my_context.h b/include/my_context.h index 976ed9850cc..228f0c18f62 100644 --- a/include/my_context.h +++ b/include/my_context.h @@ -62,7 +62,7 @@ struct my_context { ucontext_t base_context; ucontext_t spawned_context; int active; -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H unsigned int valgrind_stack_id; #endif #ifndef DBUG_OFF @@ -79,7 +79,7 @@ struct my_context { uint64_t save[9]; void *stack_top; void *stack_bot; -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H unsigned int valgrind_stack_id; #endif #ifndef DBUG_OFF @@ -96,7 +96,7 @@ struct my_context { uint64_t save[7]; void *stack_top; void *stack_bot; -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H unsigned int valgrind_stack_id; #endif #ifndef DBUG_OFF diff --git a/include/my_global.h b/include/my_global.h index 6cf37a0af0e..befc3bf4672 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -153,13 +153,11 @@ */ #if defined(__APPLE__) && defined(__MACH__) # undef SIZEOF_CHARP -# undef SIZEOF_SHORT # undef SIZEOF_INT # undef SIZEOF_LONG # undef SIZEOF_LONG_LONG # undef SIZEOF_OFF_T # undef WORDS_BIGENDIAN -# define SIZEOF_SHORT 2 # define SIZEOF_INT 4 # define SIZEOF_LONG_LONG 8 # define SIZEOF_OFF_T 8 diff --git a/include/my_pthread.h b/include/my_pthread.h index 37576ac3cb4..321d44df60a 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -445,30 +445,10 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp); #define safe_mutex_assert_not_owner(mp) do {} while (0) #define safe_mutex_setflags(mp, F) do {} while (0) -#if defined(MY_PTHREAD_FASTMUTEX) -#define my_cond_timedwait(A,B,C) pthread_cond_timedwait((A), &(B)->mutex, (C)) -#define my_cond_wait(A,B) pthread_cond_wait((A), &(B)->mutex) -#else #define my_cond_timedwait(A,B,C) pthread_cond_timedwait((A),(B),(C)) #define my_cond_wait(A,B) pthread_cond_wait((A), (B)) -#endif /* MY_PTHREAD_FASTMUTEX */ #endif /* !SAFE_MUTEX */ -#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) -typedef struct st_my_pthread_fastmutex_t -{ - pthread_mutex_t mutex; - uint spins; - uint rng_state; -} my_pthread_fastmutex_t; -void fastmutex_global_init(void); - -int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp, - const pthread_mutexattr_t *attr); -int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); - -#endif /* defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ - /* READ-WRITE thread locking */ #if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS) diff --git a/include/my_valgrind.h b/include/my_valgrind.h index 4531ec78f9a..0662f5dce71 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -19,18 +19,18 @@ #define IF_VALGRIND(A,B) B #endif -#if defined(HAVE_VALGRIND) && defined(HAVE_valgrind) +#if defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind) # include <valgrind/memcheck.h> # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) # define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) # define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) -#else /* HAVE_VALGRIND */ +#else /* HAVE_VALGRIND_MEMCHECK_H */ # define MEM_UNDEFINED(a,len) ((void) 0) # define MEM_NOACCESS(a,len) ((void) 0) # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) # define MEM_CHECK_DEFINED(a,len) ((void) 0) -#endif /* HAVE_VALGRIND */ +#endif /* HAVE_VALGRIND_MEMCHECK_H */ #ifndef DBUG_OFF #define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); memset(A, C, trash_tmp); MEM_UNDEFINED(A, trash_tmp); } while (0) diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index 1dbe8c7eb22..202dc636eee 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -1014,7 +1014,7 @@ inline_mysql_socket_accept MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len) { #ifdef FD_CLOEXEC - int flags; + int flags __attribute__ ((unused)); #endif MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET; diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index 08dfeac37f1..0afbe6052f5 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -71,8 +71,6 @@ struct st_mysql_mutex /** The real mutex. */ #ifdef SAFE_MUTEX safe_mutex_t m_mutex; -#elif defined(MY_PTHREAD_FASTMUTEX) - my_pthread_fastmutex_t m_mutex; #else pthread_mutex_t m_mutex; #endif @@ -619,8 +617,6 @@ static inline int inline_mysql_mutex_init( #endif #ifdef SAFE_MUTEX return safe_mutex_init(&that->m_mutex, attr, src_name, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - return my_pthread_fastmutex_init(&that->m_mutex, attr); #else return pthread_mutex_init(&that->m_mutex, attr); #endif @@ -642,8 +638,6 @@ static inline int inline_mysql_mutex_destroy( #endif #ifdef SAFE_MUTEX return safe_mutex_destroy(&that->m_mutex, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - return pthread_mutex_destroy(&that->m_mutex.mutex); #else return pthread_mutex_destroy(&that->m_mutex); #endif @@ -670,8 +664,6 @@ static inline int inline_mysql_mutex_lock( /* Instrumented code */ #ifdef SAFE_MUTEX result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - result= my_pthread_fastmutex_lock(&that->m_mutex); #else result= pthread_mutex_lock(&that->m_mutex); #endif @@ -687,8 +679,6 @@ static inline int inline_mysql_mutex_lock( /* Non instrumented code */ #ifdef SAFE_MUTEX result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - result= my_pthread_fastmutex_lock(&that->m_mutex); #else result= pthread_mutex_lock(&that->m_mutex); #endif @@ -717,8 +707,6 @@ static inline int inline_mysql_mutex_trylock( /* Instrumented code */ #ifdef SAFE_MUTEX result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - result= pthread_mutex_trylock(&that->m_mutex.mutex); #else result= pthread_mutex_trylock(&that->m_mutex); #endif @@ -734,8 +722,6 @@ static inline int inline_mysql_mutex_trylock( /* Non instrumented code */ #ifdef SAFE_MUTEX result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - result= pthread_mutex_trylock(&that->m_mutex.mutex); #else result= pthread_mutex_trylock(&that->m_mutex); #endif @@ -759,8 +745,6 @@ static inline int inline_mysql_mutex_unlock( #ifdef SAFE_MUTEX result= safe_mutex_unlock(&that->m_mutex, src_file, src_line); -#elif defined(MY_PTHREAD_FASTMUTEX) - result= pthread_mutex_unlock(&that->m_mutex.mutex); #else result= pthread_mutex_unlock(&that->m_mutex); #endif diff --git a/include/mysql_com.h b/include/mysql_com.h index a3790a44c1d..df1ff3fe954 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -139,7 +139,6 @@ enum enum_server_command #define NUM_FLAG 32768 /* Field is num (for clients) */ #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ #define GROUP_FLAG 32768 /* Intern: Group field */ -#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ #define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */ #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ @@ -189,7 +188,8 @@ enum enum_server_command #define REFRESH_GENERIC (1ULL << 30) #define REFRESH_FAST (1ULL << 31) /* Intern flag */ -#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ +#define CLIENT_LONG_PASSWORD 0 /* obsolete flag */ +#define CLIENT_MYSQL 1 /* mysql/old mariadb server/client */ #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ #define CLIENT_LONG_FLAG 4 /* Get all column flags */ #define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ @@ -216,7 +216,7 @@ enum enum_server_command /* Don't close the connection for a connection with expired password. */ #define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22) -#define CLIENT_PROGRESS (1UL << 29) /* Client support progress indicator */ +#define CLIENT_PROGRESS_OBSOLETE (1UL << 29) #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) /* It used to be that if mysql_real_connect() failed, it would delete any @@ -229,14 +229,23 @@ enum enum_server_command */ #define CLIENT_REMEMBER_OPTIONS (1UL << 31) +/* MariaDB extended capability flags */ +#define MARIADB_CLIENT_FLAGS_MASK 0xffffffff00000000ULL +/* Client support progress indicator */ +#define MARIADB_CLIENT_PROGRESS (1ULL << 32) + #ifdef HAVE_COMPRESS #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS #else #define CAN_CLIENT_COMPRESS 0 #endif -/* Gather all possible capabilites (flags) supported by the server */ -#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ +/* + Gather all possible capabilites (flags) supported by the server + + MARIADB_* flags supported only by MariaDB connector(s). +*/ +#define CLIENT_ALL_FLAGS (\ CLIENT_FOUND_ROWS | \ CLIENT_LONG_FLAG | \ CLIENT_CONNECT_WITH_DB | \ @@ -257,7 +266,7 @@ enum enum_server_command CLIENT_PS_MULTI_RESULTS | \ CLIENT_SSL_VERIFY_SERVER_CERT | \ CLIENT_REMEMBER_OPTIONS | \ - CLIENT_PROGRESS | \ + MARIADB_CLIENT_PROGRESS | \ CLIENT_PLUGIN_AUTH | \ CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \ CLIENT_CONNECT_ATTRS) diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index b233614fa1e..2577870bfa3 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -27,7 +27,7 @@ extern char * mysql_unix_port; When adding capabilities here, consider if they should be also added to the server's version. */ -#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \ +#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \ CLIENT_LONG_FLAG | \ CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | \ diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 86a0676d97e..5035064b8e0 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1029,7 +1029,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) while ((item= it++)) { Send_field server_field; - item->make_field(&server_field); + item->make_field(thd, &server_field); /* Keep things compatible for old clients */ if (server_field.type == MYSQL_TYPE_VARCHAR) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index c4383b31a17..b99ea688d21 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -19,10 +19,10 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1 mysql_convert_table_format.1 mysql_fix_extensions.1 mysql_install_db.1 mysql_secure_installation.1 mysql_setpermission.1 - mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysql_zap.1 + mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1 mysqltest.1 perror.1 replace.1 resolve_stack_dump.1 - resolveip.1 mysqlbug.1) + resolveip.1) SET(MAN8_SERVER mysqld.8) SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1 mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1 diff --git a/man/mysql_zap.1 b/man/mysql_zap.1 deleted file mode 100644 index ed9596cea45..00000000000 --- a/man/mysql_zap.1 +++ /dev/null @@ -1,123 +0,0 @@ -'\" t -.\" -.TH "\FBMYSQL_ZAP\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" mysql_zap -.SH "NAME" -mysql_zap \- kill processes that match a pattern -.SH "SYNOPSIS" -.HP \w'\fBmysql_zap\ [\-\fR\fB\fIsignal\fR\fR\fB]\ [\-?Ift]\ \fR\fB\fIpattern\fR\fR\ 'u -\fBmysql_zap [\-\fR\fB\fIsignal\fR\fR\fB] [\-?Ift] \fR\fB\fIpattern\fR\fR -.SH "DESCRIPTION" -.PP -\fBmysql_zap\fR -kills processes that match a pattern\&. It uses the -\fBps\fR -command and Unix signals, so it runs on Unix and Unix\-like systems\&. -.PP -Invoke -\fBmysql_zap\fR -like this: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBmysql_zap [\-\fR\fB\fIsignal\fR\fR\fB] [\-?Ift] \fR\fB\fIpattern\fR\fR -.fi -.if n \{\ -.RE -.\} -.PP -A process matches if its output line from the -\fBps\fR -command contains the pattern\&. By default, -\fBmysql_zap\fR -asks for confirmation for each process\&. Respond -y -to kill the process, or -q -to exit -\fBmysql_zap\fR\&. For any other response, -\fBmysql_zap\fR -does not attempt to kill the process\&. -.PP -If the -\fB\-\fR\fB\fIsignal\fR\fR -option is given, it specifies the name or number of the signal to send to each process\&. Otherwise, -\fBmysql_zap\fR -tries first with -TERM -(signal 15) and then with -KILL -(signal 9)\&. -.PP -\fBmysql_zap\fR -supports the following additional options: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-help\fR, -\fB\-?\fR, -\fB\-I\fR -.sp -Display a help message and exit\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-f\fR -.sp -Force mode\&. -\fBmysql_zap\fR -attempts to kill each process without confirmation\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-t\fR -.sp -Test mode\&. Display information about each process but do not kill it\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ -.SH AUTHOR -MariaDB Foundation (http://www.mariadb.org/). diff --git a/man/mysqlbug.1 b/man/mysqlbug.1 deleted file mode 100644 index 76572150ac2..00000000000 --- a/man/mysqlbug.1 +++ /dev/null @@ -1,71 +0,0 @@ -'\" t -.\" -.TH "\FBMYSQLBUG\FR" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" mysqlbug -.SH "NAME" -mysqlbug \- generate bug report -.SH "SYNOPSIS" -.HP \w'\fBmysqlbug\fR\ 'u -\fBmysqlbug\fR -.SH "DESCRIPTION" -.PP -To report MariaDB bugs, see https://mariadb.com/kb/en/mariadb/reporting-bugs/ - the mysqlbug program has now been deprecated by Oracle, and was never useful for MariaDB. - -Originally, the program enabled you to generate a bug report and send it to Oracle Corporation\&. It is a shell script and runs on Unix\&. -.PP -The normal way to report MySQL bugs is to visit -\m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for MySQL's bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. If you have no Web access, you can generate a bug report by using the -\fBmysqlbug\fR -script\&. -.PP -\fBmysqlbug\fR -helps you generate a report by determining much of the following information automatically, but if something important is missing, please include it with your message\&. -\fBmysqlbug\fR -can be found in the -scripts -directory (source distribution) and in the -bin -directory under your MySQL installation directory (binary distribution)\&. -.PP -Invoke -\fBmysqlbug\fR -without arguments: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBmysqlbug\fR -.fi -.if n \{\ -.RE -.\} -.PP -The script will place you in an editor with a copy of the report to be sent\&. Edit the lines near the beginning that indicate the nature of the problem\&. Then write the file to save your changes, quit the editor, and -\fBmysqlbug\fR -will send the report by email\&. -.SH "COPYRIGHT" -.br -.PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ -.SH AUTHOR -MariaDB Foundation (http://www.mariadb.org/). diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 01ac06f6fc9..1575d6368ae 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2131,7 +2131,7 @@ sub mysqld_client_arguments () { sub have_maria_support () { - my $maria_var= $mysqld_variables{'aria-recover'}; + my $maria_var= $mysqld_variables{'aria-recover-options'}; return defined $maria_var; } diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 2f7cb7156a4..08d87fa292d 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -13728,3 +13728,23 @@ SET NAMES utf8; # # End of MariaDB-10.1 tests # +# +# Start of MariaDB-10.2 tests +# +# +# MDEV-9407 Illegal mix of collation when using GROUP_CONCAT in a VIEW +# +SET NAMES utf8; +CREATE TABLE t1 (col1 VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_unicode_ci); +INSERT INTO t1 VALUES ('a'),('b'); +CREATE VIEW v1 AS SELECT group_concat('f') AS col1; +SELECT col1 FROM v1 UNION SELECT col1 FROM t1; +col1 +f +a +b +DROP VIEW v1; +DROP TABLE t1; +# +# End of MariaDB-10.2 tests +# diff --git a/mysql-test/r/greedy_optimizer.result b/mysql-test/r/greedy_optimizer.result index 74fe9980958..de9db45cb15 100644 --- a/mysql-test/r/greedy_optimizer.result +++ b/mysql-test/r/greedy_optimizer.result @@ -118,10 +118,10 @@ select @@optimizer_prune_level; 1 set optimizer_search_depth=63; Warnings: -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead +Warning 1292 Truncated incorrect optimizer_search_depth value: '63' select @@optimizer_search_depth; @@optimizer_search_depth -63 +62 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -133,7 +133,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 821.837037 +Last_query_cost 1693.637037 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -145,55 +145,55 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 821.837037 +Last_query_cost 1693.637037 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index -1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index -1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index +1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 794.837037 +Last_query_cost 844.037037 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index -1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index -1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index +1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 794.837037 +Last_query_cost 844.037037 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 +1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where +1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 794.837037 +Last_query_cost 844.037037 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 +1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where +1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 794.837037 +Last_query_cost 844.037037 set optimizer_prune_level=0; select @@optimizer_prune_level; @@optimizer_prune_level diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index 90d305fb384..d816b1acf92 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -4691,6 +4691,9 @@ FROM t1 LEFT JOIN (t2 LEFT OUTER JOIN t3 ON t2.b = t3.b) ON t2.a = t1.b WHERE t3.a BETWEEN 3 AND 11 OR t1.a <= t2.c; a +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'h' +Warning 1292 Truncated incorrect INTEGER value: 'j' SET SESSION optimizer_switch = 'outer_join_with_cache=off'; SET SESSION join_cache_level = DEFAULT; DROP TABLE t1,t2,t3; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index bef03904a72..21c6beac7e3 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -559,10 +559,7 @@ The following options may be given as the first argument: a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will - automatically pick a reasonable value; if set to 63, the - optimizer will switch to the original find_best search. - NOTE: The value 63 and its associated behaviour is - deprecated + automatically pick a reasonable value --optimizer-selectivity-sampling-limit=# Controls number of record samples to check condition selectivity @@ -977,6 +974,8 @@ The following options may be given as the first argument: replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave + --slave-parallel-workers=# + Alias for slave_parallel_threads --slave-run-triggers-for-rbr=name Modes for how triggers in row-base replication on slave side will be executed. Legal values are NO (default), YES @@ -1127,7 +1126,8 @@ The following options may be given as the first argument: CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS tables in the INFORMATION_SCHEMA -v, --verbose Used with --help option for detailed help. - -V, --version Output version information and exit. + -V, --version[=name] + Output version information and exit. --wait-timeout=# The number of seconds the server waits for activity on a connection before closing it @@ -1402,6 +1402,7 @@ slave-net-timeout 3600 slave-parallel-max-queued 131072 slave-parallel-mode conservative slave-parallel-threads 0 +slave-parallel-workers 0 slave-run-triggers-for-rbr NO slave-skip-errors (No default value) slave-sql-verify-checksum TRUE diff --git a/mysql-test/r/shutdown.result b/mysql-test/r/shutdown.result index 7039afb129e..748d8ec16a6 100644 --- a/mysql-test/r/shutdown.result +++ b/mysql-test/r/shutdown.result @@ -5,3 +5,7 @@ create procedure try_shutdown() shutdown; drop procedure try_shutdown; shutdown; drop user user1@localhost; +# +# MDEV-8491 - On shutdown, report the user and the host executed that. +# +FOUND /mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown/ in mysqld.1.err diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 1f38e3888a0..c56597e6e44 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -779,7 +779,7 @@ drop procedure bug11394| CREATE PROCEDURE BUG_12490() HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS; -ERROR 0A000: HELP is not allowed in stored procedures +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'HELP CONTENTS' at line 1 CREATE TABLE t_bug_12490(a int); CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 24d9f0de35a..906f6a2f083 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -1294,7 +1294,7 @@ id select_type table type possible_keys key key_len ref rows Extra set @save_optimizer_search_depth=@@optimizer_search_depth; set @@optimizer_search_depth=63; Warnings: -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead +Warning 1292 Truncated incorrect optimizer_search_depth value: '63' explain select * from t1 where (a,b) in (select a,b from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 10 diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result index 19d3d25148f..7cea1cadddd 100644 --- a/mysql-test/r/subselect3_jcl6.result +++ b/mysql-test/r/subselect3_jcl6.result @@ -1304,7 +1304,7 @@ id select_type table type possible_keys key key_len ref rows Extra set @save_optimizer_search_depth=@@optimizer_search_depth; set @@optimizer_search_depth=63; Warnings: -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead +Warning 1292 Truncated incorrect optimizer_search_depth value: '63' explain select * from t1 where (a,b) in (select a,b from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 21d97b3faea..98a8907f741 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -937,6 +937,8 @@ SELECT d FROM t2, t1 WHERE a = d AND ( pk < 2 OR d = 'z' ) ); a b c +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'x' DROP TABLE t1, t2; # # BUG#951937: Wrong result (missing rows) with semijoin+materialization, IN subquery, InnoDB, TEMPTABLE view diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index eb91fe6d61b..1b8c1fc1158 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -952,6 +952,8 @@ SELECT d FROM t2, t1 WHERE a = d AND ( pk < 2 OR d = 'z' ) ); a b c +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'x' DROP TABLE t1, t2; # # BUG#951937: Wrong result (missing rows) with semijoin+materialization, IN subquery, InnoDB, TEMPTABLE view diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 16e8f88168d..ac38e57d60a 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -939,6 +939,8 @@ SELECT d FROM t2, t1 WHERE a = d AND ( pk < 2 OR d = 'z' ) ); a b c +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'x' DROP TABLE t1, t2; # # BUG#951937: Wrong result (missing rows) with semijoin+materialization, IN subquery, InnoDB, TEMPTABLE view diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 155e9535a0a..d0cd2c97510 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1141,3 +1141,54 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-9337 ALTER from DECIMAL and INT to DATETIME returns a wrong result +# +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (1000); +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1000); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1000); +ALTER TABLE t1 MODIFY a DATETIME; +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (1000.0); +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a DATETIME); +CREATE TABLE t2 (a DECIMAL(4,0)); +INSERT INTO t2 VALUES (1000); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE t1,t2; +CREATE TABLE t1 (a DECIMAL(4,0)); +INSERT INTO t1 VALUES (1000); +ALTER TABLE t1 MODIFY a DATETIME; +SELECT * FROM t1; +a +2000-10-00 00:00:00 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index d901434fd6e..f0152d08c32 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -2134,3 +2134,84 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# MDEV-9340 Copying from INT/DOUBLE to ENUM is inconsistent +# +CREATE TABLE t1 (a ENUM('9e200','9e100')); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES ('9e100'); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1,t2; +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (9e100); +ALTER TABLE t1 MODIFY a ENUM('9e200','9e100'); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9e100' +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1,t2; +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES ('200'); +ALTER TABLE t1 MODIFY a ENUM('200','100'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT *FROM t1; +a + +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1,t2; +CREATE TABLE t1 (a ENUM('2001','2002')); +CREATE TABLE t2 (a YEAR); +INSERT INTO t2 VALUES ('2001'); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1,t2; +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES ('2001'); +ALTER TABLE t1 MODIFY a ENUM('2001','2002'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a + +DROP TABLE t1; diff --git a/mysql-test/r/type_int.result b/mysql-test/r/type_int.result index 4e7b928ac07..530a4134f4a 100644 --- a/mysql-test/r/type_int.result +++ b/mysql-test/r/type_int.result @@ -36,3 +36,60 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in Field +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10.1),(10.9); +SELECT * FROM t1; +a +10 +11 +DROP TABLE t1; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a DECIMAL(10,2)); +INSERT INTO t2 VALUES (10.1),(10.9); +INSERT INTO t1 SELECT a FROM t2; +SELECT * FROM t1; +a +10 +11 +DROP TABLE t1,t2; +CREATE TABLE t1 (a DECIMAL(10,2)); +INSERT INTO t1 VALUES (10.1),(10.9); +ALTER TABLE t1 MODIFY a INT; +SELECT * FROM t1; +a +10 +11 +DROP TABLE t1; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (TIME'00:00:10.1'),(TIME'00:00:10.9'); +SELECT * FROM t1; +a +10 +10 +DROP TABLE t1; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a TIME(1)); +INSERT INTO t2 VALUES (10.1),(10.9); +INSERT INTO t1 SELECT a FROM t2; +SELECT * FROM t1; +a +10 +10 +DROP TABLE t1,t2; +CREATE TABLE t1 (a TIME(1)); +INSERT INTO t1 VALUES (10.1),(10.9); +ALTER TABLE t1 MODIFY a INT; +SELECT * FROM t1; +a +10 +10 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/type_num_innodb.result b/mysql-test/r/type_num_innodb.result new file mode 100644 index 00000000000..581a387b2e8 --- /dev/null +++ b/mysql-test/r/type_num_innodb.result @@ -0,0 +1,107 @@ +# +# Start of 10.2 tests +# +# +# MDEV-9391 InnoDB does not produce warnings when doing WHERE int_column=varchar_column +# +CREATE TABLE t1 ( +a DOUBLE, b VARCHAR(1), c INT, +KEY(a), KEY(b) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1,'v',9),(2,'v',8),(3,'c',7),(4,'m',6),(5,'x',5), +(6,'i',4),(7,'e',3),(8,'p',2),(9,'s',1),(10,'j',9), +(11,'z',8),(12,'c',7),(13,'a',6),(14,'q',5),(15,'y',4), +(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0); +CREATE TABLE t2 ( +pk INT, d VARCHAR(1), e INT, +PRIMARY KEY(pk), KEY(d,e) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES +(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5), +(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1), +(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5), +(15,'g',6),(16,'x',7),(17,'f',8); +SELECT * FROM t1,t2 WHERE a=d; +a b c pk d e +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'f' +Warning 1292 Truncated incorrect DOUBLE value: 'f' +Warning 1292 Truncated incorrect DOUBLE value: 'g' +Warning 1292 Truncated incorrect DOUBLE value: 'k' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'o' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'r' +Warning 1292 Truncated incorrect DOUBLE value: 'u' +Warning 1292 Truncated incorrect DOUBLE value: 'w' +Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DOUBLE value: 'y' +ALTER TABLE t1 MODIFY a DECIMAL(10,0); +SELECT * FROM t1,t2 WHERE a=d; +a b c pk d e +Warnings: +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'd' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'd' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'f' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'f' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'g' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'k' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'm' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'm' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'm' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'o' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'q' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'r' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'u' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'w' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'x' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'x' +Warning 1918 Encountered illegal value '' when converting to DECIMAL +Warning 1292 Truncated incorrect DECIMAL value: 'y' +ALTER TABLE t1 MODIFY a DOUBLE; +SELECT * FROM t1,t2 WHERE a=d; +a b c pk d e +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'f' +Warning 1292 Truncated incorrect DOUBLE value: 'f' +Warning 1292 Truncated incorrect DOUBLE value: 'g' +Warning 1292 Truncated incorrect DOUBLE value: 'k' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'o' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'r' +Warning 1292 Truncated incorrect DOUBLE value: 'u' +Warning 1292 Truncated incorrect DOUBLE value: 'w' +Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DOUBLE value: 'y' +DROP TABLE t1,t2; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index bdcffc8d824..e4347509d5e 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -1217,3 +1217,32 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in Field +# +CREATE TABLE t1 (a YEAR, b TIME, c YEAR); +CREATE TABLE t2 (a YEAR); +INSERT INTO t2 VALUES (0),(1999),(2000),(2030),(2050),(2070); +INSERT INTO t1 (a,b,c) SELECT a,a,a FROM t2; +Warnings: +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b' at row 6 +ALTER TABLE t1 MODIFY c TIME; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c' at row 6 +SELECT * FROM t1; +a b c +0000 00:00:00 00:00:00 +1999 00:00:00 00:00:00 +2000 00:20:00 00:20:00 +2030 00:20:30 00:20:30 +2050 00:20:50 00:20:50 +2070 00:00:00 00:00:00 +DROP TABLE t1,t2; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 842a16e3b4a..4d28a7b8d25 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -438,3 +438,48 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings +# +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES (-0.1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1; +CREATE TABLE t1 (a YEAR); +CREATE TABLE t2 (a DECIMAL(10,1)); +INSERT INTO t2 VALUES (-0.1); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1,t2; +CREATE TABLE t1 (a DECIMAL(10,1)); +INSERT INTO t1 VALUES (-0.1); +ALTER TABLE t1 MODIFY a YEAR; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1; +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES (-0.1e0); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1; +CREATE TABLE t1 (a YEAR); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES (-0.1); +INSERT INTO t1 SELECT * FROM t2; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1,t2; +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (-0.1); +ALTER TABLE t1 MODIFY a YEAR; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index dec85fbcd4b..01a06fad00d 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -5878,3 +5878,39 @@ DROP TABLE t1; # # End of 10.1 tests # +# +# Start of 10.2 tests +# +# +# MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view +# +CREATE TABLE t1 ( +id int(11) NOT NULL PRIMARY KEY, +country varchar(32), +code int(11) default NULL +); +INSERT INTO t1 VALUES (1,'ITALY',100),(2,'ITALY',200),(3,'FRANCE',100), (4,'ITALY',100); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 AS +SELECT code, COUNT(DISTINCT country), MAX(id) FROM t1 GROUP BY code ORDER BY MAX(id); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `code` int(11) DEFAULT NULL, + `COUNT(DISTINCT country)` bigint(21) NOT NULL, + `MAX(id)` int(11) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 AS +SELECT code, COUNT(DISTINCT country), MAX(id) FROM v1 GROUP BY code ORDER BY MAX(id); +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `code` int(11) DEFAULT NULL, + `COUNT(DISTINCT country)` bigint(21) NOT NULL, + `MAX(id)` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP VIEW v1; +DROP TABLE t1,t2,t3; +# +# End of 10.2 tests +# diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index f0e1ee74e0b..655a5d3ff96 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -3816,7 +3816,7 @@ return 1' at line 1 CREATE FUNCTION fn1(a char) returns int lang sql return 1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'sql return 1' at line 1 CREATE FUNCTION fn1(a char) returns int deterministic( return 1); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'return 1)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '( return 1)' at line 1 CREATE FUNCTION fn1(a char) returns int non deterministic return 1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'deterministic return 1' at line 1 CREATE FUNCTION fn1(a char) returns int not deterministic comment 'abc' language sql sql security refiner return 1; diff --git a/mysql-test/suite/maria/maria-recover-master.opt b/mysql-test/suite/maria/maria-recover-master.opt index 7582a381a32..976c3882d2e 100644 --- a/mysql-test/suite/maria/maria-recover-master.opt +++ b/mysql-test/suite/maria/maria-recover-master.opt @@ -1 +1 @@ ---loose-aria-recover=backup --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp +--loose-aria-recover-options=backup --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp diff --git a/mysql-test/suite/maria/maria-recover.result b/mysql-test/suite/maria/maria-recover.result index 9b84c47720a..472d2351abe 100644 --- a/mysql-test/suite/maria/maria-recover.result +++ b/mysql-test/suite/maria/maria-recover.result @@ -1,17 +1,17 @@ -select @@global.aria_recover; -@@global.aria_recover +select @@global.aria_recover_options; +@@global.aria_recover_options BACKUP -set global aria_recover=off; -select @@global.aria_recover; -@@global.aria_recover +set global aria_recover_options=off; +select @@global.aria_recover_options; +@@global.aria_recover_options OFF -set global aria_recover=default; -select @@global.aria_recover; -@@global.aria_recover +set global aria_recover_options=default; +select @@global.aria_recover_options; +@@global.aria_recover_options NORMAL -set global aria_recover=normal; -select @@global.aria_recover; -@@global.aria_recover +set global aria_recover_options=normal; +select @@global.aria_recover_options; +@@global.aria_recover_options NORMAL drop database if exists mysqltest; create database mysqltest; @@ -35,5 +35,5 @@ a ThursdayMorningsMarket ThursdayMorningsMarketb drop database mysqltest; -set global aria_recover=backup; +set global aria_recover_options=backup; set global aria_checkpoint_interval=30; diff --git a/mysql-test/suite/maria/maria-recover.test b/mysql-test/suite/maria/maria-recover.test index 56259ad9a31..0f9f5e9cd26 100644 --- a/mysql-test/suite/maria/maria-recover.test +++ b/mysql-test/suite/maria/maria-recover.test @@ -1,4 +1,4 @@ -# Test of the --aria-recover option. +# Test of the --aria-recover-options option. --source include/have_maria.inc @@ -18,13 +18,13 @@ let $def_checkinterval=`select @@global.aria_checkpoint_interval`; # so that the perl code below can access it. let MYSQLD_DATADIR= `select @@datadir`; -select @@global.aria_recover; -set global aria_recover=off; -select @@global.aria_recover; -set global aria_recover=default; -select @@global.aria_recover; -set global aria_recover=normal; -select @@global.aria_recover; +select @@global.aria_recover_options; +set global aria_recover_options=off; +select @@global.aria_recover_options; +set global aria_recover_options=default; +select @@global.aria_recover_options; +set global aria_recover_options=normal; +select @@global.aria_recover_options; --disable_warnings drop database if exists mysqltest; @@ -72,5 +72,5 @@ select * from t_corrupted2; # should show corruption and repair messages select * from t_corrupted2; # should show just rows drop database mysqltest; -set global aria_recover=backup; +set global aria_recover_options=backup; eval set global aria_checkpoint_interval=$def_checkinterval; diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index feb5fa82cd4..7e0e55ed8c0 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -317,7 +317,7 @@ aria_pagecache_buffer_size 8388608 aria_pagecache_division_limit 100 aria_pagecache_file_hash_size 512 aria_page_checksum OFF -aria_recover NORMAL +aria_recover_options NORMAL aria_repair_threads 1 aria_sort_buffer_size 268434432 aria_stats_method nulls_unequal diff --git a/mysql-test/suite/maria/suite.pm b/mysql-test/suite/maria/suite.pm index c8ef6d8af72..d9af0f2ac43 100644 --- a/mysql-test/suite/maria/suite.pm +++ b/mysql-test/suite/maria/suite.pm @@ -2,7 +2,7 @@ package My::Suite::Maria; @ISA = qw(My::Suite); -return "Need Aria engine" unless defined $::mysqld_variables{'aria-recover'}; +return "Need Aria engine" unless defined $::mysqld_variables{'aria-recover-options'}; bless { }; diff --git a/mysql-test/suite/sys_vars/r/aria_recover_basic.result b/mysql-test/suite/sys_vars/r/aria_recover_basic.result deleted file mode 100644 index 9cbc6617874..00000000000 --- a/mysql-test/suite/sys_vars/r/aria_recover_basic.result +++ /dev/null @@ -1,57 +0,0 @@ -SET @start_global_value = @@global.aria_recover; -select @@global.aria_recover; -@@global.aria_recover -NORMAL -select @@session.aria_recover; -ERROR HY000: Variable 'aria_recover' is a GLOBAL variable -show global variables like 'aria_recover'; -Variable_name Value -aria_recover NORMAL -show session variables like 'aria_recover'; -Variable_name Value -aria_recover NORMAL -select * from information_schema.global_variables where variable_name='aria_recover'; -VARIABLE_NAME VARIABLE_VALUE -ARIA_RECOVER NORMAL -select * from information_schema.session_variables where variable_name='aria_recover'; -VARIABLE_NAME VARIABLE_VALUE -ARIA_RECOVER NORMAL -set global aria_recover=1; -select @@global.aria_recover; -@@global.aria_recover -NORMAL -set session aria_recover=1; -ERROR HY000: Variable 'aria_recover' is a GLOBAL variable and should be set with SET GLOBAL -set global aria_recover=normal; -select @@global.aria_recover; -@@global.aria_recover -NORMAL -set global aria_recover=backup; -select @@global.aria_recover; -@@global.aria_recover -BACKUP -set global aria_recover='force'; -select @@global.aria_recover; -@@global.aria_recover -FORCE -set global aria_recover=off; -select @@global.aria_recover; -@@global.aria_recover -OFF -set global aria_recover='quick,force'; -select @@global.aria_recover; -@@global.aria_recover -FORCE,QUICK -set global aria_recover=16; -select @@global.aria_recover; -@@global.aria_recover -OFF -set global aria_recover=1.1; -ERROR 42000: Incorrect argument type to variable 'aria_recover' -set global aria_recover=1e1; -ERROR 42000: Incorrect argument type to variable 'aria_recover' -set global aria_recover="foo"; -ERROR 42000: Variable 'aria_recover' can't be set to the value of 'foo' -set global aria_recover=32; -ERROR 42000: Variable 'aria_recover' can't be set to the value of '32' -SET @@global.aria_recover = @start_global_value; diff --git a/mysql-test/suite/sys_vars/r/aria_recover_options_basic.result b/mysql-test/suite/sys_vars/r/aria_recover_options_basic.result new file mode 100644 index 00000000000..04c45aa0dbb --- /dev/null +++ b/mysql-test/suite/sys_vars/r/aria_recover_options_basic.result @@ -0,0 +1,57 @@ +SET @start_global_value = @@global.aria_recover_options; +select @@global.aria_recover_options; +@@global.aria_recover_options +NORMAL +select @@session.aria_recover_options; +ERROR HY000: Variable 'aria_recover_options' is a GLOBAL variable +show global variables like 'aria_recover_options'; +Variable_name Value +aria_recover_options NORMAL +show session variables like 'aria_recover_options'; +Variable_name Value +aria_recover_options NORMAL +select * from information_schema.global_variables where variable_name='aria_recover_options'; +VARIABLE_NAME VARIABLE_VALUE +ARIA_RECOVER_OPTIONS NORMAL +select * from information_schema.session_variables where variable_name='aria_recover_options'; +VARIABLE_NAME VARIABLE_VALUE +ARIA_RECOVER_OPTIONS NORMAL +set global aria_recover_options=1; +select @@global.aria_recover_options; +@@global.aria_recover_options +NORMAL +set session aria_recover_options=1; +ERROR HY000: Variable 'aria_recover_options' is a GLOBAL variable and should be set with SET GLOBAL +set global aria_recover_options=normal; +select @@global.aria_recover_options; +@@global.aria_recover_options +NORMAL +set global aria_recover_options=backup; +select @@global.aria_recover_options; +@@global.aria_recover_options +BACKUP +set global aria_recover_options='force'; +select @@global.aria_recover_options; +@@global.aria_recover_options +FORCE +set global aria_recover_options=off; +select @@global.aria_recover_options; +@@global.aria_recover_options +OFF +set global aria_recover_options='quick,force'; +select @@global.aria_recover_options; +@@global.aria_recover_options +FORCE,QUICK +set global aria_recover_options=16; +select @@global.aria_recover_options; +@@global.aria_recover_options +OFF +set global aria_recover_options=1.1; +ERROR 42000: Incorrect argument type to variable 'aria_recover_options' +set global aria_recover_options=1e1; +ERROR 42000: Incorrect argument type to variable 'aria_recover_options' +set global aria_recover_options="foo"; +ERROR 42000: Variable 'aria_recover_options' can't be set to the value of 'foo' +set global aria_recover_options=32; +ERROR 42000: Variable 'aria_recover_options' can't be set to the value of '32' +SET @@global.aria_recover_options = @start_global_value; diff --git a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result index de448d3e2fc..75d99943288 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result @@ -10,7 +10,6 @@ SELECT @start_session_value; SET @@global.optimizer_search_depth = 100; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '100' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SET @@global.optimizer_search_depth = DEFAULT; SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth @@ -18,7 +17,6 @@ SELECT @@global.optimizer_search_depth; SET @@session.optimizer_search_depth = 200; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '200' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SET @@session.optimizer_search_depth = DEFAULT; SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth @@ -47,10 +45,10 @@ SELECT @@global.optimizer_search_depth; 62 SET @@global.optimizer_search_depth = 63; Warnings: -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead +Warning 1292 Truncated incorrect optimizer_search_depth value: '63' SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth -63 +62 '#--------------------FN_DYNVARS_116_04-------------------------#' SET @@session.optimizer_search_depth = 0; SELECT @@session.optimizer_search_depth; @@ -66,18 +64,17 @@ SELECT @@session.optimizer_search_depth; 62 SET @@session.optimizer_search_depth = 63; Warnings: -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead +Warning 1292 Truncated incorrect optimizer_search_depth value: '63' SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth -63 +62 '#------------------FN_DYNVARS_116_05-----------------------#' SET @@global.optimizer_search_depth = 64; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '64' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth -63 +62 SET @@global.optimizer_search_depth = -1; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '-1' @@ -87,27 +84,25 @@ SELECT @@global.optimizer_search_depth; SET @@global.optimizer_search_depth = 65536; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '65536' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth -63 +62 SET @@global.optimizer_search_depth = 65530.34; ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth' SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth -63 +62 SET @@global.optimizer_search_depth = test; ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth' SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth -63 +62 SET @@session.optimizer_search_depth = 64; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '64' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth -63 +62 SET @@session.optimizer_search_depth = -2; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '-2' @@ -119,15 +114,14 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth' SET @@session.optimizer_search_depth = 65550; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '65550' -Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth -63 +62 SET @@session.optimizer_search_depth = test; ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth' SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth -63 +62 '#------------------FN_DYNVARS_116_06-----------------------#' SELECT @@global.optimizer_search_depth = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result index 2948b2ad3fc..f2418cf31db 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_aria.result +++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result @@ -211,7 +211,7 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED -VARIABLE_NAME ARIA_RECOVER +VARIABLE_NAME ARIA_RECOVER_OPTIONS SESSION_VALUE NULL GLOBAL_VALUE NORMAL GLOBAL_VALUE_ORIGIN COMPILE-TIME diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index 170989d9fa0..986531a6dd4 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -1,5 +1,5 @@ ---- suite/sys_vars/r/sysvars_server_embedded.result 2015-09-04 13:17:44.407031503 +0000 -+++ suite/sys_vars/r/sysvars_server_embedded,32bit.reject 2015-09-04 13:39:45.098389360 +0000 +--- suite/sys_vars/r/sysvars_server_embedded.result ++++ suite/sys_vars/r/sysvars_server_embedded,32bit.reject @@ -57,7 +57,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 1 @@ -179,7 +179,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -813,7 +813,7 @@ +@@ -827,7 +827,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL @@ -188,7 +188,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -855,7 +855,7 @@ +@@ -869,7 +869,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -197,7 +197,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -897,7 +897,7 @@ +@@ -911,7 +911,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 84 VARIABLE_SCOPE GLOBAL @@ -206,7 +206,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -911,7 +911,7 @@ +@@ -925,7 +925,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL @@ -215,7 +215,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -925,7 +925,7 @@ +@@ -939,7 +939,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE GLOBAL @@ -224,7 +224,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -984,7 +984,7 @@ +@@ -998,7 +998,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 @@ -233,7 +233,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1135,7 +1135,7 @@ +@@ -1149,7 +1149,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -242,7 +242,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1163,7 +1163,7 @@ +@@ -1177,7 +1177,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -251,7 +251,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1275,7 +1275,7 @@ +@@ -1289,7 +1289,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -260,7 +260,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1306,7 +1306,7 @@ +@@ -1320,7 +1320,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -269,7 +269,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1331,7 +1331,7 @@ +@@ -1345,7 +1345,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE SESSION @@ -278,7 +278,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1362,7 +1362,7 @@ +@@ -1376,7 +1376,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -287,7 +287,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1569,7 +1569,7 @@ +@@ -1583,7 +1583,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 31536000 VARIABLE_SCOPE SESSION @@ -296,7 +296,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1667,7 +1667,7 @@ +@@ -1681,7 +1681,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -305,7 +305,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1695,7 +1695,7 @@ +@@ -1709,7 +1709,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -314,7 +314,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1737,7 +1737,7 @@ +@@ -1751,7 +1751,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION @@ -323,7 +323,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1747,14 +1747,14 @@ +@@ -1761,14 +1761,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_CACHE_SIZE SESSION_VALUE NULL @@ -341,7 +341,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1765,7 +1765,7 @@ +@@ -1779,7 +1779,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -350,7 +350,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1775,14 +1775,14 @@ +@@ -1789,14 +1789,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL @@ -368,7 +368,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1793,7 +1793,7 @@ +@@ -1807,7 +1807,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 151 VARIABLE_SCOPE GLOBAL @@ -377,7 +377,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -1807,7 +1807,7 @@ +@@ -1821,7 +1821,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -386,7 +386,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1821,7 +1821,7 @@ +@@ -1835,7 +1835,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -395,7 +395,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1849,7 +1849,7 @@ +@@ -1863,7 +1863,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 64 VARIABLE_SCOPE SESSION @@ -404,7 +404,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -1866,7 +1866,7 @@ +@@ -1880,7 +1880,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -413,7 +413,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1877,7 +1877,7 @@ +@@ -1891,7 +1891,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -422,7 +422,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1905,7 +1905,7 @@ +@@ -1919,7 +1919,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -431,7 +431,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -1919,7 +1919,7 @@ +@@ -1933,7 +1933,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -440,7 +440,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -1933,7 +1933,7 @@ +@@ -1947,7 +1947,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16382 VARIABLE_SCOPE GLOBAL @@ -449,7 +449,7 @@ VARIABLE_COMMENT Maximum number of prepared statements in the server NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -1947,7 +1947,7 @@ +@@ -1961,7 +1961,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -458,7 +458,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1961,7 +1961,7 @@ +@@ -1975,7 +1975,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -467,7 +467,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -1975,7 +1975,7 @@ +@@ -1989,7 +1989,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2003,7 +2003,7 @@ +@@ -2017,7 +2017,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2031,7 +2031,7 @@ +@@ -2045,7 +2045,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -494,7 +494,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2045,7 +2045,7 @@ +@@ -2059,7 +2059,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2059,7 +2059,7 @@ +@@ -2073,7 +2073,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2073,7 +2073,7 @@ +@@ -2087,7 +2087,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -521,7 +521,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2087,7 +2087,7 @@ +@@ -2101,7 +2101,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2101,10 +2101,10 @@ +@@ -2115,10 +2115,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -543,7 +543,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2115,7 +2115,7 @@ +@@ -2129,7 +2129,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -552,7 +552,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2129,7 +2129,7 @@ +@@ -2143,7 +2143,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2139,9 +2139,9 @@ +@@ -2153,9 +2153,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -573,7 +573,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2153,14 +2153,14 @@ +@@ -2167,14 +2167,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -591,7 +591,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2185,10 +2185,10 @@ +@@ -2199,10 +2199,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -604,7 +604,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2202,7 +2202,7 @@ +@@ -2216,7 +2216,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2255,7 +2255,7 @@ +@@ -2269,7 +2269,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -622,7 +622,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2269,7 +2269,7 @@ +@@ -2283,7 +2283,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2283,7 +2283,7 @@ +@@ -2297,7 +2297,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2297,7 +2297,7 @@ +@@ -2311,7 +2311,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2367,7 +2367,7 @@ +@@ -2381,7 +2381,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -658,16 +658,16 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2381,7 +2381,7 @@ +@@ -2395,7 +2395,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated + VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 63 -@@ -2395,7 +2395,7 @@ + NUMERIC_MAX_VALUE 62 +@@ -2409,7 +2409,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2423,7 +2423,7 @@ +@@ -2437,7 +2437,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2451,7 +2451,7 @@ +@@ -2465,7 +2465,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -694,7 +694,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2465,7 +2465,7 @@ +@@ -2479,7 +2479,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2479,7 +2479,7 @@ +@@ -2493,7 +2493,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2493,7 +2493,7 @@ +@@ -2507,7 +2507,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2507,7 +2507,7 @@ +@@ -2521,7 +2521,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2521,7 +2521,7 @@ +@@ -2535,7 +2535,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2535,7 +2535,7 @@ +@@ -2549,7 +2549,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2549,7 +2549,7 @@ +@@ -2563,7 +2563,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2563,7 +2563,7 @@ +@@ -2577,7 +2577,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2577,7 +2577,7 @@ +@@ -2591,7 +2591,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2591,7 +2591,7 @@ +@@ -2605,7 +2605,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2605,7 +2605,7 @@ +@@ -2619,7 +2619,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2619,7 +2619,7 @@ +@@ -2633,7 +2633,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2633,7 +2633,7 @@ +@@ -2647,7 +2647,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2647,7 +2647,7 @@ +@@ -2661,7 +2661,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2661,7 +2661,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2675,7 +2675,7 @@ +@@ -2689,7 +2689,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2689,7 +2689,7 @@ +@@ -2703,7 +2703,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2703,7 +2703,7 @@ +@@ -2717,7 +2717,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2717,7 +2717,7 @@ +@@ -2731,7 +2731,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2731,7 +2731,7 @@ +@@ -2745,7 +2745,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2745,7 +2745,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2759,7 +2759,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 178 VARIABLE_SCOPE GLOBAL @@ -892,7 +892,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2773,7 +2773,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -901,7 +901,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2787,7 +2787,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2801,7 +2801,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2815,7 +2815,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2829,7 +2829,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -2857,7 +2857,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2871,7 +2871,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2941,7 +2941,7 @@ +@@ -2955,7 +2955,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -973,7 +973,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -2969,7 +2969,7 @@ +@@ -2983,7 +2983,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -2983,7 +2983,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3039,10 +3039,10 @@ +@@ -3053,10 +3053,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION ONLY @@ -1004,7 +1004,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3053,7 +3053,7 @@ +@@ -3067,7 +3067,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1013,7 +1013,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3067,7 +3067,7 @@ +@@ -3081,7 +3081,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1022,7 +1022,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3081,7 +3081,7 @@ +@@ -3095,7 +3095,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1031,7 +1031,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3098,7 +3098,7 @@ +@@ -3112,7 +3112,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1040,7 +1040,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3151,7 +3151,7 @@ +@@ -3165,7 +3165,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1049,7 +1049,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3165,7 +3165,7 @@ +@@ -3179,7 +3179,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1058,7 +1058,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3179,7 +3179,7 @@ +@@ -3193,7 +3193,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1067,7 +1067,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3207,7 +3207,7 @@ +@@ -3221,7 +3221,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1076,7 +1076,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3221,10 +3221,10 @@ +@@ -3235,10 +3235,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1089,7 +1089,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3263,7 +3263,7 @@ +@@ -3277,7 +3277,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -1098,7 +1098,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3361,7 +3361,7 @@ +@@ -3375,7 +3375,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1107,7 +1107,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3375,7 +3375,7 @@ +@@ -3389,7 +3389,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1116,7 +1116,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -3434,7 +3434,7 @@ +@@ -3448,7 +3448,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1125,7 +1125,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3711,7 +3711,7 @@ +@@ -3725,7 +3725,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1134,7 +1134,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -3781,7 +3781,7 @@ +@@ -3795,7 +3795,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1143,7 +1143,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -3795,7 +3795,7 @@ +@@ -3809,7 +3809,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1152,7 +1152,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 524288 -@@ -3809,7 +3809,7 @@ +@@ -3823,7 +3823,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1161,7 +1161,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -3823,7 +3823,7 @@ +@@ -3837,7 +3837,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1170,7 +1170,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -3938,7 +3938,7 @@ +@@ -3952,7 +3952,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table NUMERIC_MIN_VALUE 1024 @@ -1179,7 +1179,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3949,7 +3949,7 @@ +@@ -3963,7 +3963,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1188,7 +1188,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -3963,7 +3963,7 @@ +@@ -3977,7 +3977,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1197,7 +1197,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4061,7 +4061,7 @@ +@@ -4075,7 +4075,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1206,7 +1206,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -4165,7 +4165,7 @@ +@@ -4179,7 +4179,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1215,7 +1215,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4178,7 +4178,7 @@ +@@ -4192,7 +4192,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1224,7 +1224,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4188,7 +4188,7 @@ +@@ -4202,7 +4202,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1233,7 +1233,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4273,7 +4273,7 @@ +@@ -4287,7 +4287,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index fd003588668..22450701bf0 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -2396,9 +2396,9 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated +VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 63 +NUMERIC_MAX_VALUE 62 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index e87f2647f69..f6e931d00aa 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -179,7 +179,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -841,7 +841,7 @@ +@@ -855,7 +855,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL @@ -188,7 +188,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -883,7 +883,7 @@ +@@ -897,7 +897,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -197,7 +197,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -925,7 +925,7 @@ +@@ -939,7 +939,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 84 VARIABLE_SCOPE GLOBAL @@ -206,7 +206,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -939,7 +939,7 @@ +@@ -953,7 +953,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL @@ -215,7 +215,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -953,7 +953,7 @@ +@@ -967,7 +967,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE GLOBAL @@ -224,7 +224,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -1012,7 +1012,7 @@ +@@ -1026,7 +1026,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 @@ -233,7 +233,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1247,7 +1247,7 @@ +@@ -1261,7 +1261,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -242,7 +242,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1275,7 +1275,7 @@ +@@ -1289,7 +1289,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -251,7 +251,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1387,7 +1387,7 @@ +@@ -1401,7 +1401,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -260,7 +260,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1418,7 +1418,7 @@ +@@ -1432,7 +1432,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -269,7 +269,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1443,7 +1443,7 @@ +@@ -1457,7 +1457,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE SESSION @@ -278,7 +278,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1474,7 +1474,7 @@ +@@ -1488,7 +1488,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -287,7 +287,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1695,7 +1695,7 @@ +@@ -1709,7 +1709,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 31536000 VARIABLE_SCOPE SESSION @@ -296,7 +296,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1835,7 +1835,7 @@ +@@ -1849,7 +1849,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -305,7 +305,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1863,7 +1863,7 @@ +@@ -1877,7 +1877,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -314,7 +314,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1919,7 +1919,7 @@ +@@ -1933,7 +1933,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION @@ -323,7 +323,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1929,14 +1929,14 @@ +@@ -1943,14 +1943,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_CACHE_SIZE SESSION_VALUE NULL @@ -341,7 +341,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1947,7 +1947,7 @@ +@@ -1961,7 +1961,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -350,7 +350,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1957,14 +1957,14 @@ +@@ -1971,14 +1971,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL @@ -368,7 +368,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1975,7 +1975,7 @@ +@@ -1989,7 +1989,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 151 VARIABLE_SCOPE GLOBAL @@ -377,7 +377,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -1989,7 +1989,7 @@ +@@ -2003,7 +2003,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -386,7 +386,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2003,7 +2003,7 @@ +@@ -2017,7 +2017,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -395,7 +395,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2031,7 +2031,7 @@ +@@ -2045,7 +2045,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 64 VARIABLE_SCOPE SESSION @@ -404,7 +404,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -2048,7 +2048,7 @@ +@@ -2062,7 +2062,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -413,7 +413,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2059,7 +2059,7 @@ +@@ -2073,7 +2073,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -422,7 +422,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2087,7 +2087,7 @@ +@@ -2101,7 +2101,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -431,7 +431,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2101,7 +2101,7 @@ +@@ -2115,7 +2115,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -440,7 +440,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2115,7 +2115,7 @@ +@@ -2129,7 +2129,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16382 VARIABLE_SCOPE GLOBAL @@ -449,7 +449,7 @@ VARIABLE_COMMENT Maximum number of prepared statements in the server NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2143,7 +2143,7 @@ +@@ -2157,7 +2157,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -458,7 +458,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2157,7 +2157,7 @@ +@@ -2171,7 +2171,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -467,7 +467,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2171,7 +2171,7 @@ +@@ -2185,7 +2185,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2199,7 +2199,7 @@ +@@ -2213,7 +2213,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2227,7 +2227,7 @@ +@@ -2241,7 +2241,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -494,7 +494,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2241,7 +2241,7 @@ +@@ -2255,7 +2255,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2255,7 +2255,7 @@ +@@ -2269,7 +2269,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2269,7 +2269,7 @@ +@@ -2283,7 +2283,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -521,7 +521,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2283,7 +2283,7 @@ +@@ -2297,7 +2297,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2297,10 +2297,10 @@ +@@ -2311,10 +2311,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -543,7 +543,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2311,7 +2311,7 @@ +@@ -2325,7 +2325,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -552,7 +552,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2325,7 +2325,7 @@ +@@ -2339,7 +2339,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2335,9 +2335,9 @@ +@@ -2349,9 +2349,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -573,7 +573,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2349,14 +2349,14 @@ +@@ -2363,14 +2363,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -591,7 +591,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2381,10 +2381,10 @@ +@@ -2395,10 +2395,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -604,7 +604,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2398,7 +2398,7 @@ +@@ -2412,7 +2412,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2451,7 +2451,7 @@ +@@ -2465,7 +2465,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -622,7 +622,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2465,7 +2465,7 @@ +@@ -2479,7 +2479,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2479,7 +2479,7 @@ +@@ -2493,7 +2493,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2493,7 +2493,7 @@ +@@ -2507,7 +2507,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2563,7 +2563,7 @@ +@@ -2577,7 +2577,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -658,16 +658,16 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2577,7 +2577,7 @@ +@@ -2591,7 +2591,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated + VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 63 -@@ -2591,7 +2591,7 @@ + NUMERIC_MAX_VALUE 62 +@@ -2605,7 +2605,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2619,7 +2619,7 @@ +@@ -2633,7 +2633,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2647,7 +2647,7 @@ +@@ -2661,7 +2661,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -694,7 +694,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2661,7 +2661,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2675,7 +2675,7 @@ +@@ -2689,7 +2689,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2689,7 +2689,7 @@ +@@ -2703,7 +2703,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2703,7 +2703,7 @@ +@@ -2717,7 +2717,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2717,7 +2717,7 @@ +@@ -2731,7 +2731,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2731,7 +2731,7 @@ +@@ -2745,7 +2745,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2745,7 +2745,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2759,7 +2759,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2773,7 +2773,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2787,7 +2787,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2801,7 +2801,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2801,7 +2801,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2815,7 +2815,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2829,7 +2829,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2857,7 +2857,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2871,7 +2871,7 @@ +@@ -2899,7 +2899,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2885,7 +2885,7 @@ +@@ -2913,7 +2913,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2899,7 +2899,7 @@ +@@ -2927,7 +2927,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2913,7 +2913,7 @@ +@@ -2941,7 +2941,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2927,7 +2927,7 @@ +@@ -2955,7 +2955,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2941,7 +2941,7 @@ +@@ -2969,7 +2969,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 178 VARIABLE_SCOPE GLOBAL @@ -892,7 +892,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2955,7 +2955,7 @@ +@@ -2983,7 +2983,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -901,7 +901,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2969,7 +2969,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2983,7 +2983,7 @@ +@@ -3011,7 +3011,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2997,7 +2997,7 @@ +@@ -3025,7 +3025,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3011,7 +3011,7 @@ +@@ -3039,7 +3039,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3025,7 +3025,7 @@ +@@ -3053,7 +3053,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -3039,7 +3039,7 @@ +@@ -3067,7 +3067,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -3053,7 +3053,7 @@ +@@ -3081,7 +3081,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3123,7 +3123,7 @@ +@@ -3151,7 +3151,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -973,7 +973,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3151,7 +3151,7 @@ +@@ -3179,7 +3179,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -3165,7 +3165,7 @@ +@@ -3193,7 +3193,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3221,10 +3221,10 @@ +@@ -3249,10 +3249,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION ONLY @@ -1004,7 +1004,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3235,7 +3235,7 @@ +@@ -3263,7 +3263,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1013,7 +1013,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3249,7 +3249,7 @@ +@@ -3277,7 +3277,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1022,7 +1022,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3263,7 +3263,7 @@ +@@ -3291,7 +3291,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1031,7 +1031,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3280,7 +3280,7 @@ +@@ -3308,7 +3308,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1040,7 +1040,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3333,7 +3333,7 @@ +@@ -3361,7 +3361,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1049,7 +1049,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3347,7 +3347,7 @@ +@@ -3375,7 +3375,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1058,7 +1058,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3361,7 +3361,7 @@ +@@ -3389,7 +3389,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1067,7 +1067,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3389,7 +3389,7 @@ +@@ -3417,7 +3417,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1076,7 +1076,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3669,10 +3669,10 @@ +@@ -3697,10 +3697,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1089,7 +1089,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3711,7 +3711,7 @@ +@@ -3739,7 +3739,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -1098,7 +1098,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3837,7 +3837,7 @@ +@@ -3865,7 +3865,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1107,7 +1107,7 @@ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3879,7 +3879,7 @@ +@@ -3907,7 +3907,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1116,7 +1116,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3907,7 +3907,7 @@ +@@ -3935,7 +3935,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE GLOBAL @@ -1125,7 +1125,7 @@ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 2147483647 -@@ -3935,7 +3935,7 @@ +@@ -3963,7 +3963,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1134,7 +1134,16 @@ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3991,7 +3991,7 @@ +@@ -3977,7 +3977,7 @@ + GLOBAL_VALUE_ORIGIN COMPILE-TIME + DEFAULT_VALUE 0 + VARIABLE_SCOPE GLOBAL +-VARIABLE_TYPE BIGINT UNSIGNED ++VARIABLE_TYPE INT UNSIGNED + VARIABLE_COMMENT Alias for slave_parallel_threads + NUMERIC_MIN_VALUE 0 + NUMERIC_MAX_VALUE 16383 +@@ -4033,7 +4033,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1143,7 +1152,7 @@ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4019,7 +4019,7 @@ +@@ -4061,7 +4061,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1152,7 +1161,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -4078,7 +4078,7 @@ +@@ -4120,7 +4120,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1161,7 +1170,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4369,7 +4369,7 @@ +@@ -4411,7 +4411,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1170,7 +1179,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -4467,7 +4467,7 @@ +@@ -4509,7 +4509,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1179,7 +1188,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -4481,7 +4481,7 @@ +@@ -4523,7 +4523,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1188,7 +1197,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 524288 -@@ -4495,7 +4495,7 @@ +@@ -4537,7 +4537,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1197,7 +1206,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -4509,7 +4509,7 @@ +@@ -4551,7 +4551,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1206,7 +1215,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -4694,7 +4694,7 @@ +@@ -4736,7 +4736,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table NUMERIC_MIN_VALUE 1024 @@ -1215,7 +1224,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4705,7 +4705,7 @@ +@@ -4747,7 +4747,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1224,7 +1233,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4719,7 +4719,7 @@ +@@ -4761,7 +4761,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1233,7 +1242,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4817,7 +4817,7 @@ +@@ -4859,7 +4859,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1242,7 +1251,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -4921,7 +4921,7 @@ +@@ -4963,7 +4963,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1251,7 +1260,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4934,7 +4934,7 @@ +@@ -4976,7 +4976,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1260,7 +1269,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4944,7 +4944,7 @@ +@@ -4986,7 +4986,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1269,7 +1278,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5029,7 +5029,7 @@ +@@ -5071,7 +5071,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 26e67fc2fdb..03fa52b37d3 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2592,9 +2592,9 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to 63, the optimizer will switch to the original find_best search. NOTE: The value 63 and its associated behaviour is deprecated +VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 63 +NUMERIC_MAX_VALUE 62 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -3971,6 +3971,20 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME SLAVE_PARALLEL_WORKERS +SESSION_VALUE NULL +GLOBAL_VALUE 0 +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE 0 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_COMMENT Alias for slave_parallel_threads +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 16383 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_RUN_TRIGGERS_FOR_RBR SESSION_VALUE NULL GLOBAL_VALUE NO diff --git a/mysql-test/suite/sys_vars/r/version.result b/mysql-test/suite/sys_vars/r/version.result new file mode 100644 index 00000000000..29a2fb8c7e9 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/version.result @@ -0,0 +1,4 @@ +SELECT @@version; +@@version +my_favorite_version +1 diff --git a/mysql-test/suite/sys_vars/t/aria_recover_basic.test b/mysql-test/suite/sys_vars/t/aria_recover_basic.test deleted file mode 100644 index 42e280b0499..00000000000 --- a/mysql-test/suite/sys_vars/t/aria_recover_basic.test +++ /dev/null @@ -1,53 +0,0 @@ -# set global ---source include/have_maria.inc - -SET @start_global_value = @@global.aria_recover; - -# -# exists as global only -# -select @@global.aria_recover; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.aria_recover; -show global variables like 'aria_recover'; -show session variables like 'aria_recover'; -select * from information_schema.global_variables where variable_name='aria_recover'; -select * from information_schema.session_variables where variable_name='aria_recover'; - -# -# show that it's writable -# -set global aria_recover=1; -select @@global.aria_recover; ---error ER_GLOBAL_VARIABLE -set session aria_recover=1; - -# -# valid values -# -set global aria_recover=normal; -select @@global.aria_recover; -set global aria_recover=backup; -select @@global.aria_recover; -set global aria_recover='force'; -select @@global.aria_recover; -set global aria_recover=off; -select @@global.aria_recover; -set global aria_recover='quick,force'; -select @@global.aria_recover; -set global aria_recover=16; -select @@global.aria_recover; - -# -# incorrect types/values -# ---error ER_WRONG_TYPE_FOR_VAR -set global aria_recover=1.1; ---error ER_WRONG_TYPE_FOR_VAR -set global aria_recover=1e1; ---error ER_WRONG_VALUE_FOR_VAR -set global aria_recover="foo"; ---error ER_WRONG_VALUE_FOR_VAR -set global aria_recover=32; - -SET @@global.aria_recover = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/aria_recover_options_basic.test b/mysql-test/suite/sys_vars/t/aria_recover_options_basic.test new file mode 100644 index 00000000000..f621998b501 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/aria_recover_options_basic.test @@ -0,0 +1,53 @@ +# set global +--source include/have_maria.inc + +SET @start_global_value = @@global.aria_recover_options; + +# +# exists as global only +# +select @@global.aria_recover_options; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.aria_recover_options; +show global variables like 'aria_recover_options'; +show session variables like 'aria_recover_options'; +select * from information_schema.global_variables where variable_name='aria_recover_options'; +select * from information_schema.session_variables where variable_name='aria_recover_options'; + +# +# show that it's writable +# +set global aria_recover_options=1; +select @@global.aria_recover_options; +--error ER_GLOBAL_VARIABLE +set session aria_recover_options=1; + +# +# valid values +# +set global aria_recover_options=normal; +select @@global.aria_recover_options; +set global aria_recover_options=backup; +select @@global.aria_recover_options; +set global aria_recover_options='force'; +select @@global.aria_recover_options; +set global aria_recover_options=off; +select @@global.aria_recover_options; +set global aria_recover_options='quick,force'; +select @@global.aria_recover_options; +set global aria_recover_options=16; +select @@global.aria_recover_options; + +# +# incorrect types/values +# +--error ER_WRONG_TYPE_FOR_VAR +set global aria_recover_options=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global aria_recover_options=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global aria_recover_options="foo"; +--error ER_WRONG_VALUE_FOR_VAR +set global aria_recover_options=32; + +SET @@global.aria_recover_options = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/version.opt b/mysql-test/suite/sys_vars/t/version.opt new file mode 100644 index 00000000000..9b6be9b7eea --- /dev/null +++ b/mysql-test/suite/sys_vars/t/version.opt @@ -0,0 +1 @@ +--version="my_favorite_version" diff --git a/mysql-test/suite/sys_vars/t/version.test b/mysql-test/suite/sys_vars/t/version.test new file mode 100644 index 00000000000..daa95386fd4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/version.test @@ -0,0 +1,6 @@ +SELECT @@version; +perl; + $cnt= $ENV{MYSQL_TEST} =~ /mysqltest_embedded / ? 1 : + grep /my_favorite_version/, `$ENV{MYSQL} -e status`; + print "$cnt\n"; +EOF diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 3e5fa873e9b..9ef4c8e2ae8 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -646,3 +646,24 @@ SET NAMES utf8; --echo # --echo # End of MariaDB-10.1 tests --echo # + + +--echo # +--echo # Start of MariaDB-10.2 tests +--echo # + +--echo # +--echo # MDEV-9407 Illegal mix of collation when using GROUP_CONCAT in a VIEW +--echo # +SET NAMES utf8; +CREATE TABLE t1 (col1 VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_unicode_ci); +INSERT INTO t1 VALUES ('a'),('b'); +CREATE VIEW v1 AS SELECT group_concat('f') AS col1; +SELECT col1 FROM v1 UNION SELECT col1 FROM t1; +DROP VIEW v1; +DROP TABLE t1; + + +--echo # +--echo # End of MariaDB-10.2 tests +--echo # diff --git a/mysql-test/t/shutdown.test b/mysql-test/t/shutdown.test index ac7f06b116d..7080f9a1a71 100644 --- a/mysql-test/t/shutdown.test +++ b/mysql-test/t/shutdown.test @@ -30,3 +30,10 @@ drop procedure try_shutdown; drop user user1@localhost; +--echo # +--echo # MDEV-8491 - On shutdown, report the user and the host executed that. +--echo # +--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err +--let SEARCH_RANGE= -50000 +--let SEARCH_PATTERN=mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown +--source include/search_pattern_in_file.inc diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index a47fbe7a372..d403b19eff7 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1093,7 +1093,7 @@ delimiter ;| # --error ER_SP_BADSTATEMENT CREATE PROCEDURE BUG_12490() HELP CONTENTS; ---error ER_SP_BADSTATEMENT +--error ER_PARSE_ERROR CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS; CREATE TABLE t_bug_12490(a int); --error ER_SP_BADSTATEMENT diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 444ab02d223..7c9d56a0780 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -695,3 +695,51 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-9337 ALTER from DECIMAL and INT to DATETIME returns a wrong result +--echo # +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (1000); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1000); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1000); +ALTER TABLE t1 MODIFY a DATETIME; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (1000.0); +SELECT * FROM t1; +DROP TABLE IF EXISTS t1; + +CREATE TABLE t1 (a DATETIME); +CREATE TABLE t2 (a DECIMAL(4,0)); +INSERT INTO t2 VALUES (1000); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a DECIMAL(4,0)); +INSERT INTO t1 VALUES (1000); +ALTER TABLE t1 MODIFY a DATETIME; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 314cb237dd3..63e9e9e7b09 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -388,3 +388,65 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + + +--echo # +--echo # MDEV-9340 Copying from INT/DOUBLE to ENUM is inconsistent +--echo # + +# DOUBLE -> ENUM +CREATE TABLE t1 (a ENUM('9e200','9e100')); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES ('9e100'); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (9e100); +ALTER TABLE t1 MODIFY a ENUM('9e200','9e100'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +# INT -> ENUM +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES ('200'); +ALTER TABLE t1 MODIFY a ENUM('200','100'); +SELECT *FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a ENUM('200','100')); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES ('100'); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + + +# YEAR -> ENUM +CREATE TABLE t1 (a ENUM('2001','2002')); +CREATE TABLE t2 (a YEAR); +INSERT INTO t2 VALUES ('2001'); +INSERT INTO t1 SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES ('2001'); +ALTER TABLE t1 MODIFY a ENUM('2001','2002'); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/type_int.test b/mysql-test/t/type_int.test index e8b9b2cffcd..271b4d5862a 100644 --- a/mysql-test/t/type_int.test +++ b/mysql-test/t/type_int.test @@ -26,3 +26,53 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in Field +--echo # + +# DECIMAL -> INT +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (10.1),(10.9); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a DECIMAL(10,2)); +INSERT INTO t2 VALUES (10.1),(10.9); +INSERT INTO t1 SELECT a FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a DECIMAL(10,2)); +INSERT INTO t1 VALUES (10.1),(10.9); +ALTER TABLE t1 MODIFY a INT; +SELECT * FROM t1; +DROP TABLE t1; + +# TIME -> INT +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (TIME'00:00:10.1'),(TIME'00:00:10.9'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a TIME(1)); +INSERT INTO t2 VALUES (10.1),(10.9); +INSERT INTO t1 SELECT a FROM t2; +SELECT * FROM t1; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a TIME(1)); +INSERT INTO t1 VALUES (10.1),(10.9); +ALTER TABLE t1 MODIFY a INT; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/type_num_innodb.test b/mysql-test/t/type_num_innodb.test new file mode 100644 index 00000000000..04bdd4c63b0 --- /dev/null +++ b/mysql-test/t/type_num_innodb.test @@ -0,0 +1,41 @@ +--source include/have_innodb.inc + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-9391 InnoDB does not produce warnings when doing WHERE int_column=varchar_column +--echo # + +CREATE TABLE t1 ( + a DOUBLE, b VARCHAR(1), c INT, + KEY(a), KEY(b) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1,'v',9),(2,'v',8),(3,'c',7),(4,'m',6),(5,'x',5), +(6,'i',4),(7,'e',3),(8,'p',2),(9,'s',1),(10,'j',9), +(11,'z',8),(12,'c',7),(13,'a',6),(14,'q',5),(15,'y',4), +(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0); +CREATE TABLE t2 ( + pk INT, d VARCHAR(1), e INT, + PRIMARY KEY(pk), KEY(d,e) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES +(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5), +(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1), +(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5), +(15,'g',6),(16,'x',7),(17,'f',8); +SELECT * FROM t1,t2 WHERE a=d; + +ALTER TABLE t1 MODIFY a DECIMAL(10,0); +SELECT * FROM t1,t2 WHERE a=d; + +ALTER TABLE t1 MODIFY a DOUBLE; +SELECT * FROM t1,t2 WHERE a=d; + +DROP TABLE t1,t2; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 27679b9ec5a..c4b93d6dbb2 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -726,3 +726,25 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + + +--echo # +--echo # MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in Field +--echo # + +CREATE TABLE t1 (a YEAR, b TIME, c YEAR); +CREATE TABLE t2 (a YEAR); +INSERT INTO t2 VALUES (0),(1999),(2000),(2030),(2050),(2070); +INSERT INTO t1 (a,b,c) SELECT a,a,a FROM t2; +ALTER TABLE t1 MODIFY c TIME; +SELECT * FROM t1; +DROP TABLE t1,t2; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index d9fa2af1eb4..22f164a757c 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -210,3 +210,45 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings +--echo # +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES (-0.1); +DROP TABLE t1; + +CREATE TABLE t1 (a YEAR); +CREATE TABLE t2 (a DECIMAL(10,1)); +INSERT INTO t2 VALUES (-0.1); +INSERT INTO t1 SELECT * FROM t2; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a DECIMAL(10,1)); +INSERT INTO t1 VALUES (-0.1); +ALTER TABLE t1 MODIFY a YEAR; +DROP TABLE t1; + +CREATE TABLE t1 (a YEAR); +INSERT INTO t1 VALUES (-0.1e0); +DROP TABLE t1; + +CREATE TABLE t1 (a YEAR); +CREATE TABLE t2 (a DOUBLE); +INSERT INTO t2 VALUES (-0.1); +INSERT INTO t1 SELECT * FROM t2; +DROP TABLE t1,t2; + +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (-0.1); +ALTER TABLE t1 MODIFY a YEAR; +DROP TABLE t1; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index b5426ce53f4..fb4992023f0 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5741,3 +5741,31 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view +--echo # +CREATE TABLE t1 ( + id int(11) NOT NULL PRIMARY KEY, + country varchar(32), + code int(11) default NULL +); +INSERT INTO t1 VALUES (1,'ITALY',100),(2,'ITALY',200),(3,'FRANCE',100), (4,'ITALY',100); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 AS +SELECT code, COUNT(DISTINCT country), MAX(id) FROM t1 GROUP BY code ORDER BY MAX(id); +SHOW CREATE TABLE t2; +CREATE TABLE t3 AS +SELECT code, COUNT(DISTINCT country), MAX(id) FROM v1 GROUP BY code ORDER BY MAX(id); +SHOW CREATE TABLE t3; +DROP VIEW v1; +DROP TABLE t1,t2,t3; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysys/my_context.c b/mysys/my_context.c index 60c0014b3b9..5faa041361a 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -24,7 +24,7 @@ #include "m_string.h" #include "my_context.h" -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H #include <valgrind/valgrind.h> #endif @@ -134,7 +134,7 @@ my_context_init(struct my_context *c, size_t stack_size) if (!(c->stack= malloc(stack_size))) return -1; /* Out of memory */ c->stack_size= stack_size; -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H c->valgrind_stack_id= VALGRIND_STACK_REGISTER(c->stack, ((unsigned char *)(c->stack))+stack_size); #endif @@ -146,7 +146,7 @@ my_context_destroy(struct my_context *c) { if (c->stack) { -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); #endif free(c->stack); @@ -384,7 +384,7 @@ my_context_init(struct my_context *c, size_t stack_size) (( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16); bzero(c->stack_top, 16); -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H c->valgrind_stack_id= VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top); #endif @@ -397,7 +397,7 @@ my_context_destroy(struct my_context *c) if (c->stack_bot) { free(c->stack_bot); -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); #endif } @@ -620,7 +620,7 @@ my_context_init(struct my_context *c, size_t stack_size) (( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16); bzero(c->stack_top, 16); -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H c->valgrind_stack_id= VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top); #endif @@ -633,7 +633,7 @@ my_context_destroy(struct my_context *c) if (c->stack_bot) { free(c->stack_bot); -#ifdef HAVE_VALGRIND +#ifdef HAVE_VALGRIND_MEMCHECK_H VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); #endif } diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 18af5f47b10..4d6abd4ba66 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -105,8 +105,6 @@ void my_mutex_init() #if defined(SAFE_MUTEX_DEFINED) safe_mutex_global_init(); -#elif defined(MY_PTHREAD_FASTMUTEX) - fastmutex_global_init(); #endif } @@ -838,88 +836,4 @@ static void print_deadlock_warning(safe_mutex_t *new_mutex, DBUG_VOID_RETURN; } -#elif defined(MY_PTHREAD_FASTMUTEX) /* !SAFE_MUTEX_DEFINED */ - -static ulong mutex_delay(ulong delayloops) -{ - ulong i; - volatile ulong j; - - j = 0; - - for (i = 0; i < delayloops * 50; i++) - j += i; - - return(j); -} - -#define MY_PTHREAD_FASTMUTEX_SPINS 8 -#define MY_PTHREAD_FASTMUTEX_DELAY 4 - -static int cpu_count= 0; - -int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp, - const pthread_mutexattr_t *attr) -{ - if ((cpu_count > 1) && (attr == MY_MUTEX_INIT_FAST)) - mp->spins= MY_PTHREAD_FASTMUTEX_SPINS; - else - mp->spins= 0; - mp->rng_state= 1; - return pthread_mutex_init(&mp->mutex, attr); -} - -/** - Park-Miller random number generator. A simple linear congruential - generator that operates in multiplicative group of integers modulo n. - - x_{k+1} = (x_k g) mod n - - Popular pair of parameters: n = 2^32 − 5 = 4294967291 and g = 279470273. - The period of the generator is about 2^31. - Largest value that can be returned: 2147483646 (RAND_MAX) - - Reference: - - S. K. Park and K. W. Miller - "Random number generators: good ones are hard to find" - Commun. ACM, October 1988, Volume 31, No 10, pages 1192-1201. -*/ - -static double park_rng(my_pthread_fastmutex_t *mp) -{ - mp->rng_state= ((my_ulonglong)mp->rng_state * 279470273U) % 4294967291U; - return (mp->rng_state / 2147483647.0); -} - -int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp) -{ - int res; - uint i; - uint maxdelay= MY_PTHREAD_FASTMUTEX_DELAY; - - for (i= 0; i < mp->spins; i++) - { - res= pthread_mutex_trylock(&mp->mutex); - - if (res == 0) - return 0; - - if (res != EBUSY) - return res; - - mutex_delay(maxdelay); - maxdelay += park_rng(mp) * MY_PTHREAD_FASTMUTEX_DELAY + 1; - } - return pthread_mutex_lock(&mp->mutex); -} - - -void fastmutex_global_init(void) -{ -#ifdef _SC_NPROCESSORS_CONF - cpu_count= sysconf(_SC_NPROCESSORS_CONF); #endif -} - -#endif /* defined(MY_PTHREAD_FASTMUTEX) && defined(SAFE_MUTEX_DEFINED) */ diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index d988f7e8317..7831896686e 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -97,13 +97,7 @@ static void closelog() {} #define FLOGGER_NO_PSI /* How to access the pthread_mutex in mysql_mutex_t */ -//#ifdef SAFE_MUTEX -//#define mysql_mutex_real_mutex(A) &(A)->m_mutex.mutex -//#elif defined(MY_PTHREAD_FASTMUTEX) -//#define mysql_mutex_real_mutex(A) &(A)->m_mutex.mutex -//#else #define mysql_mutex_real_mutex(A) &(A)->m_mutex -//#endif #define flogger_mutex_init(A,B,C) do{}while(0) #define flogger_mutex_destroy(A) do{}while(0) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6af76816c60..224e34de73b 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -133,42 +133,6 @@ ENDIF() SET(HOSTNAME "hostname") SET(MYSQLD_USER "mysql") - -# Required for mysqlbug until autotools are deprecated, once done remove these -# and expand default cmake variables -SET(CC ${CMAKE_C_COMPILER}) -SET(CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CC ${CMAKE_C_COMPILER}) -SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CFLAGS ${CFLAGS}) -SET(SAVE_CXXFLAGS ${CXXFLAGS}) -# XXX no cmake equivalent for this, just make one up -SET(CONFIGURE_LINE "Built using CMake") - -# Also required for mysqlbug, autoconf only supports --version so for now we -# just explicitly require GNU -EXECUTE_PROCESS( - COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version - COMMAND sed 1q - ERROR_QUIET - OUTPUT_VARIABLE CC_VERSION) -EXECUTE_PROCESS( - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version - COMMAND sed 1q - ERROR_QUIET - OUTPUT_VARIABLE CXX_VERSION) - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) - EXECUTE_PROCESS( - COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug - ) - -INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug - DESTINATION ${INSTALL_BINDIR} - COMPONENT Server - ) - ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", @@ -287,7 +251,6 @@ ELSE() mysql_fix_extensions mysql_setpermission mysql_secure_installation - mysql_zap mysqlaccess mysql_convert_table_format mysql_find_rows diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f8f36bfd28b..9dcd23a8392 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -427,7 +427,7 @@ mysqld_install_cmd_line() # Create the system and help tables by passing them to "mysqld --bootstrap" s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..." -if { echo "use mysql;"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null +if { echo "use mysql;"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables" "$fill_help_tables" "$maria_add_gis_sp"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null then s_echo "OK" else @@ -462,26 +462,6 @@ else exit 1 fi -s_echo "Filling help tables..." -if { echo "use mysql;"; cat "$fill_help_tables"; } | mysqld_install_cmd_line > /dev/null -then - s_echo "OK" -else - echo - echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" - echo "The \"HELP\" command might not work properly." -fi - -s_echo "Creating OpenGIS required SP-s..." -if { echo "use test;"; cat "$maria_add_gis_sp"; } | mysqld_install_cmd_line > /dev/null -then - s_echo "OK" -else - echo - echo "WARNING: OPENGIS REQUIRED SP-S WERE NOT COMPLETELY INSTALLED!" - echo "GIS extentions might not work properly." -fi - # Don't output verbose information if running inside bootstrap or using # --srcdir for testing. In such cases, there's no end user looking at diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh deleted file mode 100644 index 98c3603df15..00000000000 --- a/scripts/mysql_zap.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -# Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. -# Use is subject to license terms. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# This is a utility for MariaDB. It is not needed by any standard part -# of MariaDB. - -# Usage: mysql_zap [-signal] [-f] [-t] pattern - -# Configuration parameters. - -$sig = ""; # Default to try all signals -$ans = "y"; -$opt_f= 0; -$opt_t= 0; -$opt_a = ""; - -$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; -$LINUX = $^O eq 'linux' || $^O eq 'darwin'; -$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; - -open(TTYIN, "</dev/tty") || die "can't read /dev/tty: $!"; -open(TTYOUT, ">/dev/tty") || die "can't write /dev/tty: $!"; -select(TTYOUT); -$| = 1; -select(STDOUT); -$SIG{'INT'} = 'cleanup'; - -while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) { - if ($ARGV[0] =~ /(ZERO|HUP|INT|QUIT|ILL|TRAP|ABRT|EMT|FPE|KILL|BUS|SEGV|SYS|PIPE|ALRM|TERM|URG|STOP|TSTP|CONT|CLD|TTIN|TTOU|IO|XCPU|XFSZ|VTALRM|PROF|WINCH|LOST|USR1|USR2)/ || $ARGV[0] =~ /-(\d+)$/) { - $sig = $1; - } elsif ($ARGV[0] eq "-f") { - $opt_f=1; - } elsif ($ARGV[0] eq "-t") { - $opt_t=1; - $ans = "n"; - } - elsif ($ARGV[0] eq "-a") - { - $opt_a = 1; - } - elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I" || $ARGV[0] eq "--help") - { - &usage; - } - else { - print STDERR "$0: illegal argument $ARGV[0] ignored\n"; - } - shift; -} - -&usage if $#ARGV < 0; - -if (!$opt_f) -{ - if ($BSD) { - system "stty cbreak </dev/tty >/dev/tty 2>&1"; - } - else { - system "stty", 'cbreak', - system "stty", 'eol', '^A'; - } -} - -open(PS, "$pscmd|") || die "can't run $pscmd: $!"; -$title = <PS>; -print TTYOUT $title; - -# Catch any errors with eval. A bad pattern, for instance. -eval <<'EOF'; -process: while ($cand = <PS>) -{ - chop($cand); - ($user, $pid) = split(' ', $cand); - next if $pid == $$; - $found = !@ARGV; - if ($opt_a) { $found = 1; } - foreach $pat (@ARGV) - { - if ($opt_a) - { - if (! ($cand =~ $pat)) - { - next process; - } - } - else - { - $found = 1 if $cand =~ $pat; - } - } - next if (!$found); - if (! $opt_f && ! $opt_t) - { - print TTYOUT "$cand? "; - read(TTYIN, $ans, 1); - print TTYOUT "\n" if ($ans ne "\n"); - } - else - { - print TTYOUT "$cand\n"; - } - if ($ans =~ /^y/i) { &killpid($sig, $pid); } - if ($ans =~ /^q/i) { last; } -} -EOF - -&cleanup; - - -sub usage { - print <<EOF; -Usage: $0 [-signal] [-?Ift] [--help] pattern -Options: -I or -? "info" -f "force" -t "test". - -Version 1.0 -Kill processes that match the pattern. -If -f isn't given, ask user for confirmation for each process to kill. -If signal isn't given, try first with signal 15, then with signal 9. -If -t is given, the processes are only shown on stdout. -EOF - exit(1); -} - -sub cleanup { - if ($BSD) { - system "stty -cbreak </dev/tty >/dev/tty 2>&1"; - } - else { - system "stty", 'icanon'; - system "stty", 'eol', '^@'; - } - print "\n"; - exit; -} - -sub killpid { - local($signal,$pid) = @_; - if ($signal) - { - kill $signal,$pid; - } - else - { - print "kill -15\n"; - kill 15, $pid; - for (1..5) { - sleep 2; - return if kill(0, $pid) == 0; - } - print "kill -9\n"; - kill 9, $pid; - for (1..5) { - sleep 2; - return if kill(0, $pid) == 0; - } - print "$pid will not die!\n"; - } -} diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh deleted file mode 100644 index e9df210fa84..00000000000 --- a/scripts/mysqlbug.sh +++ /dev/null @@ -1,406 +0,0 @@ -#!/bin/sh -# Copyright (C) 2000-2002, 2004 MySQL AB -# Use is subject to license terms -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Create a bug report and mail it to the mysql mailing list -# Based on glibc bug reporting script. - -echo "Finding system information for a MySQL bug report" - -VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" -COMPILATION_COMMENT="@COMPILATION_COMMENT@" -BUGmysql="maria-developers@lists.launchpad.net" -# This is set by configure -COMP_CALL_INFO="CC='@SAVE_CC@' CFLAGS='@SAVE_CFLAGS@' CXX='@SAVE_CXX@' CXXFLAGS='@SAVE_CXXFLAGS@' LDFLAGS='@SAVE_LDFLAGS@' ASFLAGS='@SAVE_ASFLAGS@'" -COMP_RUN_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" -CONFIGURE_LINE="@CONF_COMMAND@" - -LIBC_INFO="" -for pat in /lib/libc.* /lib/libc-* /usr/lib/libc.* /usr/lib/libc-* -do - TMP=`ls -l $pat 2>/dev/null` - if test $? = 0 - then - LIBC_INFO="$LIBC_INFO -$TMP" - fi -done - -PATH=../client:$PATH:/bin:/usr/bin:/usr/local/bin -export PATH - -BUGADDR=${1-$BUGmysql} -ENVIRONMENT=`uname -a` - -: ${USER=${LOGNAME-`whoami`}} - -COMMAND=`echo $0|sed 's%.*/\([^/]*\)%\1%'` - -# Try to create a secure tmpfile -umask 077 -TEMPDIR=/tmp/mysqlbug-$$ -mkdir $TEMPDIR || (echo "can not create directory in /tmp, aborting"; exit 1;) -TEMP=${TEMPDIR}/mysqlbug - -trap 'rm -f $TEMP $TEMP.x; rmdir $TEMPDIR; exit 1' 1 2 3 13 15 -trap 'rm -f $TEMP $TEMP.x; rmdir $TEMPDIR' 0 - -# How to read the passwd database. -PASSWD="cat /etc/passwd" - -if test -f /usr/lib/sendmail -then - MAIL_AGENT="/usr/lib/sendmail -oi -t" -elif test -f /usr/sbin/sendmail -then - MAIL_AGENT="/usr/sbin/sendmail -oi -t" -else - MAIL_AGENT="rmail $BUGmysql" -fi - -# Figure out how to echo a string without a trailing newline -N=`echo 'hi there\c'` -case "$N" in - *c) ECHON1='echo -n' ECHON2= ;; - *) ECHON1=echo ECHON2='\c' ;; -esac - -# Find out the name of the originator of this PR. -if test -n "$NAME" -then - ORIGINATOR="$NAME" -elif test -f $HOME/.fullname -then - ORIGINATOR="`sed -e '1q' $HOME/.fullname`" -else - # Must use temp file due to incompatibilities in quoting behavior - # and to protect shell metacharacters in the expansion of $LOGNAME - $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP - ORIGINATOR="`cat $TEMP`" - rm -f $TEMP -fi - -if test -n "$ORGANIZATION" -then - if test -f "$ORGANIZATION" - then - ORGANIZATION="`cat $ORGANIZATION`" - fi -else - if test -f $HOME/.organization - then - ORGANIZATION="`cat $HOME/.organization`" - elif test -f $HOME/.signature - then - ORGANIZATION=`sed -e "s/^/ /" $HOME/.signature; echo ">"` - fi -fi - -PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` - -which_1 () -{ - for cmd - do - # Absolute path ?. - if expr "x$cmd" : "x/" > /dev/null - then - echo "$cmd" - exit 0 - else - for d in $PATH_DIRS - do - file="$d/$cmd" - if test -x "$file" -a ! -d "$file" - then - echo "$file" - exit 0 - fi - done - fi - done - exit 1 -} - -change_editor () -{ - echo "You can change editor by setting the environment variable VISUAL." - echo "If your shell is a bourne shell (sh) do" - echo "VISUAL=your_editors_name; export VISUAL" - echo "If your shell is a C shell (csh) do" - echo "setenv VISUAL your_editors_name" -} - -# If they don't have a preferred editor set, then use emacs -if test -z "$VISUAL" -then - if test -z "$EDITOR" - then - # Honor debian sensible-editor - if test -x "/usr/bin/sensible-editor" - then - EDIT=/usr/bin/sensible-editor - else - EDIT=emacs - fi - else - EDIT="$EDITOR" - fi -else - EDIT="$VISUAL" -fi - -#which_1 $EDIT -used_editor=`which_1 $EDIT` - -echo "test -x $used_editor" -if test -x "$used_editor" -then - echo "Using editor $used_editor"; - change_editor - sleep 2 -else - echo "Could not find a text editor. (tried $EDIT)" - change_editor - exit 1 -fi - -# Find out some information. -SYSTEM=`( test -f /bin/uname && /bin/uname -a ) || \ - ( test -f /usr/bin/uname && /usr/bin/uname -a ) || echo ""` -ARCH=`test -f /bin/arch && /bin/arch` -MACHINE=`test -f /bin/machine && /bin/machine` -FILE_PATHS= - -for cmd in perl make gmake gcc cc -do - file=`which_1 $cmd` - if test $? = 0 - then - if test $cmd = "gcc" - then - GCC_INFO=`$file -v 2>&1` - elif test $cmd = "perl" - then - PERL_INFO=`$file -v | grep -i version 2>&1` - fi - FILE_PATHS="$FILE_PATHS $file" - fi -done - -admin=`which_1 mysqladmin` -MYSQL_SERVER= -if test -x "$admin" -then - MYSQL_SERVER=`$admin version 2> /dev/null` - if test "$?" = "1" - then - MYSQL_SERVER="" - fi -fi - -SUBJECT_C="[50 character or so descriptive subject here (for reference)]" -ORGANIZATION_C='<organization of PR author (multiple lines)>' -LICENCE_C='[none | licence | email support | extended email support ]' -SYNOPSIS_C='<synopsis of the problem (one line)>' -SEVERITY_C='<[ non-critical | serious | critical ] (one line)>' -PRIORITY_C='<[ low | medium | high ] (one line)>' -CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>' -RELEASE_C='<release number or tag (one line)>' -ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>' -DESCRIPTION_C='<precise description of the problem (multiple lines)>' -HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>' -FIX_C='<how to correct or work around the problem, if known (multiple lines)>' - - -cat > $TEMP <<EOF -SEND-PR: -*- send-pr -*- -SEND-PR: Lines starting with \`SEND-PR' will be removed automatically, as -SEND-PR: will all comments (text enclosed in \`<' and \`>'). -SEND-PR: -From: ${USER} -To: ${BUGADDR} -Subject: $SUBJECT_C - ->Description: - $DESCRIPTION_C ->How-To-Repeat: - $HOW_TO_REPEAT_C ->Fix: - $FIX_C - ->Submitter-Id: <submitter ID> ->Originator: ${ORIGINATOR} ->Organization: -${ORGANIZATION- $ORGANIZATION_C} ->MySQL support: $LICENCE_C ->Synopsis: $SYNOPSIS_C ->Severity: $SEVERITY_C ->Priority: $PRIORITY_C ->Category: mysql ->Class: $CLASS_C ->Release: mysql-${VERSION} ($COMPILATION_COMMENT) -`test -n "$MYSQL_SERVER" && echo ">Server: $MYSQL_SERVER"` ->C compiler: @CC_VERSION@ ->C++ compiler: @CXX_VERSION@ ->Environment: - $ENVIRONMENT_C -`test -n "$SYSTEM" && echo "System: $SYSTEM"` -`test -n "$ARCH" && echo "Architecture: $ARCH"` -`test -n "$MACHINE" && echo "Machine: $MACHINE"` -`test -n "$FILE_PATHS" && echo "Some paths: $FILE_PATHS"` -`test -n "$GCC_INFO" && echo "GCC: $GCC_INFO"` -`test -n "$COMP_CALL_INFO" && echo "Compilation info (call): $COMP_CALL_INFO"` -`test -n "$COMP_RUN_INFO" && echo "Compilation info (used): $COMP_RUN_INFO"` -`test -n "$LIBC_INFO" && echo "LIBC: $LIBC_INFO"` -`test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"` -`test -n "$PERL_INFO" && echo "Perl: $PERL_INFO"` -EOF - -chmod u+w $TEMP -cp $TEMP $TEMP.x - -eval $EDIT $TEMP - -if cmp -s $TEMP $TEMP.x -then - echo "File not changed, no bug report submitted." - mv -f $TEMP /tmp/failed-mysql-bugreport - echo "The raw bug report exists in /tmp/failed-mysql-bugreport" - echo "If you use this remember that the first lines of the report are now a lie.." - exit 1 -fi - -# -# Check the enumeration fields - -# This is a "sed-subroutine" with one keyword parameter -# (with workaround for Sun sed bug) -# -SED_CMD=' -/$PATTERN/{ -s||| -s|<.*>|| -s|^[ ]*|| -s|[ ]*$|| -p -q -}' - - -while :; do - CNT=0 - - # - # 1) Severity - # - PATTERN=">Severity:" - SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$SEVERITY" in - ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'." - esac - # - # 2) Priority - # - PATTERN=">Priority:" - PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$PRIORITY" in - ""|low|medium|high) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'." - esac - # - # 3) Class - # - PATTERN=">Class:" - CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP` - case "$CLASS" in - ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;; - *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'." - esac - - # - # 4) Synopsis - # - VALUE=`grep "^>Synopsis:" $TEMP | sed 's/>Synopsis:[ ]*//'` - case "$VALUE" in - "$SYNOPSIS_C") echo "$COMMAND: \`$VALUE' is not a valid value for \`Synopsis'." ;; - *) CNT=`expr $CNT + 1` - esac - - test $CNT -lt 4 && - echo "Errors were found with the problem report." - - - # Check if subject of mail was changed, if not, use Synopsis field - # - subject=`grep "^Subject" $TEMP| sed 's/^Subject:[ ]*//'` - if [ X"$subject" = X"$SUBJECT_C" -o X"$subject" = X"$SYNOPSIS_C" ]; then - subject=`grep Synopsis $TEMP | sed 's/>Synopsis:[ ]*//'` - sed "s/^Subject:[ ]*.*/Subject: $subject/" $TEMP > $TEMP.tmp - mv -f $TEMP.tmp $TEMP - fi - - while :; do - $ECHON1 "a)bort, e)dit or s)end? $ECHON2" - read input - case "$input" in - a*) - echo "$COMMAND: problem report saved in $HOME/dead.mysqlbug." - cat $TEMP >> $HOME/dead.mysqlbug - xs=1; exit - ;; - e*) - eval $EDIT $TEMP - continue 2 - ;; - s*) - break 2 - ;; - esac - done -done -# -# Remove comments and send the problem report -# (we have to use patterns, where the comment contains regex chars) -# -# /^>Originator:/s;$ORIGINATOR;; -sed -e " -/^SEND-PR:/d -/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;; -/^>Confidential:/s;<.*>;; -/^>Synopsis:/s;$SYNOPSIS_C;; -/^>Severity:/s;<.*>;; -/^>Priority:/s;<.*>;; -/^>Class:/s;<.*>;; -/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;; -/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;; -/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;; -/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;; -/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;; -" $TEMP > $TEMP.x - -if $MAIL_AGENT < $TEMP.x -then - echo "$COMMAND: problem report sent" - xs=0; exit -else - echo "$COMMAND: mysterious mail failure, report not sent." - echo "$COMMAND: problem report saved in $HOME/dead.mysqlbug." - cat $TEMP >> $HOME/dead.mysqlbug -fi - -exit 0 diff --git a/sql-common/client.c b/sql-common/client.c index f846c0e19a2..7571e5c0b1d 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -601,7 +601,7 @@ restart: uint last_errno=uint2korr(pos); if (last_errno == 65535 && - (mysql->server_capabilities & CLIENT_PROGRESS)) + (mysql->server_capabilities & CLIENT_PROGRESS_OBSOLETE)) { if (cli_report_progress(mysql, pos+2, (uint) (len-3))) { diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index ec7e9207f38..9b0017c9124 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -317,8 +317,7 @@ IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED) ENDIF() ENDIF() -FOREACH(tool glibtoolize libtoolize aclocal autoconf autoheader automake gtar - tar git) +FOREACH(tool gtar tar git) STRING(TOUPPER ${tool} TOOL) FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable") MARK_AS_ADVANCED(${TOOL}_EXECUTABLE) diff --git a/sql/client_settings.h b/sql/client_settings.h index d6a157f71fd..cc90d6a174d 100644 --- a/sql/client_settings.h +++ b/sql/client_settings.h @@ -28,7 +28,7 @@ When adding capabilities here, consider if they should be also added to the libmysql version. */ -#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \ +#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \ CLIENT_LONG_FLAG | \ CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | \ diff --git a/sql/field.cc b/sql/field.cc index a7984c290de..177f219c137 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1322,6 +1322,31 @@ bool Field::can_optimize_range(const Item_bool_func *cond, } +int Field::store_hex_hybrid(const char *str, uint length) +{ + DBUG_ASSERT(result_type() != STRING_RESULT); + ulonglong nr; + + if (length > 8) + { + nr= flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX; + goto warn; + } + nr= (ulonglong) longlong_from_hex_hybrid(str, length); + if ((length == 8) && !(flags & UNSIGNED_FLAG) && (nr > LONGLONG_MAX)) + { + nr= LONGLONG_MAX; + goto warn; + } + return store((longlong) nr, true); // Assume hex numbers are unsigned + +warn: + if (!store((longlong) nr, true)) + set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + return 1; +} + + /** Numeric fields base class constructor. */ @@ -1648,9 +1673,7 @@ Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, part_of_key_not_clustered(0), part_of_sortkey(0), unireg_check(unireg_check_arg), field_length(length_arg), null_bit(null_bit_arg), is_created_from_null_item(FALSE), - read_stats(NULL), collected_stats(0), - vcol_info(0), - stored_in_db(TRUE) + read_stats(NULL), collected_stats(0), vcol_info(0) { flags=null_ptr ? 0: NOT_NULL_FLAG; comment.str= (char*) ""; @@ -8869,7 +8892,7 @@ void Field_set::sql_type(String &res) const 0 if the fields are unequally defined */ -bool Field::eq_def(Field *field) +bool Field::eq_def(const Field *field) const { if (real_type() != field->real_type() || charset() != field->charset() || pack_length() != field->pack_length()) @@ -8901,7 +8924,7 @@ static bool compare_type_names(CHARSET_INFO *charset, TYPELIB *t1, TYPELIB *t2) returns 1 if the fields are equally defined */ -bool Field_enum::eq_def(Field *field) +bool Field_enum::eq_def(const Field *field) const { TYPELIB *values; @@ -8978,7 +9001,7 @@ const uchar *Field_enum::unpack(uchar *to, const uchar *from, @return returns 1 if the fields are equally defined */ -bool Field_num::eq_def(Field *field) +bool Field_num::eq_def(const Field *field) const { if (!Field::eq_def(field)) return 0; @@ -9634,7 +9657,7 @@ void Field_bit_as_char::sql_type(String &res) const Convert create_field::length from number of characters to number of bytes. */ -void Create_field::create_length_to_internal_length(void) +void Column_definition::create_length_to_internal_length(void) { switch (sql_type) { case MYSQL_TYPE_TINY_BLOB: @@ -9682,135 +9705,34 @@ void Create_field::create_length_to_internal_length(void) } -/** - Init for a tmp table field. To be extended if need be. -*/ -void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, - uint32 length_arg, uint32 decimals_arg, - bool maybe_null, bool is_unsigned, - uint pack_length_arg) -{ - DBUG_ENTER("Create_field::init_for_tmp_table"); - - field_name= ""; - sql_type= sql_type_arg; - char_length= length= length_arg;; - unireg_check= Field::NONE; - interval= 0; - charset= &my_charset_bin; - geom_type= Field::GEOM_GEOMETRY; - - DBUG_PRINT("enter", ("sql_type: %d, length: %u, pack_length: %u", - sql_type_arg, length_arg, pack_length_arg)); - - /* - These pack flags are crafted to get it correctly through the - branches of make_field(). - */ - switch (sql_type_arg) - { - case MYSQL_TYPE_VARCHAR: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - case MYSQL_TYPE_SET: - pack_flag= 0; - break; - - case MYSQL_TYPE_GEOMETRY: - pack_flag= FIELDFLAG_GEOM; - break; - - case MYSQL_TYPE_ENUM: - pack_flag= FIELDFLAG_INTERVAL; - break; - - case MYSQL_TYPE_NEWDECIMAL: - DBUG_ASSERT(decimals_arg <= DECIMAL_MAX_SCALE); - case MYSQL_TYPE_DECIMAL: - case MYSQL_TYPE_FLOAT: - case MYSQL_TYPE_DOUBLE: - pack_flag= FIELDFLAG_NUMBER | - (decimals_arg & FIELDFLAG_MAX_DEC) << FIELDFLAG_DEC_SHIFT; - break; - - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - pack_flag= FIELDFLAG_BLOB; - break; - - case MYSQL_TYPE_BIT: - pack_flag= FIELDFLAG_NUMBER | FIELDFLAG_TREAT_BIT_AS_CHAR; - break; - - default: - pack_flag= FIELDFLAG_NUMBER; - break; - } - - /* - Set the pack flag correctly for the blob-like types. This sets the - packtype to something that make_field can use. If the pack type is - not set correctly, the packlength will be reeeeally wierd (like - 129 or so). - */ - switch (sql_type_arg) - { - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_GEOMETRY: - // If you are going to use the above types, you have to pass a - // pack_length as parameter. Assert that is really done. - DBUG_ASSERT(pack_length_arg != ~0U); - pack_flag|= pack_length_to_packflag(pack_length_arg); - break; - default: - /* Nothing */ - break; - } - - pack_flag|= - (maybe_null ? FIELDFLAG_MAYBE_NULL : 0) | - (is_unsigned ? 0 : FIELDFLAG_DECIMAL); - - DBUG_PRINT("debug", ("pack_flag: %s%s%s%s%s%s, pack_type: %d", - FLAGSTR(pack_flag, FIELDFLAG_BINARY), - FLAGSTR(pack_flag, FIELDFLAG_NUMBER), - FLAGSTR(pack_flag, FIELDFLAG_INTERVAL), - FLAGSTR(pack_flag, FIELDFLAG_GEOM), - FLAGSTR(pack_flag, FIELDFLAG_BLOB), - FLAGSTR(pack_flag, FIELDFLAG_DECIMAL), - f_packtype(pack_flag))); - vcol_info= 0; - create_if_not_exists= FALSE; - stored_in_db= TRUE; - - DBUG_VOID_RETURN; -} - - static inline bool is_item_func(Item* x) { return x != NULL && x->type() == Item::FUNC_ITEM; } -bool Create_field::check(THD *thd) +bool Column_definition::check(THD *thd) { const uint conditional_type_modifiers= AUTO_INCREMENT_FLAG; uint sign_len, allowed_type_modifier= 0; ulong max_field_charlength= MAX_FIELD_CHARLENGTH; DBUG_ENTER("Create_field::check"); + /* Initialize data for a computed field */ if (vcol_info) { + DBUG_ASSERT(vcol_info->expr_item); + vcol_info->set_field_type(sql_type); - sql_type= (enum enum_field_types)MYSQL_TYPE_VIRTUAL; + /* + Walk through the Item tree checking if all items are valid + to be part of the virtual column + */ + if (vcol_info->expr_item->walk(&Item::check_vcol_func_processor, 0, NULL)) + { + my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), field_name); + DBUG_RETURN(TRUE); + } } if (length > MAX_FIELD_BLOBLENGTH) @@ -9886,30 +9808,6 @@ bool Create_field::check(THD *thd) DBUG_RETURN(1); } - /* Initialize data for a computed field */ - if (sql_type == MYSQL_TYPE_VIRTUAL) - { - DBUG_ASSERT(vcol_info && vcol_info->expr_item); - stored_in_db= vcol_info->is_stored(); - /* - Walk through the Item tree checking if all items are valid - to be part of the virtual column - */ - if (vcol_info->expr_item->walk(&Item::check_vcol_func_processor, 0, NULL)) - { - my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), field_name); - DBUG_RETURN(TRUE); - } - - /* - Make a field created for the real type. - Note that regular and computed fields differ from each other only by - Field::vcol_info. It is is always NULL for a column that is not - computed. - */ - sql_type= vcol_info->get_real_type(); - } - sign_len= flags & UNSIGNED_FLAG ? 0 : 1; switch (sql_type) { @@ -10470,10 +10368,10 @@ Field *make_field(TABLE_SHARE *share, /** Create a field suitable for create of table. */ -Create_field::Create_field(THD *thd, Field *old_field, Field *orig_field) +Column_definition::Column_definition(THD *thd, Field *old_field, + Field *orig_field) { - field= old_field; - field_name=change=old_field->field_name; + field_name= old_field->field_name; length= old_field->field_length; flags= old_field->flags; unireg_check=old_field->unireg_check; @@ -10484,10 +10382,7 @@ Create_field::Create_field(THD *thd, Field *old_field, Field *orig_field) comment= old_field->comment; decimals= old_field->decimals(); vcol_info= old_field->vcol_info; - create_if_not_exists= FALSE; - stored_in_db= old_field->stored_in_db; option_list= old_field->option_list; - option_struct= old_field->option_struct; switch (sql_type) { case MYSQL_TYPE_BLOB: @@ -10578,7 +10473,7 @@ Create_field::Create_field(THD *thd, Field *old_field, Field *orig_field) { StringBuffer<MAX_FIELD_WIDTH> tmp(charset); String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv)); - char *pos= (char*) sql_strmake(res->ptr(), res->length()); + char *pos= (char*) thd->strmake(res->ptr(), res->length()); def= new (thd->mem_root) Item_string(thd, pos, res->length(), charset); } } diff --git a/sql/field.h b/sql/field.h index ae088ab5e31..435ea20825a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -33,6 +33,7 @@ #include "compat56.h" class Send_field; +class Copy_field; class Protocol; class Create_field; class Relay_log_info; @@ -280,6 +281,16 @@ protected: return decimal_value; } + longlong longlong_from_hex_hybrid(const char *str, uint32 length) + { + const char *end= str + length; + const char *ptr= end - MY_MIN(length, sizeof(longlong)); + ulonglong value= 0; + for ( ; ptr != end ; ptr++) + value= (value << 8) + (ulonglong) (uchar) *ptr; + return (longlong) value; + } + longlong longlong_from_string_with_check(const String *str) const { return longlong_from_string_with_check(str->charset(), @@ -392,8 +403,6 @@ struct ha_field_option_struct; struct st_cache_field; int field_conv(Field *to,Field *from); -int field_conv_incompatible(Field *to,Field *from); -bool memcpy_field_possible(Field *to, Field *from); int truncate_double(double *nr, uint field_length, uint dec, bool unsigned_flag, double max_value); longlong double_to_longlong(double nr, bool unsigned_flag, bool *error); @@ -555,12 +564,12 @@ private: when a Create_field object is created/initialized. */ enum_field_types field_type; /* Real field type*/ - /* Flag indicating that the field is physically stored in the database */ - bool stored_in_db; /* Flag indicating that the field used in a partitioning expression */ bool in_partitioning_expr; public: + /* Flag indicating that the field is physically stored in the database */ + bool stored_in_db; /* The expression to compute the value of the virtual column */ Item *expr_item; /* Text representation of the defining expression */ @@ -568,7 +577,7 @@ public: Virtual_column_info() : field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), - stored_in_db(FALSE), in_partitioning_expr(FALSE), + in_partitioning_expr(FALSE), stored_in_db(FALSE), expr_item(NULL) { expr_str.str= NULL; @@ -606,11 +615,23 @@ class Field: public Value_source { Field(const Item &); /* Prevent use of these */ void operator=(Field &); +protected: + int save_in_field_str(Field *to) + { + StringBuffer<MAX_FIELD_WIDTH> result(charset()); + val_str(&result); + return to->store(result.ptr(), result.length(), charset()); + } + static void do_field_int(Copy_field *copy); + static void do_field_real(Copy_field *copy); + static void do_field_string(Copy_field *copy); + static void do_field_temporal(Copy_field *copy); + static void do_field_decimal(Copy_field *copy); public: static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return alloc_root(mem_root, size); } static void *operator new(size_t size) throw () - { return sql_alloc(size); } + { return thd_alloc(current_thd, size); } static void operator delete(void *ptr_arg, size_t size) { TRASH(ptr_arg, size); } static void operator delete(void *ptr, MEM_ROOT *mem_root) { DBUG_ASSERT(0); } @@ -713,19 +734,31 @@ public: can be computed from other fields. */ Virtual_column_info *vcol_info; - /* - Flag indicating that the field is physically stored in tables - rather than just computed from other fields. - As of now, FALSE can be set only for computed virtual columns. - */ - bool stored_in_db; Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg); virtual ~Field() {} + /** + Convenience definition of a copy function returned by + Field::get_copy_func() + */ + typedef void Copy_func(Copy_field*); + virtual Copy_func *get_copy_func(const Field *from) const= 0; /* Store functions returns 1 on overflow and -1 on fatal error */ + virtual int store_field(Field *from) { return from->save_in_field(this); } + virtual int save_in_field(Field *to)= 0; + /** + Check if it is possible just copy the value + of the field 'from' to the field 'this', e.g. for + INSERT INTO t1 (field1) SELECT field2 FROM t2; + @param from - The field to copy from + @retval true - it is possible to just copy value of 'from' to 'this' + @retval false - conversion is needed + */ + virtual bool memcpy_field_possible(const Field *from) const= 0; virtual int store(const char *to, uint length,CHARSET_INFO *cs)=0; + virtual int store_hex_hybrid(const char *str, uint length); virtual int store(double nr)=0; virtual int store(longlong nr, bool unsigned_val)=0; virtual int store_decimal(const my_decimal *d)=0; @@ -755,6 +788,7 @@ public: */ virtual String *val_str(String*,String *)=0; String *val_int_as_str(String *val_buffer, bool unsigned_flag); + fast_field_copier get_fast_field_copier(const Field *from); /* str_needs_quotes() returns TRUE if the value returned by val_str() needs to be quoted when used in constructing an SQL query. @@ -770,7 +804,7 @@ public: return (ptr == field->ptr && null_ptr == field->null_ptr && null_bit == field->null_bit && field->type() == type()); } - virtual bool eq_def(Field *field); + virtual bool eq_def(const Field *field) const; /* pack_length() returns size (in bytes) used to store field data in memory @@ -1057,6 +1091,8 @@ public: null_bit= p_null_bit; } + bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; } + inline THD *get_thd() const { return likely(table) ? table->in_use : current_thd; } @@ -1241,6 +1277,7 @@ protected: return (op_result == E_DEC_OVERFLOW); } int warn_if_overflow(int op_result); + Copy_func *get_identical_copy_func() const; public: void set_table_name(String *alias) { @@ -1503,7 +1540,22 @@ public: void make_field(Send_field *); uint decimals() const { return (uint) dec; } uint size_of() const { return sizeof(*this); } - bool eq_def(Field *field); + bool eq_def(const Field *field) const; + Copy_func *get_copy_func(const Field *from) const + { + return do_field_int; + } + int save_in_field(Field *to) + { + return to->store(val_int(), MY_TEST(flags & UNSIGNED_FLAG)); + } + bool memcpy_field_possible(const Field *from) const + { + return real_type() == from->real_type() && + pack_length() == from->pack_length() && + !((flags & UNSIGNED_FLAG) && !(from->flags & UNSIGNED_FLAG)) && + decimals() == from->decimals(); + } int store_decimal(const my_decimal *); my_decimal *val_decimal(my_decimal *); bool val_bool() { return val_int() != 0; } @@ -1536,10 +1588,21 @@ public: const char *field_name_arg, CHARSET_INFO *charset); Item_result result_type () const { return STRING_RESULT; } uint decimals() const { return NOT_FIXED_DEC; } + int save_in_field(Field *to) { return save_in_field_str(to); } + bool memcpy_field_possible(const Field *from) const + { + return real_type() == from->real_type() && + pack_length() == from->pack_length() && + charset() == from->charset(); + } int store(double nr); int store(longlong nr, bool unsigned_val)=0; int store_decimal(const my_decimal *); int store(const char *to,uint length,CHARSET_INFO *cs)=0; + int store_hex_hybrid(const char *str, uint length) + { + return store(str, length, &my_charset_bin); + } uint repertoire(void) const { return my_charset_repertoire(field_charset); @@ -1632,6 +1695,11 @@ public: not_fixed(dec_arg >= NOT_FIXED_DEC) {} Item_result result_type () const { return REAL_RESULT; } + Copy_func *get_copy_func(const Field *from) const + { + return do_field_real; + } + int save_in_field(Field *to) { return to->store(val_real()); } int store_decimal(const my_decimal *); int store_time_dec(MYSQL_TIME *ltime, uint dec); bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); @@ -1656,6 +1724,10 @@ public: enum_field_types type() const { return MYSQL_TYPE_DECIMAL;} enum ha_base_keytype key_type() const { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; } + Copy_func *get_copy_func(const Field *from) const + { + return eq_def(from) ? get_identical_copy_func() : do_field_string; + } int reset(void); int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); @@ -1699,6 +1771,22 @@ public: enum_field_types type() const { return MYSQL_TYPE_NEWDECIMAL;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; } Item_result result_type () const { return DECIMAL_RESULT; } + Copy_func *get_copy_func(const Field *from) const + { + // if (from->real_type() == MYSQL_TYPE_BIT) // QQ: why? + // return do_field_int; + return do_field_decimal; + } + int save_in_field(Field *to) + { + my_decimal buff; + return to->store_decimal(val_decimal(&buff)); + } + bool memcpy_field_possible(const Field *from) const + { + return Field_num::memcpy_field_possible(from) && + field_length == from->field_length; + } int reset(void); bool store_value(const my_decimal *decimal_value); void set_value_on_overflow(my_decimal *decimal_value, bool sign); @@ -2035,6 +2123,10 @@ public: unireg_check_arg, field_name_arg, cs) {} enum_field_types type() const { return MYSQL_TYPE_NULL;} + Copy_func *get_copy_func(const Field *from) const + { + return do_field_string; + } int store(const char *to, uint length, CHARSET_INFO *cs) { null[0]=1; return 0; } int store(double nr) { null[0]=1; return 0; } @@ -2081,6 +2173,19 @@ public: field_name_arg) { flags|= BINARY_FLAG; } Item_result result_type () const { return STRING_RESULT; } + int store_hex_hybrid(const char *str, uint length) + { + return store(str, length, &my_charset_bin); + } + Copy_func *get_copy_func(const Field *from) const; + int save_in_field(Field *to) + { + MYSQL_TIME ltime; + if (get_date(<ime, 0)) + return to->reset(); + return to->store_time_dec(<ime, decimals()); + } + bool memcpy_field_possible(const Field *from) const; uint32 max_display_length() { return field_length; } bool str_needs_quotes() { return TRUE; } enum Derivation derivation(void) const { return DERIVATION_NUMERIC; } @@ -2091,7 +2196,7 @@ public: enum Item_result cmp_type () const { return TIME_RESULT; } bool val_bool() { return val_real() != 0e0; } uint is_equal(Create_field *new_field); - bool eq_def(Field *field) + bool eq_def(const Field *field) const { return (Field::eq_def(field) && decimals() == field->decimals()); } @@ -2344,6 +2449,28 @@ public: unireg_check_arg, field_name_arg, 1, 1) {} enum_field_types type() const { return MYSQL_TYPE_YEAR;} + Copy_func *get_copy_func(const Field *from) const + { + if (eq_def(from)) + return get_identical_copy_func(); + switch (from->cmp_type()) { + case STRING_RESULT: + return do_field_string; + case TIME_RESULT: + return do_field_temporal; + case DECIMAL_RESULT: + return do_field_decimal; + case REAL_RESULT: + return do_field_real; + case INT_RESULT: + break; + case ROW_RESULT: + default: + DBUG_ASSERT(0); + break; + } + return do_field_int; + } int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); @@ -2433,6 +2560,7 @@ protected: int store_TIME_with_warning(MYSQL_TIME *ltime, const ErrConv *str, int was_cut, int have_smth_to_conv); bool check_zero_in_date_with_warn(ulonglong fuzzydate); + static void do_field_time(Copy_field *copy); public: Field_time(uchar *ptr_arg, uint length_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, @@ -2442,6 +2570,19 @@ public: {} enum_field_types type() const { return MYSQL_TYPE_TIME;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; } + Copy_func *get_copy_func(const Field *from) const + { + return from->cmp_type() == REAL_RESULT ? do_field_string : // MDEV-9344 + from->type() == MYSQL_TYPE_YEAR ? do_field_int : + from->type() == MYSQL_TYPE_BIT ? do_field_int : + eq_def(from) ? get_identical_copy_func() : + do_field_time; + } + bool memcpy_field_possible(const Field *from) const + { + return real_type() == from->real_type() && + decimals() == from->decimals(); + } int store_time_dec(MYSQL_TIME *ltime, uint dec); int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); @@ -2810,6 +2951,7 @@ public: enum ha_base_keytype key_type() const { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; } bool zero_pack() const { return 0; } + Copy_func *get_copy_func(const Field *from) const; int reset(void) { charset()->cset->fill(charset(),(char*) ptr, field_length, @@ -2906,6 +3048,12 @@ public: return (uint32) field_length + (field_charset == &my_charset_bin ? length_bytes : 0); } + Copy_func *get_copy_func(const Field *from) const; + bool memcpy_field_possible(const Field *from) const + { + return Field_str::memcpy_field_possible(from) && + length_bytes == ((Field_varstring*) from)->length_bytes; + } int store(const char *to,uint length,CHARSET_INFO *charset); int store(longlong nr, bool unsigned_val); int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */ @@ -2958,7 +3106,9 @@ protected: The 'value'-object is a cache fronting the storage engine. */ String value; - + + static void do_copy_blob(Copy_field *copy); + static void do_conv_blob(Copy_field *copy); public: Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, @@ -2993,6 +3143,31 @@ public: enum_field_types type() const { return MYSQL_TYPE_BLOB;} enum ha_base_keytype key_type() const { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; } + Copy_func *get_copy_func(const Field *from) const + { + /* + TODO: MDEV-9331 + if (from->type() == MYSQL_TYPE_BIT) + return do_field_int; + */ + if (!(from->flags & BLOB_FLAG) || from->charset() != charset()) + return do_conv_blob; + if (from->pack_length() != Field_blob::pack_length()) + return do_copy_blob; + return get_identical_copy_func(); + } + int store_field(Field *from) + { // Be sure the value is stored + from->val_str(&value); + if (!value.is_alloced() && from->is_updatable()) + value.copy(); + return store(value.ptr(), value.length(), from->charset()); + } + bool memcpy_field_possible(const Field *from) const + { + return Field_str::memcpy_field_possible(from) && + !table->copy_blobs; + } int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); @@ -3096,7 +3271,6 @@ public: uint max_packed_col_length(uint max_length); void free() { value.free(); } inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); } - friend int field_conv_incompatible(Field *to,Field *from); uint size_of() const { return sizeof(*this); } bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } @@ -3168,6 +3342,7 @@ uint gis_field_options_read(const uchar *buf, uint buf_len, class Field_enum :public Field_str { + static void do_field_enum(Copy_field *copy_field); protected: uint packlength; public: @@ -3188,6 +3363,33 @@ public: enum_field_types type() const { return MYSQL_TYPE_STRING; } enum Item_result cmp_type () const { return INT_RESULT; } enum ha_base_keytype key_type() const; + Copy_func *get_copy_func(const Field *from) const + { + if (eq_def(from)) + return get_identical_copy_func(); + if (real_type() == MYSQL_TYPE_ENUM && + from->real_type() == MYSQL_TYPE_ENUM) + return do_field_enum; + if (from->result_type() == STRING_RESULT) + return do_field_string; + return do_field_int; + } + int store_field(Field *from) + { + if (from->real_type() == MYSQL_TYPE_ENUM && from->val_int() == 0) + { + store_type(0); + return 0; + } + return from->save_in_field(this); + } + int save_in_field(Field *to) + { + if (to->result_type() != STRING_RESULT) + return to->store(val_int(), 0); + return save_in_field_str(to); + } + bool memcpy_field_possible(const Field *from) const { return false; } int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); @@ -3206,7 +3408,7 @@ public: uint row_pack_length() const { return pack_length(); } virtual bool zero_pack() const { return 0; } bool optimize_range(uint idx, uint part) { return 0; } - bool eq_def(Field *field); + bool eq_def(const Field *field) const; bool has_charset(void) const { return TRUE; } /* enum and set are sorted as integers */ CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } @@ -3251,6 +3453,7 @@ public: { flags=(flags & ~ENUM_FLAG) | SET_FLAG; } + int store_field(Field *from) { return from->save_in_field(this); } int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr) { return Field_set::store((longlong) nr, FALSE); } int store(longlong nr, bool unsigned_val); @@ -3302,6 +3505,12 @@ public: clr_rec_bits(bit_ptr, bit_ofs, bit_len); return 0; } + Copy_func *get_copy_func(const Field *from) const + { + return do_field_int; + } + int save_in_field(Field *to) { return to->store(val_int(), true); } + bool memcpy_field_possible(const Field *from) const { return false; } int store(const char *to, uint length, CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); @@ -3430,16 +3639,24 @@ public: extern const LEX_STRING null_lex_str; + + +Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, + uchar *ptr, uint32 field_length, + uchar *null_pos, uchar null_bit, + uint pack_flag, enum_field_types field_type, + CHARSET_INFO *cs, + Field::geometry_type geom_type, uint srid, + Field::utype unireg_check, + TYPELIB *interval, const char *field_name); + /* Create field class for CREATE TABLE */ - -class Create_field :public Sql_alloc +class Column_definition: public Sql_alloc { public: const char *field_name; - const char *change; // If done with alter table - const char *after; // Put column after this one LEX_STRING comment; // Comment for field Item *def, *on_update; // Default value enum enum_field_types sql_type; @@ -3456,20 +3673,13 @@ public: uint decimals, flags, pack_length, key_length; Field::utype unireg_check; TYPELIB *interval; // Which interval to use - TYPELIB *save_interval; // Temporary copy for the above - // Used only for UCS2 intervals List<String> interval_list; CHARSET_INFO *charset; uint32 srid; Field::geometry_type geom_type; - Field *field; // For alter table engine_option_value *option_list; - /** structure with parsed options (for comparing fields in ALTER TABLE) */ - ha_field_option_struct *option_struct; - uint8 interval_id; // For rea_create_table - uint offset,pack_flag; - bool create_if_not_exists; // Used in ALTER TABLE IF NOT EXISTS + uint pack_flag; /* This is additinal data provided for any computed(virtual) field. @@ -3477,37 +3687,25 @@ public: can be computed from other fields. */ Virtual_column_info *vcol_info; - /* - Flag indicating that the field is physically stored in tables - rather than just computed from other fields. - As of now, FALSE can be set only for computed virtual columns. - */ - bool stored_in_db; - Create_field() :change(0), after(0), comment(null_lex_str), - def(0), on_update(0), sql_type(MYSQL_TYPE_NULL), - flags(0), pack_length(0), key_length(0), interval(0), - srid(0), geom_type(Field::GEOM_GEOMETRY), - field(0), option_list(NULL), option_struct(NULL), - create_if_not_exists(false), vcol_info(0), - stored_in_db(true) + Column_definition(): + comment(null_lex_str), + def(0), on_update(0), sql_type(MYSQL_TYPE_NULL), + flags(0), pack_length(0), key_length(0), interval(0), + srid(0), geom_type(Field::GEOM_GEOMETRY), + option_list(NULL), + vcol_info(0) { interval_list.empty(); } - Create_field(THD *thd, Field *field, Field *orig_field); - /* Used to make a clone of this object for ALTER/CREATE TABLE */ - Create_field *clone(MEM_ROOT *mem_root) const; + Column_definition(THD *thd, Field *field, Field *orig_field); void create_length_to_internal_length(void); - /* Init for a tmp table field. To be extended if need be. */ - void init_for_tmp_table(enum_field_types sql_type_arg, - uint32 max_length, uint32 decimals, - bool maybe_null, bool is_unsigned, - uint pack_length = ~0U); - bool check(THD *thd); + bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; } + ha_storage_media field_storage_type() const { return (ha_storage_media) @@ -3532,6 +3730,54 @@ public: unireg_check == Field::TIMESTAMP_UN_FIELD || unireg_check == Field::NEXT_NUMBER); } + + Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, + uchar *ptr, uchar *null_pos, uchar null_bit, + const char *field_name_arg) const + { + return ::make_field(share, mem_root, ptr, + length, null_pos, null_bit, + pack_flag, sql_type, charset, + geom_type, srid, unireg_check, interval, + field_name_arg); + } + Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, + const char *field_name_arg) + { + return make_field(share, mem_root, (uchar *) 0, (uchar *) "", 0, + field_name_arg); + } +}; + + +class Create_field :public Column_definition +{ +public: + const char *change; // If done with alter table + const char *after; // Put column after this one + Field *field; // For alter table + TYPELIB *save_interval; // Temporary copy for the above + // Used only for UCS2 intervals + + /** structure with parsed options (for comparing fields in ALTER TABLE) */ + ha_field_option_struct *option_struct; + uint offset; + uint8 interval_id; // For rea_create_table + bool create_if_not_exists; // Used in ALTER TABLE IF NOT EXISTS + + Create_field(): + Column_definition(), change(0), after(0), + field(0), option_struct(NULL), + create_if_not_exists(false) + { } + Create_field(THD *thd, Field *old_field, Field *orig_field): + Column_definition(thd, old_field, orig_field), + change(old_field->field_name), after(0), + field(old_field), option_struct(old_field->option_struct), + create_if_not_exists(false) + { } + /* Used to make a clone of this object for ALTER/CREATE TABLE */ + Create_field *clone(MEM_ROOT *mem_root) const; }; @@ -3556,12 +3802,6 @@ class Send_field :public Sql_alloc { */ class Copy_field :public Sql_alloc { - /** - Convenience definition of a copy function returned by - get_copy_func. - */ - typedef void Copy_func(Copy_field*); - Copy_func *get_copy_func(Field *to, Field *from); public: uchar *from_ptr,*to_ptr; uchar *from_null_ptr,*to_null_ptr; @@ -3582,7 +3822,7 @@ public: Note that for VARCHARs, do_copy() will be do_varstring*() which only copies the length-bytes (1 or 2) + the actual length of the - text instead of from/to_length bytes. @see get_copy_func() + text instead of from/to_length bytes. */ uint from_length,to_length; Field *from_field,*to_field; @@ -3597,14 +3837,6 @@ public: }; -Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root, - uchar *ptr, uint32 field_length, - uchar *null_pos, uchar null_bit, - uint pack_flag, enum_field_types field_type, - CHARSET_INFO *cs, - Field::geometry_type geom_type, uint srid, - Field::utype unireg_check, - TYPELIB *interval, const char *field_name); uint pack_length_to_packflag(uint type); enum_field_types get_blob_type_from_length(ulong length); uint32 calc_pack_length(enum_field_types type,uint32 length); diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 509c31dfa86..ecad05c7530 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -335,12 +335,12 @@ static void do_copy_next_number(Copy_field *copy) } -static void do_copy_blob(Copy_field *copy) +void Field_blob::do_copy_blob(Copy_field *copy) { ((Field_blob*) copy->to_field)->copy_value(((Field_blob*) copy->from_field)); } -static void do_conv_blob(Copy_field *copy) +void Field_blob::do_conv_blob(Copy_field *copy) { copy->from_field->val_str(©->tmp); ((Field_blob *) copy->to_field)->store(copy->tmp.ptr(), @@ -362,7 +362,7 @@ static void do_save_blob(Copy_field *copy) } -static void do_field_string(Copy_field *copy) +void Field::do_field_string(Copy_field *copy) { char buff[MAX_FIELD_WIDTH]; String res(buff, sizeof(buff), copy->from_field->charset()); @@ -373,7 +373,7 @@ static void do_field_string(Copy_field *copy) } -static void do_field_enum(Copy_field *copy) +void Field_enum::do_field_enum(Copy_field *copy) { if (copy->from_field->val_int() == 0) ((Field_enum *) copy->to_field)->store_type((ulonglong) 0); @@ -397,32 +397,45 @@ static void do_field_varbinary_pre50(Copy_field *copy) } -static void do_field_int(Copy_field *copy) +void Field::do_field_int(Copy_field *copy) { longlong value= copy->from_field->val_int(); copy->to_field->store(value, MY_TEST(copy->from_field->flags & UNSIGNED_FLAG)); } -static void do_field_real(Copy_field *copy) +void Field::do_field_real(Copy_field *copy) { double value=copy->from_field->val_real(); copy->to_field->store(value); } -static void do_field_decimal(Copy_field *copy) +void Field::do_field_decimal(Copy_field *copy) { my_decimal value; copy->to_field->store_decimal(copy->from_field->val_decimal(&value)); } -static void do_field_temporal(Copy_field *copy) +void Field::do_field_temporal(Copy_field *copy) { MYSQL_TIME ltime; - copy->from_field->get_date(<ime, 0); - copy->to_field->store_time_dec(<ime, copy->from_field->decimals()); + // TODO: we now need to check result + if (copy->from_field->get_date(<ime, 0)) + copy->to_field->reset(); + else + copy->to_field->store_time_dec(<ime, copy->from_field->decimals()); +} + + +void Field_time::do_field_time(Copy_field *copy) +{ + MYSQL_TIME ltime; + if (copy->from_field->get_date(<ime, TIME_TIME_ONLY)) + copy->to_field->reset(); + else + copy->to_field->store_time_dec(<ime, copy->from_field->decimals()); } @@ -698,122 +711,72 @@ void Copy_field::set(Field *to,Field *from,bool save) if ((to->flags & BLOB_FLAG) && save) do_copy2= do_save_blob; else - do_copy2= get_copy_func(to,from); + do_copy2= to->get_copy_func(from); if (!do_copy) // Not null do_copy=do_copy2; } -Copy_field::Copy_func * -Copy_field::get_copy_func(Field *to,Field *from) +Field::Copy_func *Field_temporal::get_copy_func(const Field *from) const +{ + /* If types are not 100 % identical then convert trough get_date() */ + if (from->cmp_type() == REAL_RESULT) + return do_field_string; // TODO: MDEV-9344 + if (from->type() == MYSQL_TYPE_YEAR) + return do_field_string; // TODO: MDEV-9343 + if (from->type() == MYSQL_TYPE_BIT) + return do_field_int; + if (!eq_def(from) || + (table->in_use->variables.sql_mode & + (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE))) + return do_field_temporal; + return get_identical_copy_func(); +} + + +Field::Copy_func *Field_varstring::get_copy_func(const Field *from) const +{ + if (from->type() == MYSQL_TYPE_BIT) + return do_field_int; + /* + Detect copy from pre 5.0 varbinary to varbinary as of 5.0 and + use special copy function that removes trailing spaces and thus + repairs data. + */ + if (from->type() == MYSQL_TYPE_VAR_STRING && !from->has_charset() && + !Field_varstring::has_charset()) + return do_field_varbinary_pre50; + if (Field_varstring::real_type() != from->real_type() || + Field_varstring::charset() != from->charset() || + length_bytes != ((const Field_varstring*) from)->length_bytes) + return do_field_string; + return length_bytes == 1 ? + (from->charset()->mbmaxlen == 1 ? do_varstring1 : do_varstring1_mb) : + (from->charset()->mbmaxlen == 1 ? do_varstring2 : do_varstring2_mb); +} + + +Field::Copy_func *Field_string::get_copy_func(const Field *from) const +{ + if (from->type() == MYSQL_TYPE_BIT) + return do_field_int; + if (Field_string::real_type() != from->real_type() || + Field_string::charset() != from->charset()) + return do_field_string; + if (Field_string::pack_length() < from->pack_length()) + return (Field_string::charset()->mbmaxlen == 1 ? + do_cut_string : do_cut_string_complex); + if (Field_string::pack_length() > from->pack_length()) + return Field_string::charset() == &my_charset_bin ? do_expand_binary : + do_expand_string; + return get_identical_copy_func(); +} + + +Field::Copy_func *Field::get_identical_copy_func() const { - if (to->flags & BLOB_FLAG) - { - if (!(from->flags & BLOB_FLAG) || from->charset() != to->charset()) - return do_conv_blob; - if (from_length != to_length) - return do_copy_blob; - } - else - { - if (to->real_type() == MYSQL_TYPE_BIT || - from->real_type() == MYSQL_TYPE_BIT) - return do_field_int; - if (to->result_type() == DECIMAL_RESULT) - return do_field_decimal; - if (from->cmp_type() == TIME_RESULT) - { - /* If types are not 100 % identical then convert trough get_date() */ - if (!to->eq_def(from) || - ((to->table->in_use->variables.sql_mode & - (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE)) && - mysql_type_to_time_type(to->type()) != MYSQL_TIMESTAMP_TIME)) - return do_field_temporal; - /* Do binary copy */ - } - // Check if identical fields - if (from->result_type() == STRING_RESULT) - { - /* - Detect copy from pre 5.0 varbinary to varbinary as of 5.0 and - use special copy function that removes trailing spaces and thus - repairs data. - */ - if (from->type() == MYSQL_TYPE_VAR_STRING && !from->has_charset() && - to->type() == MYSQL_TYPE_VARCHAR && !to->has_charset()) - return do_field_varbinary_pre50; - - if (to->real_type() != from->real_type()) - { - if (from->real_type() == MYSQL_TYPE_ENUM || - from->real_type() == MYSQL_TYPE_SET) - if (to->result_type() != STRING_RESULT) - return do_field_int; // Convert SET to number - return do_field_string; - } - if (to->real_type() == MYSQL_TYPE_ENUM || - to->real_type() == MYSQL_TYPE_SET) - { - if (!to->eq_def(from)) - { - if (from->real_type() == MYSQL_TYPE_ENUM && - to->real_type() == MYSQL_TYPE_ENUM) - return do_field_enum; - return do_field_string; - } - } - else if (to->charset() != from->charset()) - return do_field_string; - else if (to->real_type() == MYSQL_TYPE_VARCHAR) - { - if (((Field_varstring*) to)->length_bytes != - ((Field_varstring*) from)->length_bytes) - return do_field_string; - return (((Field_varstring*) to)->length_bytes == 1 ? - (from->charset()->mbmaxlen == 1 ? do_varstring1 : - do_varstring1_mb) : - (from->charset()->mbmaxlen == 1 ? do_varstring2 : - do_varstring2_mb)); - } - else if (to_length < from_length) - return (from->charset()->mbmaxlen == 1 ? - do_cut_string : do_cut_string_complex); - else if (to_length > from_length) - { - if (to->charset() == &my_charset_bin) - return do_expand_binary; - return do_expand_string; - } - } - else if (to->real_type() != from->real_type() || - to_length != from_length) - { - if ((to->real_type() == MYSQL_TYPE_ENUM || - to->real_type() == MYSQL_TYPE_SET) && - from->real_type() == MYSQL_TYPE_NEWDECIMAL) - return do_field_decimal; - if (to->real_type() == MYSQL_TYPE_DECIMAL || - to->result_type() == STRING_RESULT) - return do_field_string; - if (to->result_type() == INT_RESULT) - return do_field_int; - return do_field_real; - } - else - { - if (!to->eq_def(from)) - { - if (to->real_type() == MYSQL_TYPE_DECIMAL) - return do_field_string; - if (to->result_type() == INT_RESULT) - return do_field_int; - else - return do_field_real; - } - } - } /* Identical field types */ - switch (to_length) { + switch (pack_length()) { case 1: return do_field_1; case 2: return do_field_2; case 3: return do_field_3; @@ -824,61 +787,25 @@ Copy_field::get_copy_func(Field *to,Field *from) return do_field_eq; } -/** - Check if it is possible just copy value of the fields - @param to The field to copy to - @param from The field to copy from +bool Field_temporal::memcpy_field_possible(const Field *from) const +{ + return real_type() == from->real_type() && + decimals() == from->decimals() && + !sql_mode_for_dates(table->in_use); +} - @retval TRUE - it is possible to just copy value of 'from' to 'to'. - @retval FALSE - conversion is needed -*/ -bool memcpy_field_possible(Field *to,Field *from) +static int field_conv_memcpy(Field *to, Field *from) { - const enum_field_types to_real_type= to->real_type(); - const enum_field_types from_real_type= from->real_type(); /* - Warning: Calling from->type() may be unsafe in some (unclear) circumstances - related to SPs. See MDEV-6799. + This may happen if one does 'UPDATE ... SET x=x' + The test is here mostly for valgrind, but can also be relevant + if memcpy() is implemented with prefetch-write */ - return (to_real_type == from_real_type && - !(to->flags & BLOB_FLAG && to->table->copy_blobs) && - to->pack_length() == from->pack_length() && - !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) && - to->decimals() == from->decimals() && - to_real_type != MYSQL_TYPE_ENUM && - to_real_type != MYSQL_TYPE_SET && - to_real_type != MYSQL_TYPE_BIT && - (to_real_type != MYSQL_TYPE_NEWDECIMAL || - to->field_length == from->field_length) && - from->charset() == to->charset() && - (!sql_mode_for_dates(to->table->in_use) || - (from->type()!= MYSQL_TYPE_DATE && - from->type()!= MYSQL_TYPE_DATETIME && - from->type()!= MYSQL_TYPE_TIMESTAMP)) && - (from_real_type != MYSQL_TYPE_VARCHAR || - ((Field_varstring*)from)->length_bytes == - ((Field_varstring*)to)->length_bytes)); -} - - -/** Simple quick field convert that is called on insert. */ - -int field_conv(Field *to,Field *from) -{ - if (memcpy_field_possible(to, from)) - { // Identical fields - /* - This may happen if one does 'UPDATE ... SET x=x' - The test is here mostly for valgrind, but can also be relevant - if memcpy() is implemented with prefetch-write - */ - if (to->ptr != from->ptr) - memcpy(to->ptr, from->ptr, to->pack_length()); - return 0; - } - return field_conv_incompatible(to, from); + if (to->ptr != from->ptr) + memcpy(to->ptr,from->ptr, to->pack_length()); + return 0; } @@ -888,65 +815,34 @@ int field_conv(Field *to,Field *from) @note Impossibility of simple copy should be checked before this call. @param to The field to copy to - @param from The field to copy from @retval TRUE ERROR @retval FALSE OK + +*/ +static int field_conv_incompatible(Field *to, Field *from) +{ + return to->store_field(from); +} + + +/** + Simple quick field converter that is called on insert, e.g.: + INSERT INTO t1 (field1) SELECT field2 FROM t2; */ -int field_conv_incompatible(Field *to, Field *from) +int field_conv(Field *to,Field *from) { - const enum_field_types to_real_type= to->real_type(); - const enum_field_types from_real_type= from->real_type(); - if (to->flags & BLOB_FLAG) - { // Be sure the value is stored - Field_blob *blob=(Field_blob*) to; - from->val_str(&blob->value); + return to->memcpy_field_possible(from) ? + field_conv_memcpy(to, from) : + field_conv_incompatible(to, from); +} - if (!blob->value.is_alloced() && from->is_updatable()) - blob->value.copy(); - return blob->store(blob->value.ptr(),blob->value.length(),from->charset()); - } - if (from_real_type == MYSQL_TYPE_ENUM && - to_real_type == MYSQL_TYPE_ENUM && - from->val_int() == 0) - { - ((Field_enum *)(to))->store_type(0); - return 0; - } - Item_result from_result_type= from->result_type(); - if (from_result_type == REAL_RESULT) - return to->store(from->val_real()); - if (from_result_type == DECIMAL_RESULT) - { - my_decimal buff; - return to->store_decimal(from->val_decimal(&buff)); - } - if (from->cmp_type() == TIME_RESULT) - { - MYSQL_TIME ltime; - if (from->get_date(<ime, 0)) - return to->reset(); - else - return to->store_time_dec(<ime, from->decimals()); - } - if ((from_result_type == STRING_RESULT && - (to->result_type() == STRING_RESULT || - (from_real_type != MYSQL_TYPE_ENUM && - from_real_type != MYSQL_TYPE_SET))) || - to->type() == MYSQL_TYPE_DECIMAL) - { - char buff[MAX_FIELD_WIDTH]; - String result(buff,sizeof(buff),from->charset()); - from->val_str(&result); - /* - We use c_ptr_quick() here to make it easier if to is a float/double - as the conversion routines will do a copy of the result doesn't - end with \0. Can be replaced with .ptr() when we have our own - string->double conversion. - */ - return to->store(result.c_ptr_quick(),result.length(),from->charset()); - } - return to->store(from->val_int(), MY_TEST(from->flags & UNSIGNED_FLAG)); +fast_field_copier Field::get_fast_field_copier(const Field *from) +{ + DBUG_ENTER("Field::get_fast_field_copier"); + DBUG_RETURN(memcpy_field_possible(from) ? + &field_conv_memcpy : + &field_conv_incompatible); } diff --git a/sql/filesort.cc b/sql/filesort.cc index 917b9de6038..9289d712cbc 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -964,6 +964,177 @@ static inline void store_length(uchar *to, uint length, uint pack_length) } +void +Type_handler_string_result::make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const +{ + CHARSET_INFO *cs= item->collation.collation; + bool maybe_null= item->maybe_null; + + if (maybe_null) + *to++= 1; + char *tmp_buffer= param->tmp_buffer ? param->tmp_buffer : (char*) to; + String tmp(tmp_buffer, param->sort_length, cs); + String *res= item->str_result(&tmp); + if (!res) + { + if (maybe_null) + memset(to - 1, 0, sort_field->length + 1); + else + { + /* purecov: begin deadcode */ + /* + This should only happen during extreme conditions if we run out + of memory or have an item marked not null when it can be null. + This code is here mainly to avoid a hard crash in this case. + */ + DBUG_ASSERT(0); + DBUG_PRINT("warning", + ("Got null on something that shouldn't be null")); + memset(to, 0, sort_field->length); // Avoid crash + /* purecov: end */ + } + return; + } + + if (use_strnxfrm(cs)) + { + uint tmp_length __attribute__((unused)); + tmp_length= cs->coll->strnxfrm(cs, to, sort_field->length, + item->max_char_length() * + cs->strxfrm_multiply, + (uchar*) res->ptr(), res->length(), + MY_STRXFRM_PAD_WITH_SPACE | + MY_STRXFRM_PAD_TO_MAXLEN); + DBUG_ASSERT(tmp_length == sort_field->length); + } + else + { + uint diff; + uint sort_field_length= sort_field->length - sort_field->suffix_length; + uint length= res->length(); + if (sort_field_length < length) + { + diff= 0; + length= sort_field_length; + } + else + diff= sort_field_length - length; + if (sort_field->suffix_length) + { + /* Store length last in result_string */ + store_length(to + sort_field_length, length, sort_field->suffix_length); + } + /* apply cs->sort_order for case-insensitive comparison if needed */ + my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length); + char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' '); + cs->cset->fill(cs, (char *)to+length,diff,fill_char); + } +} + + +void +Type_handler_int_result::make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const +{ + longlong value= item->val_int_result(); + make_sort_key_longlong(to, item->maybe_null, item->null_value, + item->unsigned_flag, value); +} + + +void +Type_handler_temporal_result::make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const +{ + MYSQL_TIME buf; + if (item->get_date_result(&buf, TIME_INVALID_DATES)) + { + DBUG_ASSERT(item->maybe_null); + DBUG_ASSERT(item->null_value); + make_sort_key_longlong(to, item->maybe_null, true, + item->unsigned_flag, 0); + } + else + make_sort_key_longlong(to, item->maybe_null, false, + item->unsigned_flag, pack_time(&buf)); +} + + +void +Type_handler::make_sort_key_longlong(uchar *to, + bool maybe_null, + bool null_value, + bool unsigned_flag, + longlong value) const + +{ + if (maybe_null) + { + if (null_value) + { + memset(to, 0, 9); + return; + } + *to++= 1; + } + to[7]= (uchar) value; + to[6]= (uchar) (value >> 8); + to[5]= (uchar) (value >> 16); + to[4]= (uchar) (value >> 24); + to[3]= (uchar) (value >> 32); + to[2]= (uchar) (value >> 40); + to[1]= (uchar) (value >> 48); + if (unsigned_flag) /* Fix sign */ + to[0]= (uchar) (value >> 56); + else + to[0]= (uchar) (value >> 56) ^ 128; /* Reverse signbit */ +} + + +void +Type_handler_decimal_result::make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const +{ + my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf); + if (item->maybe_null) + { + if (item->null_value) + { + memset(to, 0, sort_field->length + 1); + return; + } + *to++= 1; + } + my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, to, + item->max_length - (item->decimals ? 1 : 0), + item->decimals); +} + + +void +Type_handler_real_result::make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const +{ + double value= item->val_result(); + if (item->maybe_null) + { + if (item->null_value) + { + memset(to, 0, sort_field->length + 1); + return; + } + *to++= 1; + } + change_double_for_sort(value, to); +} + + /** Make a sort-key from record. */ static void make_sortkey(register Sort_param *param, @@ -986,161 +1157,9 @@ static void make_sortkey(register Sort_param *param, } else { // Item - Item *item=sort_field->item; - maybe_null= item->maybe_null; - switch (sort_field->result_type) { - case STRING_RESULT: - { - CHARSET_INFO *cs=item->collation.collation; - char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' '); - - if (maybe_null) - *to++=1; - char *tmp_buffer= param->tmp_buffer ? param->tmp_buffer : (char*)to; - String tmp(tmp_buffer, param->sort_length, cs); - String *res= item->str_result(&tmp); - if (!res) - { - if (maybe_null) - memset(to-1, 0, sort_field->length+1); - else - { - /* purecov: begin deadcode */ - /* - This should only happen during extreme conditions if we run out - of memory or have an item marked not null when it can be null. - This code is here mainly to avoid a hard crash in this case. - */ - DBUG_ASSERT(0); - DBUG_PRINT("warning", - ("Got null on something that shouldn't be null")); - memset(to, 0, sort_field->length); // Avoid crash - /* purecov: end */ - } - break; - } - length= res->length(); - if (sort_field->need_strxnfrm) - { - uint tmp_length __attribute__((unused)); - tmp_length= cs->coll->strnxfrm(cs, to, sort_field->length, - item->max_char_length() * - cs->strxfrm_multiply, - (uchar*) res->ptr(), length, - MY_STRXFRM_PAD_WITH_SPACE | - MY_STRXFRM_PAD_TO_MAXLEN); - DBUG_ASSERT(tmp_length == sort_field->length); - } - else - { - uint diff; - uint sort_field_length= sort_field->length - - sort_field->suffix_length; - if (sort_field_length < length) - { - diff= 0; - length= sort_field_length; - } - else - diff= sort_field_length - length; - if (sort_field->suffix_length) - { - /* Store length last in result_string */ - store_length(to + sort_field_length, length, - sort_field->suffix_length); - } - /* apply cs->sort_order for case-insensitive comparison if needed */ - my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length); - cs->cset->fill(cs, (char *)to+length,diff,fill_char); - } - break; - } - case INT_RESULT: - case TIME_RESULT: - { - longlong UNINIT_VAR(value); - if (sort_field->result_type == INT_RESULT) - value= item->val_int_result(); - else - { - MYSQL_TIME buf; - if (item->get_date_result(&buf, TIME_INVALID_DATES)) - { - DBUG_ASSERT(maybe_null); - DBUG_ASSERT(item->null_value); - } - else - value= pack_time(&buf); - } - if (maybe_null) - { - *to++=1; /* purecov: inspected */ - if (item->null_value) - { - if (maybe_null) - memset(to-1, 0, sort_field->length+1); - else - { - DBUG_PRINT("warning", - ("Got null on something that shouldn't be null")); - memset(to, 0, sort_field->length); - } - break; - } - } - to[7]= (uchar) value; - to[6]= (uchar) (value >> 8); - to[5]= (uchar) (value >> 16); - to[4]= (uchar) (value >> 24); - to[3]= (uchar) (value >> 32); - to[2]= (uchar) (value >> 40); - to[1]= (uchar) (value >> 48); - if (item->unsigned_flag) /* Fix sign */ - to[0]= (uchar) (value >> 56); - else - to[0]= (uchar) (value >> 56) ^ 128; /* Reverse signbit */ - break; - } - case DECIMAL_RESULT: - { - my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf); - if (maybe_null) - { - if (item->null_value) - { - memset(to, 0, sort_field->length+1); - to++; - break; - } - *to++=1; - } - my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, to, - item->max_length - (item->decimals ? 1:0), - item->decimals); - break; - } - case REAL_RESULT: - { - double value= item->val_result(); - if (maybe_null) - { - if (item->null_value) - { - memset(to, 0, sort_field->length+1); - to++; - break; - } - *to++=1; - } - change_double_for_sort(value,(uchar*) to); - break; - } - case ROW_RESULT: - default: - // This case should never be choosen - DBUG_ASSERT(0); - break; - } + sort_field->item->make_sort_key(to, sort_field->item, sort_field, param); + if ((maybe_null= sort_field->item->maybe_null)) + to++; } if (sort_field->reverse) { /* Revers key */ @@ -1842,6 +1861,64 @@ static uint suffix_length(ulong string_length) } +void +Type_handler_string_result::sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *sortorder) const +{ + CHARSET_INFO *cs; + sortorder->length= item->max_length; + set_if_smaller(sortorder->length, thd->variables.max_sort_length); + if (use_strnxfrm((cs= item->collation.collation))) + { + sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length); + } + else if (cs == &my_charset_bin) + { + /* Store length last to be able to sort blob/varbinary */ + sortorder->suffix_length= suffix_length(sortorder->length); + sortorder->length+= sortorder->suffix_length; + } +} + + +void +Type_handler_temporal_result::sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *sortorder) const +{ + sortorder->length= 8; // Sizof intern longlong +} + + +void +Type_handler_int_result::sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *sortorder) const +{ + sortorder->length= 8; // Sizof intern longlong +} + + +void +Type_handler_real_result::sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *sortorder) const +{ + sortorder->length= sizeof(double); +} + + +void +Type_handler_decimal_result::sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *sortorder) const +{ + sortorder->length= + my_decimal_get_binary_size(item->max_length - (item->decimals ? 1 : 0), + item->decimals); +} + /** Calculate length of sort key. @@ -1854,8 +1931,6 @@ static uint suffix_length(ulong string_length) @note sortorder->length is updated for each sort item. - @n - sortorder->need_strxnfrm is set 1 if we have to use strxnfrm @return Total length of sort buffer in bytes @@ -1866,23 +1941,19 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) { uint length; - CHARSET_INFO *cs; *multi_byte_charset= 0; length=0; for (; s_length-- ; sortorder++) { - sortorder->need_strxnfrm= 0; sortorder->suffix_length= 0; if (sortorder->field) { - cs= sortorder->field->sort_charset(); + CHARSET_INFO *cs= sortorder->field->sort_charset(); sortorder->length= sortorder->field->sort_length(); - if (use_strnxfrm((cs=sortorder->field->sort_charset()))) { - sortorder->need_strxnfrm= 1; - *multi_byte_charset= 1; + *multi_byte_charset= true; sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length); } if (sortorder->field->maybe_null()) @@ -1890,42 +1961,10 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, } else { - sortorder->result_type= sortorder->item->cmp_type(); - switch (sortorder->result_type) { - case STRING_RESULT: - sortorder->length=sortorder->item->max_length; - set_if_smaller(sortorder->length, thd->variables.max_sort_length); - if (use_strnxfrm((cs=sortorder->item->collation.collation))) - { - sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length); - sortorder->need_strxnfrm= 1; - *multi_byte_charset= 1; - } - else if (cs == &my_charset_bin) - { - /* Store length last to be able to sort blob/varbinary */ - sortorder->suffix_length= suffix_length(sortorder->length); - sortorder->length+= sortorder->suffix_length; - } - break; - case TIME_RESULT: - case INT_RESULT: - sortorder->length=8; // Size of intern longlong - break; - case DECIMAL_RESULT: - sortorder->length= - my_decimal_get_binary_size(sortorder->item->max_length - - (sortorder->item->decimals ? 1 : 0), - sortorder->item->decimals); - break; - case REAL_RESULT: - sortorder->length=sizeof(double); - break; - case ROW_RESULT: - default: - // This case should never be choosen - DBUG_ASSERT(0); - break; + sortorder->item->sortlength(thd, sortorder->item, sortorder); + if (use_strnxfrm(sortorder->item->collation.collation)) + { + *multi_byte_charset= true; } if (sortorder->item->maybe_null) length++; // Place for NULL marker diff --git a/sql/filesort.h b/sql/filesort.h index 4c95f1202b2..22d7f987de2 100644 --- a/sql/filesort.h +++ b/sql/filesort.h @@ -24,10 +24,10 @@ class SQL_SELECT; class SQL_SELECT; class THD; struct TABLE; -typedef struct st_sort_field SORT_FIELD; +struct SORT_FIELD; class Filesort_tracker; -ha_rows filesort(THD *thd, TABLE *table, st_sort_field *sortorder, +ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, SQL_SELECT *select, ha_rows max_rows, bool sort_positions, ha_rows *examined_rows, ha_rows *found_rows, diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0e009e76066..5d789fa31e3 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1281,8 +1281,8 @@ static bool print_admin_msg(THD* thd, uint len, length=(uint) (strxmov(name, db_name, ".", table_name.c_ptr_safe(), NullS) - name); /* TODO: switch from protocol to push_warning here. The main reason we didn't - it yet is parallel repair. Due to following trace: - mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr. + it yet is parallel repair, which threads have no THD object accessible via + current_thd. Also we likely need to lock mutex here (in both cases with protocol and push_warning). @@ -9058,7 +9058,7 @@ int ha_partition::check_for_upgrade(HA_CHECK_OPT *check_opt) } m_part_info->key_algorithm= partition_info::KEY_ALGORITHM_51; if (skip_generation || - !(part_buf= generate_partition_syntax(m_part_info, + !(part_buf= generate_partition_syntax(thd, m_part_info, &part_buf_len, true, true, diff --git a/sql/item.cc b/sql/item.cc index 552069ebd9f..55bd62188b4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -629,48 +629,6 @@ void Item::rename(char *new_name) name= new_name; } -Item_result Item::cmp_type() const -{ - switch (field_type()) { - case MYSQL_TYPE_DECIMAL: - case MYSQL_TYPE_NEWDECIMAL: - return DECIMAL_RESULT; - case MYSQL_TYPE_TINY: - case MYSQL_TYPE_SHORT: - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_LONGLONG: - case MYSQL_TYPE_INT24: - case MYSQL_TYPE_YEAR: - case MYSQL_TYPE_BIT: - return INT_RESULT; - case MYSQL_TYPE_FLOAT: - case MYSQL_TYPE_DOUBLE: - return REAL_RESULT; - case MYSQL_TYPE_NULL: - case MYSQL_TYPE_VARCHAR: - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - case MYSQL_TYPE_GEOMETRY: - return STRING_RESULT; - case MYSQL_TYPE_TIMESTAMP: - case MYSQL_TYPE_TIMESTAMP2: - case MYSQL_TYPE_DATE: - case MYSQL_TYPE_TIME: - case MYSQL_TYPE_TIME2: - case MYSQL_TYPE_DATETIME: - case MYSQL_TYPE_DATETIME2: - case MYSQL_TYPE_NEWDATE: - return TIME_RESULT; - }; - DBUG_ASSERT(0); - return STRING_RESULT; -} /** Traverse item tree possibly transforming it (replacing items). @@ -969,7 +927,7 @@ bool Item::check_cols(uint c) } -void Item::set_name(const char *str, uint length, CHARSET_INFO *cs) +void Item::set_name(THD *thd, const char *str, uint length, CHARSET_INFO *cs) { if (!length) { @@ -1000,7 +958,6 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs) if (str != str_start && !is_autogenerated_name) { char buff[SAFE_NAME_LEN]; - THD *thd= current_thd; strmake(buff, str_start, MY_MIN(sizeof(buff)-1, length + (int) (str-str_start))); @@ -1018,28 +975,29 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs) if (!my_charset_same(cs, system_charset_info)) { size_t res_length; - name= sql_strmake_with_convert(str, length, cs, + name= sql_strmake_with_convert(thd, str, length, cs, MAX_ALIAS_NAME, system_charset_info, &res_length); name_length= res_length; } else - name= sql_strmake(str, (name_length= MY_MIN(length,MAX_ALIAS_NAME))); + name= thd->strmake(str, (name_length= MY_MIN(length,MAX_ALIAS_NAME))); } -void Item::set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs) +void Item::set_name_no_truncate(THD *thd, const char *str, uint length, + CHARSET_INFO *cs) { if (!my_charset_same(cs, system_charset_info)) { size_t res_length; - name= sql_strmake_with_convert(str, length, cs, + name= sql_strmake_with_convert(thd, str, length, cs, UINT_MAX, system_charset_info, &res_length); name_length= res_length; } else - name= sql_strmake(str, (name_length= length)); + name= thd->strmake(str, (name_length= length)); } @@ -1048,7 +1006,7 @@ void Item::set_name_for_rollback(THD *thd, const char *str, uint length, { char *old_name, *new_name; old_name= name; - set_name(str, length, cs); + set_name(thd, str, length, cs); new_name= name; if (old_name != new_name) { @@ -1478,8 +1436,7 @@ Item_splocal::Item_splocal(THD *thd, const LEX_STRING &sp_var_name, sp_var_type= real_type_to_type(sp_var_type); m_type= sp_map_item_type(sp_var_type); - m_field_type= sp_var_type; - m_result_type= sp_map_result_type(sp_var_type); + set_handler_by_field_type(sp_var_type); } @@ -1702,7 +1659,8 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref) } if (is_autogenerated_name) { - set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info); + set_name(thd, item_name->ptr(), (uint) item_name->length(), + system_charset_info); } collation.set(value_item->collation.collation, DERIVATION_IMPLICIT); max_length= value_item->max_length; @@ -2167,7 +2125,7 @@ bool Item_func_or_sum::agg_item_set_converter(const DTCollation &coll, } -void Item_ident_for_show::make_field(Send_field *tmp_field) +void Item_ident_for_show::make_field(THD *thd, Send_field *tmp_field) { tmp_field->table_name= tmp_field->org_table_name= table_name; tmp_field->db_name= db_name; @@ -3038,11 +2996,10 @@ default_set_param_func(Item_param *param, Item_param::Item_param(THD *thd, uint pos_in_query_arg): Item_basic_value(thd), Rewritable_query_parameter(pos_in_query_arg, 1), + Type_handler_hybrid_field_type(MYSQL_TYPE_VARCHAR), state(NO_VALUE), - item_result_type(STRING_RESULT), /* Don't pretend to be a literal unless value for this item is set. */ item_type(PARAM_ITEM), - param_type(MYSQL_TYPE_VARCHAR), set_param_func(default_set_param_func), m_out_param_info(NULL) { @@ -3242,25 +3199,25 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) DBUG_ENTER("Item_param::set_from_user_var"); if (entry && entry->value) { - item_result_type= entry->type; unsigned_flag= entry->unsigned_flag; if (limit_clause_param) { bool unused; set_int(entry->val_int(&unused), MY_INT64_NUM_DECIMAL_DIGITS); item_type= Item::INT_ITEM; + set_handler_by_result_type(entry->type); DBUG_RETURN(!unsigned_flag && value.integer < 0 ? 1 : 0); } - switch (item_result_type) { + switch (entry->type) { case REAL_RESULT: set_double(*(double*)entry->value); item_type= Item::REAL_ITEM; - param_type= MYSQL_TYPE_DOUBLE; + set_handler_by_field_type(MYSQL_TYPE_DOUBLE); break; case INT_RESULT: set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS); item_type= Item::INT_ITEM; - param_type= MYSQL_TYPE_LONGLONG; + set_handler_by_field_type(MYSQL_TYPE_LONGLONG); break; case STRING_RESULT: { @@ -3283,7 +3240,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) charset of connection, so we have to set it later. */ item_type= Item::STRING_ITEM; - param_type= MYSQL_TYPE_VARCHAR; + set_handler_by_field_type(MYSQL_TYPE_VARCHAR); if (set_str((const char *)entry->value, entry->length)) DBUG_RETURN(1); @@ -3299,7 +3256,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) my_decimal_precision_to_length_no_truncation(ent_value->precision(), decimals, unsigned_flag); item_type= Item::DECIMAL_ITEM; - param_type= MYSQL_TYPE_NEWDECIMAL; + set_handler_by_field_type(MYSQL_TYPE_NEWDECIMAL); break; } case ROW_RESULT: @@ -3724,10 +3681,9 @@ void Item_param::set_param_type_and_swap_value(Item_param *src) { Type_std_attributes::set(src); - param_type= src->param_type; + set_handler(src->type_handler()); set_param_func= src->set_param_func; item_type= src->item_type; - item_result_type= src->item_result_type; maybe_null= src->maybe_null; null_value= src->null_value; @@ -3815,7 +3771,7 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) return FALSE; } - item_result_type= arg->result_type(); + set_handler_by_result_type(arg->result_type()); item_type= arg->type(); return FALSE; } @@ -3834,7 +3790,7 @@ void Item_param::set_out_param_info(Send_field *info) { m_out_param_info= info; - param_type= m_out_param_info->type; + set_handler_by_field_type(m_out_param_info->type); } @@ -3863,9 +3819,9 @@ Item_param::get_out_param_info() const @param field container for meta-data to be filled */ -void Item_param::make_field(Send_field *field) +void Item_param::make_field(THD *thd, Send_field *field) { - Item::make_field(field); + Item::make_field(thd, field); if (!m_out_param_info) return; @@ -5396,34 +5352,18 @@ void Item::init_make_field(Send_field *tmp_field, tmp_field->flags |= UNSIGNED_FLAG; } -void Item::make_field(Send_field *tmp_field) +void Item::make_field(THD *thd, Send_field *tmp_field) { init_make_field(tmp_field, field_type()); } -void Item_empty_string::make_field(Send_field *tmp_field) +void Item_empty_string::make_field(THD *thd, Send_field *tmp_field) { init_make_field(tmp_field, string_field_type()); } -enum_field_types Item::field_type() const -{ - switch (result_type()) { - case STRING_RESULT: return string_field_type(); - case INT_RESULT: return MYSQL_TYPE_LONGLONG; - case DECIMAL_RESULT: return MYSQL_TYPE_NEWDECIMAL; - case REAL_RESULT: return MYSQL_TYPE_DOUBLE; - case ROW_RESULT: - case TIME_RESULT: - DBUG_ASSERT(0); - return MYSQL_TYPE_VARCHAR; - } - return MYSQL_TYPE_VARCHAR; -} - - /** Verifies that the input string is well-formed according to its character set. @param send_error If true, call my_error if string is not well-formed. @@ -5722,7 +5662,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, /* ARGSUSED */ -void Item_field::make_field(Send_field *tmp_field) +void Item_field::make_field(THD *thd, Send_field *tmp_field) { field->make_field(tmp_field); DBUG_ASSERT(tmp_field->table_name != 0); @@ -5786,19 +5726,9 @@ static int save_field_in_field(Field *from, bool *null_value, } -static int memcpy_field_value(Field *to, Field *from) -{ - if (to->ptr != from->ptr) - memcpy(to->ptr,from->ptr, to->pack_length()); - return 0; -} - fast_field_copier Item_field::setup_fast_field_copier(Field *to) { - DBUG_ENTER("Item_field::setup_fast_field_copier"); - DBUG_RETURN(memcpy_field_possible(to, field) ? - &memcpy_field_value : - &field_conv_incompatible); + return to->get_fast_field_copier(field); } @@ -6156,50 +6086,6 @@ void Item_hex_constant::hex_string_init(THD *thd, const char *str, unsigned_flag= 1; } -longlong Item_hex_hybrid::val_int() -{ - // following assert is redundant, because fixed=1 assigned in constructor - DBUG_ASSERT(fixed == 1); - char *end=(char*) str_value.ptr()+str_value.length(), - *ptr=end-MY_MIN(str_value.length(),sizeof(longlong)); - - ulonglong value=0; - for (; ptr != end ; ptr++) - value=(value << 8)+ (ulonglong) (uchar) *ptr; - return (longlong) value; -} - - -int Item_hex_hybrid::save_in_field(Field *field, bool no_conversions) -{ - field->set_notnull(); - if (field->result_type() == STRING_RESULT) - return field->store(str_value.ptr(), str_value.length(), - collation.collation); - - ulonglong nr; - uint32 length= str_value.length(); - - if (length > 8) - { - nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX; - goto warn; - } - nr= (ulonglong) val_int(); - if ((length == 8) && !(field->flags & UNSIGNED_FLAG) && (nr > LONGLONG_MAX)) - { - nr= LONGLONG_MAX; - goto warn; - } - return field->store((longlong) nr, TRUE); // Assume hex numbers are unsigned - -warn: - if (!field->store((longlong) nr, TRUE)) - field->set_warning(Sql_condition::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - 1); - return 1; -} - void Item_hex_hybrid::print(String *str, enum_query_type query_type) { @@ -7336,9 +7222,9 @@ void Item_ref::save_org_in_field(Field *field, fast_field_copier optimizer_data) } -void Item_ref::make_field(Send_field *field) +void Item_ref::make_field(THD *thd, Send_field *field) { - (*ref)->make_field(field); + (*ref)->make_field(thd, field); /* Non-zero in case of a view */ if (name) field->col_name= name; @@ -8498,7 +8384,7 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) Item *new_item= NULL; Item_result res_type= item_cmp_type(comp_item, item); - char *name=item->name; // Alloced by sql_alloc + char *name= item->name; // Alloced on THD::mem_root MEM_ROOT *mem_root= thd->mem_root; switch (res_type) { @@ -8523,7 +8409,7 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) else { uint length= result->length(); - char *tmp_str= sql_strmake(result->ptr(), length); + char *tmp_str= thd->strmake(result->ptr(), length); new_item= new (mem_root) Item_string(thd, name, tmp_str, length, result->charset()); } break; @@ -8823,8 +8709,9 @@ Item_cache_temporal::Item_cache_temporal(THD *thd, enum_field_types field_type_arg): Item_cache_int(thd, field_type_arg) { - if (mysql_type_to_time_type(cached_field_type) == MYSQL_TIMESTAMP_ERROR) - cached_field_type= MYSQL_TYPE_DATETIME; + if (mysql_type_to_time_type(Item_cache_temporal::field_type()) == + MYSQL_TIMESTAMP_ERROR) + set_handler_by_field_type(MYSQL_TYPE_DATETIME); } @@ -8967,7 +8854,7 @@ void Item_cache_temporal::store_packed(longlong val_arg, Item *example_arg) Item *Item_cache_temporal::clone_item(THD *thd) { Item_cache_temporal *item= new (thd->mem_root) - Item_cache_temporal(thd, cached_field_type); + Item_cache_temporal(thd, Item_cache_temporal::field_type()); item->store_packed(value, example); return item; } @@ -9264,14 +9151,28 @@ void Item_cache_row::set_null() Item_type_holder::Item_type_holder(THD *thd, Item *item) - :Item(thd, item), enum_set_typelib(0), fld_type(get_real_type(item)) + :Item(thd, item), + Type_handler_hybrid_real_field_type(get_real_type(item)), + enum_set_typelib(0) { DBUG_ASSERT(item->fixed); maybe_null= item->maybe_null; collation.set(item->collation); get_full_info(item); + /** + Field::result_merge_type(real_field_type()) should be equal to + result_type(), with one exception when "this" is a Item_field for + a BIT field: + - Field_bit::result_type() returns INT_RESULT, so does its Item_field. + - Field::result_merge_type(MYSQL_TYPE_BIT) returns STRING_RESULT. + Perhaps we need a new method in Type_handler to cover these type + merging rules for UNION. + */ + DBUG_ASSERT(real_field_type() == MYSQL_TYPE_BIT || + Item_type_holder::result_type() == + Field::result_merge_type(Item_type_holder::real_field_type())); /* fix variable decimals which always is NOT_FIXED_DEC */ - if (Field::result_merge_type(fld_type) == INT_RESULT) + if (Field::result_merge_type(real_field_type()) == INT_RESULT) decimals= 0; prev_decimal_int_part= item->decimal_int_part(); #ifdef HAVE_SPATIAL @@ -9282,19 +9183,6 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) /** - Return expression type of Item_type_holder. - - @return - Item_result (type of internal MySQL expression result) -*/ - -Item_result Item_type_holder::result_type() const -{ - return Field::result_merge_type(fld_type); -} - - -/** Find real field type of item. @return @@ -9344,7 +9232,7 @@ enum_field_types Item_type_holder::get_real_type(Item *item) */ switch (item->result_type()) { case STRING_RESULT: - return MYSQL_TYPE_VAR_STRING; + return MYSQL_TYPE_VARCHAR; case INT_RESULT: return MYSQL_TYPE_LONGLONG; case REAL_RESULT: @@ -9354,10 +9242,21 @@ enum_field_types Item_type_holder::get_real_type(Item *item) case ROW_RESULT: case TIME_RESULT: DBUG_ASSERT(0); - return MYSQL_TYPE_VAR_STRING; + return MYSQL_TYPE_VARCHAR; } } break; + case TYPE_HOLDER: + /* + Item_type_holder and Item_blob should not appear in this context. + In case they for some reasons do, returning field_type() is wrong anyway. + They must return Item_type_holder::real_field_type() instead, to make + the code in sql_type.cc and sql_type.h happy, as it expectes + Field::real_type()-compatible rather than Field::field_type()-compatible + valies in some places, and may in the future add some asserts preventing + use of field_type() instead of real_type() and the other way around. + */ + DBUG_ASSERT(0); default: break; } @@ -9383,25 +9282,26 @@ bool Item_type_holder::join_types(THD *thd, Item *item) uint decimals_orig= decimals; DBUG_ENTER("Item_type_holder::join_types"); DBUG_PRINT("info:", ("was type %d len %d, dec %d name %s", - fld_type, max_length, decimals, + real_field_type(), max_length, decimals, (name ? name : "<NULL>"))); DBUG_PRINT("info:", ("in type %d len %d, dec %d", get_real_type(item), item->max_length, item->decimals)); - fld_type= Field::field_type_merge(fld_type, get_real_type(item)); + set_handler_by_real_type(Field::field_type_merge(real_field_type(), + get_real_type(item))); { uint item_decimals= item->decimals; /* fix variable decimals which always is NOT_FIXED_DEC */ - if (Field::result_merge_type(fld_type) == INT_RESULT) + if (Field::result_merge_type(real_field_type()) == INT_RESULT) item_decimals= 0; decimals= MY_MAX(decimals, item_decimals); } - if (fld_type == FIELD_TYPE_GEOMETRY) + if (Item_type_holder::field_type() == FIELD_TYPE_GEOMETRY) geometry_type= Field_geom::geometry_type_merge(geometry_type, item->get_geometry_type()); - if (Field::result_merge_type(fld_type) == DECIMAL_RESULT) + if (Field::result_merge_type(real_field_type()) == DECIMAL_RESULT) { decimals= MY_MIN(MY_MAX(decimals, item->decimals), DECIMAL_MAX_SCALE); int item_int_part= item->decimal_int_part(); @@ -9413,7 +9313,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) unsigned_flag); } - switch (Field::result_merge_type(fld_type)) + switch (Field::result_merge_type(real_field_type())) { case STRING_RESULT: { @@ -9460,12 +9360,14 @@ bool Item_type_holder::join_types(THD *thd, Item *item) int delta1= max_length_orig - decimals_orig; int delta2= item->max_length - item->decimals; max_length= MY_MAX(delta1, delta2) + decimals; - if (fld_type == MYSQL_TYPE_FLOAT && max_length > FLT_DIG + 2) + if (Item_type_holder::real_field_type() == MYSQL_TYPE_FLOAT && + max_length > FLT_DIG + 2) { max_length= MAX_FLOAT_STR_LENGTH; decimals= NOT_FIXED_DEC; } - else if (fld_type == MYSQL_TYPE_DOUBLE && max_length > DBL_DIG + 2) + else if (Item_type_holder::real_field_type() == MYSQL_TYPE_DOUBLE && + max_length > DBL_DIG + 2) { max_length= MAX_DOUBLE_STR_LENGTH; decimals= NOT_FIXED_DEC; @@ -9473,7 +9375,8 @@ bool Item_type_holder::join_types(THD *thd, Item *item) } } else - max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7; + max_length= (Item_type_holder::field_type() == MYSQL_TYPE_FLOAT) ? + FLT_DIG+6 : DBL_DIG+7; break; } default: @@ -9485,7 +9388,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) /* Remember decimal integer part to be used in DECIMAL_RESULT handleng */ prev_decimal_int_part= decimal_int_part(); DBUG_PRINT("info", ("become type: %d len: %u dec: %u", - (int) fld_type, max_length, (uint) decimals)); + (int) real_field_type(), max_length, (uint) decimals)); DBUG_RETURN(FALSE); } @@ -9566,7 +9469,7 @@ Field *Item_type_holder::make_field_by_type(TABLE *table) uchar *null_ptr= maybe_null ? (uchar*) "" : 0; Field *field; - switch (fld_type) { + switch (Item_type_holder::real_field_type()) { case MYSQL_TYPE_ENUM: DBUG_ASSERT(enum_set_typelib); field= new Field_enum((uchar *) 0, max_length, null_ptr, 0, @@ -9602,8 +9505,8 @@ Field *Item_type_holder::make_field_by_type(TABLE *table) */ void Item_type_holder::get_full_info(Item *item) { - if (fld_type == MYSQL_TYPE_ENUM || - fld_type == MYSQL_TYPE_SET) + if (Item_type_holder::real_field_type() == MYSQL_TYPE_ENUM || + Item_type_holder::real_field_type() == MYSQL_TYPE_SET) { if (item->type() == Item::SUM_FUNC_ITEM && (((Item_sum*)item)->sum_func() == Item_sum::MAX_FUNC || diff --git a/sql/item.h b/sql/item.h index 9c5762879f0..d0e4372d53f 100644 --- a/sql/item.h +++ b/sql/item.h @@ -25,7 +25,6 @@ #include "sql_priv.h" /* STRING_BUFFER_USUAL_SIZE */ #include "unireg.h" #include "sql_const.h" /* RAND_TABLE_BIT, MAX_FIELD_NAME */ -#include "thr_malloc.h" /* sql_calloc */ #include "field.h" /* Derivation */ #include "sql_type.h" @@ -657,6 +656,14 @@ protected: SEL_TREE *get_mm_tree_for_const(RANGE_OPT_PARAM *param); + virtual Field *make_string_field(TABLE *table); + Field *tmp_table_field_from_field_type(TABLE *table, + bool fixed_length, + bool set_blob_packlength); + Field *create_tmp_field(bool group, TABLE *table, + uint convert_blob_length, + uint convert_int_length); + public: /* Cache val_str() into the own buffer, e.g. to evaluate constant @@ -697,7 +704,7 @@ public: bool with_subselect; /* If this item is a subselect or some of its arguments is or contains a subselect */ - // alloc & destruct is done as start of select using sql_alloc + // alloc & destruct is done as start of select on THD::mem_root Item(THD *thd); /* Constructor used by Item_field, Item_ref & aggregate (sum) functions. @@ -714,15 +721,15 @@ public: name=0; #endif } /*lint -e1509 */ - void set_name(const char *str, uint length, CHARSET_INFO *cs); - void set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs); + void set_name(THD *thd, const char *str, uint length, CHARSET_INFO *cs); + void set_name_no_truncate(THD *thd, const char *str, uint length, + CHARSET_INFO *cs); void set_name_for_rollback(THD *thd, const char *str, uint length, CHARSET_INFO *cs); void rename(char *new_name); void init_make_field(Send_field *tmp_field,enum enum_field_types type); virtual void cleanup(); - virtual void make_field(Send_field *field); - virtual Field *make_string_field(TABLE *table); + virtual void make_field(THD *thd, Send_field *field); virtual bool fix_fields(THD *, Item **); /* Fix after some tables has been pulled out. Basically re-calculate all @@ -755,16 +762,41 @@ public: { return save_in_field(field, 1); } virtual bool send(Protocol *protocol, String *str); virtual bool eq(const Item *, bool binary_cmp) const; + const Type_handler *type_handler() const + { + return get_handler_by_field_type(field_type()); + } + Field *make_num_distinct_aggregator_field(MEM_ROOT *mem_root, + const Item *item) const + { + return type_handler()->make_num_distinct_aggregator_field(mem_root, this); + } + Field *make_conversion_table_field(TABLE *table, + uint metadata, const Field *target) const + { + DBUG_ASSERT(0); // Should not be called in Item context + return NULL; + } /* result_type() of an item specifies how the value should be returned */ - Item_result result_type() const { return REAL_RESULT; } + Item_result result_type() const { return type_handler()->result_type(); } /* ... while cmp_type() specifies how it should be compared */ - Item_result cmp_type() const; + Item_result cmp_type() const { return type_handler()->cmp_type(); } + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const + { + type_handler()->make_sort_key(to, item, sort_field, param); + } + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const + { + type_handler()->sortlength(thd, item, attr); + } virtual Item_result cast_to_int_type() const { return cmp_type(); } enum_field_types string_field_type() const { return Type_handler::string_type_handler(max_length)->field_type(); } - enum_field_types field_type() const; virtual enum Type type() const =0; /* real_type() is the type of base item. This is same as type() for @@ -1021,8 +1053,6 @@ public: int save_str_value_in_field(Field *field, String *result); virtual Field *get_tmp_table_field() { return 0; } - /* This is also used to create fields in CREATE ... SELECT: */ - virtual Field *tmp_table_field(TABLE *t_arg) { return 0; } virtual Field *create_field_for_create_select(THD *thd, TABLE *table); virtual Field *create_field_for_schema(THD *thd, TABLE *table); virtual const char *full_name() const { return name ? name : "???"; } @@ -1630,9 +1660,18 @@ public: // used in row subselects to get value of elements virtual void bring_value() {} - Field *tmp_table_field_from_field_type(TABLE *table, - bool fixed_length, - bool set_blob_packlength); + virtual Field *create_tmp_field(bool group, TABLE *table, + uint convert_blob_length) + { + /* + Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into + Field_long : make them Field_longlong. + */ + return create_tmp_field(false, table, + convert_blob_length, + MY_INT32_NUM_DECIMAL_DIGITS - 2); + } + virtual Item_field *field_for_view_update() { return 0; } virtual Item *neg_transformer(THD *thd) { return NULL; } @@ -1984,7 +2023,7 @@ public: bool is_null(); public: - inline void make_field(Send_field *field); + inline void make_field(THD *thd, Send_field *field); inline bool const_item() const; @@ -1996,15 +2035,15 @@ public: Item_sp_variable inline implementation. *****************************************************************************/ -inline void Item_sp_variable::make_field(Send_field *field) +inline void Item_sp_variable::make_field(THD *thd, Send_field *field) { Item *it= this_item(); if (name) - it->set_name(name, (uint) strlen(name), system_charset_info); + it->set_name(thd, name, (uint) strlen(name), system_charset_info); else - it->set_name(m_name.str, (uint) m_name.length, system_charset_info); - it->make_field(field); + it->set_name(thd, m_name.str, (uint) m_name.length, system_charset_info); + it->make_field(thd, field); } inline bool Item_sp_variable::const_item() const @@ -2030,13 +2069,12 @@ inline bool Item_sp_variable::send(Protocol *protocol, String *str) class Item_splocal :public Item_sp_variable, private Settable_routine_parameter, - public Rewritable_query_parameter + public Rewritable_query_parameter, + public Type_handler_hybrid_field_type { uint m_var_idx; Type m_type; - Item_result m_result_type; - enum_field_types m_field_type; public: Item_splocal(THD *thd, const LEX_STRING &sp_var_name, uint sp_var_idx, enum_field_types sp_var_type, @@ -2054,8 +2092,12 @@ public: inline uint get_var_idx() const; inline enum Type type() const; - inline Item_result result_type() const; - inline enum_field_types field_type() const { return m_field_type; } + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } private: bool set_value(THD *thd, sp_rcontext *ctx, Item **it); @@ -2091,12 +2133,6 @@ inline enum Item::Type Item_splocal::type() const return m_type; } -inline Item_result Item_splocal::result_type() const -{ - return m_result_type; -} - - /***************************************************************************** A reference to case expression in SP, used in runtime. *****************************************************************************/ @@ -2113,6 +2149,7 @@ public: inline enum Type type() const; inline Item_result result_type() const; + enum_field_types field_type() const { return this_item()->field_type(); } public: /* @@ -2173,6 +2210,11 @@ public: bool is_null(); virtual void print(String *str, enum_query_type query_type); + enum_field_types field_type() const + { + return value_item->field_type(); + } + Item_result result_type() const { return value_item->result_type(); @@ -2224,7 +2266,6 @@ public: {} ~Item_result_field() {} /* Required with gcc 2.95 */ Field *get_tmp_table_field() { return result_field; } - Field *tmp_table_field(TABLE *t_arg) { return result_field; } /* This implementation of used_tables() used by Item_avg_field and Item_variance_field which work when only temporary table left, so theu @@ -2327,9 +2368,10 @@ public: longlong val_int() { return field->val_int(); } String *val_str(String *str) { return field->val_str(str); } my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); } - void make_field(Send_field *tmp_field); + void make_field(THD *thd, Send_field *tmp_field); CHARSET_INFO *charset_for_protocol(void) const { return field->charset_for_protocol(); } + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } }; @@ -2383,7 +2425,7 @@ public: void reset_field(Field *f); bool fix_fields(THD *, Item **); void fix_after_pullout(st_select_lex *new_parent, Item **ref); - void make_field(Send_field *tmp_field); + void make_field(THD *thd, Send_field *tmp_field); int save_in_field(Field *field,bool no_conversions); void save_org_in_field(Field *field, fast_field_copier optimizer_data); fast_field_copier setup_fast_field_copier(Field *field); @@ -2590,11 +2632,22 @@ public: } }; -/* Item represents one placeholder ('?') of prepared statement */ +/* + Item represents one placeholder ('?') of prepared statement + + Notes: + Item_param::field_type() is used when this item is in a temporary table. + This is NOT placeholder metadata sent to client, as this value + is assigned after sending metadata (in setup_one_conversion_function). + For example in case of 'SELECT ?' you'll get MYSQL_TYPE_STRING both + in result set and placeholders metadata, no matter what type you will + supply for this placeholder in mysql_stmt_execute. +*/ class Item_param :public Item_basic_value, private Settable_routine_parameter, - public Rewritable_query_parameter + public Rewritable_query_parameter, + public Type_handler_hybrid_field_type { public: enum enum_item_param_state @@ -2641,25 +2694,18 @@ public: MYSQL_TIME time; } value; - /* Cached values for virtual methods to save us one switch. */ - enum Item_result item_result_type; enum Type item_type; - /* - Used when this item is used in a temporary table. - This is NOT placeholder metadata sent to client, as this value - is assigned after sending metadata (in setup_one_conversion_function). - For example in case of 'SELECT ?' you'll get MYSQL_TYPE_STRING both - in result set and placeholders metadata, no matter what type you will - supply for this placeholder in mysql_stmt_execute. - */ - enum enum_field_types param_type; + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } Item_param(THD *thd, uint pos_in_query_arg); - enum Item_result result_type () const { return item_result_type; } enum Type type() const { return item_type; } - enum_field_types field_type() const { return param_type; } double val_real(); longlong val_int(); @@ -2736,7 +2782,7 @@ private: public: virtual const Send_field *get_out_param_info() const; - virtual void make_field(Send_field *field); + virtual void make_field(THD *thd, Send_field *field); private: Send_field *m_out_param_info; @@ -2928,10 +2974,11 @@ protected: // it is constant => can be used without fix_fields (and frequently used) fixed= 1; } - void fix_and_set_name_from_value(Derivation dv, const Metadata metadata) + void fix_and_set_name_from_value(THD *thd, Derivation dv, + const Metadata metadata) { fix_from_value(dv, metadata); - set_name(str_value.ptr(), str_value.length(), str_value.charset()); + set_name(thd, str_value.ptr(), str_value.length(), str_value.charset()); } protected: /* Just create an item and do not fill string representation */ @@ -2940,7 +2987,7 @@ protected: { collation.set(cs, dv); max_length= 0; - set_name(NULL, 0, system_charset_info); + set_name(thd, NULL, 0, system_charset_info); decimals= NOT_FIXED_DEC; fixed= 1; } @@ -2949,7 +2996,7 @@ public: Item_basic_constant(thd) { collation.set(csi, DERIVATION_COERCIBLE); - set_name(NULL, 0, system_charset_info); + set_name(thd, NULL, 0, system_charset_info); decimals= NOT_FIXED_DEC; fixed= 1; str_value.copy(str_arg, length_arg, csi); @@ -2960,14 +3007,14 @@ public: Derivation dv, uint repertoire): Item_basic_constant(thd) { str_value.set_or_copy_aligned(str, length, cs); - fix_and_set_name_from_value(dv, Metadata(&str_value, repertoire)); + fix_and_set_name_from_value(thd, dv, Metadata(&str_value, repertoire)); } Item_string(THD *thd, const char *str, uint length, CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE): Item_basic_constant(thd) { str_value.set_or_copy_aligned(str, length, cs); - fix_and_set_name_from_value(dv, Metadata(&str_value)); + fix_and_set_name_from_value(thd, dv, Metadata(&str_value)); } Item_string(THD *thd, const String *str, CHARSET_INFO *tocs, uint *conv_errors, Derivation dv, uint repertoire): Item_basic_constant(thd) @@ -2975,7 +3022,7 @@ public: if (str_value.copy(str, tocs, conv_errors)) str_value.set("", 0, tocs); // EOM ? str_value.mark_as_const(); - fix_and_set_name_from_value(dv, Metadata(&str_value, repertoire)); + fix_and_set_name_from_value(thd, dv, Metadata(&str_value, repertoire)); } // Constructors with an externally provided item name Item_string(THD *thd, const char *name_par, const char *str, uint length, @@ -2984,7 +3031,7 @@ public: { str_value.set_or_copy_aligned(str, length, cs); fix_from_value(dv, Metadata(&str_value)); - set_name(name_par, 0, system_charset_info); + set_name(thd, name_par, 0, system_charset_info); } Item_string(THD *thd, const char *name_par, const char *str, uint length, CHARSET_INFO *cs, Derivation dv, uint repertoire): @@ -2992,7 +3039,7 @@ public: { str_value.set_or_copy_aligned(str, length, cs); fix_from_value(dv, Metadata(&str_value, repertoire)); - set_name(name_par, 0, system_charset_info); + set_name(thd, name_par, 0, system_charset_info); } void print_value(String *to) const { @@ -3221,7 +3268,7 @@ public: Item_partition_func_safe_string(thd, "", 0, cs ? cs : &my_charset_utf8_general_ci) { name=(char*) header; max_length= length * collation.collation->mbmaxlen; } - void make_field(Send_field *field); + void make_field(THD *thd, Send_field *field); }; @@ -3292,7 +3339,12 @@ public: DBUG_ASSERT(fixed == 1); return (double) (ulonglong) Item_hex_hybrid::val_int(); } - longlong val_int(); + longlong val_int() + { + // following assert is redundant, because fixed=1 assigned in constructor + DBUG_ASSERT(fixed == 1); + return longlong_from_hex_hybrid(str_value.ptr(), str_value.length()); + } my_decimal *val_decimal(my_decimal *decimal_value) { // following assert is redundant, because fixed=1 assigned in constructor @@ -3301,7 +3353,11 @@ public: int2my_decimal(E_DEC_FATAL_ERROR, value, TRUE, decimal_value); return decimal_value; } - int save_in_field(Field *field, bool no_conversions); + int save_in_field(Field *field, bool no_conversions) + { + field->set_notnull(); + return field->store_hex_hybrid(str_value.ptr(), str_value.length()); + } enum Item_result cast_to_int_type() const { return INT_RESULT; } void print(String *str, enum_query_type query_type); }; @@ -3397,8 +3453,6 @@ public: { return val_real_from_date(); } my_decimal *val_decimal(my_decimal *decimal_value) { return val_decimal_from_date(decimal_value); } - Field *tmp_table_field(TABLE *table) - { return tmp_table_field_from_field_type(table, false, false); } int save_in_field(Field *field, bool no_conversions) { return save_date_in_field(field); } }; @@ -3562,28 +3616,28 @@ public: { args[0]= a; args[1]= b; } - Item_args(Item *a, Item *b, Item *c) + Item_args(THD *thd, Item *a, Item *b, Item *c) { arg_count= 0; - if ((args= (Item**) sql_alloc(sizeof(Item*) * 3))) + if ((args= (Item**) thd_alloc(thd, sizeof(Item*) * 3))) { arg_count= 3; args[0]= a; args[1]= b; args[2]= c; } } - Item_args(Item *a, Item *b, Item *c, Item *d) + Item_args(THD *thd, Item *a, Item *b, Item *c, Item *d) { arg_count= 0; - if ((args= (Item**) sql_alloc(sizeof(Item*) * 4))) + if ((args= (Item**) thd_alloc(thd, sizeof(Item*) * 4))) { arg_count= 4; args[0]= a; args[1]= b; args[2]= c; args[3]= d; } } - Item_args(Item *a, Item *b, Item *c, Item *d, Item* e) + Item_args(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e) { arg_count= 5; - if ((args= (Item**) sql_alloc(sizeof(Item*) * 5))) + if ((args= (Item**) thd_alloc(thd, sizeof(Item*) * 5))) { arg_count= 5; args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e; @@ -3792,11 +3846,11 @@ public: Item_func_or_sum(THD *thd, Item *a, Item *b): Item_result_field(thd), Item_args(a, b) { } Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c): - Item_result_field(thd), Item_args(a, b, c) { } + Item_result_field(thd), Item_args(thd, a, b, c) { } Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c, Item *d): - Item_result_field(thd), Item_args(a, b, c, d) { } + Item_result_field(thd), Item_args(thd, a, b, c, d) { } Item_func_or_sum(THD *thd, Item *a, Item *b, Item *c, Item *d, Item *e): - Item_result_field(thd), Item_args(a, b, c, d, e) { } + Item_result_field(thd), Item_args(thd, a, b, c, d, e) { } Item_func_or_sum(THD *thd, Item_func_or_sum *item): Item_result_field(thd, item), Item_args(thd, item), Used_tables_and_const_cache(item) { } @@ -3892,7 +3946,7 @@ public: bool val_bool_result(); bool is_null_result(); bool send(Protocol *prot, String *tmp); - void make_field(Send_field *field); + void make_field(THD *thd, Send_field *field); bool fix_fields(THD *, Item **); void fix_after_pullout(st_select_lex *new_parent, Item **ref); int save_in_field(Field *field, bool no_conversions); @@ -3903,7 +3957,6 @@ public: enum_field_types field_type() const { return (*ref)->field_type(); } Field *get_tmp_table_field() { return result_field ? result_field : (*ref)->get_tmp_table_field(); } - Field *tmp_table_field(TABLE *t_arg) { return 0; } Item *get_tmp_table_item(THD *thd); table_map used_tables() const; void update_used_tables(); @@ -4157,7 +4210,8 @@ public: virtual void print(String *str, enum_query_type query_type); virtual const char *full_name() const { return orig_item->full_name(); } - virtual void make_field(Send_field *field) { orig_item->make_field(field); } + virtual void make_field(THD *thd, Send_field *field) + { orig_item->make_field(thd, field); } bool eq(const Item *item, bool binary_cmp) const { Item *it= ((Item *) item)->real_item(); @@ -4528,26 +4582,21 @@ public: from Item_). */ -class Item_copy :public Item +class Item_copy :public Item, + public Type_handler_hybrid_field_type { protected: /** - Stores the type of the resulting field that would be used to store the data + Type_handler_hybrid_field_type is used to + store the type of the resulting field that would be used to store the data in the cache. This is to avoid calls to the original item. */ - enum enum_field_types cached_field_type; /** The original item that is copied */ Item *item; /** - Stores the result type of the original item, so it can be returned - without calling the original item's method - */ - Item_result cached_result_type; - - /** Constructor of the Item_copy class stores metadata information about the original class as well as a @@ -4559,8 +4608,7 @@ protected: null_value=maybe_null=item->maybe_null; Type_std_attributes::set(item); name=item->name; - cached_field_type= item->field_type(); - cached_result_type= item->result_type(); + set_handler_by_field_type(item->field_type()); fixed= item->fixed; } @@ -4585,10 +4633,15 @@ public: Item *get_item() { return item; } /** All of the subclasses should have the same type tag */ enum Type type() const { return COPY_STR_ITEM; } - enum_field_types field_type() const { return cached_field_type; } - enum Item_result result_type () const { return cached_result_type; } - void make_field(Send_field *field) { item->make_field(field); } + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } + + void make_field(THD *thd, Send_field *field) { item->make_field(thd, field); } table_map used_tables() const { return (table_map) 1L; } bool const_item() const { return 0; } bool is_null() { return null_value; } @@ -4789,11 +4842,11 @@ class Cached_item_field :public Cached_item uint length; public: - Cached_item_field(Field *arg_field) : field(arg_field) + Cached_item_field(THD *thd, Field *arg_field): field(arg_field) { field= arg_field; /* TODO: take the memory allocation below out of the constructor. */ - buff= (uchar*) sql_calloc(length=field->pack_length()); + buff= (uchar*) thd_calloc(thd, length= field->pack_length()); } bool cmp(void); }; @@ -4967,7 +5020,8 @@ public: for any value. */ -class Item_cache: public Item_basic_constant +class Item_cache: public Item_basic_constant, + public Type_handler_hybrid_field_type { protected: Item *example; @@ -4977,7 +5031,6 @@ protected: by IN->EXISTS transformation. */ Field *cached_field; - enum enum_field_types cached_field_type; /* TRUE <=> cache holds value of the last stored item (i.e actual value). store() stores item to be cached and sets this flag to FALSE. @@ -4989,18 +5042,19 @@ protected: public: Item_cache(THD *thd): Item_basic_constant(thd), + Type_handler_hybrid_field_type(MYSQL_TYPE_STRING), example(0), cached_field(0), - cached_field_type(MYSQL_TYPE_STRING), value_cached(0) { fixed= 1; maybe_null= 1; null_value= 1; } +protected: Item_cache(THD *thd, enum_field_types field_type_arg): Item_basic_constant(thd), + Type_handler_hybrid_field_type(field_type_arg), example(0), cached_field(0), - cached_field_type(field_type_arg), value_cached(0) { fixed= 1; @@ -5008,6 +5062,7 @@ public: null_value= 1; } +public: virtual bool allocate(THD *thd, uint i) { return 0; } virtual bool setup(THD *thd, Item *item) { @@ -5018,12 +5073,19 @@ public: return 0; }; enum Type type() const { return CACHE_ITEM; } - enum_field_types field_type() const { return cached_field_type; } + + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } + static Item_cache* get_cache(THD *thd, const Item *item); static Item_cache* get_cache(THD *thd, const Item* item, const Item_result type); virtual void keep_array() {} virtual void print(String *str, enum_query_type query_type); - bool eq_def(Field *field) + bool eq_def(const Field *field) { return cached_field ? cached_field->eq_def (field) : FALSE; } @@ -5167,7 +5229,7 @@ public: Item_cache_str(THD *thd, const Item *item): Item_cache(thd, item->field_type()), value(0), is_varbinary(item->type() == FIELD_ITEM && - cached_field_type == MYSQL_TYPE_VARCHAR && + Item_cache_str::field_type() == MYSQL_TYPE_VARCHAR && !((const Item_field *) item)->field->has_charset()) { collation.set(const_cast<DTCollation&>(item->collation)); @@ -5228,7 +5290,7 @@ public: bool setup(THD *thd, Item *item); void store(Item *item); void illegal_method_call(const char *); - void make_field(Send_field *) + void make_field(THD *thd, Send_field *) { illegal_method_call((const char*)"make_field"); }; @@ -5284,11 +5346,11 @@ public: Item_type_holder do not need cleanup() because its time of live limited by single SP/PS execution. */ -class Item_type_holder: public Item +class Item_type_holder: public Item, + public Type_handler_hybrid_real_field_type { protected: TYPELIB *enum_set_typelib; - enum_field_types fld_type; Field::geometry_type geometry_type; void get_full_info(Item *item); @@ -5298,8 +5360,27 @@ protected: public: Item_type_holder(THD*, Item*); - Item_result result_type() const; - enum_field_types field_type() const { return fld_type; }; + enum_field_types field_type() const + { return Type_handler_hybrid_real_field_type::field_type(); } + enum_field_types real_field_type() const + { return Type_handler_hybrid_real_field_type::real_field_type(); } + enum Item_result result_type () const + { + /* + In 10.1 Item_type_holder::result_type() returned + Field::result_merge_type(field_type()), which returned STRING_RESULT + for the BIT data type. In 10.2 it returns INT_RESULT, similar + to what Field_bit::result_type() does. This should not be + important because Item_type_holder is a limited purpose Item + and its result_type() should not be called from outside of + Item_type_holder. It's called only internally from decimal_int_part() + from join_types(), to calculate "decimals" of the result data type. + As soon as we get BIT as one of the joined types, the result field + type cannot be numeric: it's either BIT, or VARBINARY. + */ + return Type_handler_hybrid_real_field_type::result_type(); + } + enum Type type() const { return TYPE_HOLDER; } double val_real(); longlong val_int(); diff --git a/sql/item_buff.cc b/sql/item_buff.cc index d1134525f7b..62c2f76dc2e 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -43,7 +43,7 @@ Cached_item *new_Cached_item(THD *thd, Item *item, bool pass_through_ref) { Item_field *real_item= (Item_field *) item->real_item(); Field *cached_field= real_item->field; - return new Cached_item_field(cached_field); + return new (thd->mem_root) Cached_item_field(thd, cached_field); } switch (item->result_type()) { case STRING_RESULT: diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index d7e5eb597cc..dc457ed6484 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1846,8 +1846,8 @@ void Item_func_interval::fix_length_and_dec() } if (not_null_consts && - (intervals= - (interval_range*) sql_alloc(sizeof(interval_range) * (rows - 1)))) + (intervals= (interval_range*) current_thd->alloc(sizeof(interval_range) * + (rows - 1)))) { if (use_decimal_comparison) { @@ -2300,11 +2300,6 @@ uint Item_func_case_abbreviation2::decimal_precision2(Item **args) const } -Field *Item_func_ifnull::tmp_table_field(TABLE *table) -{ - return tmp_table_field_from_field_type(table, false, false); -} - double Item_func_ifnull::real_op() { @@ -3632,8 +3627,9 @@ int in_vector::find(Item *item) return (int) ((*compare)(collation, base+start*size, result) == 0); } -in_string::in_string(uint elements,qsort2_cmp cmp_func, CHARSET_INFO *cs) - :in_vector(elements, sizeof(String), cmp_func, cs), +in_string::in_string(THD *thd, uint elements, qsort2_cmp cmp_func, + CHARSET_INFO *cs) + :in_vector(thd, elements, sizeof(String), cmp_func, cs), tmp(buff, sizeof(buff), &my_charset_bin) {} @@ -3641,7 +3637,7 @@ in_string::~in_string() { if (base) { - // base was allocated with help of sql_alloc => following is OK + // base was allocated on THD::mem_root => following is OK for (uint i=0 ; i < count ; i++) ((String*) base)[i].free(); } @@ -3716,8 +3712,9 @@ void in_row::set(uint pos, Item *item) DBUG_VOID_RETURN; } -in_longlong::in_longlong(uint elements) - :in_vector(elements,sizeof(packed_longlong),(qsort2_cmp) cmp_longlong, 0) +in_longlong::in_longlong(THD *thd, uint elements) + :in_vector(thd, elements, sizeof(packed_longlong), + (qsort2_cmp) cmp_longlong, 0) {} void in_longlong::set(uint pos,Item *item) @@ -3774,8 +3771,8 @@ Item *in_datetime::create_item(THD *thd) } -in_double::in_double(uint elements) - :in_vector(elements,sizeof(double),(qsort2_cmp) cmp_double, 0) +in_double::in_double(THD *thd, uint elements) + :in_vector(thd, elements, sizeof(double), (qsort2_cmp) cmp_double, 0) {} void in_double::set(uint pos,Item *item) @@ -3797,8 +3794,8 @@ Item *in_double::create_item(THD *thd) } -in_decimal::in_decimal(uint elements) - :in_vector(elements, sizeof(my_decimal),(qsort2_cmp) cmp_decimal, 0) +in_decimal::in_decimal(THD *thd, uint elements) + :in_vector(thd, elements, sizeof(my_decimal), (qsort2_cmp) cmp_decimal, 0) {} @@ -4243,14 +4240,15 @@ void Item_func_in::fix_length_and_dec() } switch (m_compare_type) { case STRING_RESULT: - array=new (thd->mem_root) in_string(arg_count-1,(qsort2_cmp) srtcmp_in, + array=new (thd->mem_root) in_string(thd, arg_count - 1, + (qsort2_cmp) srtcmp_in, cmp_collation.collation); break; case INT_RESULT: - array= new (thd->mem_root) in_longlong(arg_count-1); + array= new (thd->mem_root) in_longlong(thd, arg_count - 1); break; case REAL_RESULT: - array= new (thd->mem_root) in_double(arg_count-1); + array= new (thd->mem_root) in_double(thd, arg_count - 1); break; case ROW_RESULT: /* @@ -4261,11 +4259,11 @@ void Item_func_in::fix_length_and_dec() ((in_row*)array)->tmp.store_value(args[0]); break; case DECIMAL_RESULT: - array= new (thd->mem_root) in_decimal(arg_count - 1); + array= new (thd->mem_root) in_decimal(thd, arg_count - 1); break; case TIME_RESULT: date_arg= find_date_time_item(args, arg_count, 0); - array= new (thd->mem_root) in_datetime(date_arg, arg_count - 1); + array= new (thd->mem_root) in_datetime(thd, date_arg, arg_count - 1); break; } if (array && !(thd->is_fatal_error)) // If not EOM @@ -6744,10 +6742,9 @@ longlong Item_func_dyncol_exists::val_int() } else { - uint strlen; + uint strlen= nm->length() * my_charset_utf8_general_ci.mbmaxlen + 1; uint dummy_errors; - buf.str= (char *)sql_alloc((strlen= nm->length() * - my_charset_utf8_general_ci.mbmaxlen + 1)); + buf.str= (char *) current_thd->alloc(strlen); if (buf.str) { buf.length= diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 16f8a247999..af9e008375a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -23,7 +23,6 @@ #pragma interface /* gcc class implementation */ #endif -#include "thr_malloc.h" /* sql_calloc */ #include "item_func.h" /* Item_int_func, Item_bool_func */ #define PCRE_STATIC 1 /* Important on Windows */ #include "pcre.h" /* pcre header file */ @@ -941,7 +940,9 @@ public: maybe_null= args[1]->maybe_null; } const char *func_name() const { return "ifnull"; } - Field *tmp_table_field(TABLE *table); + Field *create_field_for_create_select(THD *thd, TABLE *table) + { return tmp_table_field_from_field_type(table, false, false); } + table_map not_null_tables() const { return 0; } uint decimal_precision() const { @@ -1047,9 +1048,9 @@ public: uint count; uint used_count; in_vector() {} - in_vector(uint elements,uint element_length,qsort2_cmp cmp_func, + in_vector(THD *thd, uint elements, uint element_length, qsort2_cmp cmp_func, CHARSET_INFO *cmp_coll) - :base((char*) sql_calloc(elements*element_length)), + :base((char*) thd_calloc(thd, elements * element_length)), size(element_length), compare(cmp_func), collation(cmp_coll), count(elements), used_count(elements) {} virtual ~in_vector() {} @@ -1106,7 +1107,7 @@ class in_string :public in_vector } }; public: - in_string(uint elements,qsort2_cmp cmp_func, CHARSET_INFO *cs); + in_string(THD *thd, uint elements, qsort2_cmp cmp_func, CHARSET_INFO *cs); ~in_string(); void set(uint pos,Item *item); uchar *get_value(Item *item); @@ -1134,7 +1135,7 @@ protected: longlong unsigned_flag; // Use longlong, not bool, to preserve alignment } tmp; public: - in_longlong(uint elements); + in_longlong(THD *thd, uint elements); void set(uint pos,Item *item); uchar *get_value(Item *item); Item* create_item(THD *thd); @@ -1165,8 +1166,8 @@ public: /* Cache for the left item. */ Item *lval_cache; - in_datetime(Item *warn_item_arg, uint elements) - :in_longlong(elements), thd(current_thd), warn_item(warn_item_arg), + in_datetime(THD *thd, Item *warn_item_arg, uint elements) + :in_longlong(thd, elements), thd(current_thd), warn_item(warn_item_arg), lval_cache(0) {}; void set(uint pos,Item *item); uchar *get_value(Item *item); @@ -1185,7 +1186,7 @@ class in_double :public in_vector { double tmp; public: - in_double(uint elements); + in_double(THD *thd, uint elements); void set(uint pos,Item *item); uchar *get_value(Item *item); Item *create_item(THD *thd); @@ -1201,7 +1202,7 @@ class in_decimal :public in_vector { my_decimal val; public: - in_decimal(uint elements); + in_decimal(THD *thd, uint elements); void set(uint pos, Item *item); uchar *get_value(Item *item); Item *create_item(THD *thd); diff --git a/sql/item_func.cc b/sql/item_func.cc index 52575a82e03..4b376706500 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -509,43 +509,6 @@ bool Item_func::eq(const Item *item, bool binary_cmp) const } -Field *Item_func::tmp_table_field(TABLE *table) -{ - Field *field= NULL; - MEM_ROOT *mem_root= table->in_use->mem_root; - - switch (result_type()) { - case INT_RESULT: - if (max_char_length() > MY_INT32_NUM_DECIMAL_DIGITS) - field= new (mem_root) - Field_longlong(max_char_length(), maybe_null, name, - unsigned_flag); - else - field= new (mem_root) - Field_long(max_char_length(), maybe_null, name, - unsigned_flag); - break; - case REAL_RESULT: - field= new (mem_root) - Field_double(max_char_length(), maybe_null, name, decimals); - break; - case STRING_RESULT: - return make_string_field(table); - case DECIMAL_RESULT: - field= Field_new_decimal::create_from_item(mem_root, this); - break; - case ROW_RESULT: - case TIME_RESULT: - // This case should never be chosen - DBUG_ASSERT(0); - field= 0; - break; - } - if (field) - field->init(table); - return field; -} - /* bool Item_func::is_expensive_processor(uchar *arg) { @@ -2908,10 +2871,10 @@ void Item_func_min_max::fix_length_and_dec() collation.set_numeric(); fix_char_length(float_length(decimals)); /* - Set type to DOUBLE, as Item_func::tmp_table_field() does not + Set type to DOUBLE, as Item_func::create_tmp_field() does not distinguish between DOUBLE and FLOAT and always creates Field_double. Perhaps we should eventually change this to use agg_field_type() here, - and fix Item_func::tmp_table_field() to create Field_float when possible. + and fix Item_func::create_tmp_field() to create Field_float when possible. */ set_handler_by_field_type(MYSQL_TYPE_DOUBLE); break; @@ -3553,7 +3516,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func, func->used_tables_and_const_cache_join(item); f_args.arg_type[i]=item->result_type(); } - //TODO: why all following memory is not allocated with 1 call of sql_alloc? + //TODO: why all following memory is not allocated with 1 thd->alloc() call? if (!(buffers=new String[arg_count]) || !(f_args.args= (char**) thd->alloc(arg_count * sizeof(char *))) || !(f_args.lengths= (ulong*) thd->alloc(arg_count * sizeof(long))) || @@ -5345,7 +5308,7 @@ bool Item_func_set_user_var::send(Protocol *protocol, String *str_arg) return Item::send(protocol, str_arg); } -void Item_func_set_user_var::make_field(Send_field *tmp_field) +void Item_func_set_user_var::make_field(THD *thd, Send_field *tmp_field) { if (result_field) { @@ -5355,7 +5318,7 @@ void Item_func_set_user_var::make_field(Send_field *tmp_field) tmp_field->col_name=Item::name; // Use user supplied name } else - Item::make_field(tmp_field); + Item::make_field(thd, tmp_field); } @@ -5811,7 +5774,7 @@ Item_func_get_system_var(THD *thd, sys_var *var_arg, enum_var_type var_type_arg, orig_var_type(var_type_arg), component(*component_arg), cache_present(0) { /* set_name() will allocate the name */ - set_name(name_arg, (uint) name_len_arg, system_charset_info); + set_name(thd, name_arg, (uint) name_len_arg, system_charset_info); } @@ -6766,7 +6729,7 @@ error: void -Item_func_sp::make_field(Send_field *tmp_field) +Item_func_sp::make_field(THD *thd, Send_field *tmp_field) { DBUG_ENTER("Item_func_sp::make_field"); DBUG_ASSERT(sp_result_field); @@ -6801,16 +6764,6 @@ longlong Item_func_found_rows::val_int() } -Field * -Item_func_sp::tmp_table_field(TABLE *t_arg) -{ - DBUG_ENTER("Item_func_sp::tmp_table_field"); - - DBUG_ASSERT(sp_result_field); - DBUG_RETURN(sp_result_field); -} - - /** @brief Checks if requested access to function can be granted to user. If function isn't found yet, it searches function first. diff --git a/sql/item_func.h b/sql/item_func.h index 6230550067b..5e1fa753f34 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -171,12 +171,11 @@ public: } void signal_divide_by_null(); friend class udf_handler; - Field *tmp_table_field() { return result_field; } - Field *tmp_table_field(TABLE *t_arg); Field *create_field_for_create_select(THD *thd, TABLE *table) { + DBUG_ASSERT(thd == table->in_use); return result_type() != STRING_RESULT ? - tmp_table_field(table) : + create_tmp_field(false, table, 0, MY_INT32_NUM_DECIMAL_DIGITS) : tmp_table_field_from_field_type(table, false, false); } Item *get_tmp_table_item(THD *thd); @@ -376,6 +375,7 @@ public: longlong val_int() { DBUG_ASSERT(fixed == 1); return (longlong) rint(val_real()); } enum Item_result result_type () const { return REAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } void fix_length_and_dec() { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); } }; @@ -446,8 +446,6 @@ class Item_func_hybrid_field_type: public Item_hybrid_func DBUG_ASSERT((res != NULL) ^ null_value); return res; } -protected: - Item_result cached_result_type; public: Item_func_hybrid_field_type(THD *thd): @@ -595,6 +593,7 @@ public: double val_real(); String *val_str(String*str); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() {} }; @@ -1115,6 +1114,7 @@ public: const char *func_name() const { return "rollup_const"; } bool const_item() const { return 0; } Item_result result_type() const { return args[0]->result_type(); } + enum_field_types field_type() const { return args[0]->field_type(); } void fix_length_and_dec() { collation= args[0]->collation; @@ -1473,6 +1473,7 @@ class Item_func_udf_float :public Item_udf_func } double val_real(); String *val_str(String *str); + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } void fix_length_and_dec() { fix_num_length_and_dec(); } }; @@ -1489,6 +1490,7 @@ public: double val_real() { return (double) Item_func_udf_int::val_int(); } String *val_str(String *str); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals= 0; max_length= 21; } }; @@ -1505,6 +1507,7 @@ public: my_decimal *val_decimal(my_decimal *); String *val_str(String *str); enum Item_result result_type () const { return DECIMAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } void fix_length_and_dec() { fix_num_length_and_dec(); } }; @@ -1542,6 +1545,7 @@ public: return dec_buf; } enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return string_field_type(); } void fix_length_and_dec(); }; @@ -1753,7 +1757,7 @@ public: bool update_hash(void *ptr, uint length, enum Item_result type, CHARSET_INFO *cs, bool unsigned_arg); bool send(Protocol *protocol, String *str_arg); - void make_field(Send_field *tmp_field); + void make_field(THD *thd, Send_field *tmp_field); bool check(bool use_result_field); void save_item_result(Item *item); bool update(); @@ -1762,7 +1766,7 @@ public: Field *create_field_for_create_select(THD *thd, TABLE *table) { return result_type() != STRING_RESULT ? - tmp_table_field(table) : + create_tmp_field(false, table, 0, MY_INT32_NUM_DECIMAL_DIGITS) : tmp_table_field_from_field_type(table, false, true); } table_map used_tables() const @@ -1839,7 +1843,7 @@ class Item_user_var_as_out_param :public Item user_var_entry *entry; public: Item_user_var_as_out_param(THD *thd, LEX_STRING a): Item(thd), name(a) - { set_name(a.str, 0, system_charset_info); } + { set_name(thd, a.str, 0, system_charset_info); } /* We should return something different from FIELD_ITEM here */ enum Type type() const { return STRING_ITEM;} double val_real(); @@ -1851,6 +1855,7 @@ public: void print_for_load(THD *thd, String *str); void set_null_value(CHARSET_INFO* cs); void set_value(const char *str, uint length, CHARSET_INFO* cs); + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } }; @@ -2039,6 +2044,33 @@ enum Cast_target }; +struct Lex_cast_type_st: public Lex_length_and_dec_st +{ +private: + Cast_target m_type; +public: + void set(Cast_target type, const char *length, const char *dec) + { + m_type= type; + Lex_length_and_dec_st::set(length, dec); + } + void set(Cast_target type, Lex_length_and_dec_st length_and_dec) + { + m_type= type; + Lex_length_and_dec_st::operator=(length_and_dec); + } + void set(Cast_target type, const char *length) + { + set(type, length, 0); + } + void set(Cast_target type) + { + set(type, 0, 0); + } + Cast_target type() const { return m_type; } +}; + + class Item_func_row_count :public Item_int_func { public: @@ -2103,9 +2135,13 @@ public: enum enum_field_types field_type() const; - Field *tmp_table_field(TABLE *t_arg); - - void make_field(Send_field *tmp_field); + Field *create_field_for_create_select(THD *thd, TABLE *table) + { + return result_type() != STRING_RESULT ? + sp_result_field : + tmp_table_field_from_field_type(table, false, false); + } + void make_field(THD *thd, Send_field *tmp_field); Item_result result_type() const; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 07059fed4be..352c9fd93b9 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -41,7 +41,7 @@ #include "opt_range.h" -Field *Item_geometry_func::tmp_table_field(TABLE *t_arg) +Field *Item_geometry_func::create_field_for_create_select(THD *thd, TABLE *t_arg) { Field *result; if ((result= new Field_geom(max_length, maybe_null, name, t_arg->s, diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index b72661fe054..56e2a729924 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -40,7 +40,7 @@ public: Item_geometry_func(THD *thd, List<Item> &list): Item_str_func(thd, list) {} void fix_length_and_dec(); enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; } - Field *tmp_table_field(TABLE *t_arg); + Field *create_field_for_create_select(THD *thd, TABLE *table); }; class Item_func_geometry_from_text: public Item_geometry_func diff --git a/sql/item_row.h b/sql/item_row.h index cf55eddc19c..bbb9a7f1f96 100644 --- a/sql/item_row.h +++ b/sql/item_row.h @@ -49,7 +49,7 @@ public: enum Type type() const { return ROW_ITEM; }; void illegal_method_call(const char *); bool is_null() { return null_value; } - void make_field(Send_field *) + void make_field(THD *thd, Send_field *) { illegal_method_call((const char*)"make_field"); }; @@ -82,6 +82,11 @@ public: bool const_item() const { return const_item_cache; }; enum Item_result result_type() const { return ROW_RESULT; } Item_result cmp_type() const { return ROW_RESULT; } + enum_field_types field_type() const + { + DBUG_ASSERT(0); + return MYSQL_TYPE_DOUBLE; + } void update_used_tables() { used_tables_and_const_cache_init(); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9880db7745a..e22718029e5 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -4312,7 +4312,7 @@ void Item_func_dyncol_create::fix_length_and_dec() decimals= 0; } -bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg) +bool Item_func_dyncol_create::prepare_arguments(THD *thd, bool force_names_arg) { char buff[STRING_BUFFER_USUAL_SIZE]; String *res, tmp(buff, sizeof(buff), &my_charset_bin); @@ -4432,15 +4432,13 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg) if (my_charset_same(res->charset(), &my_charset_utf8_general_ci)) { keys_str[i].length= res->length(); - keys_str[i].str= sql_strmake(res->ptr(), res->length()); + keys_str[i].str= thd->strmake(res->ptr(), res->length()); } else { - uint strlen; + uint strlen= res->length() * my_charset_utf8_general_ci.mbmaxlen + 1; uint dummy_errors; - char *str= - (char *)sql_alloc((strlen= res->length() * - my_charset_utf8_general_ci.mbmaxlen + 1)); + char *str= (char *) thd->alloc(strlen); if (str) { keys_str[i].length= @@ -4489,7 +4487,7 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg) if (res && defs[i].cs) res->set_charset(defs[i].cs); if (res && - (vals[i].x.string.value.str= sql_strmake(res->ptr(), res->length()))) + (vals[i].x.string.value.str= thd->strmake(res->ptr(), res->length()))) { vals[i].x.string.value.length= res->length(); vals[i].x.string.charset= res->charset(); @@ -4521,7 +4519,7 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg) case DYN_COL_DATETIME: case DYN_COL_DATE: args[valpos]->get_date(&vals[i].x.time_value, - sql_mode_for_dates(current_thd)); + sql_mode_for_dates(thd)); break; case DYN_COL_TIME: args[valpos]->get_time(&vals[i].x.time_value); @@ -4547,7 +4545,8 @@ String *Item_func_dyncol_create::val_str(String *str) enum enum_dyncol_func_result rc; DBUG_ASSERT((arg_count & 0x1) == 0); // even number of arguments - if (prepare_arguments(FALSE)) + /* FIXME: add thd argument to Item::val_str() */ + if (prepare_arguments(current_thd, FALSE)) { res= NULL; null_value= 1; @@ -4692,7 +4691,8 @@ String *Item_func_dyncol_add::val_str(String *str) col.length= res->length(); memcpy(col.str, res->ptr(), col.length); - if (prepare_arguments(mariadb_dyncol_has_names(&col))) + /* FIXME: add thd argument to Item::val_str() */ + if (prepare_arguments(current_thd, mariadb_dyncol_has_names(&col))) goto null; if ((rc= ((names || force_names) ? @@ -4742,7 +4742,8 @@ void Item_func_dyncol_add::print(String *str, This function ensures that null_value is set correctly */ -bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp) +bool Item_dyncol_get::get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, + String *tmp) { DYNAMIC_COLUMN dyn_str; String *res; @@ -4770,10 +4771,9 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp) } else { - uint strlen; + uint strlen= nm->length() * my_charset_utf8_general_ci.mbmaxlen + 1; uint dummy_errors; - buf.str= (char *)sql_alloc((strlen= nm->length() * - my_charset_utf8_general_ci.mbmaxlen + 1)); + buf.str= (char *) thd->alloc(strlen); if (buf.str) { buf.length= @@ -4823,7 +4823,7 @@ String *Item_dyncol_get::val_str(String *str_result) char buff[STRING_BUFFER_USUAL_SIZE]; String tmp(buff, sizeof(buff), &my_charset_bin); - if (get_dyn_value(&val, &tmp)) + if (get_dyn_value(current_thd, &val, &tmp)) return NULL; switch (val.type) { @@ -4905,11 +4905,12 @@ null: longlong Item_dyncol_get::val_int() { + THD *thd= current_thd; DYNAMIC_COLUMN_VALUE val; char buff[STRING_BUFFER_USUAL_SIZE]; String tmp(buff, sizeof(buff), &my_charset_bin); - if (get_dyn_value(&val, &tmp)) + if (get_dyn_value(thd, &val, &tmp)) return 0; switch (val.type) { @@ -4930,7 +4931,6 @@ longlong Item_dyncol_get::val_int() num= double_to_longlong(val.x.double_value, unsigned_flag, &error); if (error) { - THD *thd= current_thd; char buff[30]; sprintf(buff, "%lg", val.x.double_value); push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, @@ -4950,7 +4950,6 @@ longlong Item_dyncol_get::val_int() num= my_strtoll10(val.x.string.value.str, &end, &error); if (end != org_end || error > 0) { - THD *thd= current_thd; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_BAD_DATA, ER_THD(thd, ER_BAD_DATA), @@ -4987,11 +4986,12 @@ null: double Item_dyncol_get::val_real() { + THD *thd= current_thd; DYNAMIC_COLUMN_VALUE val; char buff[STRING_BUFFER_USUAL_SIZE]; String tmp(buff, sizeof(buff), &my_charset_bin); - if (get_dyn_value(&val, &tmp)) + if (get_dyn_value(thd, &val, &tmp)) return 0.0; switch (val.type) { @@ -5014,7 +5014,6 @@ double Item_dyncol_get::val_real() if (end != (char*) val.x.string.value.str + val.x.string.value.length || error) { - THD *thd= current_thd; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_BAD_DATA, ER_THD(thd, ER_BAD_DATA), @@ -5046,11 +5045,12 @@ null: my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value) { + THD *thd= current_thd; DYNAMIC_COLUMN_VALUE val; char buff[STRING_BUFFER_USUAL_SIZE]; String tmp(buff, sizeof(buff), &my_charset_bin); - if (get_dyn_value(&val, &tmp)) + if (get_dyn_value(thd, &val, &tmp)) return NULL; switch (val.type) { @@ -5075,7 +5075,6 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value) if (rc != E_DEC_OK || end != val.x.string.value.str + val.x.string.value.length) { - THD *thd= current_thd; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_BAD_DATA, ER_THD(thd, ER_BAD_DATA), @@ -5110,7 +5109,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) String tmp(buff, sizeof(buff), &my_charset_bin); bool signed_value= 0; - if (get_dyn_value(&val, &tmp)) + if (get_dyn_value(current_thd, &val, &tmp)) return 1; // Error switch (val.type) { diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 65c286819d3..0ff38157c25 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -65,6 +65,7 @@ public: double val_real(); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return string_field_type(); } void left_right_max_length(); bool fix_fields(THD *thd, Item **ref); void update_null_value() @@ -1197,7 +1198,7 @@ protected: uint *keys_num; LEX_STRING *keys_str; bool names, force_names; - bool prepare_arguments(bool force_names); + bool prepare_arguments(THD *thd, bool force_names); void print_arguments(String *str, enum_query_type query_type); public: Item_func_dyncol_create(THD *thd, List<Item> &args, DYNCALL_CREATE_DEF *dfs); @@ -1255,7 +1256,7 @@ public: longlong val_int(); double val_real(); my_decimal *val_decimal(my_decimal *); - bool get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp); + bool get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, String *tmp); bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); void print(String *str, enum_query_type query_type); }; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index d4e3e6c5e7a..6444f672176 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1149,7 +1149,8 @@ void Item_singlerow_subselect::fix_length_and_dec() } else { - if (!(row= (Item_cache**) sql_alloc(sizeof(Item_cache*)*max_columns))) + if (!(row= (Item_cache**) current_thd->alloc(sizeof(Item_cache*) * + max_columns))) return; engine->fix_length_and_dec(row); value= *row; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 670d0a66639..1b450044954 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -378,6 +378,7 @@ public: void no_rows_in_result(); enum Item_result result_type() const { return INT_RESULT;} + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } longlong val_int(); double val_real(); String *val_str(String*); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e44a371d264..5b98ea801f0 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -496,44 +496,6 @@ Item *Item_sum::get_tmp_table_item(THD *thd) } -Field *Item_sum::create_tmp_field(bool group, TABLE *table, - uint convert_blob_length) -{ - Field *UNINIT_VAR(field); - MEM_ROOT *mem_root= table->in_use->mem_root; - - switch (result_type()) { - case REAL_RESULT: - field= new (mem_root) - Field_double(max_length, maybe_null, name, decimals, TRUE); - break; - case INT_RESULT: - field= new (mem_root) - Field_longlong(max_length, maybe_null, name, unsigned_flag); - break; - case STRING_RESULT: - if (max_length/collation.collation->mbmaxlen <= 255 || - convert_blob_length > Field_varstring::MAX_SIZE || - !convert_blob_length) - return make_string_field(table); - field= new (mem_root) Field_varstring(convert_blob_length, maybe_null, - name, table->s, collation.collation); - break; - case DECIMAL_RESULT: - field= Field_new_decimal::create_from_item(mem_root, this); - break; - case ROW_RESULT: - case TIME_RESULT: - // This case should never be choosen - DBUG_ASSERT(0); - return 0; - } - if (field) - field->init(table); - return field; -} - - void Item_sum::update_used_tables () { if (!Item_sum::const_item()) @@ -684,32 +646,6 @@ int Aggregator_distinct::composite_key_cmp(void* arg, uchar* key1, uchar* key2) } -static enum enum_field_types -calc_tmp_field_type(enum enum_field_types table_field_type, - Item_result result_type) -{ - /* Adjust tmp table type according to the chosen aggregation type */ - switch (result_type) { - case STRING_RESULT: - case REAL_RESULT: - if (table_field_type != MYSQL_TYPE_FLOAT) - table_field_type= MYSQL_TYPE_DOUBLE; - break; - case INT_RESULT: - table_field_type= MYSQL_TYPE_LONGLONG; - /* fallthrough */ - case DECIMAL_RESULT: - if (table_field_type != MYSQL_TYPE_LONGLONG) - table_field_type= MYSQL_TYPE_NEWDECIMAL; - break; - case ROW_RESULT: - default: - DBUG_ASSERT(0); - } - return table_field_type; -} - - /***************************************************************************/ C_MODE_START @@ -886,8 +822,6 @@ bool Aggregator_distinct::setup(THD *thd) } else { - List<Create_field> field_list; - Create_field field_def; /* field definition */ Item *arg; DBUG_ENTER("Aggregator_distinct::setup"); /* It's legal to call setup() more than once when in a subquery */ @@ -899,8 +833,6 @@ bool Aggregator_distinct::setup(THD *thd) PS/SP. Hence all further allocations are performed in the runtime mem_root. */ - if (field_list.push_back(&field_def, thd->mem_root)) - DBUG_RETURN(TRUE); item_sum->null_value= item_sum->maybe_null= 1; item_sum->quick_group= 0; @@ -918,17 +850,8 @@ bool Aggregator_distinct::setup(THD *thd) if (always_null) DBUG_RETURN(FALSE); - enum enum_field_types field_type; - - field_type= calc_tmp_field_type(arg->field_type(), - arg->result_type()); - field_def.init_for_tmp_table(field_type, - arg->max_length, - arg->decimals, - arg->maybe_null, - arg->unsigned_flag); - - if (! (table= create_virtual_tmp_table(thd, field_list))) + Field *field= arg->make_num_distinct_aggregator_field(thd->mem_root, arg); + if (!field || !(table= create_virtual_tmp_table(thd, field))) DBUG_RETURN(TRUE); /* XXX: check that the case of CHAR(0) works OK */ @@ -1318,11 +1241,12 @@ Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table, check if the following assignments are really needed */ Item_sum_sum::Item_sum_sum(THD *thd, Item_sum_sum *item) - :Item_sum_num(thd, item), hybrid_type(item->hybrid_type), + :Item_sum_num(thd, item), + Type_handler_hybrid_field_type(item), curr_dec_buff(item->curr_dec_buff) { /* TODO: check if the following assignments are really needed */ - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { my_decimal2decimal(item->dec_buffs, dec_buffs); my_decimal2decimal(item->dec_buffs + 1, dec_buffs + 1); @@ -1341,7 +1265,7 @@ void Item_sum_sum::clear() { DBUG_ENTER("Item_sum_sum::clear"); null_value=1; - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { curr_dec_buff= 0; my_decimal_set_zero(dec_buffs); @@ -1360,7 +1284,7 @@ void Item_sum_sum::fix_length_and_dec() switch (args[0]->cast_to_int_type()) { case REAL_RESULT: case STRING_RESULT: - hybrid_type= REAL_RESULT; + set_handler_by_field_type(MYSQL_TYPE_DOUBLE); sum= 0.0; break; case INT_RESULT: @@ -1373,7 +1297,7 @@ void Item_sum_sum::fix_length_and_dec() decimals, unsigned_flag); curr_dec_buff= 0; - hybrid_type= DECIMAL_RESULT; + set_handler_by_field_type(MYSQL_TYPE_NEWDECIMAL); my_decimal_set_zero(dec_buffs); break; } @@ -1381,9 +1305,9 @@ void Item_sum_sum::fix_length_and_dec() DBUG_ASSERT(0); } DBUG_PRINT("info", ("Type: %s (%d, %d)", - (hybrid_type == REAL_RESULT ? "REAL_RESULT" : - hybrid_type == DECIMAL_RESULT ? "DECIMAL_RESULT" : - hybrid_type == INT_RESULT ? "INT_RESULT" : + (result_type() == REAL_RESULT ? "REAL_RESULT" : + result_type() == DECIMAL_RESULT ? "DECIMAL_RESULT" : + result_type() == INT_RESULT ? "INT_RESULT" : "--ILLEGAL!!!--"), max_length, (int)decimals)); @@ -1394,7 +1318,7 @@ void Item_sum_sum::fix_length_and_dec() bool Item_sum_sum::add() { DBUG_ENTER("Item_sum_sum::add"); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { my_decimal value; const my_decimal *val= aggr->arg_val_decimal(&value); @@ -1421,7 +1345,7 @@ longlong Item_sum_sum::val_int() DBUG_ASSERT(fixed == 1); if (aggr) aggr->endup(); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { longlong result; my_decimal2int(E_DEC_FATAL_ERROR, dec_buffs + curr_dec_buff, unsigned_flag, @@ -1437,7 +1361,7 @@ double Item_sum_sum::val_real() DBUG_ASSERT(fixed == 1); if (aggr) aggr->endup(); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) my_decimal2double(E_DEC_FATAL_ERROR, dec_buffs + curr_dec_buff, &sum); return sum; } @@ -1447,7 +1371,7 @@ String *Item_sum_sum::val_str(String *str) { if (aggr) aggr->endup(); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) return val_string_from_decimal(str); return val_string_from_real(str); } @@ -1457,7 +1381,7 @@ my_decimal *Item_sum_sum::val_decimal(my_decimal *val) { if (aggr) aggr->endup(); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) return (dec_buffs + curr_dec_buff); return val_decimal_from_real(val); } @@ -1633,7 +1557,7 @@ void Item_sum_avg::fix_length_and_dec() Item_sum_sum::fix_length_and_dec(); maybe_null=null_value=1; prec_increment= current_thd->variables.div_precincrement; - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_avg::result_type() == DECIMAL_RESULT) { int precision= args[0]->decimal_precision() + prec_increment; decimals= MY_MIN(args[0]->decimals + prec_increment, DECIMAL_MAX_SCALE); @@ -1672,11 +1596,11 @@ Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table, and unpack on access. */ field= new (mem_root) - Field_string(((hybrid_type == DECIMAL_RESULT) ? + Field_string(((Item_sum_avg::result_type() == DECIMAL_RESULT) ? dec_bin_size : sizeof(double)) + sizeof(longlong), 0, name, &my_charset_bin); } - else if (hybrid_type == DECIMAL_RESULT) + else if (Item_sum_avg::result_type() == DECIMAL_RESULT) field= Field_new_decimal::create_from_item(mem_root, this); else field= new (mem_root) Field_double(max_length, maybe_null, name, decimals, @@ -1731,10 +1655,10 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val) } /* - For non-DECIMAL hybrid_type the division will be done in + For non-DECIMAL result_type() the division will be done in Item_sum_avg::val_real(). */ - if (hybrid_type != DECIMAL_RESULT) + if (Item_sum_avg::result_type() != DECIMAL_RESULT) return val_decimal_from_real(val); sum_dec= dec_buffs + curr_dec_buff; @@ -1748,7 +1672,7 @@ String *Item_sum_avg::val_str(String *str) { if (aggr) aggr->endup(); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_avg::result_type() == DECIMAL_RESULT) return val_string_from_decimal(str); return val_string_from_real(str); } @@ -2316,7 +2240,7 @@ void Item_sum_hybrid::reset_field() void Item_sum_sum::reset_field() { DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { my_decimal value, *arg_val= args[0]->val_decimal(&value); if (!arg_val) // Null @@ -2325,7 +2249,7 @@ void Item_sum_sum::reset_field() } else { - DBUG_ASSERT(hybrid_type == REAL_RESULT); + DBUG_ASSERT(result_type() == REAL_RESULT); double nr= args[0]->val_real(); // Nulls also return 0 float8store(result_field->ptr, nr); } @@ -2352,7 +2276,7 @@ void Item_sum_avg::reset_field() { uchar *res=result_field->ptr; DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_avg::result_type() == DECIMAL_RESULT) { longlong tmp; my_decimal value, *arg_dec= args[0]->val_decimal(&value); @@ -2406,7 +2330,7 @@ void Item_sum_bit::update_field() void Item_sum_sum::update_field() { DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_sum::result_type() == DECIMAL_RESULT) { my_decimal value, *arg_val= args[0]->val_decimal(&value); if (!args[0]->null_value) @@ -2461,7 +2385,7 @@ void Item_sum_avg::update_field() DBUG_ASSERT (aggr->Aggrtype() != Aggregator::DISTINCT_AGGREGATOR); - if (hybrid_type == DECIMAL_RESULT) + if (Item_sum_avg::result_type() == DECIMAL_RESULT) { my_decimal value, *arg_val= args[0]->val_decimal(&value); if (!args[0]->null_value) @@ -2500,7 +2424,7 @@ void Item_sum_avg::update_field() Item *Item_sum_avg::result_item(THD *thd, Field *field) { return - hybrid_type == DECIMAL_RESULT ? + Item_sum_avg::result_type() == DECIMAL_RESULT ? (Item_avg_field*) new (thd->mem_root) Item_avg_field_decimal(thd, this) : (Item_avg_field*) new (thd->mem_root) Item_avg_field_double(thd, this); } diff --git a/sql/item_sum.h b/sql/item_sum.h index db3312c42f4..68b034c9213 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -481,8 +481,12 @@ public: } virtual void make_unique() { force_copy_fields= TRUE; } Item *get_tmp_table_item(THD *thd); - virtual Field *create_tmp_field(bool group, TABLE *table, - uint convert_blob_length); + Field *create_tmp_field(bool group, TABLE *table, + uint convert_blob_length) + { + return Item::create_tmp_field(group, table, convert_blob_length, + MY_INT32_NUM_DECIMAL_DIGITS); + } virtual bool collect_outer_ref_processor(uchar *param); bool init_sum_func_check(THD *thd); bool check_sum_func(THD *thd, Item **ref); @@ -715,15 +719,16 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals=0; max_length=21; maybe_null=null_value=0; } }; -class Item_sum_sum :public Item_sum_num +class Item_sum_sum :public Item_sum_num, + public Type_handler_hybrid_field_type { protected: - Item_result hybrid_type; double sum; my_decimal dec_buffs[2]; uint curr_dec_buff; @@ -746,7 +751,12 @@ public: longlong val_int(); String *val_str(String*str); my_decimal *val_decimal(my_decimal *); - enum Item_result result_type () const { return hybrid_type; } + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } void reset_field(); void update_field(); void no_rows_in_result() {} @@ -1087,7 +1097,6 @@ public: } table_map used_tables() const { return (table_map) 1L; } Field *get_tmp_table_field() { DBUG_ASSERT(0); return NULL; } - Field *tmp_table_field(TABLE *) { DBUG_ASSERT(0); return NULL; } void set_result_field(Field *) { DBUG_ASSERT(0); } void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); } }; @@ -1258,6 +1267,9 @@ class Item_sum_udf_float :public Item_udf_sum double val_real(); String *val_str(String*str); my_decimal *val_decimal(my_decimal *); + enum Item_result result_type () const { return REAL_RESULT; } + enum Item_result cmp_type () const { return REAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); }; @@ -1278,6 +1290,7 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals=0; max_length=21; } Item *copy_or_same(THD* thd); }; @@ -1317,6 +1330,7 @@ public: } my_decimal *val_decimal(my_decimal *dec); enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return string_field_type(); } void fix_length_and_dec(); Item *copy_or_same(THD* thd); }; @@ -1336,6 +1350,7 @@ public: longlong val_int(); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return DECIMAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); }; @@ -1471,6 +1486,8 @@ class Item_func_group_concat : public Item_sum friend int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)), void* item_arg); +protected: + virtual Field *make_string_field(TABLE *table); public: Item_func_group_concat(THD *thd, Name_resolution_context *context_arg, @@ -1484,7 +1501,7 @@ public: enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} const char *func_name() const { return "group_concat"; } virtual Item_result result_type () const { return STRING_RESULT; } - virtual Field *make_string_field(TABLE *table); + virtual Item_result cmp_type () const { return STRING_RESULT; } enum_field_types field_type() const { if (too_big_for_varchar()) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 2faf7a7d347..4cc9f6dc5bc 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1558,9 +1558,9 @@ String *Item_temporal_hybrid_func::val_str_ascii(String *str) return (String *) 0; /* Check that the returned timestamp type matches to the function type */ - DBUG_ASSERT(cached_field_type == MYSQL_TYPE_STRING || + DBUG_ASSERT(field_type() == MYSQL_TYPE_STRING || ltime.time_type == MYSQL_TIMESTAMP_NONE || - mysql_type_to_time_type(cached_field_type) == ltime.time_type); + mysql_type_to_time_type(field_type()) == ltime.time_type); return str; } @@ -2081,7 +2081,7 @@ void Item_date_add_interval::fix_length_and_dec() (This is because you can't know if the string contains a DATE, MYSQL_TIME or DATETIME argument) */ - cached_field_type= MYSQL_TYPE_STRING; + set_handler_by_field_type(MYSQL_TYPE_STRING); arg0_field_type= args[0]->field_type(); uint interval_dec= 0; if (int_type == INTERVAL_MICROSECOND || @@ -2095,25 +2095,25 @@ void Item_date_add_interval::fix_length_and_dec() arg0_field_type == MYSQL_TYPE_TIMESTAMP) { decimals= MY_MAX(args[0]->temporal_precision(MYSQL_TYPE_DATETIME), interval_dec); - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); } else if (arg0_field_type == MYSQL_TYPE_DATE) { if (int_type <= INTERVAL_DAY || int_type == INTERVAL_YEAR_MONTH) - cached_field_type= arg0_field_type; + set_handler_by_field_type(arg0_field_type); else { decimals= interval_dec; - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); } } else if (arg0_field_type == MYSQL_TYPE_TIME) { decimals= MY_MAX(args[0]->temporal_precision(MYSQL_TYPE_TIME), interval_dec); if (int_type >= INTERVAL_DAY && int_type != INTERVAL_YEAR_MONTH) - cached_field_type= arg0_field_type; + set_handler_by_field_type(arg0_field_type); else - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); } else decimals= MY_MAX(args[0]->temporal_precision(MYSQL_TYPE_DATETIME), interval_dec); @@ -2126,7 +2126,7 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) INTERVAL interval; if (args[0]->get_date(ltime, - cached_field_type == MYSQL_TYPE_TIME ? + field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0) || get_interval_value(args[1], int_type, &interval)) return (null_value=1); @@ -2630,20 +2630,20 @@ void Item_func_add_time::fix_length_and_dec() - Otherwise the result is MYSQL_TYPE_STRING */ - cached_field_type= MYSQL_TYPE_STRING; + set_handler_by_field_type(MYSQL_TYPE_STRING); arg0_field_type= args[0]->field_type(); if (arg0_field_type == MYSQL_TYPE_DATE || arg0_field_type == MYSQL_TYPE_DATETIME || arg0_field_type == MYSQL_TYPE_TIMESTAMP || is_date) { - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); decimals= MY_MAX(args[0]->temporal_precision(MYSQL_TYPE_DATETIME), args[1]->temporal_precision(MYSQL_TYPE_TIME)); } else if (arg0_field_type == MYSQL_TYPE_TIME) { - cached_field_type= MYSQL_TYPE_TIME; + set_handler_by_field_type(MYSQL_TYPE_TIME); decimals= MY_MAX(args[0]->temporal_precision(MYSQL_TYPE_TIME), args[1]->temporal_precision(MYSQL_TYPE_TIME)); } @@ -2669,7 +2669,7 @@ bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) longlong seconds; int l_sign= sign; - if (cached_field_type == MYSQL_TYPE_DATETIME) + if (Item_func_add_time::field_type() == MYSQL_TYPE_DATETIME) { // TIMESTAMP function OR the first argument is DATE/DATETIME/TIMESTAMP if (get_arg0_date(&l_time1, 0) || @@ -3149,7 +3149,7 @@ void Item_func_str_to_date::fix_length_and_dec() #endif } - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); decimals= TIME_SECOND_PART_DIGITS; if ((const_item= args[1]->const_item())) { @@ -3164,24 +3164,24 @@ void Item_func_str_to_date::fix_length_and_dec() get_date_time_result_type(format->ptr(), format->length()); switch (cached_format_type) { case DATE_ONLY: - cached_field_type= MYSQL_TYPE_DATE; + set_handler_by_field_type(MYSQL_TYPE_DATE); break; case TIME_MICROSECOND: decimals= 6; /* fall through */ case TIME_ONLY: - cached_field_type= MYSQL_TYPE_TIME; + set_handler_by_field_type(MYSQL_TYPE_TIME); break; case DATE_TIME_MICROSECOND: decimals= 6; /* fall through */ case DATE_TIME: - cached_field_type= MYSQL_TYPE_DATETIME; + set_handler_by_field_type(MYSQL_TYPE_DATETIME); break; } } } - cached_timestamp_type= mysql_type_to_time_type(cached_field_type); + cached_timestamp_type= mysql_type_to_time_type(field_type()); Item_temporal_func::fix_length_and_dec(); } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index bb840987089..175f3b06c1a 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -165,6 +165,7 @@ public: } const char *func_name() const { return "month"; } enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals= 0; @@ -379,6 +380,7 @@ public: return (odbc_type ? "dayofweek" : "weekday"); } enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals= 0; @@ -401,6 +403,7 @@ class Item_func_dayname :public Item_func_weekday const char *func_name() const { return "dayname"; } String *val_str(String *str); enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } void fix_length_and_dec(); bool check_partition_func_processor(uchar *int_arg) {return TRUE;} bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} @@ -492,7 +495,6 @@ public: Item_temporal_func(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {} Item_temporal_func(THD *thd, Item *a, Item *b, Item *c): Item_func(thd, a, b, c) {} enum Item_result result_type () const { return STRING_RESULT; } - enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } Item_result cmp_type() const { return TIME_RESULT; } String *val_str(String *str); longlong val_int() { return val_int_from_date(); } @@ -500,7 +502,7 @@ public: bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) { DBUG_ASSERT(0); return 1; } my_decimal *val_decimal(my_decimal *decimal_value) { return val_decimal_from_date(decimal_value); } - Field *tmp_table_field(TABLE *table) + Field *create_field_for_create_select(THD *thd, TABLE *table) { return tmp_table_field_from_field_type(table, false, false); } int save_in_field(Field *field, bool no_conversions) { return save_date_in_field(field); } @@ -512,20 +514,20 @@ public: Abstract class for functions returning TIME, DATE, DATETIME or string values, whose data type depends on parameters and is set at fix_fields time. */ -class Item_temporal_hybrid_func: public Item_temporal_func +class Item_temporal_hybrid_func: public Item_temporal_func, + public Type_handler_hybrid_field_type { protected: - enum_field_types cached_field_type; // TIME, DATE, DATETIME or STRING String ascii_buf; // Conversion buffer public: Item_temporal_hybrid_func(THD *thd, Item *a, Item *b): Item_temporal_func(thd, a, b) {} - enum_field_types field_type() const { return cached_field_type; } - Item_result cmp_type() const - { - return cached_field_type == MYSQL_TYPE_STRING ? - STRING_RESULT : TIME_RESULT; - } + enum_field_types field_type() const + { return Type_handler_hybrid_field_type::field_type(); } + enum Item_result result_type () const + { return Type_handler_hybrid_field_type::result_type(); } + enum Item_result cmp_type () const + { return Type_handler_hybrid_field_type::cmp_type(); } CHARSET_INFO *charset_for_protocol() const { /* @@ -535,7 +537,7 @@ public: (which is fixed from @@collation_connection in fix_length_and_dec). */ DBUG_ASSERT(fixed == 1); - return cached_field_type == MYSQL_TYPE_STRING ? + return Item_temporal_hybrid_func::field_type() == MYSQL_TYPE_STRING ? collation.collation : &my_charset_bin; } /** @@ -578,6 +580,17 @@ public: }; +class Item_datetimefunc :public Item_temporal_func +{ +public: + Item_datetimefunc(THD *thd): Item_temporal_func(thd) {} + Item_datetimefunc(THD *thd, Item *a): Item_temporal_func(thd, a) {} + Item_datetimefunc(THD *thd, Item *a, Item *b, Item *c): + Item_temporal_func(thd, a, b ,c) {} + enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } +}; + + /* Abstract CURTIME function. Children should define what time zone is used */ class Item_func_curtime :public Item_timefunc @@ -662,11 +675,11 @@ public: /* Abstract CURRENT_TIMESTAMP function. See also Item_func_curtime */ -class Item_func_now :public Item_temporal_func +class Item_func_now :public Item_datetimefunc { MYSQL_TIME ltime; public: - Item_func_now(THD *thd, uint dec): Item_temporal_func(thd) { decimals= dec; } + Item_func_now(THD *thd, uint dec): Item_datetimefunc(thd) { decimals= dec; } bool fix_fields(THD *, Item **); void fix_length_and_dec() { @@ -756,11 +769,11 @@ public: }; -class Item_func_from_unixtime :public Item_temporal_func +class Item_func_from_unixtime :public Item_datetimefunc { Time_zone *tz; public: - Item_func_from_unixtime(THD *thd, Item *a): Item_temporal_func(thd, a) {} + Item_func_from_unixtime(THD *thd, Item *a): Item_datetimefunc(thd, a) {} const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec(); bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); @@ -781,7 +794,7 @@ class Time_zone; tables can be used during this function calculation for loading time zone descriptions. */ -class Item_func_convert_tz :public Item_temporal_func +class Item_func_convert_tz :public Item_datetimefunc { /* If time zone parameters are constants we are caching objects that @@ -793,7 +806,7 @@ class Item_func_convert_tz :public Item_temporal_func Time_zone *from_tz, *to_tz; public: Item_func_convert_tz(THD *thd, Item *a, Item *b, Item *c): - Item_temporal_func(thd, a, b, c), from_tz_cached(0), to_tz_cached(0) {} + Item_datetimefunc(thd, a, b, c), from_tz_cached(0), to_tz_cached(0) {} const char *func_name() const { return "convert_tz"; } void fix_length_and_dec(); bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index c1140946e87..ba17d2c48c3 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -2603,8 +2603,7 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath) (spv= spc->find_variable(name, false))) { Item_splocal *splocal= new (thd->mem_root) - Item_splocal(thd, name, spv->offset, - spv->type, 0); + Item_splocal(thd, name, spv->offset, spv->sql_type(), 0); #ifndef DBUG_OFF if (splocal) splocal->m_sp= lex->sphead; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index eec9892743b..c2da0a6e542 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -631,7 +631,7 @@ DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format; Time_zone *default_tz; const char *mysql_real_data_home_ptr= mysql_real_data_home; -char server_version[SERVER_VERSION_LENGTH]; +char server_version[SERVER_VERSION_LENGTH], *server_version_ptr; char *mysqld_unix_port, *opt_mysql_tmpdir; ulong thread_handling; @@ -711,7 +711,6 @@ SHOW_COMP_OPTION have_openssl; /* Thread specific variables */ -pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); mysql_mutex_t LOCK_thread_count, LOCK_thread_cache; mysql_mutex_t @@ -1808,10 +1807,35 @@ static void close_server_sock() #endif /*EMBEDDED_LIBRARY*/ -void kill_mysql(void) +/** + Set shutdown user + + @note this function may be called by multiple threads concurrently, thus + it performs safe update of shutdown_user (first thread wins). +*/ + +static volatile char *shutdown_user; +static void set_shutdown_user(THD *thd) +{ + char user_host_buff[MAX_USER_HOST_SIZE + 1]; + char *user, *expected_shutdown_user= 0; + + make_user_name(thd, user_host_buff); + + if ((user= my_strdup(user_host_buff, MYF(0))) && + !my_atomic_casptr((void **) &shutdown_user, + (void **) &expected_shutdown_user, user)) + my_free(user); +} + + +void kill_mysql(THD *thd) { DBUG_ENTER("kill_mysql"); + if (thd) + set_shutdown_user(thd); + #if defined(SIGNALS_DONT_BREAK_READ) && !defined(EMBEDDED_LIBRARY) abort_loop=1; // Break connection loops close_server_sock(); // Force accept to wake up @@ -1890,7 +1914,13 @@ static void __cdecl kill_server(int sig_ptr) if (sig != 0) // 0 is not a valid signal number my_sigset(sig, SIG_IGN); /* purify inspected */ if (sig == MYSQL_KILL_SIGNAL || sig == 0) - sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN),my_progname); + { + char *user= (char *) my_atomic_loadptr((void**) &shutdown_user); + sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN), my_progname, + user ? user : "unknown"); + if (user) + my_free(user); + } else sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */ @@ -2052,8 +2082,6 @@ static void cleanup_tls() { if (THR_THD) (void)pthread_key_delete(THR_THD); - if (THR_MALLOC) - (void)pthread_key_delete(THR_MALLOC); } @@ -2075,6 +2103,7 @@ static void mysqld_exit(int exit_code) #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE shutdown_performance_schema(); // we do it as late as possible #endif + set_malloc_size_cb(NULL); cleanup_tls(); DBUG_LEAVE; sd_notify(0, "STATUS=MariaDB server is down"); @@ -4078,8 +4107,7 @@ static int init_common_variables() connection_errors_peer_addr= 0; my_decimal_set_zero(&decimal_zero); // set decimal_zero constant; - if (pthread_key_create(&THR_THD,NULL) || - pthread_key_create(&THR_MALLOC,NULL)) + if (pthread_key_create(&THR_THD, NULL)) { sql_print_error("Can't create thread-keys"); return 1; @@ -7575,8 +7603,8 @@ struct my_option my_long_options[]= 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Used with --help option for detailed help.", &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, - NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_STR, + OPT_ARG, 0, 0, 0, 0, 0, 0}, {"plugin-load", OPT_PLUGIN_LOAD, "Semicolon-separated list of plugins to load, where each plugin is " "specified as ether a plugin_name=library_file pair or only a library_file. " @@ -7623,7 +7651,6 @@ struct my_option my_long_options[]= MYSQL_TO_BE_IMPLEMENTED_OPTION("slave-allow-batching"), // HAVE_REPLICATION MYSQL_COMPATIBILITY_OPTION("slave-checkpoint-period"), // HAVE_REPLICATION MYSQL_COMPATIBILITY_OPTION("slave-checkpoint-group"), // HAVE_REPLICATION - MYSQL_SUGGEST_ANALOG_OPTION("slave-parallel-workers", "--slave-parallel-threads"), // HAVE_REPLICATION MYSQL_SUGGEST_ANALOG_OPTION("slave-pending-jobs-size-max", "--slave-parallel-max-queued"), // HAVE_REPLICATION MYSQL_TO_BE_IMPLEMENTED_OPTION("disconnect-on-expired-password"), MYSQL_TO_BE_IMPLEMENTED_OPTION("sha256-password-private-key-path"), // HAVE_OPENSSL && !HAVE_YASSL @@ -8951,12 +8978,20 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) binlog_format_used= true; break; #include <sslopt-case.h> -#ifndef EMBEDDED_LIBRARY case 'V': - print_version(); - opt_abort= 1; // Abort after parsing all options - break; + if (argument) + { + strmake(server_version, argument, sizeof(server_version) - 1); + set_sys_var_value_origin(&server_version_ptr, sys_var::CONFIG); + } +#ifndef EMBEDDED_LIBRARY + else + { + print_version(); + opt_abort= 1; // Abort after parsing all options + } #endif /*EMBEDDED_LIBRARY*/ + break; case 'W': if (!argument) global_system_variables.log_warnings++; @@ -9647,6 +9682,8 @@ static int get_options(int *argc_ptr, char ***argv_ptr) void set_server_version(void) { + if (!IS_SYSVAR_AUTOSIZE(&server_version_ptr)) + return; char *end= strxmov(server_version, MYSQL_SERVER_VERSION, MYSQL_SERVER_SUFFIX_STR, NullS); #ifdef EMBEDDED_LIBRARY diff --git a/sql/mysqld.h b/sql/mysqld.h index 1c1478f8a63..4e6f2fcd29d 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -79,7 +79,7 @@ enum enum_slave_parallel_mode { }; /* Function prototypes */ -void kill_mysql(void); +void kill_mysql(THD *thd= 0); void close_connection(THD *thd, uint sql_errno= 0); void handle_connection_in_main_thread(THD *thd); void create_thread_to_handle_connection(THD *thd); @@ -263,12 +263,6 @@ extern my_bool encrypt_tmp_disk_tables, encrypt_tmp_files; extern ulong encryption_algorithm; extern const char *encryption_algorithm_names[]; -/* - THR_MALLOC is a key which will be used to set/get MEM_ROOT** for a thread, - using my_pthread_setspecific_ptr()/my_thread_getspecific_ptr(). -*/ -extern pthread_key(MEM_ROOT**,THR_MALLOC); - #ifdef HAVE_PSI_INTERFACE #ifdef HAVE_MMAP extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, @@ -541,6 +535,7 @@ extern uint mysql_real_data_home_len; extern const char *mysql_real_data_home_ptr; extern ulong thread_handling; extern "C" MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH]; +extern char *server_version_ptr; extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[]; extern char mysql_unpacked_real_data_home[]; extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables; diff --git a/sql/opt_range.h b/sql/opt_range.h index 0c495639db6..80f4064a529 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -24,7 +24,6 @@ #pragma interface /* gcc class implementation */ #endif -#include "thr_malloc.h" /* sql_memdup */ #include "records.h" /* READ_RECORD */ #include "queues.h" /* QUEUE */ /* diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a92c7686eaf..43a00607fe6 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -547,11 +547,11 @@ err: #define MAX_PART_NAME_SIZE 8 -char *partition_info::create_default_partition_names(uint part_no, +char *partition_info::create_default_partition_names(THD *thd, uint part_no, uint num_parts_arg, uint start_no) { - char *ptr= (char*) sql_calloc(num_parts_arg*MAX_PART_NAME_SIZE); + char *ptr= (char*) thd->calloc(num_parts_arg * MAX_PART_NAME_SIZE); char *move_ptr= ptr; uint i= 0; DBUG_ENTER("create_default_partition_names"); @@ -620,11 +620,11 @@ void partition_info::set_show_version_string(String *packet) 0 Memory allocation error */ -char *partition_info::create_default_subpartition_name(uint subpart_no, +char *partition_info::create_default_subpartition_name(THD *thd, uint subpart_no, const char *part_name) { uint size_alloc= strlen(part_name) + MAX_PART_NAME_SIZE; - char *ptr= (char*) sql_calloc(size_alloc); + char *ptr= (char*) thd->calloc(size_alloc); DBUG_ENTER("create_default_subpartition_name"); if (likely(ptr != NULL)) @@ -663,7 +663,7 @@ char *partition_info::create_default_subpartition_name(uint subpart_no, The external routine needing this code is check_partition_info */ -bool partition_info::set_up_default_partitions(handler *file, +bool partition_info::set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no) { @@ -695,7 +695,8 @@ bool partition_info::set_up_default_partitions(handler *file, my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); goto end; } - if (unlikely((!(default_name= create_default_partition_names(0, num_parts, + if (unlikely((!(default_name= create_default_partition_names(thd, 0, + num_parts, start_no))))) goto end; i= 0; @@ -744,7 +745,7 @@ end: The external routine needing this code is check_partition_info */ -bool partition_info::set_up_default_subpartitions(handler *file, +bool partition_info::set_up_default_subpartitions(THD *thd, handler *file, HA_CREATE_INFO *info) { uint i, j; @@ -771,7 +772,7 @@ bool partition_info::set_up_default_subpartitions(handler *file, if (likely(subpart_elem != 0 && (!part_elem->subpartitions.push_back(subpart_elem)))) { - char *ptr= create_default_subpartition_name(j, + char *ptr= create_default_subpartition_name(thd, j, part_elem->partition_name); if (!ptr) goto end; @@ -809,7 +810,7 @@ end: this will return an error. */ -bool partition_info::set_up_defaults_for_partitioning(handler *file, +bool partition_info::set_up_defaults_for_partitioning(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no) { @@ -819,10 +820,10 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file, { default_partitions_setup= TRUE; if (use_default_partitions) - DBUG_RETURN(set_up_default_partitions(file, info, start_no)); + DBUG_RETURN(set_up_default_partitions(thd, file, info, start_no)); if (is_sub_partitioned() && use_default_subpartitions) - DBUG_RETURN(set_up_default_subpartitions(file, info)); + DBUG_RETURN(set_up_default_subpartitions(thd, file, info)); } DBUG_RETURN(FALSE); } @@ -1702,7 +1703,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, my_error(ER_SUBPARTITION_ERROR, MYF(0)); goto end; } - if (unlikely(set_up_defaults_for_partitioning(file, info, (uint)0))) + if (unlikely(set_up_defaults_for_partitioning(thd, file, info, (uint)0))) goto end; if (!(tot_partitions= get_tot_partitions())) { @@ -1940,11 +1941,11 @@ void partition_info::print_no_partition_found(TABLE *table_arg, myf errflag) FALSE Success */ -bool partition_info::set_part_expr(char *start_token, Item *item_ptr, +bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart) { uint expr_len= end_token - start_token; - char *func_string= (char*) sql_memdup(start_token, expr_len); + char *func_string= (char*) thd->memdup(start_token, expr_len); if (!func_string) { @@ -3153,7 +3154,7 @@ part_column_list_val *partition_info::add_column_value(THD *thd) return NULL; } -bool partition_info::set_part_expr(char *start_token, Item *item_ptr, +bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart) { (void)start_token; diff --git a/sql/partition_info.h b/sql/partition_info.h index df7010b2ab3..5181e19d568 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -307,7 +307,8 @@ public: return num_parts * (is_sub_partitioned() ? num_subparts : 1); } - bool set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info, + bool set_up_defaults_for_partitioning(THD *thd, handler *file, + HA_CREATE_INFO *info, uint start_no); char *find_duplicate_field(); char *find_duplicate_name(); @@ -332,7 +333,7 @@ public: void init_col_val(part_column_list_val *col_val, Item *item); int reorganize_into_single_field_col_val(THD *thd); part_column_list_val *add_column_value(THD *thd); - bool set_part_expr(char *start_token, Item *item_ptr, + bool set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart); static int compare_column_values(const void *a, const void *b); bool set_up_charset_field_preps(THD *thd); @@ -371,12 +372,13 @@ public: bool has_same_partitioning(partition_info *new_part_info); private: static int list_part_cmp(const void* a, const void* b); - bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info, + bool set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info, uint start_no); - bool set_up_default_subpartitions(handler *file, HA_CREATE_INFO *info); - char *create_default_partition_names(uint part_no, uint num_parts, + bool set_up_default_subpartitions(THD *thd, handler *file, + HA_CREATE_INFO *info); + char *create_default_partition_names(THD *thd, uint part_no, uint num_parts, uint start_no); - char *create_default_subpartition_name(uint subpart_no, + char *create_default_subpartition_name(THD *thd, uint subpart_no, const char *part_name); bool prune_partition_bitmaps(TABLE_LIST *table_list); bool add_named_partition(const char *part_name, uint length); diff --git a/sql/procedure.h b/sql/procedure.h index a46e8cfc137..1452f33652a 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -48,7 +48,7 @@ public: virtual void set(longlong nr)=0; virtual enum_field_types field_type() const=0; void set(const char *str) { set(str,(uint) strlen(str), default_charset()); } - void make_field(Send_field *tmp_field) + void make_field(THD *thd, Send_field *tmp_field) { init_make_field(tmp_field,field_type()); } @@ -69,6 +69,7 @@ public: decimals=dec; max_length=float_length(dec); } enum Item_result result_type () const { return REAL_RESULT; } + enum Item_result cmp_type () const { return REAL_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } void set(double nr) { value=nr; } void set(longlong nr) { value=(double) nr; } @@ -96,6 +97,7 @@ public: Item_proc_int(THD *thd, const char *name_par): Item_proc(thd, name_par) { max_length=11; } enum Item_result result_type () const { return INT_RESULT; } + enum Item_result cmp_type () const { return INT_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void set(double nr) { value=(longlong) nr; } void set(longlong nr) { value=nr; } @@ -115,6 +117,7 @@ public: Item_proc_string(THD *thd, const char *name_par, uint length): Item_proc(thd, name_par) { this->max_length=length; } enum Item_result result_type () const { return STRING_RESULT; } + enum Item_result cmp_type () const { return STRING_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } void set(double nr) { str_value.set_real(nr, 2, default_charset()); } void set(longlong nr) { str_value.set(nr, default_charset()); } diff --git a/sql/protocol.cc b/sql/protocol.cc index fa42915f5a9..9e528708823 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -754,7 +754,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) char *pos; CHARSET_INFO *cs= system_charset_info; Send_field field; - item->make_field(&field); + item->make_field(thd, &field); /* Keep things compatible for old clients */ if (field.type == MYSQL_TYPE_VARCHAR) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index d1dd0298a1f..244363e43ac 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -922,6 +922,51 @@ table_def::compatible_with(THD *thd, rpl_group_info *rgi, return true; } + +/** + A wrapper to Virtual_tmp_table, to get access to its constructor, + which is protected for safety purposes (against illegal use on stack). +*/ +class Virtual_conversion_table: public Virtual_tmp_table +{ +public: + Virtual_conversion_table(THD *thd) :Virtual_tmp_table(thd) { } + /** + Add a new field into the virtual table. + @param sql_type - The real_type of the field. + @param metadata - The RBR binary log metadata for this field. + @param target_field - The field from the target table, to get extra + attributes from (e.g. typelib in case of ENUM). + */ + bool add(enum_field_types sql_type, + uint16 metadata, const Field *target_field) + { + const Type_handler *handler= Type_handler::get_handler_by_real_type(sql_type); + if (!handler) + { + sql_print_error("In RBR mode, Slave received unknown field type field %d " + " for column Name: %s.%s.%s.", + (int) sql_type, + target_field->table->s->db.str, + target_field->table->s->table_name.str, + target_field->field_name); + return true; + } + Field *tmp= handler->make_conversion_table_field(this, metadata, + target_field); + if (!tmp) + return true; + Virtual_tmp_table::add(tmp); + DBUG_PRINT("debug", ("sql_type: %d, target_field: '%s', max_length: %d, decimals: %d," + " maybe_null: %d, unsigned_flag: %d, pack_length: %u", + sql_type, target_field->field_name, + tmp->field_length, tmp->decimals(), TRUE, + tmp->flags, tmp->pack_length())); + return false; + } +}; + + /** Create a conversion table. @@ -937,8 +982,7 @@ TABLE *table_def::create_conversion_table(THD *thd, rpl_group_info *rgi, { DBUG_ENTER("table_def::create_conversion_table"); - List<Create_field> field_list; - TABLE *conv_table= NULL; + Virtual_conversion_table *conv_table; Relay_log_info *rli= rgi->rli; /* At slave, columns may differ. So we should create @@ -946,101 +990,35 @@ TABLE *table_def::create_conversion_table(THD *thd, rpl_group_info *rgi, conversion table. */ uint const cols_to_create= MY_MIN(target_table->s->fields, size()); + if (!(conv_table= new(thd) Virtual_conversion_table(thd)) || + conv_table->init(cols_to_create)) + goto err; for (uint col= 0 ; col < cols_to_create; ++col) { - Create_field *field_def= - (Create_field*) alloc_root(thd->mem_root, sizeof(Create_field)); - bool unsigned_flag= 0; - if (field_list.push_back(field_def, thd->mem_root)) - DBUG_RETURN(NULL); - - uint decimals= 0; - TYPELIB* interval= NULL; - uint pack_length= 0; - uint32 max_length= - max_display_length_for_field(type(col), field_metadata(col)); - - switch(type(col)) { - int precision; - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - interval= static_cast<Field_enum*>(target_table->field[col])->typelib; - pack_length= field_metadata(col) & 0x00ff; - break; - - case MYSQL_TYPE_NEWDECIMAL: - /* - The display length of a DECIMAL type is not the same as the - length that should be supplied to make_field, so we correct - the length here. - */ - precision= field_metadata(col) >> 8; - decimals= field_metadata(col) & 0x00ff; - max_length= - my_decimal_precision_to_length(precision, decimals, FALSE); - break; - - case MYSQL_TYPE_DECIMAL: - sql_print_error("In RBR mode, Slave received incompatible DECIMAL field " - "(old-style decimal field) from Master while creating " - "conversion table. Please consider changing datatype on " - "Master to new style decimal by executing ALTER command for" - " column Name: %s.%s.%s.", - target_table->s->db.str, - target_table->s->table_name.str, - target_table->field[col]->field_name); + if (conv_table->add(type(col), field_metadata(col), + target_table->field[col])) + { + DBUG_PRINT("debug", ("binlog_type: %d, metadata: %04X, target_field: '%s'" + " make_conversion_table_field() failed", + binlog_type(col), field_metadata(col), + target_table->field[col]->field_name)); goto err; - - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_GEOMETRY: - pack_length= field_metadata(col) & 0x00ff; - break; - - case MYSQL_TYPE_TINY: - case MYSQL_TYPE_SHORT: - case MYSQL_TYPE_INT24: - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_LONGLONG: - /* - As we don't know if the integer was signed or not on the master, - assume we have same sign on master and slave. This is true when not - using conversions so it should be true also when using conversions. - */ - unsigned_flag= ((Field_num*) target_table->field[col])->unsigned_flag; - break; - default: - break; } - - DBUG_PRINT("debug", ("sql_type: %d, target_field: '%s', max_length: %d, decimals: %d," - " maybe_null: %d, unsigned_flag: %d, pack_length: %u", - binlog_type(col), target_table->field[col]->field_name, - max_length, decimals, TRUE, unsigned_flag, - pack_length)); - field_def->init_for_tmp_table(type(col), - max_length, - decimals, - TRUE, // maybe_null - unsigned_flag, - pack_length); - field_def->charset= target_table->field[col]->charset(); - field_def->interval= interval; } - conv_table= create_virtual_tmp_table(thd, field_list); + if (conv_table->open()) + goto err; // Could not allocate record buffer? -err: - if (conv_table == NULL) - { - rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION, rgi->gtid_info(), - ER_THD(thd, ER_SLAVE_CANT_CREATE_CONVERSION), - target_table->s->db.str, - target_table->s->table_name.str); - } DBUG_RETURN(conv_table); + +err: + if (conv_table) + delete conv_table; + rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION, rgi->gtid_info(), + ER_THD(thd, ER_SLAVE_CANT_CREATE_CONVERSION), + target_table->s->db.str, + target_table->s->table_name.str); + DBUG_RETURN(NULL); } #endif /* MYSQL_CLIENT */ diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 36d3a0c0813..376cd7a82ef 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -1735,29 +1735,29 @@ ER_WRONG_AUTO_KEY 42000 S1009 ER_UNUSED_9 eng "You should never see it" ER_NORMAL_SHUTDOWN - cze "%s: normálnà ukonÄenÃ\n" - dan "%s: Normal nedlukning\n" - nla "%s: Normaal afgesloten \n" - eng "%s: Normal shutdown\n" - est "%s: MariaDB lõpetas\n" - fre "%s: Arrêt normal du serveur\n" - ger "%s: Normal heruntergefahren\n" - greek "%s: Φυσιολογική διαδικασία shutdown\n" - hun "%s: Normal leallitas\n" - ita "%s: Shutdown normale\n" - jpn "%s: 通常シャットダウン\n" - kor "%s: ì •ìƒì ì¸ shutdown\n" - nor "%s: Normal avslutning\n" - norwegian-ny "%s: Normal nedkopling\n" - pol "%s: Standardowe zakoÅ„czenie dziaÅ‚ania\n" - por "%s: 'Shutdown' normal\n" - rum "%s: Terminare normala\n" - rus "%s: ÐšÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ñтановка\n" - serbian "%s: Normalno gaÅ¡enje\n" - slo "%s: normálne ukonÄenie\n" - spa "%s: Apagado normal\n" - swe "%s: Normal avslutning\n" - ukr "%s: Ðормальне завершеннÑ\n" + cze "%s (%s): normálnà ukonÄenÃ\n" + dan "%s (%s): Normal nedlukning\n" + nla "%s (%s): Normaal afgesloten \n" + eng "%s (%s): Normal shutdown\n" + est "%s (%s): MariaDB lõpetas\n" + fre "%s (%s): Arrêt normal du serveur\n" + ger "%s (%s): Normal heruntergefahren\n" + greek "%s (%s): Φυσιολογική διαδικασία shutdown\n" + hun "%s (%s): Normal leallitas\n" + ita "%s (%s): Shutdown normale\n" + jpn "%s (%s): 通常シャットダウン\n" + kor "%s (%s): ì •ìƒì ì¸ shutdown\n" + nor "%s (%s): Normal avslutning\n" + norwegian-ny "%s (%s): Normal nedkopling\n" + pol "%s (%s): Standardowe zakoÅ„czenie dziaÅ‚ania\n" + por "%s (%s): 'Shutdown' normal\n" + rum "%s (%s): Terminare normala\n" + rus "%s (%s): ÐšÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ñтановка\n" + serbian "%s (%s): Normalno gaÅ¡enje\n" + slo "%s (%s): normálne ukonÄenie\n" + spa "%s (%s): Apagado normal\n" + swe "%s (%s): Normal avslutning\n" + ukr "%s (%s): Ðормальне завершеннÑ\n" ER_GOT_SIGNAL cze "%s: pÅ™ijat signal %d, konÄÃm\n" dan "%s: Fangede signal %d. Afslutter!!\n" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index ea112bc8296..d142b2e1f37 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -70,28 +70,6 @@ static void reset_start_time_for_sp(THD *thd) thd->set_start_time(); } -Item_result -sp_map_result_type(enum enum_field_types type) -{ - switch (type) { - case MYSQL_TYPE_BIT: - case MYSQL_TYPE_TINY: - case MYSQL_TYPE_SHORT: - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_LONGLONG: - case MYSQL_TYPE_INT24: - return INT_RESULT; - case MYSQL_TYPE_DECIMAL: - case MYSQL_TYPE_NEWDECIMAL: - return DECIMAL_RESULT; - case MYSQL_TYPE_FLOAT: - case MYSQL_TYPE_DOUBLE: - return REAL_RESULT; - default: - return STRING_RESULT; - } -} - Item::Type sp_map_item_type(enum enum_field_types type) @@ -764,7 +742,7 @@ sp_head::set_stmt_end(THD *thd) static TYPELIB * -create_typelib(MEM_ROOT *mem_root, Create_field *field_def, List<String> *src) +create_typelib(MEM_ROOT *mem_root, Column_definition *field_def, List<String> *src) { TYPELIB *result= NULL; CHARSET_INFO *cs= field_def->charset; @@ -863,30 +841,56 @@ Field * sp_head::create_result_field(uint field_max_length, const char *field_name, TABLE *table) { - uint field_length; Field *field; DBUG_ENTER("sp_head::create_result_field"); - field_length= !m_return_field_def.length ? - field_max_length : m_return_field_def.length; - - field= ::make_field(table->s, /* TABLE_SHARE ptr */ - table->in_use->mem_root, - (uchar*) 0, /* field ptr */ - field_length, /* field [max] length */ - (uchar*) "", /* null ptr */ - 0, /* null bit */ - m_return_field_def.pack_flag, - m_return_field_def.sql_type, - m_return_field_def.charset, - m_return_field_def.geom_type, m_return_field_def.srid, - Field::NONE, /* unreg check */ - m_return_field_def.interval, - field_name ? field_name : (const char *) m_name.str); + /* + m_return_field_def.length is always set to the field length calculated + by the parser, according to the RETURNS clause. See prepare_create_field() + in sql_table.cc. Value examples, depending on data type: + - 11 for INT (character representation length) + - 20 for BIGINT (character representation length) + - 22 for DOUBLE (character representation length) + - N for CHAR(N) CHARACTER SET latin1 (octet length) + - 3*N for CHAR(N) CHARACTER SET utf8 (octet length) + - 8 for blob-alike data types (packed length !!!) + + field_max_length is also set according to the data type in the RETURNS + clause but can have different values depending on the execution stage: + + 1. During direct execution: + field_max_length is 0, because Item_func_sp::fix_length_and_dec() has + not been called yet, so Item_func_sp::max_length is 0 by default. + + 2a. During PREPARE: + field_max_length is 0, because Item_func_sp::fix_length_and_dec() + has not been called yet. It's called after create_result_field(). + + 2b. During EXEC: + field_max_length is set to the maximum possible octet length of the + RETURNS data type. + - N for CHAR(N) CHARACTER SET latin1 (octet length) + - 3*N for CHAR(N) CHARACTER SET utf8 (octet length) + - 255 for TINYBLOB (octet length, not packed length !!!) + + Perhaps we should refactor prepare_create_field() to set + Create_field::length to maximum octet length for BLOBs, + instead of packed length). + */ + DBUG_ASSERT(field_max_length <= m_return_field_def.length || + (current_thd->stmt_arena->is_stmt_execute() && + m_return_field_def.length == 8 && + (m_return_field_def.pack_flag & + (FIELDFLAG_BLOB|FIELDFLAG_GEOM)))); + + field= m_return_field_def.make_field(table->s, /* TABLE_SHARE ptr */ + table->in_use->mem_root, + field_name ? + field_name : + (const char *) m_name.str); field->vcol_info= m_return_field_def.vcol_info; - field->stored_in_db= m_return_field_def.stored_in_db; if (field) field->init(table); @@ -1185,7 +1189,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success) /* Switch query context. This has to be done early as this is sometimes - allocated trough sql_alloc + allocated on THD::mem_root */ if (m_creation_ctx) saved_creation_ctx= m_creation_ctx->set_n_backup(thd); @@ -2149,7 +2153,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args) } Send_field *out_param_info= new (thd->mem_root) Send_field(); - nctx->get_item(i)->make_field(out_param_info); + nctx->get_item(i)->make_field(thd, out_param_info); out_param_info->db_name= m_db.str; out_param_info->table_name= m_name.str; out_param_info->org_table_name= m_name.str; @@ -2292,9 +2296,9 @@ sp_head::restore_lex(THD *thd) Put the instruction on the backpatch list, associated with the label. */ int -sp_head::push_backpatch(sp_instr *i, sp_label *lab) +sp_head::push_backpatch(THD *thd, sp_instr *i, sp_label *lab) { - bp_t *bp= (bp_t *)sql_alloc(sizeof(bp_t)); + bp_t *bp= (bp_t *) thd->alloc(sizeof(bp_t)); if (!bp) return 1; @@ -2328,12 +2332,11 @@ sp_head::backpatch(sp_label *lab) } /** - Prepare an instance of Create_field for field creation (fill all necessary - attributes). + Prepare an instance of Column_definition for field creation + (fill all necessary attributes). @param[in] thd Thread handle @param[in] lex Yacc parsing context - @param[in] field_type Field type @param[out] field_def An instance of create_field to be filled @retval @@ -2344,8 +2347,7 @@ sp_head::backpatch(sp_label *lab) bool sp_head::fill_field_definition(THD *thd, LEX *lex, - enum enum_field_types field_type, - Create_field *field_def) + Column_definition *field_def) { uint unused1= 0; diff --git a/sql/sp_head.h b/sql/sp_head.h index 5a91423739c..9022f954d11 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -45,9 +45,6 @@ //#define TYPE_ENUM_FUNCTION 1 #define TYPE_ENUM_PROCEDURE 2 #define //TYPE_ENUM_TRIGGER 3 #define TYPE_ENUM_PROXY 4 -Item_result -sp_map_result_type(enum enum_field_types type); - Item::Type sp_map_item_type(enum enum_field_types type); @@ -181,7 +178,7 @@ public: stored_procedure_type m_type; uint m_flags; // Boolean attributes of a stored routine - Create_field m_return_field_def; /**< This is used for FUNCTIONs only. */ + Column_definition m_return_field_def; /**< This is used for FUNCTIONs only. */ const char *m_tmp_query; ///< Temporary pointer to sub query string st_sp_chistics *m_chistics; @@ -389,7 +386,7 @@ public: /// Put the instruction on the backpatch list, associated with the label. int - push_backpatch(sp_instr *, sp_label *); + push_backpatch(THD *thd, sp_instr *, sp_label *); /// Update all instruction with this label in the backpatch list to /// the current position. @@ -421,8 +418,7 @@ public: TABLE *table); bool fill_field_definition(THD *thd, LEX *lex, - enum enum_field_types field_type, - Create_field *field_def); + Column_definition *field_def); void set_info(longlong created, longlong modified, st_sp_chistics *chistics, ulonglong sql_mode); diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index faf5a2de891..9a6353c9337 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -450,7 +450,7 @@ bool sp_pcontext::find_cursor(LEX_STRING name, void sp_pcontext::retrieve_field_definitions( - List<Create_field> *field_def_lst) const + List<Column_definition> *field_def_lst) const { /* Put local/context fields in the result list. */ diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index efe9531c3a0..2a080536b8a 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -43,9 +43,6 @@ public: /// Name of the SP-variable. LEX_STRING name; - /// Field-type of the SP-variable. - enum enum_field_types type; - /// Mode of the SP-variable. enum_mode mode; @@ -60,13 +57,14 @@ public: Item *default_value; /// Full type information (field meta-data) of the SP-variable. - Create_field field_def; + Column_definition field_def; + /// Field-type of the SP-variable. + enum_field_types sql_type() const { return field_def.sql_type; } public: sp_variable(LEX_STRING _name, uint _offset) :Sql_alloc(), name(_name), - type(MYSQL_TYPE_NULL), mode(MODE_IN), offset(_offset), default_value(NULL) @@ -347,7 +345,7 @@ public: /// context and its children. /// /// @param field_def_lst[out] Container to store type information. - void retrieve_field_definitions(List<Create_field> *field_def_lst) const; + void retrieve_field_definitions(List<Column_definition> *field_def_lst) const; /// Find SP-variable by name. /// diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index b38f4a3ddad..6e724468966 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -104,7 +104,7 @@ bool sp_rcontext::alloc_arrays(THD *thd) bool sp_rcontext::init_var_table(THD *thd) { - List<Create_field> field_def_lst; + List<Column_definition> field_def_lst; if (!m_root_parsing_ctx->max_var_index()) return false; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e5a80420470..6c6c8263449 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -6598,12 +6598,10 @@ bool grant_init() static bool grant_load(THD *thd, TABLE_LIST *tables) { - MEM_ROOT *memex_ptr; bool return_val= 1; TABLE *t_table, *c_table, *p_table; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; - MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, - THR_MALLOC); + MEM_ROOT *save_mem_root= thd->mem_root; ulonglong old_sql_mode= thd->variables.sql_mode; DBUG_ENTER("grant_load"); @@ -6628,15 +6626,14 @@ static bool grant_load(THD *thd, TABLE_LIST *tables) t_table->use_all_columns(); c_table->use_all_columns(); - memex_ptr= &grant_memroot; - my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); + thd->mem_root= &grant_memroot; if (!t_table->file->ha_index_first(t_table->record[0])) { do { GRANT_TABLE *mem_check; - if (!(mem_check=new (memex_ptr) GRANT_TABLE(t_table,c_table))) + if (!(mem_check= new (&grant_memroot) GRANT_TABLE(t_table, c_table))) { /* This could only happen if we are out memory */ goto end_unlock; @@ -6681,7 +6678,7 @@ static bool grant_load(THD *thd, TABLE_LIST *tables) { GRANT_NAME *mem_check; HASH *hash; - if (!(mem_check=new (memex_ptr) GRANT_NAME(p_table, TRUE))) + if (!(mem_check= new (&grant_memroot) GRANT_NAME(p_table, TRUE))) { /* This could only happen if we are out memory */ goto end_unlock_p; @@ -6734,7 +6731,7 @@ end_unlock_p: p_table->file->ha_index_end(); end_unlock: t_table->file->ha_index_end(); - my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr); + thd->mem_root= save_mem_root; end_index_init: thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(return_val); @@ -11336,7 +11333,8 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio, int2store(end+5, thd->client_capabilities >> 16); end[7]= data_len; DBUG_EXECUTE_IF("poison_srv_handshake_scramble_len", end[7]= -100;); - bzero(end + 8, 10); + bzero(end + 8, 6); + int4store(end + 14, thd->client_capabilities >> 32); end+= 18; /* write scramble tail */ end= (char*) memcpy(end, data + SCRAMBLE_LENGTH_323, @@ -11752,18 +11750,29 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, */ DBUG_ASSERT(net->read_pos[pkt_len] == 0); - ulong client_capabilities= uint2korr(net->read_pos); + ulonglong client_capabilities= uint2korr(net->read_pos); + compile_time_assert(sizeof(client_capabilities) >= 8); if (client_capabilities & CLIENT_PROTOCOL_41) { - if (pkt_len < 4) + if (pkt_len < 32) return packet_error; client_capabilities|= ((ulong) uint2korr(net->read_pos+2)) << 16; + if (!(client_capabilities & CLIENT_MYSQL)) + { + // it is client with mariadb extensions + ulonglong ext_client_capabilities= + (((ulonglong)uint4korr(net->read_pos + 28)) << 32); + client_capabilities|= ext_client_capabilities; + } + else if (client_capabilities & CLIENT_PROGRESS_OBSOLETE) + client_capabilities|= MARIADB_CLIENT_PROGRESS; } /* Disable those bits which are not supported by the client. */ + compile_time_assert(sizeof(thd->client_capabilities) >= 8); thd->client_capabilities&= client_capabilities; - DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities)); + DBUG_PRINT("info", ("client capabilities: %llu", thd->client_capabilities)); if (thd->client_capabilities & CLIENT_SSL) { unsigned long errptr __attribute__((unused)); @@ -11791,8 +11800,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, if (client_capabilities & CLIENT_PROTOCOL_41) { - if (pkt_len < 32) - return packet_error; thd->max_client_packet_length= uint4korr(net->read_pos+4); DBUG_PRINT("info", ("client_character_set: %d", (uint) net->read_pos[8])); if (thd_init_client_charset(thd, (uint) net->read_pos[8])) @@ -12569,7 +12576,7 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len) } DBUG_PRINT("info", - ("Capabilities: %lu packet_length: %ld Host: '%s' " + ("Capabilities: %llu packet_length: %ld Host: '%s' " "Login user: '%s' Priv_user: '%s' Using password: %s " "Access: %lu db: '%s'", thd->client_capabilities, thd->max_client_packet_length, diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 1f801a33dcd..b2bc9fc2e87 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -134,7 +134,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, } if (!(pc->f_info= - (field_info**)sql_alloc(sizeof(field_info*)*field_list.elements))) + (field_info**) thd->alloc(sizeof(field_info*) * field_list.elements))) goto err; pc->f_end = pc->f_info + field_list.elements; pc->fields = field_list; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6dfd2622805..c8b0092d246 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6137,9 +6137,9 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list, } else { - item->set_name((*ref)->name, (*ref)->name_length, + item->set_name(thd, (*ref)->name, (*ref)->name_length, system_charset_info); - item->real_item()->set_name((*ref)->name, (*ref)->name_length, + item->real_item()->set_name(thd, (*ref)->name, (*ref)->name_length, system_charset_info); } } @@ -6233,9 +6233,9 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name, */ if (*ref && !(*ref)->is_autogenerated_name) { - item->set_name((*ref)->name, (*ref)->name_length, + item->set_name(thd, (*ref)->name, (*ref)->name_length, system_charset_info); - item->real_item()->set_name((*ref)->name, (*ref)->name_length, + item->real_item()->set_name(thd, (*ref)->name, (*ref)->name_length, system_charset_info); } if (register_tree_change && arena) @@ -8789,7 +8789,7 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values, ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN), rfield->field_name, table->s->table_name.str); } - if ((!rfield->vcol_info || rfield->stored_in_db) && + if (rfield->stored_in_db() && (value->save_in_field(rfield, 0)) < 0 && !ignore_errors) { my_message(ER_UNKNOWN_ERROR, ER_THD(thd, ER_UNKNOWN_ERROR), MYF(0)); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0865f7ee375..345feb6094a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -370,16 +370,6 @@ void thd_close_connection(THD *thd) } /** - Get current THD object from thread local data - - @retval The THD object for the thread, NULL if not connection thread -*/ -THD *thd_get_current_thd() -{ - return current_thd; -} - -/** Lock data that needs protection in THD object @param thd THD object @@ -469,6 +459,16 @@ my_socket thd_get_fd(THD *thd) #endif /** + Get current THD object from thread local data + + @retval The THD object for the thread, NULL if not connection thread +*/ +THD *thd_get_current_thd() +{ + return current_thd; +} + +/** Get thread attributes for connection threads @retval Reference to thread attribute for connection threads @@ -2045,7 +2045,7 @@ int killed_errno(killed_state killed) /* Remember the location of thread info, the structure needed for - sql_alloc() and the structure for the net buffer + the structure for the net buffer */ bool THD::store_globals() @@ -2056,8 +2056,7 @@ bool THD::store_globals() */ DBUG_ASSERT(thread_stack); - if (set_current_thd(this) || - my_pthread_setspecific_ptr(THR_MALLOC, &mem_root)) + if (set_current_thd(this)) return 1; /* mysys_var is concurrently readable by a killer thread. @@ -2110,7 +2109,6 @@ void THD::reset_globals() /* Undocking the thread specific data. */ set_current_thd(0); - my_pthread_setspecific_ptr(THR_MALLOC, NULL); net.thd= 0; } @@ -3549,7 +3547,7 @@ void Query_arena::free_items() { Item *next; DBUG_ENTER("Query_arena::free_items"); - /* This works because items are allocated with sql_alloc() */ + /* This works because items are allocated on THD::mem_root */ for (; free_list; free_list= next) { next= free_list->next; @@ -4338,7 +4336,7 @@ extern "C" void thd_progress_init(MYSQL_THD thd, uint max_stage) is a high level command (like ALTER TABLE) and we are not in a stored procedure */ - thd->progress.report= ((thd->client_capabilities & CLIENT_PROGRESS) && + thd->progress.report= ((thd->client_capabilities & MARIADB_CLIENT_PROGRESS) && thd->progress.report_to_client && !thd->in_sub_stmt); thd->progress.next_report_time= 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index 6468f301082..a15a738b1bf 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -36,6 +36,7 @@ #include "violite.h" /* vio_is_connected */ #include "thr_lock.h" /* thr_lock_type, THR_LOCK_DATA, THR_LOCK_INFO */ #include "thr_timer.h" +#include "thr_malloc.h" #include "sql_digest_stream.h" // sql_digest_state @@ -1411,7 +1412,7 @@ public: Discrete_intervals_list auto_inc_intervals_forced; ulonglong limit_found_rows; ha_rows cuted_fields, sent_row_count, examined_row_count; - ulong client_capabilities; + ulonglong client_capabilities; ulong query_plan_flags; uint in_sub_stmt; bool enable_slow_log; @@ -2044,7 +2045,7 @@ public: /* Needed by MariaDB semi sync replication */ Trans_binlog_info *semisync_info; - ulong client_capabilities; /* What the client supports */ + ulonglong client_capabilities; /* What the client supports */ ulong max_client_packet_length; HASH handler_tables_hash; @@ -2086,7 +2087,7 @@ public: bool report_to_client; /* true, if we will send progress report packets to a client - (client has requested them, see CLIENT_PROGRESS; report_to_client + (client has requested them, see MARIADB_CLIENT_PROGRESS; report_to_client is true; not in sub-statement) */ bool report; @@ -4883,16 +4884,19 @@ public: /* Structs used when sorting */ +struct SORT_FIELD_ATTR +{ + uint length; /* Length of sort field */ + uint suffix_length; /* Length suffix (0-4) */ +}; + -typedef struct st_sort_field { +struct SORT_FIELD: public SORT_FIELD_ATTR +{ Field *field; /* Field to sort */ Item *item; /* Item if not sorting fields */ - uint length; /* Length of sort field */ - uint suffix_length; /* Length suffix (0-4) */ - Item_result result_type; /* Type of item */ bool reverse; /* if descending sort */ - bool need_strxnfrm; /* If we have to use strxnfrm() */ -} SORT_FIELD; +}; typedef struct st_sort_buffer { diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index a8c5569ba4a..7ecce8a8da3 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -277,7 +277,7 @@ int Materialized_cursor::send_result_set_metadata( { Send_field send_field; Item_ident *ident= static_cast<Item_ident *>(item_dst); - item_org->make_field(&send_field); + item_org->make_field(thd, &send_field); ident->db_name= thd->strdup(send_field.db_name); ident->table_name= thd->strdup(send_field.table_name); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 67e7b6115a3..baba4a876b3 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -671,7 +671,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) if ((res= unit->prepare(thd, derived->derived_result, 0))) goto exit; lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED; - if ((res= check_duplicate_names(unit->types, 0))) + if ((res= check_duplicate_names(thd, unit->types, 0))) goto exit; /* diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 662fa33dc9f..e8ade81062b 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -31,7 +31,7 @@ then do { handler_items=concat(handler_items, free_list); free_list=0; } But !!! do_command calls free_root at the end of every query and frees up - all the sql_alloc'ed memory. It's harder to work around... + all the memory allocated on THD::mem_root. It's harder to work around... */ /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 692ba81510b..e27cc6de073 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1506,7 +1506,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, { for (Field **vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) { - if ((*vfield_ptr)->stored_in_db) + if ((*vfield_ptr)->vcol_info->stored_in_db) { thd->lex->unit.insert_table_with_stored_vcol= table; break; @@ -3892,8 +3892,8 @@ void select_insert::abort_result_set() { Field *Item::create_field_for_create_select(THD *thd, TABLE *table) { Field *def_field, *tmp_field; - return create_tmp_field(thd, table, this, type(), - (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, 0); + return ::create_tmp_field(thd, table, this, type(), + (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, 0); } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 898e3ae33c6..f0bc582985b 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -506,7 +506,6 @@ void lex_start(THD *thd) lex->parsing_options.reset(); lex->empty_field_list_on_rset= 0; lex->select_lex.select_number= 1; - lex->length=0; lex->part_info= 0; lex->select_lex.in_sum_expr=0; lex->select_lex.ftfunc_list_alloc.empty(); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 644d1a19cfd..9eddd6d61ee 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -496,10 +496,6 @@ public: enum sub_select_type linkage; bool no_table_names_allowed; /* used for global order by */ - static void *operator new(size_t size) throw () - { - return sql_alloc(size); - } static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } @@ -2396,7 +2392,6 @@ struct LEX: public Query_tables_list Explain_query *explain; // type information - char *length,*dec; CHARSET_INFO *charset; LEX_STRING name; @@ -2477,7 +2472,7 @@ public: SQL_I_List<ORDER> proc_list; SQL_I_List<TABLE_LIST> auxiliary_table_list, save_list; - Create_field *last_field; + Column_definition *last_field; Item_sum *in_sum_func; udf_func udf; HA_CHECK_OPT check_opt; // check/repair options @@ -2855,8 +2850,8 @@ public: bool is_analyze, bool *printed_anything); void restore_set_statement_var(); - void init_last_field(Create_field *field, const char *name, CHARSET_INFO *cs); - void set_last_field_type(enum enum_field_types type); + void init_last_field(Column_definition *field, const char *name, CHARSET_INFO *cs); + void set_last_field_type(const Lex_field_type_st &type); bool set_bincmp(CHARSET_INFO *cs, bool bin); // Check if "KEY IF NOT EXISTS name" used outside of ALTER context bool check_add_key(DDL_options_st ddl) diff --git a/sql/sql_list.h b/sql/sql_list.h index 6f01b64df70..718306c2193 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -22,7 +22,8 @@ #include "my_sys.h" /* alloc_root, TRASH, MY_WME, MY_FAE, MY_ALLOW_ZERO_PTR */ #include "m_string.h" /* bfill */ -#include "thr_malloc.h" /* sql_alloc */ + +THD *thd_get_current_thd(); /* mysql standard class memory allocator */ @@ -31,11 +32,11 @@ class Sql_alloc public: static void *operator new(size_t size) throw () { - return sql_alloc(size); + return thd_alloc(thd_get_current_thd(), size); } static void *operator new[](size_t size) throw () { - return sql_alloc(size); + return thd_alloc(thd_get_current_thd(), size); } static void *operator new[](size_t size, MEM_ROOT *mem_root) throw () { return alloc_root(mem_root, size); } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index e102066c0bc..d43eb884abd 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -86,7 +86,7 @@ public: CHARSET_INFO *read_charset; LOAD_FILE_IO_CACHE cache; - READ_INFO(File file,uint tot_length,CHARSET_INFO *cs, + READ_INFO(THD *thd, File file, uint tot_length, CHARSET_INFO *cs, String &field_term,String &line_start,String &line_term, String &enclosed,int escape,bool get_it_from_net, bool is_fifo); ~READ_INFO(); @@ -306,7 +306,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, { for (Field **vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) { - if ((*vfield_ptr)->stored_in_db) + if ((*vfield_ptr)->vcol_info->stored_in_db) { thd->lex->unit.insert_table_with_stored_vcol= table; break; @@ -440,7 +440,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, !(thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES))) ? (*escaped)[0] : INT_MAX; - READ_INFO read_info(file,tot_length, + READ_INFO read_info(thd, file, tot_length, ex->cs ? ex->cs : thd->variables.collation_database, *field_term,*ex->line_start, *ex->line_term, *enclosed, info.escape_char, read_file_from_client, is_fifo); @@ -1337,7 +1337,7 @@ READ_INFO::unescape(char chr) */ -READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, +READ_INFO::READ_INFO(THD *thd, File file_par, uint tot_length, CHARSET_INFO *cs, String &field_term, String &line_start, String &line_term, String &enclosed_par, int escape, bool get_it_from_net, bool is_fifo) @@ -1384,7 +1384,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, /* Set of a stack for unget if long terminators */ uint length= MY_MAX(cs->mbmaxlen, MY_MAX(field_term_length, line_term_length)) + 1; set_if_bigger(length,line_start.length()); - stack=stack_pos=(int*) sql_alloc(sizeof(int)*length); + stack= stack_pos= (int*) thd->alloc(sizeof(int) * length); if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(MY_THREAD_SPECIFIC)))) error=1; /* purecov: inspected */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7c4bfb96bb5..84f0c6369fd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -637,7 +637,7 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, mysql_rwlock_t *var_lock) { Vio* save_vio; - ulong save_client_capabilities; + ulonglong save_client_capabilities; mysql_rwlock_rdlock(var_lock); if (!init_command->length) @@ -858,7 +858,7 @@ end: } -/* This works because items are allocated with sql_alloc() */ +/* This works because items are allocated on THD::mem_root */ void free_items(Item *item) { @@ -873,7 +873,7 @@ void free_items(Item *item) } /** - This works because items are allocated with sql_alloc(). + This works because items are allocated on THD::mem_root. @note The function also handles null pointers (empty list). */ void cleanup_items(Item *item) @@ -1805,7 +1805,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, DBUG_PRINT("quit",("Got shutdown command for level %u", level)); general_log_print(thd, command, NullS); my_eof(thd); - kill_mysql(); + kill_mysql(thd); error=TRUE; break; } @@ -2100,7 +2100,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, { DBUG_RETURN(1); } - schema_select_lex= new SELECT_LEX(); + schema_select_lex= new (thd->mem_root) SELECT_LEX(); db.str= schema_select_lex->db= lex->select_lex.db; schema_select_lex->table_list.first= NULL; db.length= strlen(db.str); @@ -2123,7 +2123,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, #else DBUG_ASSERT(table_ident); TABLE_LIST **query_tables_last= lex->query_tables_last; - schema_select_lex= new SELECT_LEX(); + schema_select_lex= new (thd->mem_root) SELECT_LEX(); /* 'parent_lex' is used in init_query() so it must be before it. */ schema_select_lex->parent_lex= lex; schema_select_lex->init_query(); @@ -4908,7 +4908,7 @@ end_with_restore_list: #ifndef EMBEDDED_LIBRARY if (check_global_access(thd,SHUTDOWN_ACL)) goto error; - kill_mysql(); + kill_mysql(thd); my_ok(thd); #else my_error(ER_NOT_SUPPORTED_YET, MYF(0), "embedded server"); @@ -7084,7 +7084,7 @@ void create_select_for_variable(const char *var_name) if ((var= get_system_var(thd, OPT_SESSION, tmp, null_lex_str))) { end= strxmov(buff, "@@session.", var_name, NullS); - var->set_name(buff, end-buff, system_charset_info); + var->set_name(thd, buff, end-buff, system_charset_info); add_item_to_list(thd, var); } DBUG_VOID_RETURN; @@ -7372,13 +7372,6 @@ bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length) #endif -/** Store position for column in ALTER TABLE .. ADD column. */ - -void store_position_for_column(const char *name) -{ - current_thd->lex->last_field->after=(char*) (name); -} - bool add_proc_to_list(THD* thd, Item *item) { diff --git a/sql/sql_parse.h b/sql/sql_parse.h index c3c47567cf5..6cb49f267d2 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -115,7 +115,6 @@ bool add_proc_to_list(THD *thd, Item *item); bool push_new_name_resolution_context(THD *thd, TABLE_LIST *left_op, TABLE_LIST *right_op); -void store_position_for_column(const char *name); void init_update_queries(void); bool check_simple_select(); Item *normalize_cond(THD *thd, Item *cond); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 16588871fd8..832f218fb51 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -255,7 +255,7 @@ static bool is_name_in_list(char *name, List<char> list_names) FALSE Success */ -bool partition_default_handling(TABLE *table, partition_info *part_info, +bool partition_default_handling(THD *thd, TABLE *table, partition_info *part_info, bool is_create_table_ind, const char *normalized_path) { @@ -283,7 +283,7 @@ bool partition_default_handling(TABLE *table, partition_info *part_info, part_info->num_subparts= num_parts / part_info->num_parts; } } - part_info->set_up_defaults_for_partitioning(table->file, + part_info->set_up_defaults_for_partitioning(thd, table->file, NULL, 0U); DBUG_RETURN(FALSE); } @@ -455,7 +455,7 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0, function. */ -static bool set_up_field_array(TABLE *table, +static bool set_up_field_array(THD *thd, TABLE *table, bool is_sub_part) { Field **ptr, *field, **field_array; @@ -492,7 +492,7 @@ static bool set_up_field_array(TABLE *table, DBUG_RETURN(result); } size_field_array= (num_fields+1)*sizeof(Field*); - field_array= (Field**)sql_calloc(size_field_array); + field_array= (Field**) thd->calloc(size_field_array); if (unlikely(!field_array)) { mem_alloc_error(size_field_array); @@ -617,7 +617,7 @@ static bool create_full_part_field_array(THD *thd, TABLE *table, num_part_fields++; } size_field_array= (num_part_fields+1)*sizeof(Field*); - field_array= (Field**)sql_calloc(size_field_array); + field_array= (Field**) thd->calloc(size_field_array); if (unlikely(!field_array)) { mem_alloc_error(size_field_array); @@ -804,7 +804,7 @@ static void clear_field_flag(TABLE *table) */ -static bool handle_list_of_fields(List_iterator<char> it, +static bool handle_list_of_fields(THD *thd, List_iterator<char> it, TABLE *table, partition_info *part_info, bool is_sub_part) @@ -865,7 +865,7 @@ static bool handle_list_of_fields(List_iterator<char> it, } } } - result= set_up_field_array(table, is_sub_part); + result= set_up_field_array(thd, table, is_sub_part); end: DBUG_RETURN(result); } @@ -1034,7 +1034,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, if ((!is_sub_part) && (error= check_signed_flag(part_info))) goto end; - result= set_up_field_array(table, is_sub_part); + result= set_up_field_array(thd, table, is_sub_part); end: end_lex_with_single_table(thd, table, old_lex); #if !defined(DBUG_OFF) @@ -1622,7 +1622,7 @@ bool fix_partition_func(THD *thd, TABLE *table, if (!is_create_table_ind || thd->lex->sql_command != SQLCOM_CREATE_TABLE) { - if (partition_default_handling(table, part_info, + if (partition_default_handling(thd, table, part_info, is_create_table_ind, table->s->normalized_path.str)) { @@ -1641,7 +1641,7 @@ bool fix_partition_func(THD *thd, TABLE *table, if (part_info->list_of_subpart_fields) { List_iterator<char> it(part_info->subpart_field_list); - if (unlikely(handle_list_of_fields(it, table, part_info, TRUE))) + if (unlikely(handle_list_of_fields(thd, it, table, part_info, TRUE))) goto end; } else @@ -1668,7 +1668,7 @@ bool fix_partition_func(THD *thd, TABLE *table, if (part_info->list_of_part_fields) { List_iterator<char> it(part_info->part_field_list); - if (unlikely(handle_list_of_fields(it, table, part_info, FALSE))) + if (unlikely(handle_list_of_fields(thd, it, table, part_info, FALSE))) goto end; } else @@ -1690,7 +1690,7 @@ bool fix_partition_func(THD *thd, TABLE *table, if (part_info->column_list) { List_iterator<char> it(part_info->part_field_list); - if (unlikely(handle_list_of_fields(it, table, part_info, FALSE))) + if (unlikely(handle_list_of_fields(thd, it, table, part_info, FALSE))) goto end; } else @@ -2468,7 +2468,7 @@ static int add_key_with_algorithm(File fptr, partition_info *part_info, common queries. */ -char *generate_partition_syntax(partition_info *part_info, +char *generate_partition_syntax(THD *thd, partition_info *part_info, uint *buf_length, bool use_sql_alloc, bool show_partition_options, @@ -2642,7 +2642,7 @@ char *generate_partition_syntax(partition_info *part_info, goto close_file; *buf_length= (uint)buffer_length; if (use_sql_alloc) - buf= (char*) sql_alloc(*buf_length+1); + buf= (char*) thd->alloc(*buf_length + 1); else buf= (char*) my_malloc(*buf_length+1, MYF(MY_WME)); if (!buf) @@ -4976,7 +4976,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, } alt_part_info->part_type= tab_part_info->part_type; alt_part_info->subpart_type= tab_part_info->subpart_type; - if (alt_part_info->set_up_defaults_for_partitioning(table->file, 0, + if (alt_part_info->set_up_defaults_for_partitioning(thd, table->file, 0, tab_part_info->num_parts)) { goto err; @@ -5395,7 +5395,8 @@ state of p1. DBUG_ASSERT(!alt_part_info->use_default_partitions); /* We specified partitions explicitly so don't use defaults anymore. */ tab_part_info->use_default_partitions= FALSE; - if (alt_part_info->set_up_defaults_for_partitioning(table->file, 0, 0)) + if (alt_part_info->set_up_defaults_for_partitioning(thd, table->file, 0, + 0)) { goto err; } diff --git a/sql/sql_partition.h b/sql/sql_partition.h index b560c53562d..dd352b60120 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -262,7 +262,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, Alter_table_ctx *alter_ctx, bool *partition_changed, bool *fast_alter_table); -char *generate_partition_syntax(partition_info *part_info, +char *generate_partition_syntax(THD *thd, partition_info *part_info, uint *buf_length, bool use_sql_alloc, bool show_partition_options, HA_CREATE_INFO *create_info, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6568910da44..ca23e11676a 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -721,54 +721,44 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, case MYSQL_TYPE_TINY: param->set_param_func= set_param_tiny; param->item_type= Item::INT_ITEM; - param->item_result_type= INT_RESULT; break; case MYSQL_TYPE_SHORT: param->set_param_func= set_param_short; param->item_type= Item::INT_ITEM; - param->item_result_type= INT_RESULT; break; case MYSQL_TYPE_LONG: param->set_param_func= set_param_int32; param->item_type= Item::INT_ITEM; - param->item_result_type= INT_RESULT; break; case MYSQL_TYPE_LONGLONG: param->set_param_func= set_param_int64; param->item_type= Item::INT_ITEM; - param->item_result_type= INT_RESULT; break; case MYSQL_TYPE_FLOAT: param->set_param_func= set_param_float; param->item_type= Item::REAL_ITEM; - param->item_result_type= REAL_RESULT; break; case MYSQL_TYPE_DOUBLE: param->set_param_func= set_param_double; param->item_type= Item::REAL_ITEM; - param->item_result_type= REAL_RESULT; break; case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_NEWDECIMAL: param->set_param_func= set_param_decimal; param->item_type= Item::DECIMAL_ITEM; - param->item_result_type= DECIMAL_RESULT; break; case MYSQL_TYPE_TIME: param->set_param_func= set_param_time; param->item_type= Item::STRING_ITEM; - param->item_result_type= STRING_RESULT; break; case MYSQL_TYPE_DATE: param->set_param_func= set_param_date; param->item_type= Item::STRING_ITEM; - param->item_result_type= STRING_RESULT; break; case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: param->set_param_func= set_param_datetime; param->item_type= Item::STRING_ITEM; - param->item_result_type= STRING_RESULT; break; case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: @@ -781,7 +771,6 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, DBUG_ASSERT(thd->variables.character_set_client); param->value.cs_info.final_character_set_of_str_value= &my_charset_bin; param->item_type= Item::STRING_ITEM; - param->item_result_type= STRING_RESULT; break; default: /* @@ -811,10 +800,9 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, charset of connection, so we have to set it later. */ param->item_type= Item::STRING_ITEM; - param->item_result_type= STRING_RESULT; } } - param->param_type= (enum enum_field_types) param_type; + param->set_handler_by_field_type((enum enum_field_types) param_type); } #ifndef EMBEDDED_LIBRARY @@ -826,8 +814,8 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, */ inline bool is_param_long_data_type(Item_param *param) { - return ((param->param_type >= MYSQL_TYPE_TINY_BLOB) && - (param->param_type <= MYSQL_TYPE_STRING)); + return ((param->field_type() >= MYSQL_TYPE_TINY_BLOB) && + (param->field_type() <= MYSQL_TYPE_STRING)); } @@ -1216,7 +1204,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt, the parameter's members that might be needed further (e.g. value.cs_info.character_set_client is used in the query_val_str()). */ - setup_one_conversion_function(thd, param, param->param_type); + setup_one_conversion_function(thd, param, param->field_type()); if (param->set_from_user_var(thd, entry)) DBUG_RETURN(1); diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 48f7987daf5..a169823e25e 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -124,7 +124,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) NullS, NullS, field_info->field_name); if (field) { - field->set_name(field_info->old_name, + field->set_name(thd, field_info->old_name, (uint) strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ea30bf96f06..cb0f9e594ff 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -115,12 +115,6 @@ static int join_tab_cmp(const void *dummy, const void* ptr1, const void* ptr2); static int join_tab_cmp_straight(const void *dummy, const void* ptr1, const void* ptr2); static int join_tab_cmp_embedded_first(const void *emb, const void* ptr1, const void *ptr2); C_MODE_END -/* - TODO: 'find_best' is here only temporarily until 'greedy_search' is - tested and approved. -*/ -static bool find_best(JOIN *join,table_map rest_tables,uint index, - double record_count,double read_time, uint use_cond_selectivity); static uint cache_record_length(JOIN *join,uint index); bool get_best_combination(JOIN *join); static store_key *get_store_key(THD *thd, @@ -6602,10 +6596,6 @@ static void choose_initial_table_order(JOIN *join) the query @param join_tables set of the tables in the query - @todo - 'MAX_TABLES+2' denotes the old implementation of find_best before - the greedy version. Will be removed when greedy_search is approved. - @retval FALSE ok @retval @@ -6668,27 +6658,13 @@ choose_plan(JOIN *join, table_map join_tables) } else { - if (search_depth == MAX_TABLES+2) - { /* - TODO: 'MAX_TABLES+2' denotes the old implementation of find_best before - the greedy version. Will be removed when greedy_search is approved. - */ - join->best_read= DBL_MAX; - if (find_best(join, join_tables, join->const_tables, 1.0, 0.0, - use_cond_selectivity)) - { - DBUG_RETURN(TRUE); - } - } - else - { - if (search_depth == 0) - /* Automatically determine a reasonable value for 'search_depth' */ - search_depth= determine_search_depth(join); - if (greedy_search(join, join_tables, search_depth, prune_level, - use_cond_selectivity)) - DBUG_RETURN(TRUE); - } + DBUG_ASSERT(search_depth <= MAX_TABLES + 1); + if (search_depth == 0) + /* Automatically determine a reasonable value for 'search_depth' */ + search_depth= determine_search_depth(join); + if (greedy_search(join, join_tables, search_depth, prune_level, + use_cond_selectivity)) + DBUG_RETURN(TRUE); } /* @@ -7990,105 +7966,6 @@ best_extension_by_limited_search(JOIN *join, /** - @todo - - TODO: this function is here only temporarily until 'greedy_search' is - tested and accepted. - - RETURN VALUES - FALSE ok - TRUE Fatal error -*/ -static bool -find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, - double read_time, uint use_cond_selectivity) -{ - DBUG_ENTER("find_best"); - THD *thd= join->thd; - if (thd->check_killed()) - DBUG_RETURN(TRUE); - if (!rest_tables) - { - DBUG_PRINT("best",("read_time: %g record_count: %g",read_time, - record_count)); - - read_time+=record_count/(double) TIME_FOR_COMPARE; - if (join->sort_by_table && - join->sort_by_table != - join->positions[join->const_tables].table->table) - read_time+=record_count; // We have to make a temp table - if (read_time < join->best_read) - { - memcpy((uchar*) join->best_positions,(uchar*) join->positions, - sizeof(POSITION)*idx); - join->best_read= read_time - 0.001; - } - DBUG_RETURN(FALSE); - } - if (read_time+record_count/(double) TIME_FOR_COMPARE >= join->best_read) - DBUG_RETURN(FALSE); /* Found better before */ - - JOIN_TAB *s; - double best_record_count=DBL_MAX,best_read_time=DBL_MAX; - bool disable_jbuf= join->thd->variables.join_cache_level == 0; - for (JOIN_TAB **pos=join->best_ref+idx ; (s=*pos) ; pos++) - { - table_map real_table_bit=s->table->map; - if ((rest_tables & real_table_bit) && !(rest_tables & s->dependent) && - (!idx|| !check_interleaving_with_nj(s))) - { - double records, best; - POSITION loose_scan_pos; - best_access_path(join, s, rest_tables, idx, disable_jbuf, record_count, - join->positions + idx, &loose_scan_pos); - records= join->positions[idx].records_read; - best= join->positions[idx].read_time; - /* - Go to the next level only if there hasn't been a better key on - this level! This will cut down the search for a lot simple cases! - */ - double current_record_count=record_count*records; - double current_read_time=read_time+best; - advance_sj_state(join, rest_tables, idx, ¤t_record_count, - ¤t_read_time, &loose_scan_pos); - - double pushdown_cond_selectivity= 1.0; - if (use_cond_selectivity > 1) - pushdown_cond_selectivity= table_cond_selectivity(join, idx, s, - rest_tables & - ~real_table_bit); - join->positions[idx].cond_selectivity= pushdown_cond_selectivity; - double partial_join_cardinality= current_record_count * - pushdown_cond_selectivity; - - if (best_record_count > partial_join_cardinality || - best_read_time > current_read_time || - (idx == join->const_tables && s->table == join->sort_by_table)) - { - if (best_record_count >= partial_join_cardinality && - best_read_time >= current_read_time && - (!(s->key_dependent & rest_tables) || records < 2.0)) - { - best_record_count= partial_join_cardinality; - best_read_time=current_read_time; - } - swap_variables(JOIN_TAB*, join->best_ref[idx], *pos); - if (find_best(join,rest_tables & ~real_table_bit,idx+1, - partial_join_cardinality,current_read_time, - use_cond_selectivity)) - DBUG_RETURN(TRUE); - swap_variables(JOIN_TAB*, join->best_ref[idx], *pos); - } - restore_prev_nj_state(s); - restore_prev_sj_state(rest_tables, s, idx); - if (join->select_options & SELECT_STRAIGHT_JOIN) - break; // Don't test all combinations - } - } - DBUG_RETURN(FALSE); -} - - -/** Find how much space the prevous read not const tables takes in cache. */ @@ -12490,9 +12367,9 @@ static void clear_tables(JOIN *join) class COND_CMP :public ilink { public: - static void *operator new(size_t size) + static void *operator new(size_t size, MEM_ROOT *mem_root) { - return (void*) sql_alloc((uint) size); + return alloc_root(mem_root, size); } static void operator delete(void *ptr __attribute__((unused)), size_t size __attribute__((unused))) @@ -14112,7 +13989,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list, { cond->marker=1; COND_CMP *tmp2; - if ((tmp2=new COND_CMP(and_father,func))) + if ((tmp2= new (thd->mem_root) COND_CMP(and_father, func))) save_list->push_back(tmp2); } /* @@ -14144,7 +14021,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list, thd->change_item_tree(args + 1, value); cond->marker=1; COND_CMP *tmp2; - if ((tmp2=new COND_CMP(and_father,func))) + if ((tmp2=new (thd->mem_root) COND_CMP(and_father, func))) save_list->push_back(tmp2); } if (functype != Item_func::LIKE_FUNC) @@ -15796,7 +15673,6 @@ Field *create_tmp_field_from_field(THD *thd, Field *org_field, else if (org_field->type() == FIELD_TYPE_DOUBLE) ((Field_double *) new_field)->not_fixed= TRUE; new_field->vcol_info= 0; - new_field->stored_in_db= TRUE; new_field->cond_selectivity= 1.0; new_field->next_equal_field= NULL; new_field->option_list= NULL; @@ -15805,90 +15681,61 @@ Field *create_tmp_field_from_field(THD *thd, Field *org_field, return new_field; } -/** - Create field for temporary table using type of given item. - - @param thd Thread handler - @param item Item to create a field for - @param table Temporary table - @param copy_func If set and item is a function, store copy of - item in this array - @param modify_item 1 if item->result_field should point to new - item. This is relevent for how fill_record() - is going to work: - If modify_item is 1 then fill_record() will - update the record in the original table. - If modify_item is 0 then fill_record() will - update the temporary table - @param convert_blob_length If >0 create a varstring(convert_blob_length) - field instead of blob. - - @retval - 0 on error - @retval - new_created field -*/ -static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, - Item ***copy_func, bool modify_item, - uint convert_blob_length) +Field *Item::create_tmp_field(bool group, TABLE *table, + uint convert_blob_length, + uint convert_int_length) { - bool maybe_null= item->maybe_null; Field *UNINIT_VAR(new_field); - MEM_ROOT *mem_root= thd->mem_root; + MEM_ROOT *mem_root= table->in_use->mem_root; - switch (item->result_type()) { + switch (cmp_type()) { case REAL_RESULT: new_field= new (mem_root) - Field_double(item->max_length, maybe_null, - item->name, item->decimals, TRUE); + Field_double(max_length, maybe_null, name, decimals, TRUE); break; case INT_RESULT: /* Select an integer type with the minimal fit precision. - MY_INT32_NUM_DECIMAL_DIGITS is sign inclusive, don't consider the sign. - Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into - Field_long : make them Field_longlong. + convert_int_length is sign inclusive, don't consider the sign. */ - if (item->max_length >= (MY_INT32_NUM_DECIMAL_DIGITS - 1)) - new_field=new (mem_root) - Field_longlong(item->max_length, maybe_null, - item->name, item->unsigned_flag); + if (max_char_length() > convert_int_length) + new_field= new (mem_root) + Field_longlong(max_char_length(), maybe_null, name, unsigned_flag); else - new_field=new (mem_root) - Field_long(item->max_length, maybe_null, item->name, - item->unsigned_flag); + new_field= new (mem_root) + Field_long(max_char_length(), maybe_null, name, unsigned_flag); + break; + case TIME_RESULT: + new_field= tmp_table_field_from_field_type(table, true, false); break; case STRING_RESULT: - DBUG_ASSERT(item->collation.collation); + DBUG_ASSERT(collation.collation); /* - DATE/TIME and GEOMETRY fields have STRING_RESULT result type. + GEOMETRY fields have STRING_RESULT result type. To preserve type they needed to be handled separately. */ - if (item->cmp_type() == TIME_RESULT || - item->field_type() == MYSQL_TYPE_GEOMETRY) - new_field= item->tmp_table_field_from_field_type(table, true, false); + if (field_type() == MYSQL_TYPE_GEOMETRY) + new_field= tmp_table_field_from_field_type(table, true, false); /* Make sure that the blob fits into a Field_varstring which has 2-byte lenght. */ - else if (item->max_length/item->collation.collation->mbmaxlen > 255 && + else if (max_length / collation.collation->mbmaxlen > 255 && convert_blob_length <= Field_varstring::MAX_SIZE && convert_blob_length) new_field= new (mem_root) Field_varstring(convert_blob_length, maybe_null, - item->name, table->s, - item->collation.collation); + name, table->s, collation.collation); else - new_field= item->make_string_field(table); - new_field->set_derivation(item->collation.derivation); + new_field= make_string_field(table); + new_field->set_derivation(collation.derivation); break; case DECIMAL_RESULT: - new_field= Field_new_decimal::create_from_item(mem_root, item); + new_field= Field_new_decimal::create_from_item(mem_root, this); break; case ROW_RESULT: - default: // This case should never be choosen DBUG_ASSERT(0); new_field= 0; @@ -15896,6 +15743,42 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, } if (new_field) new_field->init(table); + return new_field; +} + + + +/** + Create field for temporary table using type of given item. + + @param thd Thread handler + @param item Item to create a field for + @param table Temporary table + @param copy_func If set and item is a function, store copy of + item in this array + @param modify_item 1 if item->result_field should point to new + item. This is relevent for how fill_record() + is going to work: + If modify_item is 1 then fill_record() will + update the record in the original table. + If modify_item is 0 then fill_record() will + update the temporary table + @param convert_blob_length If >0 create a varstring(convert_blob_length) + field instead of blob. + + @retval + 0 on error + @retval + new_created field +*/ + +static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, + Item ***copy_func, bool modify_item, + uint convert_blob_length) +{ + Field *UNINIT_VAR(new_field); + DBUG_ASSERT(thd == table->in_use); + new_field= item->Item::create_tmp_field(false, table, convert_blob_length); if (copy_func && item->real_item()->is_result_field()) *((*copy_func)++) = item; // Save for copy_funcs @@ -15990,8 +15873,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, switch (type) { case Item::SUM_FUNC_ITEM: { - Item_sum *item_sum=(Item_sum*) item; - result= item_sum->create_tmp_field(group, table, convert_blob_length); + result= item->create_tmp_field(group, table, convert_blob_length); if (!result) my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR)); return result; @@ -16135,9 +16017,9 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, a tmp_set bitmap to be used by things like filesort. */ -void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps) +void +setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps, uint field_count) { - uint field_count= table->s->fields; uint bitmap_size= bitmap_buffer_size(field_count); DBUG_ASSERT(table->s->vfields == 0 && table->def_vcol_set == 0); @@ -16161,6 +16043,13 @@ void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps) } +void +setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps) +{ + setup_tmp_table_column_bitmaps(table, bitmaps, table->s->fields); +} + + /** Create a temp table according to a field list. @@ -17047,141 +16936,108 @@ err: /****************************************************************************/ -/** - Create a reduced TABLE object with properly set up Field list from a - list of field definitions. - - The created table doesn't have a table handler associated with - it, has no keys, no group/distinct, no copy_funcs array. - The sole purpose of this TABLE object is to use the power of Field - class to read/write data to/from table->record[0]. Then one can store - the record in any container (RB tree, hash, etc). - The table is created in THD mem_root, so are the table's fields. - Consequently, if you don't BLOB fields, you don't need to free it. - - @param thd connection handle - @param field_list list of column definitions +void *Virtual_tmp_table::operator new(size_t size, THD *thd) throw() +{ + return (Virtual_tmp_table *) alloc_root(thd->mem_root, size); +} - @return - 0 if out of memory, TABLE object in case of success -*/ -TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list) +bool Virtual_tmp_table::init(uint field_count) { - uint field_count= field_list.elements; - uint blob_count= 0; - Field **field; - Create_field *cdef; /* column definition */ - uint record_length= 0; - uint null_count= 0; /* number of columns which may be null */ - uint null_pack_length; /* NULL representation array length */ uint *blob_field; uchar *bitmaps; - TABLE *table; - TABLE_SHARE *share; - - if (!multi_alloc_root(thd->mem_root, - &table, sizeof(*table), - &share, sizeof(*share), + if (!multi_alloc_root(in_use->mem_root, + &s, sizeof(*s), &field, (field_count + 1) * sizeof(Field*), - &blob_field, (field_count+1) *sizeof(uint), - &bitmaps, bitmap_buffer_size(field_count)*5, + &blob_field, (field_count + 1) * sizeof(uint), + &bitmaps, bitmap_buffer_size(field_count) * 5, NullS)) - return 0; + return true; + bzero(s, sizeof(*s)); + s->blob_field= blob_field; + setup_tmp_table_column_bitmaps(this, bitmaps, field_count); + m_alloced_field_count= field_count; + return false; +}; - bzero(table, sizeof(*table)); - bzero(share, sizeof(*share)); - table->field= field; - table->s= share; - table->temp_pool_slot= MY_BIT_NONE; - share->blob_field= blob_field; - share->fields= field_count; - setup_tmp_table_column_bitmaps(table, bitmaps); +bool Virtual_tmp_table::add(List<Column_definition> &field_list) +{ /* Create all fields and calculate the total length of record */ - List_iterator_fast<Create_field> it(field_list); - while ((cdef= it++)) - { - *field= make_field(share, thd->mem_root, 0, cdef->length, - (uchar*) (f_maybe_null(cdef->pack_flag) ? "" : 0), - f_maybe_null(cdef->pack_flag) ? 1 : 0, - cdef->pack_flag, cdef->sql_type, cdef->charset, - cdef->geom_type, cdef->srid, cdef->unireg_check, - cdef->interval, cdef->field_name); - if (!*field) - goto error; - (*field)->init(table); - record_length+= (*field)->pack_length(); - if (! ((*field)->flags & NOT_NULL_FLAG)) - null_count++; - - if ((*field)->flags & BLOB_FLAG) - share->blob_field[blob_count++]= (uint) (field - table->field); - - field++; + Column_definition *cdef; /* column definition */ + List_iterator_fast<Column_definition> it(field_list); + for ( ; (cdef= it++); ) + { + Field *tmp; + if (!(tmp= cdef->make_field(s, in_use->mem_root, 0, + (uchar*) (f_maybe_null(cdef->pack_flag) ? "" : 0), + f_maybe_null(cdef->pack_flag) ? 1 : 0, + cdef->field_name))) + return true; + add(tmp); } - *field= NULL; /* mark the end of the list */ - share->blob_field[blob_count]= 0; /* mark the end of the list */ - share->blob_fields= blob_count; + return false; +} - null_pack_length= (null_count + 7)/8; - share->reclength= record_length + null_pack_length; - share->rec_buff_length= ALIGN_SIZE(share->reclength + 1); - table->record[0]= (uchar*) thd->alloc(share->rec_buff_length); - if (!table->record[0]) - goto error; - if (null_pack_length) - { - table->null_flags= (uchar*) table->record[0]; - share->null_fields= null_count; - share->null_bytes= share->null_bytes_for_compare= null_pack_length; - } +void Virtual_tmp_table::setup_field_pointers() +{ + uchar *null_pos= record[0]; + uchar *field_pos= null_pos + s->null_bytes; + uint null_bit= 1; - table->in_use= thd; /* field->reset() may access table->in_use */ + for (Field **cur_ptr= field; *cur_ptr; ++cur_ptr) { - /* Set up field pointers */ - uchar *null_pos= table->record[0]; - uchar *field_pos= null_pos + share->null_bytes; - uint null_bit= 1; - - for (field= table->field; *field; ++field) + Field *cur_field= *cur_ptr; + if ((cur_field->flags & NOT_NULL_FLAG)) + cur_field->move_field(field_pos); + else { - Field *cur_field= *field; - if ((cur_field->flags & NOT_NULL_FLAG)) - cur_field->move_field(field_pos); - else + cur_field->move_field(field_pos, (uchar*) null_pos, null_bit); + null_bit<<= 1; + if (null_bit == (uint)1 << 8) { - cur_field->move_field(field_pos, (uchar*) null_pos, null_bit); - null_bit<<= 1; - if (null_bit == (uint)1 << 8) - { - ++null_pos; - null_bit= 1; - } + ++null_pos; + null_bit= 1; } - if (cur_field->type() == MYSQL_TYPE_BIT && - cur_field->key_type() == HA_KEYTYPE_BIT) + } + if (cur_field->type() == MYSQL_TYPE_BIT && + cur_field->key_type() == HA_KEYTYPE_BIT) + { + /* This is a Field_bit since key_type is HA_KEYTYPE_BIT */ + static_cast<Field_bit*>(cur_field)->set_bit_ptr(null_pos, null_bit); + null_bit+= cur_field->field_length & 7; + if (null_bit > 7) { - /* This is a Field_bit since key_type is HA_KEYTYPE_BIT */ - static_cast<Field_bit*>(cur_field)->set_bit_ptr(null_pos, null_bit); - null_bit+= cur_field->field_length & 7; - if (null_bit > 7) - { - null_pos++; - null_bit-= 8; - } + null_pos++; + null_bit-= 8; } - cur_field->reset(); - - field_pos+= cur_field->pack_length(); } + cur_field->reset(); + field_pos+= cur_field->pack_length(); } - return table; -error: - for (field= table->field; *field; ++field) - delete *field; /* just invokes field destructor */ - return 0; +} + + +bool Virtual_tmp_table::open() +{ + // Make sure that we added all the fields we planned to: + DBUG_ASSERT(s->fields == m_alloced_field_count); + field[s->fields]= NULL; // mark the end of the list + s->blob_field[s->blob_fields]= 0; // mark the end of the list + + uint null_pack_length= (s->null_fields + 7) / 8; // NULL-bit array length + s->reclength+= null_pack_length; + s->rec_buff_length= ALIGN_SIZE(s->reclength + 1); + if (!(record[0]= (uchar*) in_use->alloc(s->rec_buff_length))) + return true; + if (null_pack_length) + { + null_flags= (uchar*) record[0]; + s->null_bytes= s->null_bytes_for_compare= null_pack_length; + } + setup_field_pointers(); + return false; } @@ -22990,7 +22846,7 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array, str.length(0); str.extra_allocation(1024); item->print(&str, QT_ORDINARY); - item_field->name= sql_strmake(str.ptr(),str.length()); + item_field->name= thd->strmake(str.ptr(),str.length()); } #endif } diff --git a/sql/sql_select.h b/sql/sql_select.h index 9f9047399fe..1b1bb6ded71 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1861,7 +1861,180 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, All methods presume that there is at least one field to change. */ -TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list); + +class Virtual_tmp_table: public TABLE +{ + /** + Destruct collected fields. This method is called on errors only, + when we could not make the virtual temporary table completely, + e.g. when some of the fields could not be created or added. + + This is needed to avoid memory leaks, as some fields can be BLOB + variants and thus can have String onboard. Strings must be destructed + as they store data not the heap (not on MEM_ROOT). + */ + void destruct_fields() + { + for (uint i= 0; i < s->fields; i++) + delete field[i]; // to invoke the field destructor + s->fields= 0; // safety + } + +protected: + /** + The number of the fields that are going to be in the table. + We remember the number of the fields at init() time, and + at open() we check that all of the fields were really added. + */ + uint m_alloced_field_count; + + /** + Setup field pointers and null-bit pointers. + */ + void setup_field_pointers(); + +public: + /** + Create a new empty virtual temporary table on the thread mem_root. + After creation, the caller must: + - call init() + - populate the table with new fields using add(). + - call open(). + @param thd - Current thread. + */ + static void *operator new(size_t size, THD *thd) throw(); + + Virtual_tmp_table(THD *thd) + { + bzero(this, sizeof(*this)); + temp_pool_slot= MY_BIT_NONE; + in_use= thd; + } + + ~Virtual_tmp_table() + { + destruct_fields(); + } + + /** + Allocate components for the given number of fields. + - fields[] + - s->blob_fields[], + - bitmaps: def_read_set, def_write_set, tmp_set, eq_join_set, cond_set. + @param field_count - The number of fields we plan to add to the table. + @returns false - on success. + @returns true - on error. + */ + bool init(uint field_count); + + /** + Add one Field to the end of the field array, update members: + s->reclength, s->fields, s->blob_fields, s->null_fuelds. + */ + bool add(Field *new_field) + { + DBUG_ASSERT(s->fields < m_alloced_field_count); + new_field->init(this); + field[s->fields]= new_field; + s->reclength+= new_field->pack_length(); + if (!(new_field->flags & NOT_NULL_FLAG)) + s->null_fields++; + if (new_field->flags & BLOB_FLAG) + { + // Note, s->blob_fields was incremented in Field_blob::Field_blob + DBUG_ASSERT(s->blob_fields); + DBUG_ASSERT(s->blob_fields <= m_alloced_field_count); + s->blob_field[s->blob_fields - 1]= s->fields; + } + s->fields++; + return false; + } + + /** + Add fields from a Column_definition list + @returns false - on success. + @returns true - on error. + */ + bool add(List<Column_definition> &field_list); + + /** + Open a virtual table for read/write: + - Setup end markers in TABLE::field and TABLE_SHARE::blob_fields, + - Allocate a buffer in TABLE::record[0]. + - Set field pointers (Field::ptr, Field::null_pos, Field::null_bit) to + the allocated record. + This method is called when all of the fields have been added to the table. + After calling this method the table is ready for read and write operations. + @return false - on success + @return true - on error (e.g. could not allocate the record buffer). + */ + bool open(); +}; + + +/** + Create a reduced TABLE object with properly set up Field list from a + list of field definitions. + + The created table doesn't have a table handler associated with + it, has no keys, no group/distinct, no copy_funcs array. + The sole purpose of this TABLE object is to use the power of Field + class to read/write data to/from table->record[0]. Then one can store + the record in any container (RB tree, hash, etc). + The table is created in THD mem_root, so are the table's fields. + Consequently, if you don't BLOB fields, you don't need to free it. + + @param thd connection handle + @param field_list list of column definitions + + @return + 0 if out of memory, or a + TABLE object ready for read and write in case of success +*/ + +inline TABLE * +create_virtual_tmp_table(THD *thd, List<Column_definition> &field_list) +{ + Virtual_tmp_table *table; + if (!(table= new(thd) Virtual_tmp_table(thd))) + return NULL; + if (table->init(field_list.elements) || + table->add(field_list) || + table->open()) + { + delete table; + return NULL; + } + return table; +} + + +/** + Create a new virtual temporary table consisting of a single field. + SUM(DISTINCT expr) and similar numeric aggregate functions use this. + @param thd - Current thread + @param field - The field that will be added into the table. + @return NULL - On error. + @return !NULL - A pointer to the created table that is ready + for read and write. +*/ +inline TABLE * +create_virtual_tmp_table(THD *thd, Field *field) +{ + Virtual_tmp_table *table; + DBUG_ASSERT(field); + if (!(table= new(thd) Virtual_tmp_table(thd))) + return NULL; + if (table->init(1) || + table->add(field) || + table->open()) + { + delete table; + return NULL; + } + return table; +} + int test_if_item_cache_changed(List<Cached_item> &list); int join_init_read_record(JOIN_TAB *tab); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d931aed475a..f4dd24a1d0f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1892,7 +1892,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, field->vcol_info->expr_str.length, system_charset_info); packet->append(STRING_WITH_LEN(")")); - if (field->stored_in_db) + if (field->vcol_info->stored_in_db) packet->append(STRING_WITH_LEN(" PERSISTENT")); else packet->append(STRING_WITH_LEN(" VIRTUAL")); @@ -2171,7 +2171,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet, char *part_syntax; String comment_start; table->part_info->set_show_version_string(&comment_start); - if ((part_syntax= generate_partition_syntax(table->part_info, + if ((part_syntax= generate_partition_syntax(thd, table->part_info, &part_syntax_len, FALSE, show_table_options, @@ -5392,7 +5392,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, table->field[17]->store(type.ptr(), type.length(), cs); if (field->vcol_info) { - if (field->stored_in_db) + if (field->vcol_info->stored_in_db) table->field[17]->store(STRING_WITH_LEN("PERSISTENT"), cs); else table->field[17]->store(STRING_WITH_LEN("VIRTUAL"), cs); @@ -5675,7 +5675,6 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table, if (sp) { Field *field; - Create_field *field_def; String tmp_string; if (routine_type == TYPE_ENUM_FUNCTION) { @@ -5687,14 +5686,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table, get_field(thd->mem_root, proc_table->field[MYSQL_PROC_MYSQL_TYPE], &tmp_string); table->field[15]->store(tmp_string.ptr(), tmp_string.length(), cs); - field_def= &sp->m_return_field_def; - field= make_field(&share, thd->mem_root, - (uchar*) 0, field_def->length, - (uchar*) "", 0, field_def->pack_flag, - field_def->sql_type, field_def->charset, - field_def->geom_type, field_def->srid, Field::NONE, - field_def->interval, ""); - + field= sp->m_return_field_def.make_field(&share, thd->mem_root, ""); field->table= &tbl; tbl.in_use= thd; store_column_type(table, field, cs, 6); @@ -5713,7 +5705,6 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table, { const char *tmp_buff; sp_variable *spvar= spcont->find_variable(i); - field_def= &spvar->field_def; switch (spvar->mode) { case sp_variable::MODE_IN: tmp_buff= "IN"; @@ -5742,12 +5733,8 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table, &tmp_string); table->field[15]->store(tmp_string.ptr(), tmp_string.length(), cs); - field= make_field(&share, thd->mem_root, (uchar*) 0, field_def->length, - (uchar*) "", 0, field_def->pack_flag, - field_def->sql_type, field_def->charset, - field_def->geom_type, field_def->srid, Field::NONE, - field_def->interval, spvar->name.str); - + field= spvar->field_def.make_field(&share, thd->mem_root, + spvar->name.str); field->table= &tbl; tbl.in_use= thd; store_column_type(table, field, cs, 6); @@ -5834,18 +5821,11 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, TABLE_SHARE share; TABLE tbl; Field *field; - Create_field *field_def= &sp->m_return_field_def; bzero((char*) &tbl, sizeof(TABLE)); (void) build_table_filename(path, sizeof(path), "", "", "", 0); init_tmp_table_share(thd, &share, "", 0, "", path); - field= make_field(&share, thd->mem_root, (uchar*) 0, - field_def->length, - (uchar*) "", 0, field_def->pack_flag, - field_def->sql_type, field_def->charset, - field_def->geom_type, field_def->srid, Field::NONE, - field_def->interval, ""); - + field= sp->m_return_field_def.make_field(&share, thd->mem_root, ""); field->table= &tbl; tbl.in_use= thd; store_column_type(table, field, cs, 5); @@ -7495,7 +7475,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) item->max_length+= 1; if (item->decimals > 0) item->max_length+= 1; - item->set_name(fields_info->field_name, + item->set_name(thd, fields_info->field_name, strlen(fields_info->field_name), cs); break; case MYSQL_TYPE_TINY_BLOB: @@ -7518,7 +7498,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) { DBUG_RETURN(0); } - item->set_name(fields_info->field_name, + item->set_name(thd, fields_info->field_name, strlen(fields_info->field_name), cs); break; } @@ -7578,7 +7558,7 @@ static int make_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) Item_field(thd, context, NullS, NullS, field_info->field_name); if (field) { - field->set_name(field_info->old_name, + field->set_name(thd, field_info->old_name, strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) @@ -7613,7 +7593,7 @@ int make_schemata_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) buffer.append(lex->wild->ptr()); buffer.append(')'); } - field->set_name(buffer.ptr(), buffer.length(), system_charset_info); + field->set_name(thd, buffer.ptr(), buffer.length(), system_charset_info); } return 0; } @@ -7640,15 +7620,15 @@ int make_table_names_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) NullS, NullS, field_info->field_name); if (add_item_to_list(thd, field)) return 1; - field->set_name(buffer.ptr(), buffer.length(), system_charset_info); + field->set_name(thd, buffer.ptr(), buffer.length(), system_charset_info); if (thd->lex->verbose) { - field->set_name(buffer.ptr(), buffer.length(), system_charset_info); + field->set_name(thd, buffer.ptr(), buffer.length(), system_charset_info); field_info= &schema_table->fields_info[3]; field= new (thd->mem_root) Item_field(thd, context, NullS, NullS, field_info->field_name); if (add_item_to_list(thd, field)) return 1; - field->set_name(field_info->old_name, strlen(field_info->old_name), + field->set_name(thd, field_info->old_name, strlen(field_info->old_name), system_charset_info); } return 0; @@ -7673,7 +7653,7 @@ int make_columns_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) NullS, NullS, field_info->field_name); if (field) { - field->set_name(field_info->old_name, + field->set_name(thd, field_info->old_name, strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) @@ -7698,7 +7678,7 @@ int make_character_sets_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) NullS, NullS, field_info->field_name); if (field) { - field->set_name(field_info->old_name, + field->set_name(thd, field_info->old_name, strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) @@ -7723,7 +7703,7 @@ int make_proc_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table) NullS, NullS, field_info->field_name); if (field) { - field->set_name(field_info->old_name, + field->set_name(thd, field_info->old_name, strlen(field_info->old_name), system_charset_info); if (add_item_to_list(thd, field)) diff --git a/sql/sql_sort.h b/sql/sql_sort.h index d30ddfb6eec..1622d9df360 100644 --- a/sql/sql_sort.h +++ b/sql/sql_sort.h @@ -23,8 +23,8 @@ #include "queues.h" typedef struct st_buffpek BUFFPEK; -typedef struct st_sort_field SORT_FIELD; +struct SORT_FIELD; class Field; struct TABLE; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 28e76ae43f1..324741fb55e 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1656,7 +1656,7 @@ public: bool is_single_comp_pk; - Index_prefix_calc(TABLE *table, KEY *key_info) + Index_prefix_calc(THD *thd, TABLE *table, KEY *key_info) : index_table(table), index_info(key_info) { uint i; @@ -1677,7 +1677,7 @@ public: } if ((calc_state= - (Prefix_calc_state *) sql_alloc(sizeof(Prefix_calc_state)*key_parts))) + (Prefix_calc_state *) thd->alloc(sizeof(Prefix_calc_state)*key_parts))) { uint keyno= key_info-table->key_info; for (i= 0, state= calc_state; i < key_parts; i++, state++) @@ -1691,7 +1691,8 @@ public: break; if (!(state->last_prefix= - new Cached_item_field(key_info->key_part[i].field))) + new (thd->mem_root) Cached_item_field(thd, + key_info->key_part[i].field))) break; state->entry_count= state->prefix_count= 0; prefixes++; @@ -2475,7 +2476,7 @@ int collect_statistics_for_index(THD *thd, TABLE *table, uint index) if (key_info->flags & HA_FULLTEXT) DBUG_RETURN(rc); - Index_prefix_calc index_prefix_calc(table, key_info); + Index_prefix_calc index_prefix_calc(thd, table, key_info); DEBUG_SYNC(table->in_use, "statistics_collection_start1"); DEBUG_SYNC(table->in_use, "statistics_collection_start2"); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 80d4ec049d8..8ea9db41ce4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -63,7 +63,8 @@ const char *primary_key_name="PRIMARY"; static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end); -static char *make_unique_key_name(const char *field_name,KEY *start,KEY *end); +static char *make_unique_key_name(THD *thd, const char *field_name, KEY *start, + KEY *end); static int copy_data_between_tables(THD *thd, TABLE *from,TABLE *to, List<Create_field> &create, bool ignore, uint order_num, ORDER *order, @@ -71,7 +72,7 @@ static int copy_data_between_tables(THD *thd, TABLE *from,TABLE *to, Alter_info::enum_enable_or_disable keys_onoff, Alter_table_ctx *alter_ctx); -static bool prepare_blob_field(THD *thd, Create_field *sql_field); +static bool prepare_blob_field(THD *thd, Column_definition *sql_field); static int mysql_prepare_create_table(THD *, HA_CREATE_INFO *, Alter_info *, uint *, handler *, KEY **, uint *, int); static uint blob_length_by_type(enum_field_types type); @@ -1813,7 +1814,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) partition_info *part_info= lpt->table->part_info; if (part_info) { - if (!(part_syntax_buf= generate_partition_syntax(part_info, + if (!(part_syntax_buf= generate_partition_syntax(lpt->thd, part_info, &syntax_len, TRUE, TRUE, lpt->create_info, @@ -1896,7 +1897,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) { TABLE_SHARE *share= lpt->table->s; char *tmp_part_syntax_str; - if (!(part_syntax_buf= generate_partition_syntax(part_info, + if (!(part_syntax_buf= generate_partition_syntax(lpt->thd, part_info, &syntax_len, TRUE, TRUE, lpt->create_info, @@ -2875,7 +2876,7 @@ void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval, 1 Error */ -int prepare_create_field(Create_field *sql_field, +int prepare_create_field(Column_definition *sql_field, uint *blob_columns, longlong table_flags) { @@ -3468,7 +3469,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, sql_field->flags= dup_field->flags; sql_field->interval= dup_field->interval; sql_field->vcol_info= dup_field->vcol_info; - sql_field->stored_in_db= dup_field->stored_in_db; it2.remove(); // Remove first (create) definition select_field_pos--; break; @@ -3510,14 +3510,14 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, (virtual fields) and update their offset later (see the next loop). */ - if (sql_field->stored_in_db) + if (sql_field->stored_in_db()) record_offset+= sql_field->pack_length; } /* Update virtual fields' offset*/ it.rewind(); while ((sql_field=it++)) { - if (!sql_field->stored_in_db) + if (!sql_field->stored_in_db()) { sql_field->offset= record_offset; record_offset+= sql_field->pack_length; @@ -3870,7 +3870,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } #endif - if (!sql_field->stored_in_db) + if (!sql_field->stored_in_db()) { /* Key fields must always be physically stored. */ my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0)); @@ -4029,7 +4029,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, primary_key=1; } else if (!(key_name= key->name.str)) - key_name=make_unique_key_name(sql_field->field_name, + key_name=make_unique_key_name(thd, sql_field->field_name, *key_info_buffer, key_info); if (check_if_keyname_exists(key_name, *key_info_buffer, key_info)) { @@ -4238,7 +4238,7 @@ static void set_table_default_charset(THD *thd, In this case the error is given */ -static bool prepare_blob_field(THD *thd, Create_field *sql_field) +static bool prepare_blob_field(THD *thd, Column_definition *sql_field) { DBUG_ENTER("prepare_blob_field"); @@ -4297,7 +4297,7 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field) */ -void sp_prepare_create_field(THD *thd, Create_field *sql_field) +void sp_prepare_create_field(THD *thd, Column_definition *sql_field) { if (sql_field->sql_type == MYSQL_TYPE_SET || sql_field->sql_type == MYSQL_TYPE_ENUM) @@ -4479,7 +4479,7 @@ handler *mysql_create_frm_image(THD *thd, We reverse the partitioning parser and generate a standard format for syntax stored in frm file. */ - if (!(part_syntax_buf= generate_partition_syntax(part_info, + if (!(part_syntax_buf= generate_partition_syntax(thd, part_info, &syntax_len, TRUE, TRUE, create_info, @@ -5071,7 +5071,7 @@ check_if_keyname_exists(const char *name, KEY *start, KEY *end) static char * -make_unique_key_name(const char *field_name,KEY *start,KEY *end) +make_unique_key_name(THD *thd, const char *field_name,KEY *start,KEY *end) { char buff[MAX_FIELD_NAME],*buff_end; @@ -5089,7 +5089,7 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end) *buff_end= '_'; int10_to_str(i, buff_end+1, 10); if (!check_if_keyname_exists(buff,start,end)) - return sql_strdup(buff); + return thd->strdup(buff); } return (char*) "not_specified"; // Should never happen } @@ -6242,18 +6242,6 @@ static bool fill_alter_inplace_info(THD *thd, ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; } - /* - Check if the altered column is computed and either - is stored or is used in the partitioning expression. - TODO: Mark such a column with an alter flag only if - the defining expression has changed. - */ - if (field->vcol_info && - (field->stored_in_db || field->vcol_info->is_in_partitioning_expr())) - { - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; - } - /* Check if field was renamed */ if (my_strcasecmp(system_charset_info, field->field_name, new_field->field_name)) @@ -6320,20 +6308,29 @@ static bool fill_alter_inplace_info(THD *thd, new_field_it.init(alter_info->create_list); while ((new_field= new_field_it++)) { - if (! new_field->field) + Virtual_column_info *vcol_info; + if (new_field->field) + vcol_info= new_field->field->vcol_info; + else { + vcol_info= new_field->vcol_info; /* Field is not present in old version of table and therefore was added. Again corresponding storage engine flag should be already set. */ DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN); + } - if (new_field->vcol_info && - (new_field->stored_in_db || new_field->vcol_info->is_in_partitioning_expr())) - { - ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; - } - break; + /* + Check if the altered column is computed and either + is stored or is used in the partitioning expression. + TODO: Mark such a column with an alter flag only if + the defining expression has changed. + */ + if (vcol_info && + (vcol_info->stored_in_db || vcol_info->is_in_partitioning_expr())) + { + ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; } } @@ -7396,7 +7393,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, of the list for now. Their positions will be corrected later. */ new_create_list.push_back(def, thd->mem_root); - if (field->stored_in_db != def->stored_in_db) + if (field->stored_in_db() != def->stored_in_db()) { my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN, MYF(0)); goto err; diff --git a/sql/sql_table.h b/sql/sql_table.h index a8124177840..109da541a28 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -23,6 +23,7 @@ class Alter_info; class Alter_table_ctx; +class Column_definition; class Create_field; struct TABLE_LIST; class THD; @@ -249,8 +250,8 @@ bool log_drop_table(THD *thd, const char *db_name, size_t db_name_length, bool quick_rm_table(THD *thd, handlerton *base, const char *db, const char *table_name, uint flags); void close_cached_table(THD *thd, TABLE *table); -void sp_prepare_create_field(THD *thd, Create_field *sql_field); -int prepare_create_field(Create_field *sql_field, +void sp_prepare_create_field(THD *thd, Column_definition *sql_field); +int prepare_create_field(Column_definition *sql_field, uint *blob_columns, longlong table_flags); CHARSET_INFO* get_sql_field_charset(Create_field *sql_field, diff --git a/sql/sql_test.h b/sql/sql_test.h index 3c1ee188eeb..867582a9569 100644 --- a/sql/sql_test.h +++ b/sql/sql_test.h @@ -22,7 +22,7 @@ class JOIN; struct TABLE_LIST; typedef class Item COND; typedef class st_select_lex SELECT_LEX; -typedef struct st_sort_field SORT_FIELD; +struct SORT_FIELD; #ifndef DBUG_OFF void print_where(COND *cond,const char *info, enum_query_type query_type); diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 7d52419ae18..4e492e7099d 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -16,6 +16,9 @@ #include "sql_type.h" #include "sql_const.h" +#include "sql_class.h" +#include "item.h" +#include "log.h" static Type_handler_tiny type_handler_tiny; static Type_handler_short type_handler_short; @@ -27,9 +30,13 @@ static Type_handler_bit type_handler_bit; static Type_handler_float type_handler_float; static Type_handler_double type_handler_double; static Type_handler_time type_handler_time; +static Type_handler_time2 type_handler_time2; static Type_handler_date type_handler_date; +static Type_handler_newdate type_handler_newdate; static Type_handler_datetime type_handler_datetime; +static Type_handler_datetime2 type_handler_datetime2; static Type_handler_timestamp type_handler_timestamp; +static Type_handler_timestamp2 type_handler_timestamp2; static Type_handler_olddecimal type_handler_olddecimal; static Type_handler_newdecimal type_handler_newdecimal; static Type_handler_null type_handler_null; @@ -39,7 +46,11 @@ static Type_handler_tiny_blob type_handler_tiny_blob; static Type_handler_medium_blob type_handler_medium_blob; static Type_handler_long_blob type_handler_long_blob; static Type_handler_blob type_handler_blob; +#ifdef HAVE_SPATIAL static Type_handler_geometry type_handler_geometry; +#endif +static Type_handler_enum type_handler_enum; +static Type_handler_set type_handler_set; /** @@ -111,8 +122,7 @@ Type_handler_hybrid_field_type::Type_handler_hybrid_field_type() const Type_handler * -Type_handler_hybrid_field_type::get_handler_by_field_type(enum_field_types type) - const +Type_handler::get_handler_by_field_type(enum_field_types type) { switch (type) { case MYSQL_TYPE_DECIMAL: return &type_handler_olddecimal; @@ -127,7 +137,7 @@ Type_handler_hybrid_field_type::get_handler_by_field_type(enum_field_types type) case MYSQL_TYPE_FLOAT: return &type_handler_float; case MYSQL_TYPE_DOUBLE: return &type_handler_double; case MYSQL_TYPE_NULL: return &type_handler_null; - case MYSQL_TYPE_VARCHAR: return &type_handler_varchar; + case MYSQL_TYPE_VARCHAR: return &type_handler_varchar; case MYSQL_TYPE_TINY_BLOB: return &type_handler_tiny_blob; case MYSQL_TYPE_MEDIUM_BLOB: return &type_handler_medium_blob; case MYSQL_TYPE_LONG_BLOB: return &type_handler_long_blob; @@ -136,17 +146,501 @@ Type_handler_hybrid_field_type::get_handler_by_field_type(enum_field_types type) case MYSQL_TYPE_STRING: return &type_handler_string; case MYSQL_TYPE_ENUM: return &type_handler_varchar; // Map to VARCHAR case MYSQL_TYPE_SET: return &type_handler_varchar; // Map to VARCHAR - case MYSQL_TYPE_GEOMETRY: return &type_handler_geometry; + case MYSQL_TYPE_GEOMETRY: +#ifdef HAVE_SPATIAL + return &type_handler_geometry; +#else + return NULL; +#endif + case MYSQL_TYPE_TIMESTAMP: return &type_handler_timestamp2;// Map to timestamp2 + case MYSQL_TYPE_TIMESTAMP2: return &type_handler_timestamp2; + case MYSQL_TYPE_DATE: return &type_handler_newdate; // Map to newdate + case MYSQL_TYPE_TIME: return &type_handler_time2; // Map to time2 + case MYSQL_TYPE_TIME2: return &type_handler_time2; + case MYSQL_TYPE_DATETIME: return &type_handler_datetime2; // Map to datetime2 + case MYSQL_TYPE_DATETIME2: return &type_handler_datetime2; + case MYSQL_TYPE_NEWDATE: + /* + NEWDATE is actually a real_type(), not a field_type(), + but it's used around the code in field_type() context. + We should probably clean up the code not to use MYSQL_TYPE_NEWDATE + in field_type() context and add DBUG_ASSERT(0) here. + */ + return &type_handler_newdate; + }; + DBUG_ASSERT(0); + return &type_handler_string; +} + + +const Type_handler * +Type_handler::get_handler_by_real_type(enum_field_types type) +{ + switch (type) { + case MYSQL_TYPE_DECIMAL: return &type_handler_olddecimal; + case MYSQL_TYPE_NEWDECIMAL: return &type_handler_newdecimal; + case MYSQL_TYPE_TINY: return &type_handler_tiny; + case MYSQL_TYPE_SHORT: return &type_handler_short; + case MYSQL_TYPE_LONG: return &type_handler_long; + case MYSQL_TYPE_LONGLONG: return &type_handler_longlong; + case MYSQL_TYPE_INT24: return &type_handler_int24; + case MYSQL_TYPE_YEAR: return &type_handler_year; + case MYSQL_TYPE_BIT: return &type_handler_bit; + case MYSQL_TYPE_FLOAT: return &type_handler_float; + case MYSQL_TYPE_DOUBLE: return &type_handler_double; + case MYSQL_TYPE_NULL: return &type_handler_null; + case MYSQL_TYPE_VARCHAR: return &type_handler_varchar; + case MYSQL_TYPE_TINY_BLOB: return &type_handler_tiny_blob; + case MYSQL_TYPE_MEDIUM_BLOB: return &type_handler_medium_blob; + case MYSQL_TYPE_LONG_BLOB: return &type_handler_long_blob; + case MYSQL_TYPE_BLOB: return &type_handler_blob; + case MYSQL_TYPE_VAR_STRING: + /* + VAR_STRING is actually a field_type(), not a real_type(), + but it's used around the code in real_type() context. + We should clean up the code and add DBUG_ASSERT(0) here. + */ + return &type_handler_string; + case MYSQL_TYPE_STRING: return &type_handler_string; + case MYSQL_TYPE_ENUM: return &type_handler_enum; + case MYSQL_TYPE_SET: return &type_handler_set; + case MYSQL_TYPE_GEOMETRY: +#ifdef HAVE_SPATIAL + return &type_handler_geometry; +#else + return NULL; +#endif case MYSQL_TYPE_TIMESTAMP: return &type_handler_timestamp; - case MYSQL_TYPE_TIMESTAMP2: return &type_handler_timestamp; + case MYSQL_TYPE_TIMESTAMP2: return &type_handler_timestamp2; case MYSQL_TYPE_DATE: return &type_handler_date; case MYSQL_TYPE_TIME: return &type_handler_time; - case MYSQL_TYPE_TIME2: return &type_handler_time; + case MYSQL_TYPE_TIME2: return &type_handler_time2; case MYSQL_TYPE_DATETIME: return &type_handler_datetime; - case MYSQL_TYPE_DATETIME2: return &type_handler_datetime; - case MYSQL_TYPE_NEWDATE: return &type_handler_date; + case MYSQL_TYPE_DATETIME2: return &type_handler_datetime2; + case MYSQL_TYPE_NEWDATE: return &type_handler_newdate; }; DBUG_ASSERT(0); return &type_handler_string; } + +/** + Create a DOUBLE field by default. +*/ +Field * +Type_handler::make_num_distinct_aggregator_field(MEM_ROOT *mem_root, + const Item *item) const +{ + return new(mem_root) + Field_double(NULL, item->max_length, + (uchar *) (item->maybe_null ? "" : 0), + item->maybe_null ? 1 : 0, Field::NONE, + item->name, item->decimals, 0, item->unsigned_flag); +} + + +Field * +Type_handler_float::make_num_distinct_aggregator_field(MEM_ROOT *mem_root, + const Item *item) + const +{ + return new(mem_root) + Field_float(NULL, item->max_length, + (uchar *) (item->maybe_null ? "" : 0), + item->maybe_null ? 1 : 0, Field::NONE, + item->name, item->decimals, 0, item->unsigned_flag); +} + + +Field * +Type_handler_decimal_result::make_num_distinct_aggregator_field( + MEM_ROOT *mem_root, + const Item *item) + const +{ + DBUG_ASSERT(item->decimals <= DECIMAL_MAX_SCALE); + return new (mem_root) + Field_new_decimal(NULL, item->max_length, + (uchar *) (item->maybe_null ? "" : 0), + item->maybe_null ? 1 : 0, Field::NONE, + item->name, item->decimals, 0, item->unsigned_flag); +} + + +Field * +Type_handler_int_result::make_num_distinct_aggregator_field(MEM_ROOT *mem_root, + const Item *item) + const +{ + /** + Make a longlong field for all INT-alike types. It could create + smaller fields for TINYINT, SMALLINT, MEDIUMINT, INT though. + */ + return new(mem_root) + Field_longlong(NULL, item->max_length, + (uchar *) (item->maybe_null ? "" : 0), + item->maybe_null ? 1 : 0, Field::NONE, + item->name, 0, item->unsigned_flag); +} + + +/***********************************************************************/ + +#define TMPNAME "" + +Field *Type_handler_tiny::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + /* + As we don't know if the integer was signed or not on the master, + assume we have same sign on master and slave. This is true when not + using conversions so it should be true also when using conversions. + */ + bool unsigned_flag= ((Field_num*) target)->unsigned_flag; + return new (table->in_use->mem_root) + Field_tiny(NULL, 4 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*zerofill*/, unsigned_flag); +} + + +Field *Type_handler_short::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + bool unsigned_flag= ((Field_num*) target)->unsigned_flag; + return new (table->in_use->mem_root) + Field_short(NULL, 6 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*zerofill*/, unsigned_flag); +} + + +Field *Type_handler_int24::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + bool unsigned_flag= ((Field_num*) target)->unsigned_flag; + return new (table->in_use->mem_root) + Field_medium(NULL, 9 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*zerofill*/, unsigned_flag); +} + + +Field *Type_handler_long::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + bool unsigned_flag= ((Field_num*) target)->unsigned_flag; + return new (table->in_use->mem_root) + Field_long(NULL, 11 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*zerofill*/, unsigned_flag); +} + + +Field *Type_handler_longlong::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + bool unsigned_flag= ((Field_num*) target)->unsigned_flag; + return new (table->in_use->mem_root) + Field_longlong(NULL, 20 /*max_length*/,(uchar *) "", 1, Field::NONE, + TMPNAME, 0/*zerofill*/, unsigned_flag); +} + + + +Field *Type_handler_float::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new (table->in_use->mem_root) + Field_float(NULL, 12 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*dec*/, 0/*zerofill*/, 0/*unsigned_flag*/); +} + + +Field *Type_handler_double::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new (table->in_use->mem_root) + Field_double(NULL, 22 /*max_length*/, (uchar *) "", 1, Field::NONE, + TMPNAME, 0/*dec*/, 0/*zerofill*/, 0/*unsigned_flag*/); +} + + +Field *Type_handler_newdecimal::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + int precision= metadata >> 8; + uint decimals= metadata & 0x00ff; + uint32 max_length= my_decimal_precision_to_length(precision, decimals, false); + DBUG_ASSERT(decimals <= DECIMAL_MAX_SCALE); + return new (table->in_use->mem_root) + Field_new_decimal(NULL, max_length, (uchar *) "", 1, Field::NONE, + TMPNAME, decimals, 0/*zerofill*/, 0/*unsigned*/); +} + + +Field *Type_handler_olddecimal::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + sql_print_error("In RBR mode, Slave received incompatible DECIMAL field " + "(old-style decimal field) from Master while creating " + "conversion table. Please consider changing datatype on " + "Master to new style decimal by executing ALTER command for" + " column Name: %s.%s.%s.", + target->table->s->db.str, + target->table->s->table_name.str, + target->field_name); + return NULL; +} + + +Field *Type_handler_year::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_year(NULL, 4, (uchar *) "", 1, Field::NONE, TMPNAME); +} + + +Field *Type_handler_null::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_null(NULL, 0, Field::NONE, TMPNAME, target->charset()); +} + + +Field *Type_handler_timestamp::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + // We assume TIMESTAMP(0) + return new(table->in_use->mem_root) + Field_timestamp(NULL, MAX_DATETIME_WIDTH, (uchar *) "", 1, + Field::NONE, TMPNAME, table->s); +} + + +Field *Type_handler_timestamp2::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_timestampf(NULL, (uchar *) "", 1, Field::NONE, + TMPNAME, table->s, metadata); +} + + +Field *Type_handler_newdate::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_newdate(NULL, (uchar *) "", 1, Field::NONE, TMPNAME); +} + + +Field *Type_handler_date::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_date(NULL, (uchar *) "", 1, Field::NONE, TMPNAME); +} + + +Field *Type_handler_time::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_time(NULL, MAX_TIME_WIDTH, (uchar *) "", 1, + Field::NONE, TMPNAME); +} + + +Field *Type_handler_time2::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_timef(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, metadata); +} + + +Field *Type_handler_datetime::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_datetime(NULL, MAX_DATETIME_WIDTH, (uchar *) "", 1, + Field::NONE, TMPNAME); +} + + +Field *Type_handler_datetime2::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_datetimef(NULL, (uchar *) "", 1, + Field::NONE, TMPNAME, metadata); +} + + +Field *Type_handler_bit::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + DBUG_ASSERT((metadata & 0xff) <= 7); + uint32 max_length= 8 * (metadata >> 8U) + (metadata & 0x00ff); + return new(table->in_use->mem_root) + Field_bit_as_char(NULL, max_length, (uchar *) "", 1, + Field::NONE, TMPNAME); +} + + +Field *Type_handler_string::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + /* This is taken from Field_string::unpack. */ + uint32 max_length= (((metadata >> 4) & 0x300) ^ 0x300) + (metadata & 0x00ff); + return new(table->in_use->mem_root) + Field_string(NULL, max_length, (uchar *) "", 1, + Field::NONE, TMPNAME, target->charset()); +} + + +Field *Type_handler_varchar::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_varstring(NULL, metadata, HA_VARCHAR_PACKLENGTH(metadata), + (uchar *) "", 1, Field::NONE, TMPNAME, + table->s, target->charset()); +} + + +Field *Type_handler_tiny_blob::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, + table->s, 1, target->charset()); +} + + +Field *Type_handler_blob::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, + table->s, 2, target->charset()); +} + + +Field *Type_handler_medium_blob::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, + table->s, 3, target->charset()); +} + + +Field *Type_handler_long_blob::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + return new(table->in_use->mem_root) + Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, + table->s, 4, target->charset()); +} + + +#ifdef HAVE_SPATIAL +Field *Type_handler_geometry::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + DBUG_ASSERT(target->type() == MYSQL_TYPE_GEOMETRY); + /* + We do not do not update feature_gis statistics here: + status_var_increment(target->table->in_use->status_var.feature_gis); + as this is only a temporary field. + The statistics was already incremented when "target" was created. + */ + return new(table->in_use->mem_root) + Field_geom(NULL, (uchar *) "", 1, Field::NONE, TMPNAME, table->s, 4, + ((const Field_geom*) target)->geom_type, + ((const Field_geom*) target)->srid); +} +#endif + +Field *Type_handler_enum::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + DBUG_ASSERT(target->type() == MYSQL_TYPE_STRING); + DBUG_ASSERT(target->real_type() == MYSQL_TYPE_ENUM); + return new(table->in_use->mem_root) + Field_enum(NULL, target->field_length, + (uchar *) "", 1, Field::NONE, TMPNAME, + metadata & 0x00ff/*pack_length()*/, + ((const Field_enum*) target)->typelib, target->charset()); +} + + +Field *Type_handler_set::make_conversion_table_field(TABLE *table, + uint metadata, + const Field *target) + const +{ + DBUG_ASSERT(target->type() == MYSQL_TYPE_STRING); + DBUG_ASSERT(target->real_type() == MYSQL_TYPE_SET); + return new(table->in_use->mem_root) + Field_set(NULL, target->field_length, + (uchar *) "", 1, Field::NONE, TMPNAME, + metadata & 0x00ff/*pack_length()*/, + ((const Field_enum*) target)->typelib, target->charset()); +} diff --git a/sql/sql_type.h b/sql/sql_type.h index f5a42e8d97d..596c338720e 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -23,12 +23,26 @@ #include "mysqld.h" +class Field; +class Item; +class Type_std_attributes; +class Sort_param; +struct TABLE; +struct SORT_FIELD_ATTR; + class Type_handler { protected: const Type_handler *string_type_handler(uint max_octet_length) const; + void make_sort_key_longlong(uchar *to, + bool maybe_null, bool null_value, + bool unsigned_flag, + longlong value) const; public: + static const Type_handler *get_handler_by_field_type(enum_field_types type); + static const Type_handler *get_handler_by_real_type(enum_field_types type); virtual enum_field_types field_type() const= 0; + virtual enum_field_types real_field_type() const { return field_type(); } virtual Item_result result_type() const= 0; virtual Item_result cmp_type() const= 0; virtual const Type_handler* @@ -36,6 +50,48 @@ public: CHARSET_INFO *cs) const { return this; } virtual ~Type_handler() {} + /** + Makes a temporary table Field to handle numeric aggregate functions, + e.g. SUM(DISTINCT expr), AVG(DISTINCT expr), etc. + */ + virtual Field *make_num_distinct_aggregator_field(MEM_ROOT *, + const Item *) const; + /** + Makes a temporary table Field to handle RBR replication type conversion. + @param TABLE - The conversion table the field is going to be added to. + It's used to access to table->in_use->mem_root, + to create the new field on the table memory root, + as well as to increment statistics in table->share + (e.g. table->s->blob_count). + @param metadata - Metadata from the binary log. + @param target - The field in the target table on the slave. + + Note, the data types of "target" and of "this" are not necessarily + always the same, in general case it's possible that: + this->field_type() != target->field_type() + and/or + this->real_type( ) != target->real_type() + + This method decodes metadata according to this->real_type() + and creates a new field also according to this->real_type(). + + In some cases it lurks into "target", to get some extra information, e.g.: + - unsigned_flag for numeric fields + - charset() for string fields + - typelib and field_length for SET and ENUM + - geom_type and srid for GEOMETRY + This information is not available in the binary log, so + we assume that these fields are the same on the master and on the slave. + */ + virtual Field *make_conversion_table_field(TABLE *TABLE, + uint metadata, + const Field *target) const= 0; + virtual void make_sort_key(uchar *to, Item *item, + const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const= 0; + virtual void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const= 0; }; @@ -47,6 +103,11 @@ public: Item_result result_type() const { return REAL_RESULT; } Item_result cmp_type() const { return REAL_RESULT; } virtual ~Type_handler_real_result() {} + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const; + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const; }; @@ -56,6 +117,12 @@ public: Item_result result_type() const { return DECIMAL_RESULT; } Item_result cmp_type() const { return DECIMAL_RESULT; } virtual ~Type_handler_decimal_result() {}; + Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const; + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const; }; @@ -65,6 +132,12 @@ public: Item_result result_type() const { return INT_RESULT; } Item_result cmp_type() const { return INT_RESULT; } virtual ~Type_handler_int_result() {} + Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const; + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const; }; @@ -74,6 +147,11 @@ public: Item_result result_type() const { return STRING_RESULT; } Item_result cmp_type() const { return TIME_RESULT; } virtual ~Type_handler_temporal_result() {} + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const; + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const; }; @@ -86,6 +164,11 @@ public: const Type_handler * type_handler_adjusted_to_max_octet_length(uint max_octet_length, CHARSET_INFO *cs) const; + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const; + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const; }; @@ -114,6 +197,8 @@ class Type_handler_tiny: public Type_handler_int_result public: virtual ~Type_handler_tiny() {} enum_field_types field_type() const { return MYSQL_TYPE_TINY; } + Field *make_conversion_table_field(TABLE *TABLE, uint metadata, + const Field *target) const; }; @@ -122,6 +207,8 @@ class Type_handler_short: public Type_handler_int_result public: virtual ~Type_handler_short() {} enum_field_types field_type() const { return MYSQL_TYPE_SHORT; } + Field *make_conversion_table_field(TABLE *TABLE, uint metadata, + const Field *target) const; }; @@ -130,6 +217,8 @@ class Type_handler_long: public Type_handler_int_result public: virtual ~Type_handler_long() {} enum_field_types field_type() const { return MYSQL_TYPE_LONG; } + Field *make_conversion_table_field(TABLE *TABLE, uint metadata, + const Field *target) const; }; @@ -138,6 +227,8 @@ class Type_handler_longlong: public Type_handler_int_result public: virtual ~Type_handler_longlong() {} enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } + Field *make_conversion_table_field(TABLE *TABLE, uint metadata, + const Field *target) const; }; @@ -146,6 +237,8 @@ class Type_handler_int24: public Type_handler_int_result public: virtual ~Type_handler_int24() {} enum_field_types field_type() const { return MYSQL_TYPE_INT24; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -154,6 +247,8 @@ class Type_handler_year: public Type_handler_int_result public: virtual ~Type_handler_year() {} enum_field_types field_type() const { return MYSQL_TYPE_YEAR; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -162,6 +257,8 @@ class Type_handler_bit: public Type_handler_int_result public: virtual ~Type_handler_bit() {} enum_field_types field_type() const { return MYSQL_TYPE_BIT; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -170,6 +267,9 @@ class Type_handler_float: public Type_handler_real_result public: virtual ~Type_handler_float() {} enum_field_types field_type() const { return MYSQL_TYPE_FLOAT; } + Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -178,6 +278,8 @@ class Type_handler_double: public Type_handler_real_result public: virtual ~Type_handler_double() {} enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -186,6 +288,19 @@ class Type_handler_time: public Type_handler_temporal_result public: virtual ~Type_handler_time() {} enum_field_types field_type() const { return MYSQL_TYPE_TIME; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; + + +class Type_handler_time2: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_time2() {} + enum_field_types field_type() const { return MYSQL_TYPE_TIME; } + enum_field_types real_field_type() const { return MYSQL_TYPE_TIME2; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -194,6 +309,18 @@ class Type_handler_date: public Type_handler_temporal_result public: virtual ~Type_handler_date() {} enum_field_types field_type() const { return MYSQL_TYPE_DATE; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; + + +class Type_handler_newdate: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_newdate() {} + enum_field_types field_type() const { return MYSQL_TYPE_DATE; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -202,6 +329,19 @@ class Type_handler_datetime: public Type_handler_temporal_result public: virtual ~Type_handler_datetime() {} enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; + + +class Type_handler_datetime2: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_datetime2() {} + enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } + enum_field_types real_field_type() const { return MYSQL_TYPE_DATETIME2; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -210,6 +350,19 @@ class Type_handler_timestamp: public Type_handler_temporal_result public: virtual ~Type_handler_timestamp() {} enum_field_types field_type() const { return MYSQL_TYPE_TIMESTAMP; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; + + +class Type_handler_timestamp2: public Type_handler_temporal_result +{ +public: + virtual ~Type_handler_timestamp2() {} + enum_field_types field_type() const { return MYSQL_TYPE_TIMESTAMP; } + enum_field_types real_field_type() const { return MYSQL_TYPE_TIMESTAMP2; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -218,6 +371,8 @@ class Type_handler_olddecimal: public Type_handler_decimal_result public: virtual ~Type_handler_olddecimal() {} enum_field_types field_type() const { return MYSQL_TYPE_DECIMAL; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -226,6 +381,8 @@ class Type_handler_newdecimal: public Type_handler_decimal_result public: virtual ~Type_handler_newdecimal() {} enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -234,6 +391,8 @@ class Type_handler_null: public Type_handler_string_result public: virtual ~Type_handler_null() {} enum_field_types field_type() const { return MYSQL_TYPE_NULL; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -242,6 +401,8 @@ class Type_handler_string: public Type_handler_string_result public: virtual ~Type_handler_string() {} enum_field_types field_type() const { return MYSQL_TYPE_STRING; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -250,6 +411,8 @@ class Type_handler_varchar: public Type_handler_string_result public: virtual ~Type_handler_varchar() {} enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -258,6 +421,8 @@ class Type_handler_tiny_blob: public Type_handler_string_result public: virtual ~Type_handler_tiny_blob() {} enum_field_types field_type() const { return MYSQL_TYPE_TINY_BLOB; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -266,6 +431,8 @@ class Type_handler_medium_blob: public Type_handler_string_result public: virtual ~Type_handler_medium_blob() {} enum_field_types field_type() const { return MYSQL_TYPE_MEDIUM_BLOB; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -274,6 +441,8 @@ class Type_handler_long_blob: public Type_handler_string_result public: virtual ~Type_handler_long_blob() {} enum_field_types field_type() const { return MYSQL_TYPE_LONG_BLOB; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -282,14 +451,42 @@ class Type_handler_blob: public Type_handler_string_result public: virtual ~Type_handler_blob() {} enum_field_types field_type() const { return MYSQL_TYPE_BLOB; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; +#ifdef HAVE_SPATIAL class Type_handler_geometry: public Type_handler_string_result { public: virtual ~Type_handler_geometry() {} enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; +#endif + + +class Type_handler_enum: public Type_handler_string_result +{ +public: + virtual ~Type_handler_enum() {} + enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } + virtual enum_field_types real_field_type() const { return MYSQL_TYPE_ENUM; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; +}; + + +class Type_handler_set: public Type_handler_string_result +{ +public: + virtual ~Type_handler_set() {} + enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } + virtual enum_field_types real_field_type() const { return MYSQL_TYPE_SET; } + Field *make_conversion_table_field(TABLE *, uint metadata, + const Field *target) const; }; @@ -306,9 +503,11 @@ class Type_handler_hybrid_field_type: public Type_handler { const Type_handler *m_type_handler; const Type_handler *get_handler_by_result_type(Item_result type) const; - const Type_handler *get_handler_by_field_type(enum_field_types type) const; public: Type_handler_hybrid_field_type(); + Type_handler_hybrid_field_type(const Type_handler *handler) + :m_type_handler(handler) + { } Type_handler_hybrid_field_type(enum_field_types type) :m_type_handler(get_handler_by_field_type(type)) { } @@ -316,8 +515,16 @@ public: :m_type_handler(other->m_type_handler) { } enum_field_types field_type() const { return m_type_handler->field_type(); } + enum_field_types real_field_type() const + { + return m_type_handler->real_field_type(); + } Item_result result_type() const { return m_type_handler->result_type(); } Item_result cmp_type() const { return m_type_handler->cmp_type(); } + void set_handler(const Type_handler *other) + { + m_type_handler= other; + } const Type_handler *set_handler_by_result_type(Item_result type) { return (m_type_handler= get_handler_by_result_type(type)); @@ -335,6 +542,10 @@ public: { return (m_type_handler= get_handler_by_field_type(type)); } + const Type_handler *set_handler_by_real_type(enum_field_types type) + { + return (m_type_handler= get_handler_by_real_type(type)); + } const Type_handler * type_handler_adjusted_to_max_octet_length(uint max_octet_length, CHARSET_INFO *cs) const @@ -343,6 +554,42 @@ public: m_type_handler->type_handler_adjusted_to_max_octet_length(max_octet_length, cs); } + Field *make_num_distinct_aggregator_field(MEM_ROOT *mem_root, + const Item *item) const + { + return m_type_handler->make_num_distinct_aggregator_field(mem_root, item); + } + Field *make_conversion_table_field(TABLE *table, uint metadata, + const Field *target) const + { + return m_type_handler->make_conversion_table_field(table, metadata, target); + } + void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, + Sort_param *param) const + { + m_type_handler->make_sort_key(to, item, sort_field, param); + } + void sortlength(THD *thd, + const Type_std_attributes *item, + SORT_FIELD_ATTR *attr) const + { + m_type_handler->sortlength(thd, item, attr); + } + }; + +/** + This class is used for Item_type_holder, which preserves real_type. +*/ +class Type_handler_hybrid_real_field_type: + public Type_handler_hybrid_field_type +{ +public: + Type_handler_hybrid_real_field_type(enum_field_types type) + :Type_handler_hybrid_field_type(get_handler_by_real_type(type)) + { } +}; + + #endif /* SQL_TYPE_H_INCLUDED */ diff --git a/sql/sql_union.cc b/sql/sql_union.cc index c8350838ee8..069eadc7519 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -534,7 +534,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, while ((type= tp++)) { - if (type->result_type() == STRING_RESULT && + if (type->cmp_type() == STRING_RESULT && type->collation.derivation == DERIVATION_NONE) { my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION"); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 85189fa481f..62e6790a142 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -58,7 +58,7 @@ static int mysql_register_view(THD *, TABLE_LIST *, enum_view_create_mode); NAME_LEN, it is truncated. */ -static void make_unique_view_field_name(Item *target, +static void make_unique_view_field_name(THD *thd, Item *target, List<Item> &item_list, Item *last_element) { @@ -96,7 +96,7 @@ static void make_unique_view_field_name(Item *target, } target->orig_name= target->name; - target->set_name(buff, name_len, system_charset_info); + target->set_name(thd, buff, name_len, system_charset_info); } @@ -123,7 +123,7 @@ static void make_unique_view_field_name(Item *target, isn't allowed */ -bool check_duplicate_names(List<Item> &item_list, bool gen_unique_view_name) +bool check_duplicate_names(THD *thd, List<Item> &item_list, bool gen_unique_view_name) { Item *item; List_iterator_fast<Item> it(item_list); @@ -144,9 +144,9 @@ bool check_duplicate_names(List<Item> &item_list, bool gen_unique_view_name) if (!gen_unique_view_name) goto err; if (item->is_autogenerated_name) - make_unique_view_field_name(item, item_list, item); + make_unique_view_field_name(thd, item, item_list, item); else if (check->is_autogenerated_name) - make_unique_view_field_name(check, item_list, item); + make_unique_view_field_name(thd, check, item_list, item); else goto err; } @@ -167,7 +167,7 @@ err: @param item_list List of Items which should be checked */ -static void make_valid_column_names(List<Item> &item_list) +static void make_valid_column_names(THD *thd, List<Item> &item_list) { Item *item; uint name_len; @@ -181,7 +181,7 @@ static void make_valid_column_names(List<Item> &item_list) continue; name_len= my_snprintf(buff, NAME_LEN, "Name_exp_%u", column_no); item->orig_name= item->name; - item->set_name(buff, name_len, system_charset_info); + item->set_name(thd, buff, name_len, system_charset_info); } DBUG_VOID_RETURN; @@ -539,16 +539,16 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, } while ((item= it++, name= nm++)) { - item->set_name(name->str, (uint) name->length, system_charset_info); + item->set_name(thd, name->str, (uint) name->length, system_charset_info); item->is_autogenerated_name= FALSE; } } /* Check if the auto generated column names are conforming. */ for (sl= select_lex; sl; sl= sl->next_select()) - make_valid_column_names(sl->item_list); + make_valid_column_names(thd, sl->item_list); - if (check_duplicate_names(select_lex->item_list, 1)) + if (check_duplicate_names(thd, select_lex->item_list, 1)) { res= TRUE; goto err; diff --git a/sql/sql_view.h b/sql/sql_view.h index ce83dc656ad..9c75643fd48 100644 --- a/sql/sql_view.h +++ b/sql/sql_view.h @@ -51,7 +51,8 @@ int view_repair(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt); extern TYPELIB updatable_views_with_limit_typelib; -bool check_duplicate_names(List<Item>& item_list, bool gen_unique_view_names); +bool check_duplicate_names(THD *thd, List<Item>& item_list, + bool gen_unique_view_names); bool mysql_rename_view(THD *thd, const char *new_db, const char *new_name, TABLE_LIST *view); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e857a3b633a..1899dd60f88 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -346,7 +346,7 @@ int case_stmt_action_when(LEX *lex, Item *when, bool simple) */ return !MY_TEST(i) || - sp->push_backpatch(i, ctx->push_label(thd, empty_lex_str, 0)) || + sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0)) || sp->add_cont_backpatch(i) || sp->add_instr(i); } @@ -380,7 +380,7 @@ int case_stmt_action_then(LEX *lex) (jump from instruction 4 to 12, 7 to 12 ... in the example) */ - return sp->push_backpatch(i, ctx->last_label()); + return sp->push_backpatch(lex->thd, i, ctx->last_label()); } static bool @@ -464,7 +464,8 @@ set_local_variable(THD *thd, sp_variable *spv, Item *val) sp_set= new (thd->mem_root) sp_instr_set(lex->sphead->instructions(), lex->spcont, - spv->offset, it, spv->type, lex, TRUE); + spv->offset, it, spv->sql_type(), + lex, TRUE); return (sp_set == NULL || lex->sphead->add_instr(sp_set)); } @@ -563,7 +564,8 @@ create_item_for_sp_var(THD *thd, LEX_STRING name, sp_variable *spvar, len_in_q= end_in_q - start_in_q; item= new (thd->mem_root) - Item_splocal(thd, name, spvar->offset, spvar->type, pos_in_q, len_in_q); + Item_splocal(thd, name, spvar->offset, spvar->sql_type(), + pos_in_q, len_in_q); #ifndef DBUG_OFF if (item) @@ -882,7 +884,7 @@ static void add_key_to_list(LEX *lex, LEX_STRING *field_name, lex->alter_info.key_list.push_back(key, mem_root); } -void LEX::init_last_field(Create_field *field, const char *field_name, +void LEX::init_last_field(Column_definition *field, const char *field_name, CHARSET_INFO *cs) { last_field= field; @@ -890,28 +892,25 @@ void LEX::init_last_field(Create_field *field, const char *field_name, field->field_name= field_name; /* reset LEX fields that are used in Create_field::set_and_check() */ - length= 0; - dec= 0; charset= cs; } -void LEX::set_last_field_type(enum enum_field_types field_type) +void LEX::set_last_field_type(const Lex_field_type_st &type) { - last_field->sql_type= field_type; - last_field->create_if_not_exists= check_exists; + last_field->sql_type= type.field_type(); last_field->charset= charset; - if (length) + if (type.length()) { int err; - last_field->length= my_strtoll10(length, NULL, &err); + last_field->length= my_strtoll10(type.length(), NULL, &err); if (err) last_field->length= ~0ULL; // safety } else last_field->length= 0; - last_field->decimals= dec ? (uint)atoi(dec) : 0; + last_field->decimals= type.dec() ? (uint)atoi(type.dec()) : 0; } bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) @@ -953,8 +952,13 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) LEX_SYMBOL symbol; struct sys_var_with_base variable; struct { int vars, conds, hndlrs, curs; } spblock; + Lex_length_and_dec_st Lex_length_and_dec; + Lex_cast_type_st Lex_cast_type; + Lex_field_type_st Lex_field_type; + Lex_dyncol_type_st Lex_dyncol_type; /* pointers */ + Create_field *create_field; CHARSET_INFO *charset; Condition_information_item *cond_info_item; DYNCALL_CREATE_DEF *dyncol_def; @@ -976,6 +980,7 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) TABLE_LIST *table_list; Table_ident *table; char *simple_string; + const char *const_simple_string; chooser_compare_func_creator boolfunc2creator; class my_var *myvar; class sp_condition_value *spcondvalue; @@ -989,7 +994,6 @@ bool LEX::set_bincmp(CHARSET_INFO *cs, bool bin) udf_func *udf; /* enums */ - enum Cast_target cast_type; enum Condition_information_item::Name cond_info_item_name; enum enum_diag_condition_item_name diag_condition_item_name; enum Diagnostics_information::Which_area diag_area; @@ -1023,10 +1027,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 160 shift/reduce conflicts. + Currently there are 121 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 162 +%expect 121 /* Comments for TOKENS. @@ -1730,11 +1734,22 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type <simple_string> remember_name remember_end opt_db remember_tok_start wild_and_where + field_length opt_field_length opt_field_length_default_1 + +%type <const_simple_string> + opt_place %type <string> text_string hex_or_bin_String opt_gconcat_separator -%type <field_type> type_with_opt_collate int_type real_type field_type +%type <field_type> int_type real_type + +%type <Lex_field_type> type_with_opt_collate field_type + +%type <Lex_dyncol_type> opt_dyncol_type dyncol_type + numeric_dyncol_type temporal_dyncol_type string_dyncol_type + +%type <create_field> field_spec column_def %type <geom_type> spatial_type @@ -1748,7 +1763,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); opt_natural_language_mode opt_query_expansion opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt - optional_flush_tables_arguments opt_dyncol_type dyncol_type + optional_flush_tables_arguments opt_time_precision kill_type kill_option int_num opt_default_time_precision case_stmt_body opt_bin_mod @@ -1852,7 +1867,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type <ha_rkey_mode> handler_rkey_mode -%type <cast_type> cast_type +%type <Lex_cast_type> cast_type cast_type_numeric cast_type_temporal + +%type <Lex_length_and_dec> precision opt_precision float_options %type <symbol> keyword keyword_sp @@ -1898,7 +1915,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); persistent_column_stat_spec persistent_index_stat_spec table_column_list table_index_list table_index_name check start checksum - field_list field_list_item field_spec kill column_def key_def + field_list field_list_item kill key_def keycache_list keycache_list_or_parts assign_to_keycache assign_to_keycache_parts preload_list preload_list_or_parts preload_keys preload_keys_parts @@ -1906,13 +1923,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); opt_limit_clause delete_limit_clause fields opt_values values procedure_list procedure_list2 procedure_item field_def handler opt_generated_always - opt_precision opt_ignore opt_column opt_restrict + opt_ignore opt_column opt_restrict grant revoke set lock unlock string_list field_options field_option field_opt_list opt_binary table_lock_list table_lock ref_list opt_match_clause opt_on_update_delete use opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name table_alias_ref_list table_alias_ref - opt_place opt_attribute opt_attribute_list attribute column_list column_list_id opt_column_list grant_privileges grant_ident grant_list grant_option object_privilege object_privilege_list user_list user_and_role_list @@ -1925,9 +1941,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); handler_rkey_function handler_read_or_scan single_multi table_wild_list table_wild_one opt_wild union_clause union_list - precision subselect_start opt_and charset + subselect_start opt_and charset subselect_end select_var_list select_var_list_init help - field_length opt_field_length opt_extended_describe shutdown opt_format_json prepare prepare_src execute deallocate @@ -1955,6 +1970,7 @@ END_OF_INPUT %type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt %type <NONE> sp_proc_stmt_statement sp_proc_stmt_return + sp_proc_stmt_in_returns_clause %type <NONE> sp_proc_stmt_compound_ok %type <NONE> sp_proc_stmt_if %type <NONE> sp_labeled_control sp_unlabeled_control @@ -2958,9 +2974,7 @@ sp_param_name_and_type: LEX *lex= Lex; sp_variable *spvar= $<spvar>2; - spvar->type= $3; - if (lex->sphead->fill_field_definition(thd, lex, $3, - lex->last_field)) + if (lex->sphead->fill_field_definition(thd, lex, lex->last_field)) { MYSQL_YYABORT; } @@ -3055,7 +3069,6 @@ sp_decl: LEX *lex= Lex; sp_pcontext *pctx= lex->spcont; uint num_vars= pctx->context_var_count(); - enum enum_field_types var_type= $4; Item *dflt_value_item= $5; if (!dflt_value_item) @@ -3078,11 +3091,10 @@ sp_decl: if (!last) spvar->field_def= *lex->last_field; - spvar->type= var_type; spvar->default_value= dflt_value_item; spvar->field_def.field_name= spvar->name.str; - if (lex->sphead->fill_field_definition(thd, lex, var_type, + if (lex->sphead->fill_field_definition(thd, lex, &spvar->field_def)) { MYSQL_YYABORT; @@ -3097,7 +3109,7 @@ sp_decl: pctx, var_idx, dflt_value_item, - var_type, + $4.field_type(), lex, last)); if (is == NULL || @@ -3147,10 +3159,10 @@ sp_decl: /* For continue handlers, mark end of handler scope. */ if ($2 == sp_handler::CONTINUE && - sp->push_backpatch(i, ctx->last_label())) + sp->push_backpatch(thd, i, ctx->last_label())) MYSQL_YYABORT; - if (sp->push_backpatch(i, ctx->push_label(thd, empty_lex_str, 0))) + if (sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0))) MYSQL_YYABORT; } sp_hcond_list sp_proc_stmt @@ -3175,7 +3187,7 @@ sp_decl: sp_instr_hreturn(sp->instructions(), ctx); if (i == NULL || sp->add_instr(i) || - sp->push_backpatch(i, lex->spcont->last_label())) /* Block end */ + sp->push_backpatch(thd, i, lex->spcont->last_label())) /* Block end */ MYSQL_YYABORT; } lex->sphead->backpatch(hlab); @@ -3682,18 +3694,31 @@ sp_opt_default: | DEFAULT expr { $$ = $2; } ; -sp_proc_stmt: - sp_proc_stmt_statement - | sp_proc_stmt_return +/* + ps_proc_stmt_in_returns_clause is a statement that is allowed + in the RETURNS clause of a stored function definition directly, + without the BEGIN..END block. + It should not include any syntax structures starting with '(', to avoid + shift/reduce conflicts with the rule "field_type" and its sub-rules + that scan an optional length, like CHAR(1) or YEAR(4). + See MDEV-9166. +*/ +sp_proc_stmt_in_returns_clause: + sp_proc_stmt_return | sp_labeled_block | sp_unlabeled_block | sp_labeled_control + | sp_proc_stmt_compound_ok + ; + +sp_proc_stmt: + sp_proc_stmt_in_returns_clause + | sp_proc_stmt_statement | sp_proc_stmt_leave | sp_proc_stmt_iterate | sp_proc_stmt_open | sp_proc_stmt_fetch | sp_proc_stmt_close - | sp_proc_stmt_compound_ok ; sp_proc_stmt_compound_ok: @@ -3847,7 +3872,7 @@ sp_proc_stmt_leave: i= new (lex->thd->mem_root) sp_instr_jump(ip, ctx); if (i == NULL) MYSQL_YYABORT; - sp->push_backpatch(i, lab); /* Jumping forward */ + sp->push_backpatch(thd, i, lab); /* Jumping forward */ sp->add_instr(i); } } @@ -4024,7 +4049,7 @@ sp_if: sp_instr_jump_if_not *i= new (lex->thd->mem_root) sp_instr_jump_if_not(ip, ctx, $2, lex); if (i == NULL || - sp->push_backpatch(i, ctx->push_label(thd, empty_lex_str, 0)) || + sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0)) || sp->add_cont_backpatch(i) || sp->add_instr(i)) MYSQL_YYABORT; @@ -4041,7 +4066,7 @@ sp_if: sp->add_instr(i)) MYSQL_YYABORT; sp->backpatch(ctx->pop_label()); - sp->push_backpatch(i, ctx->push_label(thd, empty_lex_str, 0)); + sp->push_backpatch(thd, i, ctx->push_label(thd, empty_lex_str, 0)); } sp_elseifs { @@ -4332,7 +4357,7 @@ while_body: sp_instr_jump_if_not(ip, lex->spcont, $1, lex); if (i == NULL || /* Jumping forward */ - sp->push_backpatch(i, lex->spcont->last_label()) || + sp->push_backpatch(thd, i, lex->spcont->last_label()) || sp->new_cont_backpatch(i) || sp->add_instr(i)) MYSQL_YYABORT; @@ -5090,7 +5115,7 @@ part_func: '(' remember_name part_func_expr remember_end ')' { partition_info *part_info= Lex->part_info; - if (part_info->set_part_expr($2+1, $3, $4, FALSE)) + if (part_info->set_part_expr(thd, $2 + 1, $3, $4, FALSE)) { MYSQL_YYABORT; } part_info->num_columns= 1; part_info->column_list= FALSE; @@ -5100,7 +5125,7 @@ part_func: sub_part_func: '(' remember_name part_func_expr remember_end ')' { - if (Lex->part_info->set_part_expr($2+1, $3, $4, TRUE)) + if (Lex->part_info->set_part_expr(thd, $2 + 1, $3, $4, TRUE)) { MYSQL_YYABORT; } } ; @@ -6043,13 +6068,13 @@ field_list: ; field_list_item: - column_def + column_def { } | key_def ; column_def: - field_spec opt_check_constraint - | field_spec references + field_spec opt_check_constraint { $$= $1; } + | field_spec references { $$= $1; } ; key_def: @@ -6171,21 +6196,23 @@ field_spec: MYSQL_YYABORT; lex->init_last_field(f, $1.str, NULL); + $<create_field>$= f; } field_type { Lex->set_last_field_type($3); } field_def { LEX *lex=Lex; - Create_field *f= lex->last_field; + $$= $<create_field>2; - if (f->check(thd)) + if ($$->check(thd)) MYSQL_YYABORT; - lex->alter_info.create_list.push_back(f, thd->mem_root); + lex->alter_info.create_list.push_back($$, thd->mem_root); - if (f->flags & PRI_KEY_FLAG) + $$->create_if_not_exists= Lex->check_exists; + if ($$->flags & PRI_KEY_FLAG) add_key_to_list(lex, &$1, Key::PRIMARY, Lex->check_exists); - else if (f->flags & (UNIQUE_FLAG | UNIQUE_KEY_FLAG)) + else if ($$->flags & UNIQUE_KEY_FLAG) add_key_to_list(lex, &$1, Key::UNIQUE, Lex->check_exists); } ; @@ -6231,13 +6258,13 @@ vcol_attribute: UNIQUE_SYM { LEX *lex=Lex; - lex->last_field->flags|= UNIQUE_FLAG; + lex->last_field->flags|= UNIQUE_KEY_FLAG; lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; } | UNIQUE_SYM KEY_SYM { LEX *lex=Lex; - lex->last_field->flags|= UNIQUE_FLAG; + lex->last_field->flags|= UNIQUE_KEY_FLAG; lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; } | COMMENT_SYM TEXT_STRING_sys { Lex->last_field->comment= $2; } @@ -6277,15 +6304,15 @@ virtual_column_func: ; field_type: - int_type opt_field_length field_options { $$=$1; } - | real_type opt_precision field_options { $$=$1; } + int_type opt_field_length field_options { $$.set($1, $2); } + | real_type opt_precision field_options { $$.set($1, $2); } | FLOAT_SYM float_options field_options { - $$=MYSQL_TYPE_FLOAT; - if (Lex->length && !Lex->dec) + $$.set(MYSQL_TYPE_FLOAT, $2); + if ($2.length() && !$2.dec()) { int err; - ulonglong tmp_length= my_strtoll10(Lex->length, NULL, &err); + ulonglong tmp_length= my_strtoll10($2.length(), NULL, &err); if (err || tmp_length > PRECISION_FOR_DOUBLE) { my_error(ER_WRONG_FIELD_SPEC, MYF(0), @@ -6293,80 +6320,57 @@ field_type: MYSQL_YYABORT; } else if (tmp_length > PRECISION_FOR_FLOAT) - $$= MYSQL_TYPE_DOUBLE; - Lex->length= 0; + $$.set(MYSQL_TYPE_DOUBLE); + else + $$.set(MYSQL_TYPE_FLOAT); } } - | BIT_SYM - { - Lex->length= (char*) "1"; - $$=MYSQL_TYPE_BIT; - } - | BIT_SYM field_length + | BIT_SYM opt_field_length_default_1 { - $$=MYSQL_TYPE_BIT; + $$.set(MYSQL_TYPE_BIT, $2); } | BOOL_SYM { - Lex->length= (char*) "1"; - $$=MYSQL_TYPE_TINY; + $$.set(MYSQL_TYPE_TINY, "1"); } | BOOLEAN_SYM { - Lex->length= (char*) "1"; - $$=MYSQL_TYPE_TINY; - } - | char field_length opt_binary - { - $$=MYSQL_TYPE_STRING; + $$.set(MYSQL_TYPE_TINY, "1"); } - | char opt_binary + | char opt_field_length_default_1 opt_binary { - Lex->length= (char*) "1"; - $$=MYSQL_TYPE_STRING; + $$.set(MYSQL_TYPE_STRING, $2); } - | nchar field_length opt_bin_mod + | nchar opt_field_length_default_1 opt_bin_mod { - $$=MYSQL_TYPE_STRING; + $$.set(MYSQL_TYPE_STRING, $2); bincmp_collation(national_charset_info, $3); } - | nchar opt_bin_mod - { - Lex->length= (char*) "1"; - $$=MYSQL_TYPE_STRING; - bincmp_collation(national_charset_info, $2); - } - | BINARY field_length + | BINARY opt_field_length_default_1 { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_STRING; - } - | BINARY - { - Lex->length= (char*) "1"; - Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_STRING; + $$.set(MYSQL_TYPE_STRING, $2); } | varchar field_length opt_binary { - $$= MYSQL_TYPE_VARCHAR; + $$.set(MYSQL_TYPE_VARCHAR, $2); } | nvarchar field_length opt_bin_mod { - $$= MYSQL_TYPE_VARCHAR; + $$.set(MYSQL_TYPE_VARCHAR, $2); bincmp_collation(national_charset_info, $3); } | VARBINARY field_length { Lex->charset=&my_charset_bin; - $$= MYSQL_TYPE_VARCHAR; + $$.set(MYSQL_TYPE_VARCHAR, $2); } | YEAR_SYM opt_field_length field_options { - if (Lex->length) + if ($2) { errno= 0; - ulong length= strtoul(Lex->length, NULL, 10); + ulong length= strtoul($2, NULL, 10); if (errno == 0 && length <= MAX_FIELD_BLOBLENGTH && length != 4) { char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1]; @@ -6377,18 +6381,18 @@ field_type: buff, "YEAR(4)"); } } - $$=MYSQL_TYPE_YEAR; + $$.set(MYSQL_TYPE_YEAR, $2); } | DATE_SYM - { $$=MYSQL_TYPE_DATE; } + { $$.set(MYSQL_TYPE_DATE); } | TIME_SYM opt_field_length - { $$= opt_mysql56_temporal_format ? - MYSQL_TYPE_TIME2 : MYSQL_TYPE_TIME; } + { $$.set(opt_mysql56_temporal_format ? + MYSQL_TYPE_TIME2 : MYSQL_TYPE_TIME, $2); } | TIMESTAMP opt_field_length { if (thd->variables.sql_mode & MODE_MAXDB) - $$= opt_mysql56_temporal_format ? - MYSQL_TYPE_DATETIME2 : MYSQL_TYPE_DATETIME; + $$.set(opt_mysql56_temporal_format ? + MYSQL_TYPE_DATETIME2 : MYSQL_TYPE_DATETIME, $2); else { /* @@ -6397,29 +6401,29 @@ field_type: */ if (!opt_explicit_defaults_for_timestamp) Lex->last_field->flags|= NOT_NULL_FLAG; - $$= opt_mysql56_temporal_format ? MYSQL_TYPE_TIMESTAMP2 - : MYSQL_TYPE_TIMESTAMP; + $$.set(opt_mysql56_temporal_format ? MYSQL_TYPE_TIMESTAMP2 + : MYSQL_TYPE_TIMESTAMP, $2); } } | DATETIME opt_field_length - { $$= opt_mysql56_temporal_format ? - MYSQL_TYPE_DATETIME2 : MYSQL_TYPE_DATETIME; } + { $$.set(opt_mysql56_temporal_format ? + MYSQL_TYPE_DATETIME2 : MYSQL_TYPE_DATETIME, $2); } | TINYBLOB { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_TINY_BLOB; + $$.set(MYSQL_TYPE_TINY_BLOB); } | BLOB_SYM opt_field_length { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_BLOB; + $$.set(MYSQL_TYPE_BLOB, $2); } | spatial_type float_options srid_option { #ifdef HAVE_SPATIAL Lex->charset=&my_charset_bin; Lex->last_field->geom_type= $1; - $$=MYSQL_TYPE_GEOMETRY; + $$.set(MYSQL_TYPE_GEOMETRY, $2); #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -6429,57 +6433,52 @@ field_type: | MEDIUMBLOB { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_MEDIUM_BLOB; + $$.set(MYSQL_TYPE_MEDIUM_BLOB); } | LONGBLOB { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_LONG_BLOB; + $$.set(MYSQL_TYPE_LONG_BLOB); } | LONG_SYM VARBINARY { Lex->charset=&my_charset_bin; - $$=MYSQL_TYPE_MEDIUM_BLOB; + $$.set(MYSQL_TYPE_MEDIUM_BLOB); } | LONG_SYM varchar opt_binary - { $$=MYSQL_TYPE_MEDIUM_BLOB; } + { $$.set(MYSQL_TYPE_MEDIUM_BLOB); } | TINYTEXT opt_binary - { $$=MYSQL_TYPE_TINY_BLOB; } + { $$.set(MYSQL_TYPE_TINY_BLOB); } | TEXT_SYM opt_field_length opt_binary - { $$=MYSQL_TYPE_BLOB; } + { $$.set(MYSQL_TYPE_BLOB, $2); } | MEDIUMTEXT opt_binary - { $$=MYSQL_TYPE_MEDIUM_BLOB; } + { $$.set(MYSQL_TYPE_MEDIUM_BLOB); } | LONGTEXT opt_binary - { $$=MYSQL_TYPE_LONG_BLOB; } + { $$.set(MYSQL_TYPE_LONG_BLOB); } | DECIMAL_SYM float_options field_options - { $$=MYSQL_TYPE_NEWDECIMAL;} + { $$.set(MYSQL_TYPE_NEWDECIMAL, $2);} | NUMERIC_SYM float_options field_options - { $$=MYSQL_TYPE_NEWDECIMAL;} + { $$.set(MYSQL_TYPE_NEWDECIMAL, $2);} | FIXED_SYM float_options field_options - { $$=MYSQL_TYPE_NEWDECIMAL;} + { $$.set(MYSQL_TYPE_NEWDECIMAL, $2);} | ENUM '(' string_list ')' opt_binary - { $$=MYSQL_TYPE_ENUM; } + { $$.set(MYSQL_TYPE_ENUM); } | SET '(' string_list ')' opt_binary - { $$=MYSQL_TYPE_SET; } + { $$.set(MYSQL_TYPE_SET); } | LONG_SYM opt_binary - { $$=MYSQL_TYPE_MEDIUM_BLOB; } + { $$.set(MYSQL_TYPE_MEDIUM_BLOB); } | SERIAL_SYM { - $$=MYSQL_TYPE_LONGLONG; + $$.set(MYSQL_TYPE_LONGLONG); Lex->last_field->flags|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG | - UNIQUE_FLAG); + UNIQUE_KEY_FLAG); } ; spatial_type: GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; } | GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; } - | POINT_SYM - { - Lex->length= const_cast<char*>(STRINGIFY_ARG - (MAX_LEN_GEOM_POINT_FIELD)); - $$= Field::GEOM_POINT; - } + | POINT_SYM { $$= Field::GEOM_POINT; } | MULTIPOINT { $$= Field::GEOM_MULTIPOINT; } | LINESTRING { $$= Field::GEOM_LINESTRING; } | MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; } @@ -6540,21 +6539,13 @@ srid_option: ; float_options: - /* empty */ - { Lex->dec=Lex->length= (char*)0; } - | field_length - { Lex->dec= (char*)0; } - | precision - {} + /* empty */ { $$.set(0, 0); } + | field_length { $$.set($1, 0); } + | precision { $$= $1; } ; precision: - '(' NUM ',' NUM ')' - { - LEX *lex=Lex; - lex->length=$2.str; - lex->dec=$4.str; - } + '(' NUM ',' NUM ')' { $$.set($2.str, $4.str); } ; field_options: @@ -6574,19 +6565,22 @@ field_option: ; field_length: - '(' LONG_NUM ')' { Lex->length= $2.str; } - | '(' ULONGLONG_NUM ')' { Lex->length= $2.str; } - | '(' DECIMAL_NUM ')' { Lex->length= $2.str; } - | '(' NUM ')' { Lex->length= $2.str; }; + '(' LONG_NUM ')' { $$= $2.str; } + | '(' ULONGLONG_NUM ')' { $$= $2.str; } + | '(' DECIMAL_NUM ')' { $$= $2.str; } + | '(' NUM ')' { $$= $2.str; }; opt_field_length: - /* empty */ { Lex->length=(char*) 0; /* use default length */ } - | field_length { } - ; + /* empty */ { $$= (char*) 0; /* use default length */ } + | field_length { $$= $1; } + +opt_field_length_default_1: + /* empty */ { $$= (char*) "1"; } + | field_length { $$= $1; } opt_precision: - /* empty */ {} - | precision {} + /* empty */ { $$.set(0, 0); } + | precision { $$= $1; } ; opt_attribute: @@ -6614,7 +6608,7 @@ attribute: | SERIAL_SYM DEFAULT VALUE_SYM { LEX *lex=Lex; - lex->last_field->flags|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG; + lex->last_field->flags|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_KEY_FLAG; lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; } | opt_primary KEY_SYM @@ -6626,7 +6620,7 @@ attribute: | UNIQUE_SYM { LEX *lex=Lex; - lex->last_field->flags|= UNIQUE_FLAG; + lex->last_field->flags|= UNIQUE_KEY_FLAG; lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; } | UNIQUE_SYM KEY_SYM @@ -7634,6 +7628,7 @@ alter_list_item: add_column column_def opt_place { Lex->create_last_non_select_table= Lex->last_table(); + $2->after= $3; } | ADD key_def { @@ -7650,14 +7645,16 @@ alter_list_item: { Lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN; Lex->create_last_non_select_table= Lex->last_table(); - Lex->last_field->change= $4.str; + $5->change= $4.str; + $5->after= $6; } | MODIFY_SYM opt_column opt_if_exists_table_element field_spec opt_place { Lex->alter_info.flags|= Alter_info::ALTER_CHANGE_COLUMN; Lex->create_last_non_select_table= Lex->last_table(); - Lex->last_field->change= Lex->last_field->field_name; + $4->change= $4->field_name; + $4->after= $5; } | DROP opt_column opt_if_exists_table_element field_ident opt_restrict { @@ -7870,15 +7867,15 @@ opt_restrict: ; opt_place: - /* empty */ {} + /* empty */ { $$= NULL; } | AFTER_SYM ident { - store_position_for_column($2.str); + $$= $2.str; Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER; } | FIRST_SYM { - store_position_for_column(first_keyword); + $$= first_keyword; Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER; } ; @@ -8722,11 +8719,11 @@ select_item: MYSQL_YYABORT; } $2->is_autogenerated_name= FALSE; - $2->set_name($4.str, $4.length, system_charset_info); + $2->set_name(thd, $4.str, $4.length, system_charset_info); } else if (!$2->name) { - $2->set_name($1, (uint) ($3 - $1), thd->charset()); + $2->set_name(thd, $1, (uint) ($3 - $1), thd->charset()); } } ; @@ -9187,92 +9184,44 @@ all_or_any: opt_dyncol_type: /* empty */ { - LEX *lex= Lex; - $$= DYN_COL_NULL; /* automatic type */ - lex->charset= NULL; - lex->length= lex->dec= 0; + $$.set(DYN_COL_NULL); /* automatic type */ + Lex->charset= NULL; } | AS dyncol_type { $$= $2; } ; dyncol_type: - INT_SYM - { - LEX *lex= Lex; - $$= DYN_COL_INT; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | UNSIGNED INT_SYM - { - LEX *lex= Lex; - $$= DYN_COL_UINT; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | DOUBLE_SYM - { - LEX *lex= Lex; - $$= DYN_COL_DOUBLE; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | REAL - { - LEX *lex= Lex; - $$= DYN_COL_DOUBLE; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | FLOAT_SYM - { - LEX *lex= Lex; - $$= DYN_COL_DOUBLE; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | DECIMAL_SYM float_options - { - $$= DYN_COL_DECIMAL; - Lex->charset= NULL; - } - | char + numeric_dyncol_type { $$= $1; Lex->charset= NULL; } + | temporal_dyncol_type { $$= $1; Lex->charset= NULL; } + | string_dyncol_type { $$= $1; } + ; + +numeric_dyncol_type: + INT_SYM { $$.set(DYN_COL_INT); } + | UNSIGNED INT_SYM { $$.set(DYN_COL_UINT); } + | DOUBLE_SYM { $$.set(DYN_COL_DOUBLE); } + | REAL { $$.set(DYN_COL_DOUBLE); } + | FLOAT_SYM { $$.set(DYN_COL_DOUBLE); } + | DECIMAL_SYM float_options { $$.set(DYN_COL_DECIMAL, $2); } + ; + +temporal_dyncol_type: + DATE_SYM { $$.set(DYN_COL_DATE); } + | TIME_SYM opt_field_length { $$.set(DYN_COL_TIME, 0, $2); } + | DATETIME opt_field_length { $$.set(DYN_COL_DATETIME, 0, $2); } + ; + +string_dyncol_type: + char { Lex->charset= thd->variables.collation_connection; } opt_binary { - LEX *lex= Lex; - $$= DYN_COL_STRING; - lex->length= lex->dec= 0; + $$.set(DYN_COL_STRING); } | nchar { - LEX *lex= Lex; - $$= DYN_COL_STRING; - lex->charset= national_charset_info; - lex->length= lex->dec= 0; - } - | DATE_SYM - { - LEX *lex= Lex; - $$= DYN_COL_DATE; - lex->charset= NULL; - lex->length= lex->dec= 0; - } - | TIME_SYM opt_field_length - { - LEX *lex= Lex; - $$= DYN_COL_TIME; - lex->charset= NULL; - lex->dec= lex->length; - lex->length= 0; - } - | DATETIME opt_field_length - { - LEX *lex= Lex; - $$= DYN_COL_DATETIME; - lex->charset= NULL; - lex->dec= lex->length; - lex->length= 0; + $$.set(DYN_COL_STRING); + Lex->charset= national_charset_info; } ; @@ -9286,14 +9235,14 @@ dyncall_create_element: MYSQL_YYABORT; $$->key= $1; $$->value= $3; - $$->type= (DYNAMIC_COLUMN_TYPE)$4; + $$->type= (DYNAMIC_COLUMN_TYPE)$4.dyncol_type(); $$->cs= lex->charset; - if (lex->length) - $$->len= strtoul(lex->length, NULL, 10); + if ($4.length()) + $$->len= strtoul($4.length(), NULL, 10); else $$->len= 0; - if (lex->dec) - $$->frac= strtoul(lex->dec, NULL, 10); + if ($4.dec()) + $$->frac= strtoul($4.dec(), NULL, 10); else $$->len= 0; } @@ -9434,7 +9383,7 @@ simple_expr: | CAST_SYM '(' expr AS cast_type ')' { LEX *lex= Lex; - $$= create_func_cast(thd, $3, $5, lex->length, lex->dec, + $$= create_func_cast(thd, $3, $5.type(), $5.length(), $5.dec(), lex->charset); if ($$ == NULL) MYSQL_YYABORT; @@ -9447,7 +9396,7 @@ simple_expr: } | CONVERT_SYM '(' expr ',' cast_type ')' { - $$= create_func_cast(thd, $3, $5, Lex->length, Lex->dec, + $$= create_func_cast(thd, $3, $5.type(), $5.length(), $5.dec(), Lex->charset); if ($$ == NULL) MYSQL_YYABORT; @@ -9887,8 +9836,8 @@ function_call_nonkeyword: COLUMN_GET_SYM '(' expr ',' expr AS cast_type ')' { LEX *lex= Lex; - $$= create_func_dyncol_get(thd, $3, $5, $7, - lex->length, lex->dec, + $$= create_func_dyncol_get(thd, $3, $5, $7.type(), + $7.length(), $7.dec(), lex->charset); if ($$ == NULL) MYSQL_YYABORT; @@ -10028,7 +9977,7 @@ function_call_conflict: if (!(i1= get_system_var(thd, OPT_SESSION, name, null_lex_str))) MYSQL_YYABORT; - i1->set_name((const char *) + i1->set_name(thd, (const char *) STRING_WITH_LEN("@@default_week_format"), system_charset_info); $$= new (thd->mem_root) Item_func_week(thd, $3, i1); @@ -10315,7 +10264,7 @@ udf_expr: if ($4.str) { $2->is_autogenerated_name= FALSE; - $2->set_name($4.str, $4.length, system_charset_info); + $2->set_name(thd, $4.str, $4.length, system_charset_info); } /* A field has to have its proper name in order for name @@ -10325,7 +10274,7 @@ udf_expr: */ else if ($2->type() != Item::FIELD_ITEM && $2->type() != Item::REF_ITEM /* For HAVING */ ) - $2->set_name($1, (uint) ($3 - $1), thd->charset()); + $2->set_name(thd, $1, (uint) ($3 - $1), thd->charset()); $$= $2; } ; @@ -10577,43 +10526,35 @@ in_sum_expr: cast_type: BINARY opt_field_length - { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } + { $$.set(ITEM_CAST_CHAR, $2); Lex->charset= &my_charset_bin; } | CHAR_SYM opt_field_length { Lex->charset= thd->variables.collation_connection; } opt_binary - { $$=ITEM_CAST_CHAR; Lex->dec= 0; } + { $$.set(ITEM_CAST_CHAR, $2); } | NCHAR_SYM opt_field_length - { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } - | INT_SYM - { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | SIGNED_SYM - { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | SIGNED_SYM INT_SYM - { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | UNSIGNED - { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | UNSIGNED INT_SYM - { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | DATE_SYM - { $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } - | TIME_SYM opt_field_length - { - $$=ITEM_CAST_TIME; - LEX *lex= Lex; - lex->charset= NULL; lex->dec= lex->length; lex->length= (char*)0; - } - | DATETIME opt_field_length { - $$=ITEM_CAST_DATETIME; - LEX *lex= Lex; - lex->charset= NULL; lex->dec= lex->length; lex->length= (char*)0; - } - | DECIMAL_SYM float_options - { $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; } - | DOUBLE_SYM - { Lex->charset= NULL; Lex->length= Lex->dec= 0;} - opt_precision - { $$=ITEM_CAST_DOUBLE; } + Lex->charset= national_charset_info; + $$.set(ITEM_CAST_CHAR, $2, 0); + } + | cast_type_numeric { $$= $1; Lex->charset= NULL; } + | cast_type_temporal { $$= $1; Lex->charset= NULL; } + ; + +cast_type_numeric: + INT_SYM { $$.set(ITEM_CAST_SIGNED_INT); } + | SIGNED_SYM { $$.set(ITEM_CAST_SIGNED_INT); } + | SIGNED_SYM INT_SYM { $$.set(ITEM_CAST_SIGNED_INT); } + | UNSIGNED { $$.set(ITEM_CAST_UNSIGNED_INT); } + | UNSIGNED INT_SYM { $$.set(ITEM_CAST_UNSIGNED_INT); } + | DECIMAL_SYM float_options { $$.set(ITEM_CAST_DECIMAL, $2); } + | DOUBLE_SYM opt_precision { $$.set(ITEM_CAST_DOUBLE, $2); } + ; + +cast_type_temporal: + DATE_SYM { $$.set(ITEM_CAST_DATE); } + | TIME_SYM opt_field_length { $$.set(ITEM_CAST_TIME, 0, $2); } + | DATETIME opt_field_length { $$.set(ITEM_CAST_DATETIME, 0, $2); } + ; opt_expr_list: /* empty */ { $$= NULL; } @@ -11576,7 +11517,7 @@ limit_option: if (spc && (spv = spc->find_variable($1, false))) { splocal= new (thd->mem_root) - Item_splocal(thd, $1, spv->offset, spv->type, + Item_splocal(thd, $1, spv->offset, spv->sql_type(), lip->get_tok_start() - lex->sphead->m_tmp_query, lip->get_ptr() - lip->get_tok_start()); if (splocal == NULL) @@ -11762,7 +11703,7 @@ procedure_item: if (add_proc_to_list(thd, $2)) MYSQL_YYABORT; if (!$2->name) - $2->set_name($1, (uint) ($3 - $1), thd->charset()); + $2->set_name(thd, $1, (uint) ($3 - $1), thd->charset()); } ; @@ -11816,7 +11757,7 @@ select_outvar: MYSQL_YYABORT; } $$ = Lex->result ? (new (thd->mem_root) - my_var_sp($1, t->offset, t->type, + my_var_sp($1, t->offset, t->sql_type(), Lex->sphead)) : NULL; } @@ -13488,7 +13429,7 @@ load_data_set_elem: if (lex->update_list.push_back($1, thd->mem_root) || lex->value_list.push_back($4, thd->mem_root)) MYSQL_YYABORT; - $4->set_name_no_truncate($3, (uint) ($5 - $3), thd->charset()); + $4->set_name_no_truncate(thd, $3, (uint) ($5 - $3), thd->charset()); } ; @@ -13831,7 +13772,7 @@ simple_ident: Item_splocal *splocal; splocal= new (thd->mem_root) - Item_splocal(thd, $1, spv->offset, spv->type, + Item_splocal(thd, $1, spv->offset, spv->sql_type(), lip->get_tok_start_prev() - lex->sphead->m_tmp_query, lip->get_tok_end() - lip->get_tok_start_prev()); if (splocal == NULL) @@ -14264,6 +14205,7 @@ keyword: | ASCII_SYM {} | BACKUP_SYM {} | BEGIN_SYM {} + | BINLOG_SYM {} | BYTE_SYM {} | CACHE_SYM {} | CHARSET {} @@ -14347,7 +14289,6 @@ keyword_sp: | AUTO_SYM {} | AVG_ROW_LENGTH {} | AVG_SYM {} - | BINLOG_SYM {} | BIT_SYM {} | BLOCK_SYM {} | BOOL_SYM {} @@ -16449,8 +16390,7 @@ sf_tail: } type_with_opt_collate /* $11 */ { /* $12 */ - if (Lex->sphead->fill_field_definition(thd, Lex, $11, - Lex->last_field)) + if (Lex->sphead->fill_field_definition(thd, Lex, Lex->last_field)) MYSQL_YYABORT; } sp_c_chistics /* $13 */ @@ -16460,7 +16400,7 @@ sf_tail: lex->sphead->set_body_start(thd, lip->get_cpp_tok_start()); } - sp_proc_stmt /* $15 */ + sp_proc_stmt_in_returns_clause /* $15 */ { LEX *lex= thd->lex; sp_head *sp= lex->sphead; diff --git a/sql/structs.h b/sql/structs.h index c1c832d07ec..e51f3e0fe3a 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -557,4 +557,74 @@ public: }; +struct Lex_length_and_dec_st +{ +private: + const char *m_length; + const char *m_dec; +public: + void set(const char *length, const char *dec) + { + m_length= length; + m_dec= dec; + } + const char *length() const { return m_length; } + const char *dec() const { return m_dec; } +}; + + +struct Lex_field_type_st: public Lex_length_and_dec_st +{ +private: + enum_field_types m_type; + void set(enum_field_types type, const char *length, const char *dec) + { + m_type= type; + Lex_length_and_dec_st::set(length, dec); + } +public: + void set(enum_field_types type, Lex_length_and_dec_st length_and_dec) + { + m_type= type; + Lex_length_and_dec_st::operator=(length_and_dec); + } + void set(enum_field_types type, const char *length) + { + set(type, length, 0); + } + void set(enum_field_types type) + { + set(type, 0, 0); + } + enum_field_types field_type() const { return m_type; } +}; + + +struct Lex_dyncol_type_st: public Lex_length_and_dec_st +{ +private: + int m_type; // enum_dynamic_column_type is not visible here, so use int +public: + void set(int type, const char *length, const char *dec) + { + m_type= type; + Lex_length_and_dec_st::set(length, dec); + } + void set(int type, Lex_length_and_dec_st length_and_dec) + { + m_type= type; + Lex_length_and_dec_st::operator=(length_and_dec); + } + void set(int type, const char *length) + { + set(type, length, 0); + } + void set(int type) + { + set(type, 0, 0); + } + int dyncol_type() const { return m_type; } +}; + + #endif /* STRUCTS_INCLUDED */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 42bcfa2ee95..08f4e3e4ea0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1848,6 +1848,15 @@ static Sys_var_ulong Sys_slave_parallel_threads( NOT_IN_BINLOG, ON_CHECK(check_slave_parallel_threads), ON_UPDATE(fix_slave_parallel_threads)); +/* Alias for @@slave_parallel_threads to match what MySQL 5.7 uses. */ +static Sys_var_ulong Sys_slave_parallel_workers( + "slave_parallel_workers", + "Alias for slave_parallel_threads", + GLOBAL_VAR(opt_slave_parallel_threads), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0,16383), DEFAULT(0), BLOCK_SIZE(1), NO_MUTEX_GUARD, + NOT_IN_BINLOG, ON_CHECK(check_slave_parallel_threads), + ON_UPDATE(fix_slave_parallel_threads)); + static bool check_slave_domain_parallel_threads(sys_var *self, THD *thd, set_var *var) @@ -2328,17 +2337,6 @@ static Sys_var_ulong Sys_optimizer_use_condition_selectivity( SESSION_VAR(optimizer_use_condition_selectivity), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1, 5), DEFAULT(1), BLOCK_SIZE(1)); -/** Warns about deprecated value 63 */ -static bool fix_optimizer_search_depth(sys_var *self, THD *thd, - enum_var_type type) -{ - SV *sv= type == OPT_GLOBAL ? &global_system_variables : &thd->variables; - if (sv->optimizer_search_depth == MAX_TABLES+2) - WARN_DEPRECATED(thd, 10, 2, "optimizer-search-depth=63", - "a search depth less than 63"); - return false; -} - static Sys_var_ulong Sys_optimizer_search_depth( "optimizer_search_depth", "Maximum depth of search performed by the query optimizer. Values " @@ -2346,13 +2344,10 @@ static Sys_var_ulong Sys_optimizer_search_depth( "query plans, but take longer to compile a query. Values smaller " "than the number of tables in a relation result in faster " "optimization, but may produce very bad query plans. If set to 0, " - "the system will automatically pick a reasonable value; if set to " - "63, the optimizer will switch to the original find_best search. " - "NOTE: The value 63 and its associated behaviour is deprecated", + "the system will automatically pick a reasonable value", SESSION_VAR(optimizer_search_depth), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, MAX_TABLES+2), DEFAULT(MAX_TABLES+1), BLOCK_SIZE(1), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), - ON_UPDATE(fix_optimizer_search_depth)); + VALID_RANGE(0, MAX_TABLES+1), DEFAULT(MAX_TABLES+1), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0)); /* this is used in the sigsegv handler */ export const char *optimizer_switch_names[]= @@ -3382,7 +3377,6 @@ static Sys_var_mybool Sys_timed_mutexes( NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), DEPRECATED("")); -static char *server_version_ptr; static Sys_var_charptr Sys_version( "version", "Server version", READ_ONLY GLOBAL_VAR(server_version_ptr), diff --git a/sql/table.cc b/sql/table.cc index a90eb2eee15..5f9f8f356cd 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -948,12 +948,10 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, plugin_ref se_plugin= 0; keyinfo= &first_keyinfo; share->ext_key_parts= 0; - MEM_ROOT **root_ptr, *old_root; + MEM_ROOT *old_root= thd->mem_root; DBUG_ENTER("TABLE_SHARE::init_from_binary_frm_image"); - root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); - old_root= *root_ptr; - *root_ptr= &share->mem_root; + thd->mem_root= &share->mem_root; if (write && write_frm_image(frm_image, frm_length)) goto err; @@ -1675,7 +1673,10 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, reg_field->field_index= i; reg_field->comment=comment; reg_field->vcol_info= vcol_info; - reg_field->stored_in_db= fld_stored_in_db; + if (vcol_info) + reg_field->vcol_info->stored_in_db= fld_stored_in_db; + else + DBUG_ASSERT(fld_stored_in_db == true); if (field_type == MYSQL_TYPE_BIT && !f_bit_as_char(pack_flag)) { null_bits_are_used= 1; @@ -1698,7 +1699,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (use_hash && my_hash_insert(&share->name_hash, (uchar*) field_ptr)) goto err; - if (!reg_field->stored_in_db) + if (!reg_field->stored_in_db()) { share->stored_fields--; if (share->stored_rec_length>=recpos) @@ -2084,7 +2085,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->db_plugin= se_plugin; share->error= OPEN_FRM_OK; thd->status_var.opened_shares++; - *root_ptr= old_root; + thd->mem_root= old_root; DBUG_RETURN(0); err: @@ -2097,7 +2098,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!thd->is_error()) open_table_error(share, OPEN_FRM_CORRUPTED, share->open_errno); - *root_ptr= old_root; + thd->mem_root= old_root; DBUG_RETURN(HA_ERR_NOT_A_TABLE); } @@ -2526,6 +2527,10 @@ bool unpack_vcol_info_from_frm(THD *thd, /* From now on use vcol_info generated by the parser. */ field->vcol_info= vcol_storage.vcol_info; + /* copy the stored_in_db property, the parser doesn't generate it */ + field->vcol_info->stored_in_db= + table->s->field[field->field_index]->vcol_info->stored_in_db; + /* Validate the Item tree. */ if (fix_vcol_expr(thd, table, field)) { @@ -6154,7 +6159,7 @@ void TABLE::mark_virtual_columns_for_write(bool insert_fl) tmp_vfield= *vfield_ptr; if (bitmap_is_set(write_set, tmp_vfield->field_index)) bitmap_updated= mark_virtual_col(tmp_vfield); - else if (tmp_vfield->stored_in_db) + else if (tmp_vfield->vcol_info->stored_in_db) { bool mark_fl= insert_fl; if (!mark_fl) @@ -6888,13 +6893,15 @@ int update_virtual_fields(THD *thd, TABLE *table, for (vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++) { vfield= (*vfield_ptr); - DBUG_ASSERT(vfield->vcol_info && vfield->vcol_info->expr_item); + Virtual_column_info *vcol_info= vfield->vcol_info; + DBUG_ASSERT(vcol_info); + DBUG_ASSERT(vcol_info->expr_item); if ((bitmap_is_set(table->vcol_set, vfield->field_index) && - (vcol_update_mode == VCOL_UPDATE_FOR_WRITE || !vfield->stored_in_db)) || + (vcol_update_mode == VCOL_UPDATE_FOR_WRITE || !vcol_info->stored_in_db)) || vcol_update_mode == VCOL_UPDATE_ALL) { /* Compute the actual value of the virtual fields */ - error= vfield->vcol_info->expr_item->save_in_field(vfield, 0); + error= vcol_info->expr_item->save_in_field(vfield, 0); DBUG_PRINT("info", ("field '%s' - updated", vfield->field_name)); } else diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index b82d29e51f4..cbed769a424 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -66,56 +66,7 @@ void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc, } -#ifndef MYSQL_CLIENT -void *sql_alloc(size_t Size) -{ - MEM_ROOT *root= *my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); - return alloc_root(root,Size); -} -#endif - - -void *sql_calloc(size_t size) -{ - void *ptr; - if ((ptr=sql_alloc(size))) - bzero(ptr,size); - return ptr; -} - - -char *sql_strdup(const char *str) -{ - size_t len= strlen(str)+1; - char *pos; - if ((pos= (char*) sql_alloc(len))) - memcpy(pos,str,len); - return pos; -} - - -char *sql_strmake(const char *str, size_t len) -{ - char *pos; - if ((pos= (char*) sql_alloc(len+1))) - { - memcpy(pos,str,len); - pos[len]=0; - } - return pos; -} - - -void* sql_memdup(const void *ptr, size_t len) -{ - void *pos; - if ((pos= sql_alloc(len))) - memcpy(pos,ptr,len); - return pos; -} - - -char *sql_strmake_with_convert(const char *str, size_t arg_length, +char *sql_strmake_with_convert(THD *thd, const char *str, size_t arg_length, CHARSET_INFO *from_cs, size_t max_res_length, CHARSET_INFO *to_cs, size_t *result_length) @@ -125,7 +76,7 @@ char *sql_strmake_with_convert(const char *str, size_t arg_length, max_res_length--; // Reserve place for end null set_if_smaller(new_length, max_res_length); - if (!(pos= (char*) sql_alloc(new_length+1))) + if (!(pos= (char*) thd->alloc(new_length + 1))) return pos; // Error if ((from_cs == &my_charset_bin) || (to_cs == &my_charset_bin)) diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h index 0b17c5cdaf1..fc23c87c9fd 100644 --- a/sql/thr_malloc.h +++ b/sql/thr_malloc.h @@ -22,12 +22,7 @@ typedef struct st_mem_root MEM_ROOT; void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size, myf my_flags); -void *sql_alloc(size_t); -void *sql_calloc(size_t); -char *sql_strdup(const char *str); -char *sql_strmake(const char *str, size_t len); -void *sql_memdup(const void * ptr, size_t size); -char *sql_strmake_with_convert(const char *str, size_t arg_length, +char *sql_strmake_with_convert(THD *thd, const char *str, size_t arg_length, CHARSET_INFO *from_cs, size_t max_res_length, CHARSET_INFO *to_cs, size_t *result_length); diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 5bcea767aae..9fb38319096 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -87,7 +87,6 @@ struct Worker_thread_context #endif pthread_setspecific(THR_KEY_mysys,mysys_var); pthread_setspecific(THR_THD, 0); - pthread_setspecific(THR_MALLOC, 0); } }; diff --git a/sql/tztime.cc b/sql/tztime.cc index 5e5f34f29a5..f94e10c4877 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1800,8 +1800,6 @@ end: delete thd; if (org_thd) org_thd->store_globals(); /* purecov: inspected */ - else - my_pthread_setspecific_ptr(THR_MALLOC, 0); default_tz= default_tz_name ? global_system_variables.time_zone : my_tz_SYSTEM; diff --git a/sql/unireg.cc b/sql/unireg.cc index 66959f400d9..f565fc97d86 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -874,7 +874,7 @@ static bool pack_fields(uchar *buff, List<Create_field> &create_fields, { *buff++= (uchar) (1 + MY_TEST(field->interval)); *buff++= (uchar) field->sql_type; - *buff++= (uchar) field->stored_in_db; + *buff++= (uchar) field->vcol_info->stored_in_db; if (field->interval) *buff++= (uchar) field->interval_id; memcpy(buff, field->vcol_info->expr_str.str, field->vcol_info->expr_str.length); @@ -921,9 +921,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options, thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values while ((field=it++)) { - /* - regfield don't have to be deleted as it's allocated with sql_alloc() - */ + /* regfield don't have to be deleted as it's allocated on THD::mem_root */ Field *regfield= make_field(&share, thd->mem_root, buff+field->offset + data_offset, field->length, diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 93276d2f278..bbce62e0641 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1645,7 +1645,7 @@ void ha_archive::update_create_info(HA_CREATE_INFO *create_info) } if (!(my_readlink(tmp_real_path, share->data_file_name, MYF(0)))) - create_info->data_file_name= sql_strdup(tmp_real_path); + create_info->data_file_name= thd_strdup(ha_thd(), tmp_real_path); DBUG_VOID_RETURN; } diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 75dfcd22d49..04926228aa4 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1448,7 +1448,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Flags |= U_NULLS; // Mark virtual columns as such - if (fp->vcol_info && !fp->stored_in_db) + if (!fp->stored_in_db()) pcf->Flags |= U_VIRTUAL; pcf->Key= 0; // Not used when called from MySQL @@ -1946,7 +1946,7 @@ int ha_connect::MakeRecord(char *buf) for (field= table->field; *field && !rc; field++) { fp= *field; - if (fp->vcol_info && !fp->stored_in_db) + if (!fp->stored_in_db()) continue; // This is a virtual column if (bitmap_is_set(map, fp->field_index) || alter) { @@ -2067,8 +2067,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *) for (Field **field=table->field ; *field ; field++) { fp= *field; - if ((fp->vcol_info && !fp->stored_in_db) || - fp->option_struct->special) + if (!fp->stored_in_db() || fp->option_struct->special) continue; // Is a virtual column possible here ??? if ((xmod == MODE_INSERT && tdbp->GetAmType() != TYPE_AM_MYSQL @@ -5980,7 +5979,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, for (field= table_arg->field; *field; field++) { fp= *field; - if (fp->vcol_info && !fp->stored_in_db) + if (!fp->stored_in_db()) continue; // This is a virtual column if (fp->flags & AUTO_INCREMENT_FLAG) { diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 7ae962880d1..8c608e82388 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -83,6 +83,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB #ENDIF() CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) +IF(HAVE_SCHED_GETCPU) + ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU) +ENDIF() IF(NOT MSVC) # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not @@ -240,11 +243,13 @@ IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC) ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1) ENDIF() -CHECK_C_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS) +CHECK_CXX_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS) +IF(HAVE_C99_INITIALIZERS) + ADD_DEFINITIONS(-DHAVE_C99_INITIALIZERS) +ENDIF() ENDIF(NOT MSVC) -CHECK_FUNCTION_EXISTS(asprintf HAVE_ASPRINTF) CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF) # Solaris atomics diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 527c5beb47c..3c8287a7be4 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -7436,7 +7436,7 @@ ha_innobase::build_template( /* Push down an index condition or an end_range check. */ for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -7555,7 +7555,7 @@ ha_innobase::build_template( pushdown. */ for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -7595,7 +7595,7 @@ ha_innobase::build_template( for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { const Field* field; - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -8177,7 +8177,7 @@ calc_row_difference( for (sql_idx = 0; sql_idx < n_fields; sql_idx++) { field = table->field[sql_idx]; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; o_ptr = (const byte*) old_row + get_field_offset(table, field); @@ -8316,7 +8316,7 @@ calc_row_difference( } } } - if (field->stored_in_db) + if (field->stored_in_db()) innodb_idx++; } @@ -10533,7 +10533,7 @@ create_table_def( for (i = 0; i < n_cols; i++) { Field* field = form->field[i]; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; col_type = get_innobase_type_from_mysql_type(&unsigned_type, diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 74f36467f1f..0087b220d2f 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -385,7 +385,7 @@ ha_innobase::check_if_supported_inplace_alter( const Field* field = table->field[i]; const dict_col_t* col = dict_table_get_nth_col(prebuilt->table, icol); ulint unsigned_flag; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; icol++; @@ -1233,7 +1233,7 @@ innobase_rec_to_mysql( ulint ilen; const uchar* ifield; - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1286,7 +1286,7 @@ innobase_fields_to_mysql( Field* field; ulint ipos; - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1335,7 +1335,7 @@ innobase_row_to_mysql( Field* field; const dfield_t* df = dtuple_get_nth_field(row, i); - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1641,7 +1641,7 @@ innobase_fts_check_doc_id_col( for (i = 0; i < n_cols; i++, sql_idx++) { const Field* field; while (!((field= altered_table->field[sql_idx])-> - stored_in_db)) + stored_in_db())) sql_idx++; if (my_strcasecmp(system_charset_info, field->field_name, FTS_DOC_ID_COL_NAME)) { @@ -2507,7 +2507,7 @@ innobase_build_col_map( } while (const Create_field* new_field = cf_it++) { - if (!new_field->stored_in_db) + if (!new_field->stored_in_db()) { sql_idx++; continue; @@ -2516,7 +2516,7 @@ innobase_build_col_map( table->field[old_i]; old_i++) { const Field* field = table->field[old_i]; - if (!table->field[old_i]->stored_in_db) + if (!table->field[old_i]->stored_in_db()) continue; if (new_field->field == field) { col_map[old_innobase_i] = i; @@ -2889,7 +2889,7 @@ prepare_inplace_alter_table_dict( for (uint i = 0; i < altered_table->s->stored_fields; i++, sql_idx++) { const Field* field; while (!((field= altered_table->field[sql_idx])-> - stored_in_db)) + stored_in_db())) sql_idx++; ulint is_unsigned; ulint field_type @@ -3983,7 +3983,7 @@ func_exit: ha_alter_info->alter_info->create_list); while (const Create_field* new_field = cf_it++) { const Field* field; - if (!new_field->stored_in_db) { + if (!new_field->stored_in_db()) { i++; continue; } @@ -3992,7 +3992,7 @@ func_exit: DBUG_ASSERT(innodb_idx < altered_table->s->stored_fields); for (uint old_i = 0; table->field[old_i]; old_i++) { - if (!table->field[old_i]->stored_in_db) + if (!table->field[old_i]->stored_in_db()) continue; if (new_field->field == table->field[old_i]) { goto found_col; @@ -4691,7 +4691,7 @@ innobase_rename_columns_try( & Alter_inplace_info::ALTER_COLUMN_NAME); for (Field** fp = table->field; *fp; fp++, i++) { - if (!((*fp)->flags & FIELD_IS_RENAMED) || !((*fp)->stored_in_db)) { + if (!((*fp)->flags & FIELD_IS_RENAMED) || !((*fp)->stored_in_db())) { continue; } diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 5fdd2a920a5..844e8627939 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -255,7 +255,7 @@ static MYSQL_SYSVAR_ULONG(pagecache_file_hash_size, pagecache_file_hash_size, "value is probably 1/10 of number of possible open Aria files.", 0,0, 512, 128, 16384, 1); -static MYSQL_SYSVAR_SET(recover, maria_recover_options, PLUGIN_VAR_OPCMDARG, +static MYSQL_SYSVAR_SET(recover_options, maria_recover_options, PLUGIN_VAR_OPCMDARG, "Specifies how corrupted tables should be automatically repaired", NULL, NULL, HA_RECOVER_DEFAULT, &maria_recover_typelib); @@ -435,8 +435,8 @@ static void _ma_check_print_msg(HA_CHECK *param, const char *msg_type, NullS) - name); /* TODO: switch from protocol to push_warning here. The main reason we didn't - it yet is parallel repair. Due to following trace: - ma_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr. + it yet is parallel repair, which threads have no THD object accessible via + current_thd. Also we likely need to lock mutex here (in both cases with protocol and push_warning). @@ -3494,7 +3494,7 @@ static int mark_recovery_start(const char* log_dir) DBUG_ENTER("mark_recovery_start"); if (!(maria_recover_options & HA_RECOVER_ANY)) ma_message_no_user(ME_JUST_WARNING, "Please consider using option" - " --aria-recover[=...] to automatically check and" + " --aria-recover-options[=...] to automatically check and" " repair tables when logs are removed by option" " --aria-force-start-after-recovery-failures=#"); if (recovery_failures >= force_start_after_recovery_failures) @@ -3701,7 +3701,7 @@ struct st_mysql_sys_var* system_variables[]= { MYSQL_SYSVAR(pagecache_buffer_size), MYSQL_SYSVAR(pagecache_division_limit), MYSQL_SYSVAR(pagecache_file_hash_size), - MYSQL_SYSVAR(recover), + MYSQL_SYSVAR(recover_options), MYSQL_SYSVAR(repair_threads), MYSQL_SYSVAR(sort_buffer_size), MYSQL_SYSVAR(stats_method), diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 4284e22782d..cbf411544b6 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -166,8 +166,8 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type, name); /* TODO: switch from protocol to push_warning here. The main reason we didn't - it yet is parallel repair. Due to following trace: - mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr. + it yet is parallel repair, which threads have no THD object accessible via + current_thd. Also we likely need to lock mutex here (in both cases with protocol and push_warning). diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 05d5ef1d6ca..418e09547da 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -100,7 +100,7 @@ #include "../myisam/ha_myisam.h" #include "ha_myisammrg.h" #include "myrg_def.h" -#include "thr_malloc.h" // int_sql_alloc +#include "thr_malloc.h" // init_sql_alloc #include "sql_class.h" // THD #include "debug_sync.h" diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 71064918197..a9aea90dcdd 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -8577,7 +8577,7 @@ int spider_discover_table_structure( DBUG_RETURN(ER_SPIDER_UNKNOWN_NUM); } #ifdef SPIDER_HAS_DISCOVER_TABLE_STRUCTURE_COMMENT - if (!(part_syntax = generate_partition_syntax(part_info, &part_syntax_len, + if (!(part_syntax = generate_partition_syntax(thd, part_info, &part_syntax_len, FALSE, TRUE, info, NULL, NULL))) #else if (!(part_syntax = generate_partition_syntax(part_info, &part_syntax_len, diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 71014239990..2b605d14677 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -34,7 +34,7 @@ MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG) ############################################ -SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump" PARENT_SCOPE) +SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-10.2/README-TOKUDB\nusr/share/doc/mariadb-server-10.2/README.md" PARENT_SCOPE) MARK_AS_ADVANCED(BUILDNAME) MARK_AS_ADVANCED(BUILD_TESTING) MARK_AS_ADVANCED(CMAKE_TOKUDB_REVISION) diff --git a/storage/tokudb/PerconaFT/CMakeLists.txt b/storage/tokudb/PerconaFT/CMakeLists.txt index 843b4c9d0e8..6e3aaee139b 100644 --- a/storage/tokudb/PerconaFT/CMakeLists.txt +++ b/storage/tokudb/PerconaFT/CMakeLists.txt @@ -33,7 +33,7 @@ endif() include(TokuFeatureDetection) include(TokuSetupCompiler) -include(TokuSetupCTest) +#include(TokuSetupCTest) include(TokuThirdParty) set(TOKU_CMAKE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/storage/tokudb/PerconaFT/portability/toku_config.h.in b/storage/tokudb/PerconaFT/portability/toku_config.h.in index e1412cc9e14..9033f27fd25 100644 --- a/storage/tokudb/PerconaFT/portability/toku_config.h.in +++ b/storage/tokudb/PerconaFT/portability/toku_config.h.in @@ -78,6 +78,10 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #cmakedefine HAVE_O_DIRECT 1 #cmakedefine HAVE_F_NOCACHE 1 +#cmakedefine HAVE_MAP_ANONYMOUS 1 +#cmakedefine HAVE_MINCORE 1 +#cmakedefine HAVE_PR_SET_PTRACER 1 +#cmakedefine HAVE_PR_SET_PTRACER_ANY 1 #cmakedefine HAVE_MALLOC_SIZE 1 #cmakedefine HAVE_MALLOC_USABLE_SIZE 1 #cmakedefine HAVE_MEMALIGN 1 diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 6ff879c9f1a..2e3542e6eb4 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -335,7 +335,7 @@ static inline bool do_ignore_flag_optimization(THD* thd, TABLE* table, bool opt_ static inline uint get_key_parts(const KEY *key) { #if (50609 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100009 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100009 <= MYSQL_VERSION_ID) return key->user_defined_key_parts; #else return key->key_parts; @@ -1969,7 +1969,7 @@ int ha_tokudb::write_frm_data(DB* db, DB_TXN* txn, const char* frm_name) { size_t frm_len = 0; int error = 0; -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID error = table_share->read_frm_image((const uchar**)&frm_data,&frm_len); if (error) { goto cleanup; } #else @@ -2009,7 +2009,7 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) { HA_METADATA_KEY curr_key = hatoku_frm_data; // get the frm data from MySQL -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID error = table_share->read_frm_image((const uchar**)&mysql_frm_data,&mysql_frm_len); if (error) { goto cleanup; diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index a54bebc5420..9cf1affe0c5 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -156,7 +156,7 @@ static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_i static ulong fix_handler_flags(THD *thd, TABLE *table, TABLE *altered_table, Alter_inplace_info *ha_alter_info) { ulong handler_flags = ha_alter_info->handler_flags; -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID // This is automatically supported, hide the flag from later checks handler_flags &= ~Alter_inplace_info::ALTER_PARTITIONED; #endif @@ -659,13 +659,13 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i if (commit) { #if (50613 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100000 <= MYSQL_VERSION_ID) if (ha_alter_info->group_commit_ctx) { ha_alter_info->group_commit_ctx = NULL; } #endif #if (50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599) || \ - (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100000 <= MYSQL_VERSION_ID) #if WITH_PARTITION_STORAGE_ENGINE if (TOKU_PARTITION_WRITE_FRM_DATA || altered_table->part_info == NULL) { #else diff --git a/storage/tokudb/hatoku_cmp.cc b/storage/tokudb/hatoku_cmp.cc index 001af657c1d..be0ea1e3ff3 100644 --- a/storage/tokudb/hatoku_cmp.cc +++ b/storage/tokudb/hatoku_cmp.cc @@ -54,7 +54,7 @@ static bool field_valid_for_tokudb_table(Field* field) { case MYSQL_TYPE_FLOAT: #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100000 <= MYSQL_VERSION_ID) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: @@ -203,7 +203,7 @@ static TOKU_TYPE mysql_to_toku_type (Field* field) { goto exit; #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100000 <= MYSQL_VERSION_ID) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: @@ -3167,7 +3167,7 @@ static bool fields_are_same_type(Field* a, Field* b) { case MYSQL_TYPE_TIMESTAMP: #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ - (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199) + (100000 <= MYSQL_VERSION_ID) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index 3602e0b6b5a..83bf0f699c6 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -30,7 +30,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #pragma interface /* gcc class implementation */ #endif -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID #if !defined(TOKUDB_CHECK_JEMALLOC) #define TOKUDB_CHECK_JEMALLOC 1 diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 74e133ecffd..d97986f162b 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -103,7 +103,7 @@ static int tokudb_rollback_by_xid(handlerton* hton, XID* xid); static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint); -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts); static int tokudb_discover_table_existence(handlerton *hton, const char *db, const char *name); #endif @@ -357,7 +357,7 @@ static int tokudb_init_func(void *p) { tokudb_hton->savepoint_rollback = tokudb_rollback_to_savepoint; tokudb_hton->savepoint_release = tokudb_release_savepoint; -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID tokudb_hton->discover_table = tokudb_discover_table; tokudb_hton->discover_table_existence = tokudb_discover_table_existence; #else @@ -1002,7 +1002,7 @@ static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoin TOKUDB_DBUG_RETURN(error); } -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts) { uchar *frmblob = 0; size_t frmlen; @@ -1047,7 +1047,7 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch DBT value = {}; bool do_commit = false; -#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100199 +#if 100000 <= MYSQL_VERSION_ID tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); if (thd_sql_command(thd) == SQLCOM_CREATE_TABLE && trx && trx->sub_sp_level) { do_commit = false; diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 8d1bd543d0c..cdcdf0286e8 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -91,6 +91,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB #ENDIF() CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) +IF(HAVE_SCHED_GETCPU) + ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU) +ENDIF() IF(NOT MSVC) # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not @@ -249,11 +252,13 @@ IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC) ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1) ENDIF() -CHECK_C_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS) +CHECK_CXX_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS) +IF(HAVE_C99_INITIALIZERS) + ADD_DEFINITIONS(-DHAVE_C99_INITIALIZERS) +ENDIF() ENDIF(NOT MSVC) -CHECK_FUNCTION_EXISTS(asprintf HAVE_ASPRINTF) CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF) # Solaris atomics diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 2f989a47d86..c50d3fd934b 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -7969,7 +7969,7 @@ ha_innobase::build_template( /* Push down an index condition or an end_range check. */ for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -8088,7 +8088,7 @@ ha_innobase::build_template( pushdown. */ for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -8128,7 +8128,7 @@ ha_innobase::build_template( for (i = 0, sql_idx = 0; i < n_stored_fields; i++, sql_idx++) { const Field* field; - while (!table->field[sql_idx]->stored_in_db) { + while (!table->field[sql_idx]->stored_in_db()) { sql_idx++; } @@ -8727,7 +8727,7 @@ calc_row_difference( for (sql_idx = 0; sql_idx < n_fields; sql_idx++) { field = table->field[sql_idx]; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; o_ptr = (const byte*) old_row + get_field_offset(table, field); @@ -8865,7 +8865,7 @@ calc_row_difference( } } } - if (field->stored_in_db) + if (field->stored_in_db()) innodb_idx++; } @@ -11130,7 +11130,7 @@ create_table_def( for (i = 0; i < n_cols; i++) { Field* field = form->field[i]; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; col_type = get_innobase_type_from_mysql_type(&unsigned_type, diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index 076c4b6c3b6..7ea581f99a2 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -386,7 +386,7 @@ ha_innobase::check_if_supported_inplace_alter( const Field* field = table->field[i]; const dict_col_t* col = dict_table_get_nth_col(prebuilt->table, icol); ulint unsigned_flag; - if (!field->stored_in_db) + if (!field->stored_in_db()) continue; icol++; @@ -1233,7 +1233,7 @@ innobase_rec_to_mysql( ulint ilen; const uchar* ifield; - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1286,7 +1286,7 @@ innobase_fields_to_mysql( Field* field; ulint ipos; - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1335,7 +1335,7 @@ innobase_row_to_mysql( Field* field; const dfield_t* df = dtuple_get_nth_field(row, i); - while (!((field= table->field[sql_idx])->stored_in_db)) + while (!((field= table->field[sql_idx])->stored_in_db())) sql_idx++; field->reset(); @@ -1642,7 +1642,7 @@ innobase_fts_check_doc_id_col( for (i = 0; i < n_cols; i++, sql_idx++) { const Field* field; while (!((field= altered_table->field[sql_idx])-> - stored_in_db)) + stored_in_db())) sql_idx++; if (my_strcasecmp(system_charset_info, field->field_name, FTS_DOC_ID_COL_NAME)) { @@ -2508,7 +2508,7 @@ innobase_build_col_map( } while (const Create_field* new_field = cf_it++) { - if (!new_field->stored_in_db) + if (!new_field->stored_in_db()) { sql_idx++; continue; @@ -2517,7 +2517,7 @@ innobase_build_col_map( table->field[old_i]; old_i++) { const Field* field = table->field[old_i]; - if (!table->field[old_i]->stored_in_db) + if (!table->field[old_i]->stored_in_db()) continue; if (new_field->field == field) { col_map[old_innobase_i] = i; @@ -2891,7 +2891,7 @@ prepare_inplace_alter_table_dict( for (uint i = 0; i < altered_table->s->stored_fields; i++, sql_idx++) { const Field* field; while (!((field= altered_table->field[sql_idx])-> - stored_in_db)) + stored_in_db())) sql_idx++; ulint is_unsigned; ulint field_type @@ -3994,7 +3994,7 @@ func_exit: ha_alter_info->alter_info->create_list); while (const Create_field* new_field = cf_it++) { const Field* field; - if (!new_field->stored_in_db) { + if (!new_field->stored_in_db()) { i++; continue; } @@ -4003,7 +4003,7 @@ func_exit: DBUG_ASSERT(innodb_idx < altered_table->s->stored_fields); for (uint old_i = 0; table->field[old_i]; old_i++) { - if (!table->field[old_i]->stored_in_db) + if (!table->field[old_i]->stored_in_db()) continue; if (new_field->field == table->field[old_i]) { goto found_col; @@ -4702,7 +4702,7 @@ innobase_rename_columns_try( & Alter_inplace_info::ALTER_COLUMN_NAME); for (Field** fp = table->field; *fp; fp++, i++) { - if (!((*fp)->flags & FIELD_IS_RENAMED) || !((*fp)->stored_in_db)) { + if (!((*fp)->flags & FIELD_IS_RENAMED) || !((*fp)->stored_in_db())) { continue; } diff --git a/strings/decimal.c b/strings/decimal.c index 2353a8aefce..74d456c9c9f 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -283,7 +283,7 @@ static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) from number for processing */ -int decimal_actual_fraction(decimal_t *from) +int decimal_actual_fraction(const decimal_t *from) { int frac= from->frac, i; dec1 *buf0= from->buf + ROUND_UP(from->intg) + ROUND_UP(frac) - 1; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index dd892b45449..9f62666f97a 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -15385,7 +15385,7 @@ static void test_mysql_insert_id() myheader("test_mysql_insert_id"); - rc= mysql_query(mysql, "drop table if exists t1"); + rc= mysql_query(mysql, "drop table if exists t1,t2"); myquery(rc); /* table without auto_increment column */ rc= mysql_query(mysql, "create table t1 (f1 int, f2 varchar(255), key(f1))"); @@ -18748,8 +18748,11 @@ static void test_progress_reporting() myheader("test_progress_reporting"); - conn= client_connect(CLIENT_PROGRESS, MYSQL_PROTOCOL_TCP, 0); - DIE_UNLESS(conn->client_flag & CLIENT_PROGRESS); + + conn= client_connect(CLIENT_PROGRESS_OBSOLETE, MYSQL_PROTOCOL_TCP, 0); + if (!(conn->server_capabilities & CLIENT_PROGRESS_OBSOLETE)) + return; + DIE_UNLESS(conn->client_flag & CLIENT_PROGRESS_OBSOLETE); mysql_options(conn, MYSQL_PROGRESS_CALLBACK, (void*) report_progress); rc= mysql_query(conn, "set @save=@@global.progress_report_time"); |