diff --git a/CMakeLists.txt b/CMakeLists.txt index 059d68e0a3c..235a65a6437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -317,6 +317,24 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in ${CMAKE_BINARY_DIR}/include/mysql_version.h ) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in ${CMAKE_BINARY_DIR}/sql/sql_builtin.cc) +CONFIGURE_FILE( + ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) + +# Handle the "INFO_*" files. +INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) +# Source: This can be done during the cmake phase, all information is +# available, but should be repeated on each "make" just in case someone +# does "cmake ; make ; bzr pull ; make". +CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs) +ADD_CUSTOM_TARGET(INFO_SRC ALL + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_src.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +) +# Build flags: This must be postponed to the make phase. +ADD_CUSTOM_TARGET(INFO_BIN ALL + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_bin.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +) # Packaging IF(WIN32) @@ -344,6 +362,7 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") OPTIONAL ) INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) + INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) IF(UNIX) INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) ENDIF() diff --git a/README b/README index 48948352e12..2e18fb55a22 100644 --- a/README +++ b/README @@ -3,18 +3,29 @@ MySQL Server This is a release of MySQL, a dual-license SQL database server. For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. -MySQL is brought to you by the MySQL team at Oracle. +MySQL is brought to you by Oracle. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. +MySQL FOSS License Exception +We want free and open source software applications under certain +licenses to be able to use specified GPL-licensed MySQL client +libraries despite the fact that not all such FOSS licenses are +compatible with version 2 of the GNU General Public License. +Therefore there are special exceptions to the terms and conditions +of the GPLv2 as applied to these client libraries, which are +identified and described in more detail in the FOSS License +Exception at +. + This distribution may include materials developed by third parties. For license and attribution notices for these materials, please refer to the documentation that accompanies -this distribution (see the Licenses for Third-Party Components -appendix). A copy of the license/notices is also reproduced -below. +this distribution (see the "Licenses for Third-Party Components" +appendix) or view the online documentation at +. GPLv2 Disclaimer For the avoidance of doubt, except that if any license choice @@ -38,8 +49,6 @@ Some Reference Manual sections of special interest: chapter. - For the new features/bugfix history, see the MySQL Change History appendix. -- For currently known bugs, see the Errors and Common Problems - appendix. You can browse the MySQL Reference Manual online or download it in any of several formats at the URL given earlier in this file. diff --git a/VERSION b/VERSION index 17335ff3fc5..ca1578a8642 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=10 +MYSQL_VERSION_PATCH=11 MYSQL_VERSION_EXTRA= diff --git a/client/client_priv.h b/client/client_priv.h index cc589e55d52..0652444be64 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -50,9 +50,6 @@ enum options_client OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT, -#ifdef HAVE_NDBCLUSTER_DB - OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, -#endif OPT_TRIGGERS, OPT_MYSQL_ONLY_PRINT, OPT_MYSQL_LOCK_DIRECTORY, diff --git a/client/mysqldump.c b/client/mysqldump.c index 66f0c2801f5..c2d526edd4e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1153,6 +1153,9 @@ static int switch_db_collation(FILE *sql_file, { if (strcmp(current_db_cl_name, required_db_cl_name) != 0) { + char quoted_db_buf[NAME_LEN * 2 + 3]; + char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE); + CHARSET_INFO *db_cl= get_charset_by_name(required_db_cl_name, MYF(0)); if (!db_cl) @@ -1160,7 +1163,7 @@ static int switch_db_collation(FILE *sql_file, fprintf(sql_file, "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n", - (const char *) db_name, + (const char *) quoted_db_name, (const char *) db_cl->csname, (const char *) db_cl->name, (const char *) delimiter); @@ -1181,6 +1184,9 @@ static int restore_db_collation(FILE *sql_file, const char *delimiter, const char *db_cl_name) { + char quoted_db_buf[NAME_LEN * 2 + 3]; + char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE); + CHARSET_INFO *db_cl= get_charset_by_name(db_cl_name, MYF(0)); if (!db_cl) @@ -1188,7 +1194,7 @@ static int restore_db_collation(FILE *sql_file, fprintf(sql_file, "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n", - (const char *) db_name, + (const char *) quoted_db_name, (const char *) db_cl->csname, (const char *) db_cl->name, (const char *) delimiter); diff --git a/cmake/info_bin.cmake b/cmake/info_bin.cmake new file mode 100644 index 00000000000..9cec3de0e0f --- /dev/null +++ b/cmake/info_bin.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +# The sole purpose of this cmake control file is to create the "INFO_BIN" file. + +# By having a separate cmake file for this, it is ensured this happens +# only in the build (Unix: "make") phase, not when cmake runs. +# This, in turn, avoids creating stuff in the source directory - +# it should get into the binary directory only. + + +# Get the macros which the "INFO_*" files. +INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) + +# Here is where the action is. +CREATE_INFO_BIN() + diff --git a/cmake/info_macros.cmake.in b/cmake/info_macros.cmake.in new file mode 100644 index 00000000000..9e08cffb2bf --- /dev/null +++ b/cmake/info_macros.cmake.in @@ -0,0 +1,132 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +# Handle/create the "INFO_*" files describing a MySQL (server) binary. +# This is part of the fix for bug#42969. + + +# Several of cmake's variables need to be translated from '@' notation +# to '${}', this is done by the "configure" call in top level "CMakeLists.txt". +# If further variables are used in this file, add them to this list. + +SET(VERSION "@VERSION@") +SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@") +SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") +SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") +SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@") +SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@") +SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@") +SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") +SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@") +SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@") +SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@") + + +# Create an "INFO_SRC" file with information about the source (only). +# We use "bzr version-info", if possible, and the "VERSION" contents. +# +# Outside development (BZR tree), the "INFO_SRC" file will not be modified +# provided it exists (from "make dist" or a source tarball creation). + +MACRO(CREATE_INFO_SRC target_dir) + SET(INFO_SRC "${target_dir}/INFO_SRC") + + IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr) + # Sources are in a BZR repository: Always update. + EXECUTE_PROCESS( + COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE VERSION_INFO + RESULT_VARIABLE RESULT + ) + FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n") + # to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n") + # For better readability ... + FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n") + ELSEIF(EXISTS ${INFO_SRC}) + # Outside a BZR tree, there is no need to change an existing "INFO_SRC", + # it cannot be improved. + ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC) + # If we are building from a source distribution, it also contains "INFO_SRC". + # Similar, the export used for a release build already has the file. + FILE(READ ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC SOURCE_INFO) + FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n") + ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/INFO_SRC) + # This is not the proper location, but who knows ... + FILE(READ ${CMAKE_SOURCE_DIR}/INFO_SRC SOURCE_INFO) + FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n") + ELSE() + # This is a fall-back. + FILE(WRITE ${INFO_SRC} "\nMySQL source ${VERSION}\n") + ENDIF() +ENDMACRO(CREATE_INFO_SRC) + + +# This is for the "real" build, must be run again with each cmake run +# to make sure we report the current flags (not those of some previous run). + +MACRO(CREATE_INFO_BIN) + SET(INFO_BIN "Docs/INFO_BIN") + + FILE(WRITE ${INFO_BIN} "===== Information about the build process: =====\n") + IF (WIN32) + EXECUTE_PROCESS(COMMAND cmd /c date /T OUTPUT_VARIABLE TMP_DATE) + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) + ELSE() + SET(TMP_DATE "(no date command known for this platform)") + ENDIF() + SITE_NAME(HOSTNAME) + FILE(APPEND ${INFO_BIN} "Build was run at ${TMP_DATE} on host '${HOSTNAME}'\n\n") + + # According to the cmake docs, these variables should always be set. + # However, they are empty in my tests, using cmake 2.6.4 on Linux, various Unix, and Windows. + # Still, include this code, so we will profit if a build environment does provide that info. + IF(CMAKE_HOST_SYSTEM) + FILE(APPEND ${INFO_BIN} "Build was done on ${CMAKE_HOST_SYSTEM} using ${CMAKE_HOST_SYSTEM_PROCESSOR}\n") + ENDIF() + IF(CMAKE_CROSSCOMPILING) + FILE(APPEND ${INFO_BIN} "Build was done for ${CMAKE_SYSTEM} using ${CMAKE_SYSTEM_PROCESSOR}\n") + ENDIF() + + # ${CMAKE_VERSION} doesn't work in 2.6.0, use the separate components. + FILE(APPEND ${INFO_BIN} "Build was done using cmake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} \n\n") + + IF (WIN32) + FILE(APPEND ${INFO_BIN} "===== Compiler / generator used: =====\n") + FILE(APPEND ${INFO_BIN} ${CMAKE_GENERATOR} "\n\n") + ELSEIF(UNIX) + FILE(APPEND ${INFO_BIN} "===== Compiler flags used (from the 'sql/' subdirectory): =====\n") + IF(EXISTS sql/CMakeFiles/sql.dir/flags.make) + EXECUTE_PROCESS(COMMAND egrep "^# compile|^C_|^CXX_" sql/CMakeFiles/sql.dir/flags.make OUTPUT_VARIABLE COMPILE_FLAGS) + FILE(APPEND ${INFO_BIN} ${COMPILE_FLAGS} "\n") + ELSE() + FILE(APPEND ${INFO_BIN} "File 'sql/CMakeFiles/sql.dir/flags.make' is not yet found.\n\n") + ENDIF() + ENDIF() + FILE(APPEND ${INFO_BIN} "Pointer size: ${CMAKE_SIZEOF_VOID_P}\n\n") + + FILE(APPEND ${INFO_BIN} "===== Feature flags used: =====\n") + IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) + # Attention: "-N" prevents cmake from entering a recursion, and it must be a separate flag from "-L". + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -N -L ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE FEATURE_FLAGS) + FILE(APPEND ${INFO_BIN} ${FEATURE_FLAGS} "\n") + ELSE() + FILE(APPEND ${INFO_BIN} "File 'CMakeCache.txt' is not yet found.\n\n") + ENDIF() + + FILE(APPEND ${INFO_BIN} "===== EOF =====\n") +ENDMACRO(CREATE_INFO_BIN) + diff --git a/cmake/info_src.cmake b/cmake/info_src.cmake new file mode 100644 index 00000000000..97776b70901 --- /dev/null +++ b/cmake/info_src.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +# The sole purpose of this cmake control file is to create the "INFO_SRC" file. + +# As long as and "bzr pull" (or "bzr commit") is followed by a "cmake", +# the call in top level "CMakeLists.txt" is sufficient. +# This file is to provide a separate target for the "make" phase, +# to ensure the BZR revision-id is correct even after a sequence +# cmake ; make ; bzr pull ; make + + +# Get the macros which handle the "INFO_*" files. +INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) + +# Here is where the action is. +CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs) + diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in index 95412370c28..ef1677db1c0 100644 --- a/cmake/make_dist.cmake.in +++ b/cmake/make_dist.cmake.in @@ -1,4 +1,4 @@ -# Copyright (C) 2009 Sun Microsystems, Inc +# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,6 +29,8 @@ SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@") SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") +SET(VERSION "@VERSION@") + SET(MYSQL_DOCS_LOCATION "@MYSQL_DOCS_LOCATION@") @@ -100,12 +102,22 @@ CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc ${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY) +# Copy spec files +CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/mysql.${VERSION}.spec + ${PACKAGE_DIR}/support-files/mysql.${VERSION}.spec COPYONLY) + # Add documentation, if user has specified where to find them IF(MYSQL_DOCS_LOCATION) MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION}) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory "${MYSQL_DOCS_LOCATION}" "${PACKAGE_DIR}") ENDIF() +# Ensure there is an "INFO_SRC" file. +INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) +IF(NOT EXISTS ${PACKAGE_DIR}/Docs/INFO_SRC) + CREATE_INFO_SRC(${PACKAGE_DIR}/Docs) +ENDIF() + # In case we used CPack, it could have copied some # extra files that are not usable on different machines. FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt) diff --git a/extra/comp_err.c b/extra/comp_err.c index 4c40e70f5b7..9f7b47a1a1e 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -219,14 +219,13 @@ static void print_escaped_string(FILE *f, const char *str) static int create_header_files(struct errors *error_head) { - uint er_last; + uint er_last= 0; FILE *er_definef, *sql_statef, *er_namef; struct errors *tmp_error; struct message *er_msg; const char *er_text; DBUG_ENTER("create_header_files"); - LINT_INIT(er_last); if (!(er_definef= my_fopen(HEADERFILE, O_WRONLY, MYF(MY_WME)))) { diff --git a/include/my_bit.h b/include/my_bit.h index b396b84b0d8..cdb0680b652 100644 --- a/include/my_bit.h +++ b/include/my_bit.h @@ -1,3 +1,18 @@ +/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef MY_BIT_INCLUDED #define MY_BIT_INCLUDED @@ -44,9 +59,12 @@ static inline uint my_count_bits(ulonglong v) #endif } -static inline uint my_count_bits_ushort(ushort v) +static inline uint my_count_bits_uint32(uint32 v) { - return _my_bits_nbits[v]; + return (uint) (uchar) (_my_bits_nbits[(uchar) v] + + _my_bits_nbits[(uchar) (v >> 8)] + + _my_bits_nbits[(uchar) (v >> 16)] + + _my_bits_nbits[(uchar) (v >> 24)]); } diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 78b33b09a51..80a7fce1155 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,9 +125,10 @@ bitmap_is_set(const MY_BITMAP *map,uint bit) static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) { - *(map1)->last_word_ptr|= (map1)->last_word_mask; - *(map2)->last_word_ptr|= (map2)->last_word_mask; - return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0; + if (memcmp(map1->bitmap, map2->bitmap, 4*(no_words_in_map(map1)-1)) != 0) + return FALSE; + return ((*map1->last_word_ptr | map1->last_word_mask) == + (*map2->last_word_ptr | map2->last_word_mask)); } #define bitmap_clear_all(MAP) \ diff --git a/include/my_global.h b/include/my_global.h index c1ae8a6d6bc..02f4eb596d0 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1476,7 +1476,6 @@ static inline double rint(double x) #undef HAVE_OPENSSL #undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #endif /* EMBEDDED_LIBRARY */ diff --git a/include/my_pthread.h b/include/my_pthread.h index b8608a97849..e5215648791 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -806,8 +806,7 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr; typedef ulong my_thread_id; extern my_bool my_thread_global_init(void); -extern my_bool my_thread_basic_global_init(void); -extern void my_thread_basic_global_reinit(void); +extern void my_thread_global_reinit(void); extern void my_thread_global_end(void); extern my_bool my_thread_init(void); extern void my_thread_end(void); diff --git a/include/my_sys.h b/include/my_sys.h index 5cef60799b8..ed96abc7711 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -643,7 +643,6 @@ extern int my_error_register(const char** (*get_errmsgs) (), extern const char **my_error_unregister(int first, int last); extern void my_message(uint my_err, const char *str,myf MyFlags); extern void my_message_stderr(uint my_err, const char *str, myf MyFlags); -extern my_bool my_basic_init(void); extern my_bool my_init(void); extern void my_end(int infoflag); extern int my_redel(const char *from, const char *to, int MyFlags); diff --git a/include/mysql_embed.h b/include/mysql_embed.h index e860a4486eb..3b6f851bd6f 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -25,7 +25,6 @@ #undef HAVE_DLOPEN /* No udf functions */ #undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #endif /* EMBEDDED_LIBRARY */ #endif /* MYSQL_EMBED_INCLUDED */ diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 4b519d3e37f..a95419fbc19 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -5,8 +5,6 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment funcs_1.charset_collation_1 # depends on compile-time decisions -innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected - main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically @@ -16,8 +14,6 @@ main.sp @solaris # Bug#47791 2010-01-20 alik Several tes main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris -rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again -rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_innodb_bug28430 # Bug#46029 sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun diff --git a/mysql-test/collections/disabled-daily.list b/mysql-test/collections/disabled-daily.list new file mode 100644 index 00000000000..6edb3d1d0b3 --- /dev/null +++ b/mysql-test/collections/disabled-daily.list @@ -0,0 +1,9 @@ +rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. diff --git a/mysql-test/collections/disabled-weekly.list b/mysql-test/collections/disabled-weekly.list new file mode 100644 index 00000000000..6edb3d1d0b3 --- /dev/null +++ b/mysql-test/collections/disabled-weekly.list @@ -0,0 +1,9 @@ +rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. diff --git a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test index 6817405b2d9..af048aeb92a 100644 --- a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test +++ b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test @@ -2,22 +2,24 @@ # # BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log" -# Replication should work when OPTIMIZE TABLE timeouts, and -# when OPTIMIZE TABLE is executed on a non-existing table +# Replication should work when when OPTIMIZE TABLE is +# executed on a non-existing table. # +# Due to patch for BUG#989, checking that an OPTIMIZE +# that fails due to a lock wait timeout on an InnoDB table +# is not valid anymore, as an mdl lock is hit before, +# thence no timeout occurs, but instead a deadlock. +# + eval CREATE TABLE t1 ( a int ) ENGINE=$engine_type; BEGIN; INSERT INTO t1 VALUES (1); connection master1; -OPTIMIZE TABLE t1; - OPTIMIZE TABLE non_existing; sync_slave_with_master; -# End of 4.1 tests - connection master; select * from t1; commit; diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 5c68254f00e..86831164c71 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -61,7 +61,7 @@ let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status # Set way of comparing let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value'); -if ($is_number) +if ($_is_number) { let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value); } @@ -70,7 +70,7 @@ while (`$_query`) { if (!$_status_timeout_counter) { - --echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparison $status_var_value **** + --echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparsion $status_var_value **** --echo Note: the following output may have changed since the failure was detected --echo **** Showing STATUS, PROCESSLIST **** eval SHOW $status_type STATUS LIKE '$status_var'; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5e61b4f1867..b0295f8380a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1560,12 +1560,6 @@ sub command_line_setup { $debug_d= "d,query,info,error,enter,exit"; } - if ($opt_debug && $opt_debug ne "1") - { - $debug_d= "d,$opt_debug"; - $debug_d= "d,query,info,error,enter,exit" if $opt_debug eq "std"; - } - mtr_report("Checking supported features..."); check_ndbcluster_support(\%mysqld_variables); @@ -2166,6 +2160,7 @@ sub environment_setup { $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir; $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir; $ENV{'MYSQL_LIBDIR'}= "$basedir/lib"; + $ENV{'MYSQL_BINDIR'}= "$bindir"; $ENV{'MYSQL_SHAREDIR'}= $path_language; $ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir; diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 304f562d47d..69b93555ec0 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1383,3 +1383,11 @@ ALTER TABLE t1 CHANGE a id INT; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 DROP TABLE t1; +# +# Bug#11754461 CANNOT ALTER TABLE WHEN KEY PREFIX TOO LONG +# +DROP DATABASE IF EXISTS db1; +CREATE DATABASE db1 CHARACTER SET utf8; +CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100))); +ALTER TABLE db1.t1 ADD baz INT; +DROP DATABASE db1; diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 7f0cdf3f17b..231755a3f69 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -238,3 +238,6 @@ select a from t1 where a like "abcdefgh a abcdefghá drop table t1; +set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators) +using cp1250); +ERROR HY000: Unknown locale: '1' diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 9a781c61e91..24604d9d5fc 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -386,6 +386,8 @@ FD FD FD D18D FD FE FE FE D18E FE FF FF FF D18F FF DROP TABLE t1; +set global LC_TIME_NAMES=convert((-8388608) using cp1251); +ERROR HY000: Unknown locale: '-8388608' # # End of 5.1 tests # @@ -3217,5 +3219,20 @@ maketime(`a`,`a`,`a`) DROP TABLE t1; SET sql_mode=default; # +# Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations +# +CREATE TABLE t1 (test1 INT, test2 VARCHAR(255)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `test1` int(11) DEFAULT NULL, + `test2` varchar(255) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1; +COALESCE(IF(test1=1, 1, NULL), test2) +SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1; +COALESCE(IF(test1=1, NULL, 1), test2) +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result index bd25b1beed4..5a402d57e65 100644 --- a/mysql-test/r/ctype_eucjpms.result +++ b/mysql-test/r/ctype_eucjpms.result @@ -9859,6 +9859,8 @@ hex(convert(_eucjpms 0xA5FE41 using ucs2)) select hex(convert(_eucjpms 0x8FABF841 using ucs2)); hex(convert(_eucjpms 0x8FABF841 using ucs2)) 003F0041 +set global LC_TIME_NAMES=convert((convert((0x63) using eucjpms)) using utf8); +ERROR HY000: Unknown locale: 'c' # # Start of 5.5 tests # diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 78827b5b907..abeb19c0c8f 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -218,6 +218,12 @@ hex(a) hex(lower(a)) hex(upper(a)) 8352835E 8352835E 8352835E 8372835E 8372835E 8372835E DROP TABLE t1; +# +# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED. +# +SELECT QUOTE('ƒ\'); +QUOTE('ƒ\') +'ƒ\' # End of 5.1 tests # # Start of 5.5 tests diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 0ee80b921a1..e41544f2197 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -990,8 +990,8 @@ old_password(name) 14e500b131773991 select quote(name) from bug20536; quote(name) -???????? -???????????????? +'test1' +'\'test\\_2\'' drop table bug20536; set names ucs2; ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' @@ -1238,6 +1238,17 @@ CREATE VIEW v1 AS SELECT 1 from t1 WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +# +# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +# +SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850)); +HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850)) +00 +SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED); +CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '' End of 5.0 tests # # Start of 5.5 tests diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index beafbf80e1e..ebb1bd443a2 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -30,13 +30,13 @@ binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' 1 1 1 select hex(_utf16 0x44); hex(_utf16 0x44) -00000044 +0044 select hex(_utf16 0x3344); hex(_utf16 0x3344) 3344 select hex(_utf16 0x113344); hex(_utf16 0x113344) -000000113344 +00113344 CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16; INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004'); SELECT hex(word) FROM t1 ORDER BY word; @@ -434,10 +434,10 @@ aardvarz DROP TABLE t1; SELECT hex(cast(0xAA as char character set utf16)); hex(cast(0xAA as char character set utf16)) -000000AA +00AA SELECT hex(convert(0xAA using utf16)); hex(convert(0xAA using utf16)) -000000AA +00AA CREATE TABLE t1 (a char(10) character set utf16); INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); SELECT HEX(a) FROM t1; @@ -1102,5 +1102,20 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t2; # +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf16'a' THEN 'A' END +A +SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf16'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 37d5aa98be3..d749383d249 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -1152,5 +1152,20 @@ d f DROP TABLE t1; # +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf32'a' THEN 'A' END +A +SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf32'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index 2282f65c456..352f421eda7 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -724,7 +724,7 @@ utf8_general_ci utf8_general_ci CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest1`; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -757,8 +757,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -791,7 +791,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql @@ -800,7 +800,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest2`; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -833,8 +833,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -867,7 +867,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql @@ -1742,7 +1742,7 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1770,8 +1770,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1799,7 +1799,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql @@ -1821,7 +1821,7 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1849,8 +1849,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1878,7 +1878,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql @@ -2486,7 +2486,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER USE `mysqltest1`; /*!50106 SET @save_time_zone= @@TIME_ZONE */ ; DELIMITER ;; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2512,9 +2512,9 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ;; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2540,7 +2540,7 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ; /*!50106 SET TIME_ZONE= @save_time_zone */ ; @@ -2553,7 +2553,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER USE `mysqltest2`; /*!50106 SET @save_time_zone= @@TIME_ZONE */ ; DELIMITER ;; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2579,9 +2579,9 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ;; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2607,7 +2607,7 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ; /*!50106 SET TIME_ZONE= @save_time_zone */ ; diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result index 9d27fdb22bb..1385612fc32 100644 --- a/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -724,7 +724,7 @@ utf8_general_ci utf8_general_ci CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest1`; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -757,8 +757,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -791,7 +791,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql @@ -800,7 +800,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; USE `mysqltest2`; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -833,8 +833,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -867,7 +867,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql @@ -1742,7 +1742,7 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1770,8 +1770,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1799,7 +1799,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql @@ -1821,7 +1821,7 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(0),(1); -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1849,8 +1849,8 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -1878,7 +1878,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ; ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql @@ -2486,7 +2486,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER USE `mysqltest1`; /*!50106 SET @save_time_zone= @@TIME_ZONE */ ; DELIMITER ;; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2512,9 +2512,9 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ;; -ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2540,7 +2540,7 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ; /*!50106 SET TIME_ZONE= @save_time_zone */ ; @@ -2553,7 +2553,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER USE `mysqltest2`; /*!50106 SET @save_time_zone= @@TIME_ZONE */ ; DELIMITER ;; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2579,9 +2579,9 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ;; -ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; /*!50003 SET @saved_cs_results = @@character_set_results */ ;; /*!50003 SET @saved_col_connection = @@collation_connection */ ;; @@ -2607,7 +2607,7 @@ END */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; -ALTER DATABASE mysqltest2 CHARACTER SET cp866 COLLATE cp866_general_ci ;; +ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;; DELIMITER ; /*!50106 SET TIME_ZONE= @save_time_zone */ ; diff --git a/mysql-test/r/file_contents.result b/mysql-test/r/file_contents.result new file mode 100644 index 00000000000..110769e12f8 --- /dev/null +++ b/mysql-test/r/file_contents.result @@ -0,0 +1,6 @@ + +Checking 'INFO_SRC' and 'INFO_BIN' +INFO_SRC: Found MySQL version number / Found BZR revision id +INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line + +End of tests diff --git a/mysql-test/r/filesort_debug.result b/mysql-test/r/filesort_debug.result index cb62e5e7a21..c35a6753353 100644 --- a/mysql-test/r/filesort_debug.result +++ b/mysql-test/r/filesort_debug.result @@ -14,3 +14,20 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1; ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1 DROP TABLE t1; DROP FUNCTION f1; +# +# Bug #11747102 +# 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES +# +# connection 1 +CREATE TABLE t1(f0 int auto_increment primary key, f1 int); +INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5); +SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed'; +# Sending: (not reaped since connection is killed later) +SELECT * FROM t1 ORDER BY f1 ASC, f0; +# connection 2 +SET DEBUG_SYNC='now WAIT_FOR filesort_started'; +KILL @id; +SET DEBUG_SYNC='now SIGNAL filesort_killed'; +# connection default +SET DEBUG_SYNC= "RESET"; +DROP TABLE t1; diff --git a/mysql-test/r/func_encrypt_ucs2.result b/mysql-test/r/func_encrypt_ucs2.result new file mode 100644 index 00000000000..2ca40434cae --- /dev/null +++ b/mysql-test/r/func_encrypt_ucs2.result @@ -0,0 +1,19 @@ +# +# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +# +SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2))); +CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2))) +9 +SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED); +CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '' +SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))); +CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))) +4 +SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED); +CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'test' diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 2a95b234548..bbc86ddeda0 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -136,7 +136,7 @@ dayname("1962-03-03") dayname("1962-03-03")+0 Saturday 5 select monthname("1972-03-04"),monthname("1972-03-04")+0; monthname("1972-03-04") monthname("1972-03-04")+0 -March 3 +March 0 select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T') 00|12|0|12|00|AM|12:00:00 AM|00|00:00:00 @@ -1368,3 +1368,11 @@ SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR); SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR) NULL # +# BUG#59895 - setting storage engine to null segfaults mysqld +# +SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1; +MONTHNAME(0) MONTHNAME(0) IS NULL MONTHNAME(0) + 1 +NULL 1 NULL +SET storage_engine=NULL; +ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL' +# diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 5706f076c6c..22cb6d29b2c 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1034,6 +1034,14 @@ p NULL NULL drop table t1; +# +# Test for bug #59888 "debug assertion when attempt to create spatial index +# on char > 31 bytes". +# +create table t1(a char(32) not null) engine=myisam; +create spatial index i on t1 (a); +ERROR 42000: A SPATIAL index may only contain a geometrical type column +drop table t1; End of 5.1 tests CREATE TABLE t1( col0 BINARY NOT NULL, diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 188485d366f..2a52d63e1d7 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1856,6 +1856,42 @@ ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1; COUNT(*) 2 DROP TABLE t1; +# +# Bug#59839: Aggregation followed by subquery yields wrong result +# +CREATE TABLE t1 ( +a INT, +b INT, +c INT, +KEY (a, b) +); +INSERT INTO t1 VALUES +( 1, 1, 1 ), +( 1, 2, 2 ), +( 1, 3, 3 ), +( 1, 4, 6 ), +( 1, 5, 5 ), +( 1, 9, 13 ), +( 2, 1, 6 ), +( 2, 2, 7 ), +( 2, 3, 8 ); +EXPLAIN +SELECT a, AVG(t1.b), +(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c, +(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c +FROM t1 GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL a 10 NULL 9 Using index +3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 2 Using where +2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 2 Using where +SELECT a, AVG(t1.b), +(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c, +(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c +FROM t1 GROUP BY a; +a AVG(t1.b) t11c t12c +1 4.0000 6 6 +2 2.0000 7 7 +DROP TABLE t1; # End of 5.1 tests # # Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00 diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index b0858894b71..9d9f5df5211 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -842,7 +842,7 @@ SET max_heap_table_size = 16384; SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size; SET GLOBAL myisam_data_pointer_size = 2; INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -call mtr.add_suppression("mysqld: The table '.*#sql.*' is full"); +call mtr.add_suppression("mysqld.*: The table '.*#sql.*' is full"); INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7; Got one of the listed errors SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index e36bef1f338..5a3e7938121 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -680,4 +680,21 @@ Warnings: Warning 1292 Truncated incorrect datetime value: '1' DROP FUNCTION f1; DROP TABLE t1; +# +# BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a +# table is updated twice +# +CREATE TABLE t1( +pk INT, +a INT, +PRIMARY KEY (pk) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (0,0); +UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2; + +# Should be (1,2) +SELECT * FROM t1; +pk a +1 2 +DROP TABLE t1; end of tests diff --git a/mysql-test/r/multi_update_innodb.result b/mysql-test/r/multi_update_innodb.result new file mode 100644 index 00000000000..12a94accc1f --- /dev/null +++ b/mysql-test/r/multi_update_innodb.result @@ -0,0 +1,29 @@ +# +# BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a +# table is updated twice +# +CREATE TABLE t1( +pk INT, +a INT, +b INT, +PRIMARY KEY (pk) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0,0,0); +UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. +SELECT * FROM t1; +pk a b +0 0 0 +CREATE VIEW v1 AS SELECT * FROM t1; +UPDATE v1 AS A, t1 AS B SET A.pk = 1, B.a = 2; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. +SELECT * FROM t1; +pk a b +0 0 0 +UPDATE t1 AS A, t1 AS B SET A.a = 1, B.b = 2; +# Should be (0,1,2) +SELECT * FROM t1; +pk a b +0 1 2 +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index dd3ea5e9716..8972b12abb9 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4591,5 +4591,41 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO DROP TABLE `comment_table`; # +# BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN +# DATABASE NAMES IN ALTER DATABASE +# +CREATE DATABASE `test-database`; +USE `test-database`; +CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN +END | +ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci; +ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `test` ( + `c1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; +DROP DATABASE `test-database`; +# # End of 5.1 tests # diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 9c8b93d9fe2..1d7a08e9a7c 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2264,3 +2264,51 @@ INSERT INTO t1 VALUES(0); DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; End of 5.1 tests +# +# BUG#55385: UPDATE statement throws an error, but still updates +# the table entries +CREATE TABLE t1_part ( +partkey int, +nokey int +) PARTITION BY LINEAR HASH(partkey) PARTITIONS 3; +INSERT INTO t1_part VALUES (1, 1) , (10, 10); +CREATE VIEW v1 AS SELECT * FROM t1_part; + +# Should be (1,1),(10,10) +SELECT * FROM t1_part; +partkey nokey +1 1 +10 10 + +# Case 1 +# Update is refused because partitioning key is updated +UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.partkey = 2, B.nokey = 3; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. +UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2, B.partkey = 3; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. + +# Case 2 +# Like 1, but partition accessed through a view +UPDATE t1_part AS A NATURAL JOIN v1 as B SET A.nokey = 2 , B.partkey = 3; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. +UPDATE v1 AS A NATURAL JOIN t1_part as B SET A.nokey = 2 , B.partkey = 3; +ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'. + +# Should be (1,1),(10,10) +SELECT * FROM t1_part; +partkey nokey +1 1 +10 10 + +# Case 3 +# Update is accepted because partitioning key is not updated +UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2 , B.nokey = 3; + +# Should be (1,3),(10,3) +SELECT * FROM t1_part; +partkey nokey +1 3 +10 3 + +DROP VIEW v1; +DROP TABLE t1_part; diff --git a/mysql-test/r/signal_code.result b/mysql-test/r/signal_code.result index 2ecba4701fa..ca46f1d2079 100644 --- a/mysql-test/r/signal_code.result +++ b/mysql-test/r/signal_code.result @@ -20,16 +20,16 @@ return 0; end $$ show procedure code signal_proc; Pos Instruction -0 stmt 131 "SIGNAL foo" -1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 132 "RESIGNAL foo" -3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 130 "SIGNAL foo" +1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 131 "RESIGNAL foo" +3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..." drop procedure signal_proc; show function code signal_func; Pos Instruction -0 stmt 131 "SIGNAL foo" -1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 132 "RESIGNAL foo" -3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 130 "SIGNAL foo" +1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 131 "RESIGNAL foo" +3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..." 4 freturn 3 0 drop function signal_func; diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index c7ea4cbb311..16a43a00f04 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -155,11 +155,11 @@ Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." -3 stmt 89 "call sudoku_init()" +3 stmt 88 "call sudoku_init()" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 -7 stmt 89 "call sudoku_count()" +7 stmt 88 "call sudoku_count()" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index 6ef3bf392d9..ad0d103c1e0 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -142,3 +142,27 @@ XA PREPARE 'x'; XA PREPARE 'x'; ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state XA ROLLBACK 'x'; +# +# Bug#59986 Assert in Diagnostics_area::set_ok_status() for XA COMMIT +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB; +INSERT INTO t1 VALUES (1, 1), (2, 2); +# Connection con1 +XA START 'a'; +UPDATE t1 SET b= 3 WHERE a=1; +# Connection default +XA START 'b'; +UPDATE t1 SET b=4 WHERE a=2; +# Sending: +UPDATE t1 SET b=5 WHERE a=1; +# Connection con1 +UPDATE t1 SET b=6 WHERE a=2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +XA COMMIT 'a'; +ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected +# Connection default +# Reaping: UPDATE t1 SET b=5 WHERE a=1 +XA END 'b'; +XA ROLLBACK 'b'; +DROP TABLE t1; diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 4568775d3fd..8ca9ab84bf7 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1124,6 +1124,14 @@ Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT une SELECT UPDATEXML(CONVERT(_latin1'