diff --git a/.bzrignore b/.bzrignore index a17b1dec6cb..4c437cdd36c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -997,6 +997,7 @@ libmysqld/.deps/sql_cursor.Po libmysqld/.deps/sql_db.Po libmysqld/.deps/sql_delete.Po libmysqld/.deps/sql_truncate.Po +libmysqld/.deps/sql_reload.Po libmysqld/.deps/datadict.Po libmysqld/.deps/sql_derived.Po libmysqld/.deps/sql_do.Po @@ -1175,6 +1176,7 @@ libmysqld/sql_cursor.h libmysqld/sql_db.cc libmysqld/sql_delete.cc libmysqld/sql_truncate.cc +libmysqld/sql_reload.cc libmysqld/datadict.cc libmysqld/sql_derived.cc libmysqld/sql_do.cc @@ -2067,6 +2069,7 @@ sql/.deps/sql_cursor.Po sql/.deps/sql_db.Po sql/.deps/sql_delete.Po sql/.deps/sql_truncate.Po +sql/.deps/sql_reload.Po sql/.deps/datadict.Po sql/.deps/sql_derived.Po sql/.deps/sql_do.Po diff --git a/Makefile.am b/Makefile.am index ef815238998..c4b4f6d6f92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -264,7 +264,8 @@ test-full-qa: # Headers which need to be checked for abi/api compatibility. # -API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ +API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin_audit.h \ + $(top_srcdir)/include/mysql/plugin_ftparser.h \ $(top_srcdir)/include/mysql.h \ $(top_srcdir)/include/mysql/psi/psi_abi_v1.h \ $(top_srcdir)/include/mysql/psi/psi_abi_v2.h \ diff --git a/README b/README index e1a4a88c6f5..7fb52404b17 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is a release of MySQL, a dual-license SQL database server. +This is a release of MySQL, a dual-license SQL DBMS. MySQL is brought to you by the MySQL team at Oracle Corporation. ************************************************************ diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e36659d74bf..80c5bbd1c9f 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -64,7 +64,10 @@ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c) SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqlslap mysqlclient) -ADD_EXECUTABLE(echo echo.c) +# "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/". +IF(WIN32) + MYSQL_ADD_EXECUTABLE(echo echo.c) +ENDIF(WIN32) SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap PROPERTIES HAS_CXX TRUE) diff --git a/client/mysql.cc b/client/mysql.cc index a985c135361..14473ba4b51 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -93,6 +93,7 @@ extern "C" { #else #include #define HAVE_READLINE +#define USE_POPEN #endif //int vidattr(long unsigned int attrs); // Was missing in sun curses } @@ -108,10 +109,6 @@ extern "C" { #define cmp_database(cs,A,B) strcmp((A),(B)) #endif -#if !defined(__WIN__) && !defined(THREAD) -#define USE_POPEN -#endif - #include "completion_hash.h" #define PROMPT_CHAR '\\' diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 8416432ffe1..ddc8105abec 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -6244,8 +6244,10 @@ get_one_option(int optid, const struct my_option *opt, char *argument) print_version(); exit(0); case OPT_MYSQL_PROTOCOL: +#ifndef EMBEDDED_LIBRARY opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); +#endif break; case '?': usage(); diff --git a/client/sql_string.cc b/client/sql_string.cc index 6b749409a64..dec6ac94eb2 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -31,9 +31,12 @@ ** String functions *****************************************************************************/ -bool String::real_alloc(uint32 arg_length) +bool String::real_alloc(uint32 length) { - arg_length=ALIGN_SIZE(arg_length+1); + uint32 arg_length= ALIGN_SIZE(length + 1); + DBUG_ASSERT(arg_length > length); + if (arg_length <= length) + return TRUE; /* Overflow */ str_length=0; if (Alloced_length < arg_length) { @@ -56,6 +59,9 @@ bool String::real_alloc(uint32 arg_length) bool String::realloc(uint32 alloc_length) { uint32 len=ALIGN_SIZE(alloc_length+1); + DBUG_ASSERT(len > alloc_length); + if (len <= alloc_length) + return TRUE; /* Overflow */ if (Alloced_length < len) { char *new_ptr; diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake index 7911b7848a8..b9ff9f7af73 100644 --- a/cmake/abi_check.cmake +++ b/cmake/abi_check.cmake @@ -15,7 +15,8 @@ # # Headers which need to be checked for abi/api compatibility are in -# API_PREPROCESSOR_HEADER. +# API_PREPROCESSOR_HEADER. plugin.h is tested implicitly via +# plugin_audit.h and plugin_ftparser.h. # # We use gcc specific preprocessing command and sed/diff, so it will # only be run on Unix and only if gcc is used. @@ -27,7 +28,8 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux") SET(COMPILER ${CMAKE_C_COMPILER}) ENDIF() SET(API_PREPROCESSOR_HEADER - ${CMAKE_SOURCE_DIR}/include/mysql/plugin.h + ${CMAKE_SOURCE_DIR}/include/mysql/plugin_audit.h + ${CMAKE_SOURCE_DIR}/include/mysql/plugin_ftparser.h ${CMAKE_SOURCE_DIR}/include/mysql.h ${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.h ${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v2.h @@ -38,18 +40,18 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux") -DCOMPILER=${COMPILER} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} - "-DDMYSQL_ABI_CHECK -DABI_HEADERS=${API_PREPROCESSOR_HEADER}" + "-DABI_HEADERS=${API_PREPROCESSOR_HEADER}" -P ${CMAKE_SOURCE_DIR}/cmake/do_abi_check.cmake VERBATIM ) ADD_CUSTOM_TARGET(abi_check_all COMMAND ${CMAKE_COMMAND} - -DCMAKE_C_COMPILER=${COMPILER} - -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} - -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} - "-DMYSQL_ABI_CHECK -DABI_HEADERS=${API_PREPROCESSOR_HEADER}" - -P ${CMAKE_SOURCE_DIR}/cmake/scripts/do_abi_check.cmake + -DCOMPILER=${COMPILER} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -DBINARY_DIR=${CMAKE_BINARY_DIR} + "-DABI_HEADERS=${API_PREPROCESSOR_HEADER}" + -P ${CMAKE_SOURCE_DIR}/cmake/do_abi_check.cmake VERBATIM ) ENDIF() diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake index aa7784e7372..78006bd018c 100644 --- a/cmake/do_abi_check.cmake +++ b/cmake/do_abi_check.cmake @@ -56,8 +56,9 @@ FOREACH(file ${ABI_HEADERS}) SET(tmpfile ${file}.pp.tmp) EXECUTE_PROCESS( COMMAND ${COMPILER} - -E -nostdinc -dI -I${SOURCE_DIR}/include -I${BINARY_DIR}/include - -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql ${file} + -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include + -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql + ${file} ERROR_QUIET OUTPUT_FILE ${tmpfile}) EXECUTE_PROCESS( COMMAND sed -e diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 9fcfc031281..2aed1267fe6 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -782,7 +782,7 @@ dnl Emits shell script for checking configure arguments dnl Arguments to this macro is default value for selected plugins AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [none])) + __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [default])) ]) AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[ diff --git a/configure.in b/configure.in index 7f342f1ceda..80b88c76831 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.5.6-m3], [], [mysql]) +AC_INIT([MySQL Server], [5.5.7-rc], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM @@ -2605,7 +2605,7 @@ MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support], dnl -- ndbcluster requires partition to be enabled -MYSQL_CONFIGURE_PLUGINS([none]) +MYSQL_CONFIGURE_PLUGINS([default]) # Only build client code? AC_ARG_WITH(server, diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp index 7a9d50aaac9..7fc681e1a05 100644 --- a/extra/yassl/taocrypt/src/coding.cpp +++ b/extra/yassl/taocrypt/src/coding.cpp @@ -185,7 +185,7 @@ void Base64Decoder::Decode() { word32 bytes = coded_.size(); word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz); - plainSz = (plainSz * 3 + 3) / 4; + plainSz = ((plainSz * 3) / 4) + 3; decoded_.New(plainSz); word32 i = 0; diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index aee7561d242..5334fc0f5ae 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -54,6 +54,7 @@ SET(HEADERS keycache.h m_ctype.h my_attribute.h + my_compiler.h ${HEADERS_GEN_CONFIGURE} ) diff --git a/include/Makefile.am b/include/Makefile.am index 9dbd818d592..415e2ef8c8c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -28,12 +28,15 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ mysql/client_plugin.h mysql/plugin_auth_common.h \ mysql/services.h \ mysql/service_my_snprintf.h mysql/service_thd_alloc.h \ + mysql/service_thread_scheduler.h \ + mysql/service_thd_wait.h \ my_pthread.h my_no_pthread.h \ decimal.h errmsg.h my_global.h my_net.h \ my_getopt.h sslopt-longopts.h my_dir.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \ - $(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h + m_ctype.h my_attribute.h my_compiler.h \ + $(HEADERS_GEN_CONFIGURE) $(HEADERS_GEN_MAKE) \ + probes_mysql.h probes_mysql_nodtrace.h noinst_HEADERS = lf.h my_bit.h \ heap.h my_bitmap.h my_uctype.h password.h \ @@ -47,7 +50,7 @@ noinst_HEADERS = lf.h my_bit.h \ my_user.h my_atomic.h atomic/nolock.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \ atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \ - atomic/solaris.h mysql/innodb_priv.h my_compiler.h + atomic/solaris.h mysql/innodb_priv.h pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \ mysql/psi/mysql_file.h diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h index 8baa84e110e..90602ef900c 100644 --- a/include/atomic/x86-gcc.h +++ b/include/atomic/x86-gcc.h @@ -111,9 +111,9 @@ On some platforms (e.g. Mac OS X and Solaris) the ebx register is held as a pointer to the global offset table. Thus we're not allowed to use the b-register on those platforms when compiling - PIC code, to avoid this we push ebx and pop ebx and add a movl - instruction to avoid having ebx in the interface of the assembler - instruction. + PIC code, to avoid this we push ebx and pop ebx. The new value + is copied directly from memory to avoid problems with a implicit + manipulation of the stack pointer by the push. cmpxchg8b works on both 32-bit platforms and 64-bit platforms but the code here is only used on 32-bit platforms, on 64-bit @@ -121,11 +121,13 @@ fine. */ #define make_atomic_cas_body64 \ - int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \ - asm volatile ("push %%ebx; movl %3, %%ebx;" \ - LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx" \ - : "=m" (*a), "+A" (*cmp), "=c" (ret) \ - : "m" (ebx), "c" (ecx), "m" (*a) \ + asm volatile ("push %%ebx;" \ + "movl (%%ecx), %%ebx;" \ + "movl 4(%%ecx), %%ecx;" \ + LOCK_prefix "; cmpxchg8b %0;" \ + "setz %2; pop %%ebx" \ + : "=m" (*a), "+A" (*cmp), "=c" (ret) \ + : "c" (&set), "m" (*a) \ : "memory", "esp") #endif diff --git a/include/m_ctype.h b/include/m_ctype.h index 06cbfd779c8..42e8f88cc0e 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -539,6 +539,11 @@ size_t my_strnxfrm_unicode(CHARSET_INFO *, uchar *dst, size_t dstlen, const uchar *src, size_t srclen); +size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *, + uchar *dst, size_t dstlen, + const uchar *src, size_t srclen); +size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t); + int my_wildcmp_unicode(CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, diff --git a/include/my_pthread.h b/include/my_pthread.h index 0c89a2ed384..5cf181596ad 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -601,6 +601,8 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); #define rw_trywrlock(A) my_rw_trywrlock((A)) #define rw_unlock(A) my_rw_unlock((A)) #define rwlock_destroy(A) my_rw_destroy((A)) +#define rw_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A)) +#define rw_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner((A)) #endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */ @@ -624,6 +626,8 @@ extern int rw_pr_init(rw_pr_lock_t *); #define rw_pr_trywrlock(A) pthread_rwlock_trywrlock(A) #define rw_pr_unlock(A) pthread_rwlock_unlock(A) #define rw_pr_destroy(A) pthread_rwlock_destroy(A) +#define rw_pr_lock_assert_write_owner(A) +#define rw_pr_lock_assert_not_write_owner(A) #else /* Otherwise we have to use our own implementation of read/write locks. */ #define NEED_MY_RW_LOCK 1 @@ -636,6 +640,8 @@ extern int rw_pr_init(struct st_my_rw_lock_t *); #define rw_pr_trywrlock(A) my_rw_trywrlock((A)) #define rw_pr_unlock(A) my_rw_unlock((A)) #define rw_pr_destroy(A) my_rw_destroy((A)) +#define rw_pr_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A)) +#define rw_pr_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner((A)) #endif /* defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && defined(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP) */ @@ -651,6 +657,9 @@ typedef struct st_my_rw_lock_t { int state; /* -1:writer,0:free,>0:readers */ int waiters; /* number of waiting writers */ my_bool prefer_readers; +#ifdef SAFE_MUTEX + pthread_t write_thread; +#endif } my_rw_lock_t; extern int my_rw_init(my_rw_lock_t *, my_bool *); @@ -660,6 +669,17 @@ extern int my_rw_wrlock(my_rw_lock_t *); extern int my_rw_unlock(my_rw_lock_t *); extern int my_rw_tryrdlock(my_rw_lock_t *); extern int my_rw_trywrlock(my_rw_lock_t *); +#ifdef SAFE_MUTEX +#define my_rw_lock_assert_write_owner(A) \ + DBUG_ASSERT((A)->state == -1 && pthread_equal(pthread_self(), \ + (A)->write_thread)) +#define my_rw_lock_assert_not_write_owner(A) \ + DBUG_ASSERT((A)->state >= 0 || ! pthread_equal(pthread_self(), \ + (A)->write_thread)) +#else +#define my_rw_lock_assert_write_owner(A) +#define my_rw_lock_assert_not_write_owner(A) +#endif #endif /* NEED_MY_RW_LOCK */ diff --git a/include/myisam.h b/include/myisam.h index 3efc65a900a..c4076ead403 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -249,7 +249,7 @@ typedef struct st_columndef /* column information */ extern char * myisam_log_filename; /* Name of logfile */ extern ulong myisam_block_size; -extern uint myisam_concurrent_insert; +extern ulong myisam_concurrent_insert; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_off_t myisam_max_temp_length; extern ulong myisam_data_pointer_size; diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 01ca76983a6..7ec68ff5040 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -71,7 +71,7 @@ typedef struct st_mysql_xid MYSQL_XID; Plugin API. Common for all plugin types. */ -#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101 +#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102 /* The allowable types of plugins @@ -529,6 +529,7 @@ long long thd_test_options(const MYSQL_THD thd, long long test_options); int thd_sql_command(const MYSQL_THD thd); const char *thd_proc_info(MYSQL_THD thd, const char *info); void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); +void thd_storage_lock_wait(MYSQL_THD thd, long long value); int thd_tx_isolation(const MYSQL_THD thd); char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, unsigned int max_query_len); diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp new file mode 100644 index 00000000000..b48cbca2e87 --- /dev/null +++ b/include/mysql/plugin_audit.h.pp @@ -0,0 +1,217 @@ +#include "plugin.h" +#include +#include +extern struct my_snprintf_service_st { + size_t (*my_snprintf_type)(char*, size_t, const char*, ...); + size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); +} *my_snprintf_service; +size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); +#include +struct st_mysql_lex_string +{ + char *str; + size_t length; +}; +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +extern struct thd_alloc_service_st { + void *(*thd_alloc_func)(void*, unsigned int); + void *(*thd_calloc_func)(void*, unsigned int); + char *(*thd_strdup_func)(void*, const char *); + char *(*thd_strmake_func)(void*, const char *, unsigned int); + void *(*thd_memdup_func)(void*, const void*, unsigned int); + MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + const char *, unsigned int, int); +} *thd_alloc_service; +void *thd_alloc(void* thd, unsigned int size); +void *thd_calloc(void* thd, unsigned int size); +char *thd_strdup(void* thd, const char *str); +char *thd_strmake(void* thd, const char *str, unsigned int size); +void *thd_memdup(void* thd, const void* str, unsigned int size); +MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); +#include +typedef enum _thd_wait_type_e { + THD_WAIT_MUTEX= 1, + THD_WAIT_DISKIO= 2, + THD_WAIT_ROW_TABLE_LOCK= 3, + THD_WAIT_GLOBAL_LOCK= 4 +} thd_wait_type; +extern struct thd_wait_service_st { + void (*thd_wait_begin_func)(void*, thd_wait_type); + void (*thd_wait_end_func)(void*); +} *thd_wait_service; +void thd_wait_begin(void* thd, thd_wait_type wait_type); +void thd_wait_end(void* thd); +#include +struct scheduler_functions; +extern struct my_thread_scheduler_service { + int (*set)(struct scheduler_functions *scheduler); + int (*reset)(); +} *my_thread_scheduler_service; +int my_thread_scheduler_set(struct scheduler_functions *scheduler); +int my_thread_scheduler_reset(); +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; +}; +typedef struct st_mysql_xid MYSQL_XID; +enum enum_mysql_show_type +{ + SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, + SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, + SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, + SHOW_always_last +}; +struct st_mysql_show_var { + const char *name; + char *value; + enum enum_mysql_show_type type; +}; +typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); +struct st_mysql_sys_var; +struct st_mysql_value; +typedef int (*mysql_var_check_func)(void* thd, + struct st_mysql_sys_var *var, + void *save, struct st_mysql_value *value); +typedef void (*mysql_var_update_func)(void* thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); +struct st_mysql_plugin +{ + int type; + void *info; + const char *name; + const char *author; + const char *descr; + int license; + int (*init)(void *); + int (*deinit)(void *); + unsigned int version; + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + void * __reserved1; +}; +#include "plugin_ftparser.h" +#include "plugin.h" +enum enum_ftparser_mode +{ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + char *doc, int doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + struct charset_info_st *cs; + char *doc; + int length; + int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; +struct st_mysql_daemon +{ + int interface_version; +}; +struct st_mysql_information_schema +{ + int interface_version; +}; +struct st_mysql_storage_engine +{ + int interface_version; +}; +struct handlerton; + struct Mysql_replication { + int interface_version; + }; +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); +}; +int thd_in_lock_tables(const void* thd); +int thd_tablespace_op(const void* thd); +long long thd_test_options(const void* thd, long long test_options); +int thd_sql_command(const void* thd); +const char *thd_proc_info(void* thd, const char *info); +void **thd_ha_data(const void* thd, const struct handlerton *hton); +void thd_storage_lock_wait(void* thd, long long value); +int thd_tx_isolation(const void* thd); +char *thd_security_context(void* thd, char *buffer, unsigned int length, + unsigned int max_query_len); +void thd_inc_row_count(void* thd); +int mysql_tmpfile(const char *prefix); +int thd_killed(const void* thd); +unsigned long thd_get_thread_id(const void* thd); +void thd_get_xid(const void* thd, MYSQL_XID *xid); +void mysql_query_cache_invalidate4(void* thd, + const char *key, unsigned int key_length, + int using_trx); +void *thd_get_ha_data(const void* thd, const struct handlerton *hton); +void thd_set_ha_data(void* thd, const struct handlerton *hton, + const void *ha_data); +struct mysql_event +{ + unsigned int event_class; +}; +struct mysql_event_general +{ + unsigned int event_class; + unsigned int event_subclass; + int general_error_code; + unsigned long general_thread_id; + const char *general_user; + unsigned int general_user_length; + const char *general_command; + unsigned int general_command_length; + const char *general_query; + unsigned int general_query_length; + struct charset_info_st *general_charset; + unsigned long long general_time; + unsigned long long general_rows; +}; +struct st_mysql_audit +{ + int interface_version; + void (*release_thd)(void*); + void (*event_notify)(void*, const struct mysql_event *); + unsigned long class_mask[1]; +}; diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin_ftparser.h.pp similarity index 87% rename from include/mysql/plugin.h.pp rename to include/mysql/plugin_ftparser.h.pp index ce9902ee418..2c2c1adbf88 100644 --- a/include/mysql/plugin.h.pp +++ b/include/mysql/plugin_ftparser.h.pp @@ -1,3 +1,4 @@ +#include "plugin.h" #include #include extern struct my_snprintf_service_st { @@ -30,6 +31,27 @@ void *thd_memdup(void* thd, const void* str, unsigned int size); MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, const char *str, unsigned int size, int allocate_lex_string); +#include +typedef enum _thd_wait_type_e { + THD_WAIT_MUTEX= 1, + THD_WAIT_DISKIO= 2, + THD_WAIT_ROW_TABLE_LOCK= 3, + THD_WAIT_GLOBAL_LOCK= 4 +} thd_wait_type; +extern struct thd_wait_service_st { + void (*thd_wait_begin_func)(void*, thd_wait_type); + void (*thd_wait_end_func)(void*); +} *thd_wait_service; +void thd_wait_begin(void* thd, thd_wait_type wait_type); +void thd_wait_end(void* thd); +#include +struct scheduler_functions; +extern struct my_thread_scheduler_service { + int (*set)(struct scheduler_functions *scheduler); + int (*reset)(); +} *my_thread_scheduler_service; +int my_thread_scheduler_set(struct scheduler_functions *scheduler); +int my_thread_scheduler_reset(); struct st_mysql_xid { long formatID; long gtrid_length; @@ -74,7 +96,51 @@ struct st_mysql_plugin void * __reserved1; }; #include "plugin_ftparser.h" -#include "plugin.h" +struct st_mysql_daemon +{ + int interface_version; +}; +struct st_mysql_information_schema +{ + int interface_version; +}; +struct st_mysql_storage_engine +{ + int interface_version; +}; +struct handlerton; + struct Mysql_replication { + int interface_version; + }; +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); +}; +int thd_in_lock_tables(const void* thd); +int thd_tablespace_op(const void* thd); +long long thd_test_options(const void* thd, long long test_options); +int thd_sql_command(const void* thd); +const char *thd_proc_info(void* thd, const char *info); +void **thd_ha_data(const void* thd, const struct handlerton *hton); +void thd_storage_lock_wait(void* thd, long long value); +int thd_tx_isolation(const void* thd); +char *thd_security_context(void* thd, char *buffer, unsigned int length, + unsigned int max_query_len); +void thd_inc_row_count(void* thd); +int mysql_tmpfile(const char *prefix); +int thd_killed(const void* thd); +unsigned long thd_get_thread_id(const void* thd); +void thd_get_xid(const void* thd, MYSQL_XID *xid); +void mysql_query_cache_invalidate4(void* thd, + const char *key, unsigned int key_length, + int using_trx); +void *thd_get_ha_data(const void* thd, const struct handlerton *hton); +void thd_set_ha_data(void* thd, const struct handlerton *hton, + const void *ha_data); enum enum_ftparser_mode { MYSQL_FTPARSER_SIMPLE_MODE= 0, @@ -121,47 +187,3 @@ struct st_mysql_ftparser int (*init)(MYSQL_FTPARSER_PARAM *param); int (*deinit)(MYSQL_FTPARSER_PARAM *param); }; -struct st_mysql_daemon -{ - int interface_version; -}; -struct st_mysql_information_schema -{ - int interface_version; -}; -struct st_mysql_storage_engine -{ - int interface_version; -}; -struct handlerton; - struct Mysql_replication { - int interface_version; - }; -struct st_mysql_value -{ - int (*value_type)(struct st_mysql_value *); - const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); - int (*val_real)(struct st_mysql_value *, double *realbuf); - int (*val_int)(struct st_mysql_value *, long long *intbuf); - int (*is_unsigned)(struct st_mysql_value *); -}; -int thd_in_lock_tables(const void* thd); -int thd_tablespace_op(const void* thd); -long long thd_test_options(const void* thd, long long test_options); -int thd_sql_command(const void* thd); -const char *thd_proc_info(void* thd, const char *info); -void **thd_ha_data(const void* thd, const struct handlerton *hton); -int thd_tx_isolation(const void* thd); -char *thd_security_context(void* thd, char *buffer, unsigned int length, - unsigned int max_query_len); -void thd_inc_row_count(void* thd); -int mysql_tmpfile(const char *prefix); -int thd_killed(const void* thd); -unsigned long thd_get_thread_id(const void* thd); -void thd_get_xid(const void* thd, MYSQL_XID *xid); -void mysql_query_cache_invalidate4(void* thd, - const char *key, unsigned int key_length, - int using_trx); -void *thd_get_ha_data(const void* thd, const struct handlerton *hton); -void thd_set_ha_data(void* thd, const struct handlerton *hton, - const void *ha_data); diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index d133f2655fb..60b4f5d6ef4 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -215,6 +215,14 @@ typedef struct st_mysql_cond mysql_cond_t; #define mysql_mutex_assert_not_owner(M) \ safe_mutex_assert_not_owner(&(M)->m_mutex) +/** Wrappers for instrumented prlock objects. */ + +#define mysql_prlock_assert_write_owner(M) \ + rw_pr_lock_assert_write_owner(&(M)->m_prlock) + +#define mysql_prlock_assert_not_write_owner(M) \ + rw_pr_lock_assert_not_write_owner(&(M)->m_prlock) + /** @def mysql_mutex_init(K, M, A) Instrumented mutex_init. diff --git a/include/mysql/service_thd_wait.h b/include/mysql/service_thd_wait.h new file mode 100644 index 00000000000..2a8f5e610a3 --- /dev/null +++ b/include/mysql/service_thd_wait.h @@ -0,0 +1,83 @@ +/* Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef MYSQL_SERVICE_THD_WAIT_INCLUDED +#define MYSQL_SERVICE_THD_WAIT_INCLUDED + +/** + @file include/mysql/service_thd_wait.h + This service provides functions for plugins and storage engines to report + when they are going to sleep/stall. + + SYNOPSIS + thd_wait_begin() - call just before a wait begins + thd Thread object + Use NULL if the thd is NOT known. + wait_type Type of wait + 1 -- short wait (e.g. for mutex) + 2 -- medium wait (e.g. for disk io) + 3 -- large wait (e.g. for locked row/table) + NOTES + This is used by the threadpool to have better knowledge of which + threads that currently are actively running on CPUs. When a thread + reports that it's going to sleep/stall, the threadpool scheduler is + free to start another thread in the pool most likely. The expected wait + time is simply an indication of how long the wait is expected to + become, the real wait time could be very different. + + thd_wait_end() called immediately after the wait is complete + + thd_wait_end() MUST be called if thd_wait_begin() was called. + + Using thd_wait_...() service is optional but recommended. Using it will + improve performance as the thread pool will be more active at managing the + thread workload. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _thd_wait_type_e { + THD_WAIT_MUTEX= 1, + THD_WAIT_DISKIO= 2, + THD_WAIT_ROW_TABLE_LOCK= 3, + THD_WAIT_GLOBAL_LOCK= 4 +} thd_wait_type; + +extern struct thd_wait_service_st { + void (*thd_wait_begin_func)(MYSQL_THD, thd_wait_type); + void (*thd_wait_end_func)(MYSQL_THD); +} *thd_wait_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define thd_wait_begin(_THD, _WAIT_TYPE) \ + thd_wait_service->thd_wait_begin_func(_THD, _WAIT_TYPE) +#define thd_wait_end(_THD) thd_wait_service->thd_wait_end_func(_THD) + +#else + +void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type); +void thd_wait_end(MYSQL_THD thd); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/include/mysql/service_thread_scheduler.h b/include/mysql/service_thread_scheduler.h new file mode 100644 index 00000000000..a4396b721bd --- /dev/null +++ b/include/mysql/service_thread_scheduler.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED +#define SERVICE_THREAD_SCHEDULER_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +struct scheduler_functions; + +extern struct my_thread_scheduler_service { + int (*set)(struct scheduler_functions *scheduler); + int (*reset)(); +} *my_thread_scheduler_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define my_thread_scheduler_set(F) my_thread_scheduler_service->set((F)) +#define my_thread_scheduler_reset() my_thread_scheduler_service->reset() + +#else + +/** + Set the thread scheduler to use for the server. + + @param scheduler Pointer to scheduler callbacks to use. + @retval 0 Scheduler installed correctly. + @retval 1 Invalid value (NULL) used for scheduler. +*/ +int my_thread_scheduler_set(struct scheduler_functions *scheduler); + +/** + Restore the previous thread scheduler. + + @note If no thread scheduler was installed previously with + thd_set_thread_scheduler, this function will report an error. + + @retval 0 Scheduler installed correctly. + @retval 1 No scheduler installed. +*/ +int my_thread_scheduler_reset(); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */ diff --git a/include/mysql/services.h b/include/mysql/services.h index 19003e66b96..6c67a582fb8 100644 --- a/include/mysql/services.h +++ b/include/mysql/services.h @@ -20,6 +20,8 @@ extern "C" { #include #include +#include +#include #ifdef __cplusplus } diff --git a/include/service_versions.h b/include/service_versions.h index 114957cdd86..4fd886c8a83 100644 --- a/include/service_versions.h +++ b/include/service_versions.h @@ -21,4 +21,5 @@ #define VERSION_my_snprintf 0x0100 #define VERSION_thd_alloc 0x0100 - +#define VERSION_thd_wait 0x0100 +#define VERSION_my_thread_scheduler 0x0100 diff --git a/include/thr_lock.h b/include/thr_lock.h index 5626c067e5e..91473737be3 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -155,6 +155,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *data, enum thr_lock_type new_lock_type); my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data, ulong lock_wait_timeout); +void thr_set_lock_wait_callback(void (*before_wait)(void), + void (*after_wait)(void)); #ifdef __cplusplus } #endif diff --git a/include/violite.h b/include/violite.h index 05ceaa272c1..f4083216894 100644 --- a/include/violite.h +++ b/include/violite.h @@ -217,6 +217,7 @@ struct st_vio void (*timeout)(Vio*, unsigned int which, unsigned int timeout); my_bool (*poll_read)(Vio *vio, uint timeout); my_bool (*is_connected)(Vio*); + my_bool (*has_data) (Vio*); #ifdef HAVE_OPENSSL void *ssl_arg; #endif diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 893c3e494f9..545d03532c1 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -65,7 +65,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/datadict.cc - ../sql/sql_truncate.cc + ../sql/sql_admin.cc ../sql/sql_truncate.cc ../sql/sql_reload.cc ../sql/sql_lex.cc ../sql/keycaches.cc ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc ../sql/sql_binlog.cc ../sql/sql_manager.cc @@ -81,6 +81,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/sql_time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/partition_info.cc ../sql/sql_connect.cc ../sql/scheduler.cc ../sql/sql_audit.cc + ../sql/sql_alter.cc ../sql/sql_partition_admin.cc ../sql/event_parse_data.cc ../sql/sql_signal.cc ../sql/rpl_handler.cc ../sql/rpl_utility.cc diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index e2521bfcac7..bfbe02f9339 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -63,7 +63,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ protocol.cc net_serv.cc opt_range.cc \ opt_sum.cc procedure.cc records.cc sql_acl.cc \ sql_load.cc discover.cc sql_locale.cc \ - sql_profile.cc sql_truncate.cc datadict.cc \ + sql_profile.cc sql_admin.cc sql_truncate.cc datadict.cc \ + sql_reload.cc \ sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \ sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \ sql_lex.cc sql_list.cc sql_manager.cc \ @@ -78,9 +79,10 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \ debug_sync.cc sql_tablespace.cc transaction.cc \ - rpl_injector.cc my_user.c partition_info.cc \ + rpl_injector.cc my_user.c partition_info.cc sql_alter.cc \ sql_servers.cc event_parse_data.cc sql_signal.cc \ - rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc + rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc \ + sql_partition_admin.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources) diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt index 79431ff65fe..396430fba12 100644 --- a/libservices/CMakeLists.txt +++ b/libservices/CMakeLists.txt @@ -15,7 +15,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) -SET(MYSQLSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c) +SET(MYSQLSERVICES_SOURCES + my_snprintf_service.c + thd_alloc_service.c + thd_wait_service.c + my_thread_scheduler_service.c) ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES}) INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR}) diff --git a/libservices/Makefile.am b/libservices/Makefile.am index 642081859c1..d25c5c9680c 100644 --- a/libservices/Makefile.am +++ b/libservices/Makefile.am @@ -15,5 +15,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include pkglib_LIBRARIES = libmysqlservices.a -libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c +libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c \ + thd_wait_service.c \ + my_thread_scheduler_service.c EXTRA_DIST = CMakeLists.txt diff --git a/libservices/my_thread_scheduler_service.c b/libservices/my_thread_scheduler_service.c new file mode 100644 index 00000000000..dc8d40c6713 --- /dev/null +++ b/libservices/my_thread_scheduler_service.c @@ -0,0 +1,21 @@ +/* + Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA +*/ + +#include +SERVICE_VERSION my_thread_scheduler_service= + (void*)VERSION_my_thread_scheduler; diff --git a/libservices/thd_wait_service.c b/libservices/thd_wait_service.c new file mode 100644 index 00000000000..3c87a2d0d1b --- /dev/null +++ b/libservices/thd_wait_service.c @@ -0,0 +1,19 @@ +/* + Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +SERVICE_VERSION *thd_wait_service= (void*)VERSION_thd_wait; diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 6ba53bd9c2c..b8eb11b2fea 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -16,6 +16,7 @@ INSTALL( DIRECTORY . DESTINATION ${INSTALL_MYSQLTESTDIR} + USE_SOURCE_PERMISSIONS COMPONENT Test PATTERN "var/" EXCLUDE PATTERN "lib/My/SafeProcess" EXCLUDE diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 800044242ac..7609a4799e3 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -19,7 +19,6 @@ main.mysqlbinlog_row @solaris # Bug#52202 2010-03-22 alik mysqlbinlog main.mysqlbinlog_row_innodb @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max main.mysqlbinlog_row_myisam @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible) -main.plugin* @solaris # Bug#47146 Linking problem with example plugin when dtrace enabled main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server @@ -32,7 +31,6 @@ rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails spora rpl.rpl_innodb_bug28430* # Bug#46029 rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows -rpl.rpl_plugin_load* @solaris # Bug#47146 rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun 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/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index aaadda941fb..6bf9a27afaf 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -262,7 +262,6 @@ DROP TABLE IF EXISTS t2; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb; INSERT INTO t1 VALUES (4,4); ---error ER_DUP_ENTRY CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; SELECT * from t2; TRUNCATE table t2; @@ -277,11 +276,9 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ; INSERT INTO t1 values (7,7); ROLLBACK; INSERT INTO t1 values (8,8); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t1 values (9,9); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; @@ -291,11 +288,9 @@ INSERT INTO t1 values (10,10); INSERT INTO t2 select * from t1; SELECT * from t1; INSERT INTO t2 values (100,100); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t2 values (101,101); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; @@ -377,7 +372,8 @@ reset master; begin; insert into ti values (1); -insert into ti values (2) ; +insert into ti values (2) ; +# This is SAFE because --binlog-direct-non-transactional-updates=FALSE insert into tt select * from ti; rollback; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test index 68aa949a7c7..7eca19bc834 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test @@ -24,6 +24,7 @@ reset master; begin; insert into ti values (1); insert into ti values (2) ; +# This is SAFE because --binlog-direct-non-transactional-updates=FALSE insert into tt select * from ti; rollback; diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc index 2d480349c65..8e89cde004d 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -725,7 +725,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --eval SET @check_temp='$available_n_temp' --eval SET @table_temp='$table_n' SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); - --let $available_t_temp= `SELECT @check_temp` + --let $available_n_temp= `SELECT @check_temp` --enable_query_log --eval DROP TEMPORARY TABLE $table_t, $table_n diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test index 32f8d16b900..67bf0f5b8ac 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test @@ -378,9 +378,12 @@ sync_slave_with_master; let $MYSQLD_DATADIR= `SELECT @@datadir`; ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-slave.sql ---diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql +if (`select @@session.binlog_format != 'STATEMENT'`) +{ + --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-master.sql + --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-slave.sql + --diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql +} --echo ######################################################################### --echo # CLEAN diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test index 4bc1c004ba7..8b9b7e7ff39 100644 --- a/mysql-test/extra/rpl_tests/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -153,7 +153,7 @@ connection master; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info = "RENAME TABLE t1 TO t3, t2 TO t1" and - state = "Waiting for table"; + state = "Waiting for table metadata lock"; --source include/wait_condition.inc COMMIT; diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc index 57772dddefc..c615ebd02cd 100644 --- a/mysql-test/include/check_no_concurrent_insert.inc +++ b/mysql-test/include/check_no_concurrent_insert.inc @@ -43,7 +43,8 @@ connection default; # of our statement. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "insert into $table (i) values (0)"; + where state = "Waiting for table level lock" and + info = "insert into $table (i) values (0)"; --source include/wait_condition.inc --disable_result_log diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index c0d30b56ef7..81fbdb03bca 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -723,7 +723,7 @@ call p_verify_status_increment(4, 4, 4, 4); --echo # Sic: no table is created. create table if not exists t2 (a int) select 6 union select 7; --echo # Sic: first commits the statement, and then the transaction. -call p_verify_status_increment(2, 0, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); create table t3 select a from t2; call p_verify_status_increment(2, 0, 4, 4); alter table t3 add column (b int); diff --git a/mysql-test/include/ctype_filesort2.inc b/mysql-test/include/ctype_filesort2.inc new file mode 100644 index 00000000000..7b09eb482a5 --- /dev/null +++ b/mysql-test/include/ctype_filesort2.inc @@ -0,0 +1,16 @@ +# +# Testing filesort for full Unicode character sets +# with supplementary characters. +# + +--echo # +--echo # Bug#55980 Character sets: supplementary character _bin ordering is wrong +--echo # +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index 77913fc8c18..06a9107e963 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1625,6 +1625,108 @@ SET @x=aswkt(point(1,2)); SELECT charset(@x), collation(@x); +--echo # +--echo # Bug#54916 GROUP_CONCAT + IFNULL truncates output +--echo # +SELECT @@collation_connection; +# ENGINE=MYISAM is very important to make sure "SYSTEM" join type +# is in use, which will create instances of Item_copy. +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +if (`SELECT @@character_set_connection != 'ucs2'`) +{ + # Temporarily disable for ucs2 + # For details, see Bug#55744 GROUP_CONCAT + CASE + ucs return garbage + SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1; +} +--enable_metadata +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +--disable_metadata +--echo # All columns must be VARCHAR(9) with the same length: +--disable_warnings +CREATE TABLE t2 AS +SELECT + CONCAT(a), + IFNULL(a,''), + IF(a,a,''), + CASE WHEN a THEN a ELSE '' END, + COALESCE(a,'') +FROM t1; +--enable_warnings +# The above query is expected to send a warning +# in case of ucs2 character set, until Bug#55744 is fixed. +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +DROP TABLE t2; + +DROP TABLE t1; + +--echo # +--echo # End of Bug#54916 +--echo # + + --echo # --echo # Bug#52159 returning time type from function and empty left join causes debug assertion --echo # diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc index 89c34abc871..84d23b80811 100644 --- a/mysql-test/include/deadlock.inc +++ b/mysql-test/include/deadlock.inc @@ -159,7 +159,7 @@ drop table if exists A; create table A (c int); insert into A (c) values (0); ---error 0,ER_LOCK_DEADLOCK,ER_UPDATE_TABLE_USED +--error 0,ER_LOCK_DEADLOCK,ER_TABLE_EXISTS_ERROR create table a as select * from A; drop table A; diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index 98988ab55ba..65e9e61d077 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -523,7 +523,7 @@ connection waiter; --echo connection: waiter let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Flushing tables"; + where state = "Waiting for table flush"; --source include/wait_condition.inc connection default; --echo connection: default @@ -557,7 +557,8 @@ connection waiter; --echo connection: waiter let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t0"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t0"; --source include/wait_condition.inc connection default; --echo connection: default @@ -743,7 +744,8 @@ send alter table t1 engine=memory; connection con2; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 engine=memory"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 engine=memory"; --source include/wait_condition.inc connection default; --error ER_ILLEGAL_HA @@ -764,7 +766,8 @@ send alter table t1 engine=memory; connection con2; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 engine=memory"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 engine=memory"; --source include/wait_condition.inc connection default; --echo # Since S metadata lock was already acquired at HANDLER OPEN time @@ -1024,7 +1027,9 @@ connection con1; --echo # --> connection con2 connection con2; --echo # Waitng for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1055,7 +1060,9 @@ connection con1; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1097,7 +1104,8 @@ send rename table t0 to t3, t1 to t0, t3 to t1; connection con1; --echo # Waiting for 'rename table ...' to get blocked... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='rename table t0 to t3, t1 to t0, t3 to t1'; + where state='Waiting for table metadata lock' and + info='rename table t0 to t3, t1 to t0, t3 to t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1137,7 +1145,9 @@ connection con2; --echo # --> connection con1 connection con1; --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1146,7 +1156,9 @@ send select * from t2; --echo # --> connection con1 connection con1; --echo # Waiting for 'select * from t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='select * from t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='select * from t2'; unlock tables; --echo # --> connection con2 connection con2; @@ -1190,10 +1202,14 @@ connection default; --echo # --> connection con3 connection con3; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # Demonstrate that t2 lock was released and t2 was dropped --echo # after ROLLBACK TO SAVEPOINT @@ -1255,10 +1271,14 @@ connection default; --echo # --> connection con3 connection con3; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # Demonstrate that t2 lock was released and t2 was dropped --echo # after ROLLBACK TO SAVEPOINT @@ -1314,7 +1334,9 @@ drop table t1, t2; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t3' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t3'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t3'; --source include/wait_condition.inc --echo # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler --echo # lock. @@ -1348,7 +1370,9 @@ send drop table t2; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # --> connection con1 connection con1; @@ -1400,7 +1424,8 @@ connection con2; --echo # has read from the table commits. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock tables t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock tables t1 write"; --source include/wait_condition.inc --echo # --> connection default @@ -1427,7 +1452,8 @@ connection con1; --echo # Waiting for 'handler t1 read a next' to get blocked... let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "handler t1 read a next"; + where state = "Waiting for table level lock" and + info = "handler t1 read a next"; --source include/wait_condition.inc --echo # The below 'drop table t1' should be able to proceed without diff --git a/mysql-test/include/have_thread_concurrency.inc b/mysql-test/include/have_thread_concurrency.inc deleted file mode 100644 index 730edbf4895..00000000000 --- a/mysql-test/include/have_thread_concurrency.inc +++ /dev/null @@ -1,10 +0,0 @@ -disable_query_log; -disable_result_log; -set @have_thread_concurrency=0; -select @have_thread_concurrency:=1 from information_schema.global_variables where variable_name='thread_concurrency'; -if (`select @have_thread_concurrency = 0`) -{ - skip Need @@thread_concurrency; -} -enable_result_log; -enable_query_log; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index fe6abe13892..3481d572514 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -742,7 +742,6 @@ drop table if exists t2; CREATE TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error ER_DUP_ENTRY CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; @@ -756,13 +755,11 @@ drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; COMMIT; BEGIN; INSERT INTO t2 values(101,101); ---error ER_DUP_ENTRY CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; @@ -1583,7 +1580,7 @@ connect (con1, localhost, root,,); --echo # Connection default connection default; let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='TRUNCATE TABLE t1'; + WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1'; --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a; ROLLBACK; diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc index b3fd5e47179..91e0eff1e0f 100644 --- a/mysql-test/include/mysqlhotcopy.inc +++ b/mysql-test/include/mysqlhotcopy.inc @@ -5,7 +5,7 @@ --source include/not_windows.inc --source include/not_embedded.inc -if ($MYSQLHOTCOPY) +if (!$MYSQLHOTCOPY) { die due to missing mysqlhotcopy tool; } diff --git a/mysql-test/include/not_blackhole.inc b/mysql-test/include/not_blackhole.inc new file mode 100644 index 00000000000..078927ec4ca --- /dev/null +++ b/mysql-test/include/not_blackhole.inc @@ -0,0 +1,5 @@ +if (`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'blackhole'`){ + skip Blackhole engine enabled; +} diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 115ce3800ea..8ae731a9b2c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2192,10 +2192,12 @@ sub environment_setup { # mysqlhotcopy # ---------------------------------------------------- my $mysqlhotcopy= - mtr_pl_maybe_exists("$bindir/scripts/mysqlhotcopy"); - # Since mysqltest interprets the real path as "false" in an if, - # use 1 ("true") to indicate "not exists" so it can be tested for - $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1; + mtr_pl_maybe_exists("$bindir/scripts/mysqlhotcopy") || + mtr_pl_maybe_exists("$path_client_bindir/mysqlhotcopy"); + if ($mysqlhotcopy) + { + $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy; + } # ---------------------------------------------------- # perror diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 4a2e108f8c6..dbeedb481cd 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -469,7 +469,7 @@ drop table t1; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (1), (1); CREATE TABLE t2 ( a INT AUTO_INCREMENT KEY ); -CREATE TABLE IF NOT EXISTS t2 AS SELECT a FROM t1; +INSERT INTO t2 SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' UPDATE t2 SET a = 2; SELECT a FROM t2; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index fcbf5812312..40d900a0389 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -160,6 +160,8 @@ t1 CREATE TABLE `t1` ( `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'ifnull' SELECT 'case+union+test' UNION SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END; diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index a9b04d54400..993d33d7a38 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -830,7 +830,7 @@ create table if not exists t2 (a int) select 6 union select 7; Warnings: Note 1050 Table 't2' already exists # Sic: first commits the statement, and then the transaction. -call p_verify_status_increment(2, 0, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS create table t3 select a from t2; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index fce775c5952..d5f3945fb6b 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1,5 +1,6 @@ drop table if exists t1,t2,t3,t4,t5; drop database if exists mysqltest; +drop view if exists v1; create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -264,15 +265,14 @@ create table if not exists t1 select 1,2; Warnings: Note 1050 Table 't1' already exists create table if not exists t1 select 1,2,3,4; -ERROR 21S01: Column count doesn't match value count at row 1 +Warnings: +Note 1050 Table 't1' already exists create table if not exists t1 select 1; Warnings: Note 1050 Table 't1' already exists select * from t1; 1 2 3 1 2 3 -0 1 2 -0 0 1 drop table t1; flush status; create table t1 (a int not null, b int, primary key (a)); @@ -280,28 +280,21 @@ insert into t1 values (1,1); create table if not exists t1 select 2; Warnings: Note 1050 Table 't1' already exists -Warning 1364 Field 'a' doesn't have a default value select * from t1; a b 1 1 -0 2 create table if not exists t1 select 3 as 'a',4 as 'b'; Warnings: Note 1050 Table 't1' already exists -create table if not exists t1 select 3 as 'a',3 as 'b'; -ERROR 23000: Duplicate entry '3' for key 'PRIMARY' show warnings; Level Code Message Note 1050 Table 't1' already exists -Error 1062 Duplicate entry '3' for key 'PRIMARY' show status like "Opened_tables"; Variable_name Value Opened_tables 2 select * from t1; a b 1 1 -0 2 -3 4 drop table t1; create table `t1 `(a int); ERROR 42000: Incorrect table name 't1 ' @@ -611,7 +604,7 @@ b drop table t1,t2; create table t1 (a int); create table t1 select * from t1; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR 42S01: Table 't1' already exists create table t2 union = (t1) select * from t1; ERROR HY000: 'test.t2' is not BASE TABLE flush tables with read lock; @@ -811,7 +804,8 @@ create table t1 (primary key(a)) select "b" as b; ERROR 42000: Key column 'a' doesn't exist in table create table t1 (a int); create table if not exists t1 select 1 as a, 2 as b; -ERROR 21S01: Column count doesn't match value count at row 1 +Warnings: +Note 1050 Table 't1' already exists drop table t1; create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' @@ -823,25 +817,14 @@ Warnings: Note 1050 Table 't1' already exists select * from t1; i -1 create table if not exists t1 select * from t1; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +Warnings: +Note 1050 Table 't1' already exists select * from t1; i -1 +drop table t1; create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin); ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'coalesce' -select * from t1; -i -1 -alter table t1 add primary key (i); -create table if not exists t1 (select 2 as i) union all (select 2 as i); -ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -select * from t1; -i -1 -2 -drop table t1; create temporary table t1 (j int); create table if not exists t1 select 1; select * from t1; @@ -893,8 +876,6 @@ select * from t2; i 1 2 -1 -2 unlock tables; drop table t1, t2; create table t1 (upgrade int); @@ -1561,6 +1542,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -1586,11 +1568,9 @@ CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL); INSERT IGNORE INTO t1 (b) VALUES (5); CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY) SELECT a FROM t1; -CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY) -SELECT a FROM t1; +INSERT INTO t2 SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY) -SELECT a FROM t1; +INSERT INTO t2 SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' DROP TABLE t1, t2; # @@ -1620,7 +1600,7 @@ drop table if exists t2; Warnings: Note 1051 Unknown table 't2' CREATE TABLE t2 (a int, b int, primary key (a)); -CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; +INSERT INTO t2 select * from t1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' SELECT * from t2; a b @@ -1633,13 +1613,7 @@ a b 1 1 drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); -CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -SELECT * from t2; -a b -1 1 -TRUNCATE table t2; -INSERT INTO t2 select * from t1; +INSERT INTO t2 SELECT * FROM t1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' SELECT * from t2; a b @@ -1964,11 +1938,7 @@ CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW BEGIN INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ; END ; | -CREATE TABLE IF NOT EXISTS t1 ( -`pk` INTEGER NOT NULL AUTO_INCREMENT , -`int` INTEGER , -PRIMARY KEY ( `pk` ) -) SELECT `pk` , `int_key` FROM B ; +INSERT INTO t1 (pk, int_key) SELECT `pk` , `int_key` FROM B ; ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW BEGIN @@ -2088,3 +2058,347 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 set @@sql_mode= @old_mode; drop tables t1, t2; +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int); +INSERT INTO t1 VALUES (1), (1); +INSERT INTO t2 VALUES (2), (2); +CREATE VIEW v1 AS SELECT id FROM t2; +CREATE TABLE IF NOT EXISTS v1(a int, b int) SELECT id, id FROM t1; +Warnings: +Note 1050 Table 'v1' already exists +SHOW CREATE TABLE v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t2`.`id` AS `id` from `t2` latin1 latin1_swedish_ci +SELECT * FROM t2; +id +2 +2 +SELECT * FROM v1; +id +2 +2 +DROP VIEW v1; +CREATE TEMPORARY TABLE tt1 AS SELECT id FROM t2; +CREATE TEMPORARY TABLE IF NOT EXISTS tt1(a int, b int) SELECT id, id FROM t1; +Warnings: +Note 1050 Table 'tt1' already exists +SELECT * FROM t2; +id +2 +2 +SELECT * FROM tt1; +id +2 +2 +DROP TEMPORARY TABLE tt1; +DROP TABLE t1, t2; +# +# WL#5370 "Changing 'CREATE TABLE IF NOT EXISTS ... SELECT' +# behaviour. +# +# +# 1. Basic case: a base table. +# +create table if not exists t1 (a int) select 1 as a; +select * from t1; +a +1 +create table t1 (a int) select 2 as a; +ERROR 42S01: Table 't1' already exists +select * from t1; +a +1 +# Produces an essential warning ER_TABLE_EXISTS. +create table if not exists t1 (a int) select 2 as a; +Warnings: +Note 1050 Table 't1' already exists +# No new data in t1. +select * from t1; +a +1 +drop table t1; +# +# 2. A temporary table. +# +create temporary table if not exists t1 (a int) select 1 as a; +select * from t1; +a +1 +create temporary table t1 (a int) select 2 as a; +ERROR 42S01: Table 't1' already exists +select * from t1; +a +1 +# An essential warning. +create temporary table if not exists t1 (a int) select 2 as a; +Warnings: +Note 1050 Table 't1' already exists +# No new data in t1. +select * from t1; +a +1 +drop temporary table t1; +# +# 3. Creating a base table in presence of a temporary table. +# +create table t1 (a int); +# Create a view for convenience of querying t1 shadowed by a temp. +create view v1 as select a from t1; +drop table t1; +create temporary table t1 (a int) select 1 as a; +create table if not exists t1 (a int) select 2 as a; +select * from t1; +a +1 +select * from v1; +a +2 +# Note: an essential warning. +create table if not exists t1 (a int) select 3 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +1 +select * from v1; +a +2 +drop temporary table t1; +select * from t1; +a +2 +drop view v1; +drop table t1; +# +# 4. Creating a temporary table in presence of a base table. +# +create table t1 (a int) select 1 as a; +create temporary table if not exists t1 select 2 as a; +select * from t1; +a +2 +# Note: an essential warning. +create temporary table if not exists t1 select 3 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +2 +drop temporary table t1; +select * from t1; +a +1 +drop table t1; +# +# 5. Creating a base table in presence of an updatable view. +# +create table t2 (a int unique); +create view t1 as select a from t2; +insert into t1 (a) values (1); +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +# Note: an essential warning. +create table if not exists t1 (a int); +Warnings: +Note 1050 Table 't1' already exists +create table t1 (a int) select 2 as a; +ERROR 42S01: Table 't1' already exists +select * from t1; +a +1 +# Note: an essential warning. +create table if not exists t1 (a int) select 2 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +1 +select * from t2; +a +1 +create temporary table if not exists t1 (a int) select 3 as a; +select * from t1; +a +3 +select * from t2; +a +1 +# Note: an essential warning. +create temporary table if not exists t1 (a int) select 4 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +3 +select * from t2; +a +1 +drop temporary table t1; +# +# Repeating the test with a non-updatable view. +# +drop view t1; +create view t1 as select a + 5 as a from t2; +insert into t1 (a) values (1); +ERROR HY000: The target table t1 of the INSERT is not insertable-into +update t1 set a=3 where a=2; +ERROR HY000: Column 'a' is not updatable +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +# Note: an essential warning. +create table if not exists t1 (a int); +Warnings: +Note 1050 Table 't1' already exists +create table t1 (a int) select 2 as a; +ERROR 42S01: Table 't1' already exists +select * from t1; +a +6 +# Note: an essential warning. +create table if not exists t1 (a int) select 2 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +6 +select * from t2; +a +1 +create temporary table if not exists t1 (a int) select 3 as a; +select * from t1; +a +3 +select * from t2; +a +1 +# Note: an essential warning. +create temporary table if not exists t1 (a int) select 4 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +3 +select * from t2; +a +1 +drop temporary table t1; +drop view t1; +drop table t2; +# +# Repeating the test with a view select a constant number +# +create view t1 as select 1 as a; +insert into t1 (a) values (1); +ERROR HY000: The target table t1 of the INSERT is not insertable-into +update t1 set a=3 where a=2; +ERROR HY000: The target table t1 of the UPDATE is not updatable +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +# Note: an essential warning. +create table if not exists t1 (a int); +Warnings: +Note 1050 Table 't1' already exists +create table t1 (a int) select 2 as a; +ERROR 42S01: Table 't1' already exists +select * from t1; +a +1 +# Note: an essential warning. +create table if not exists t1 (a int) select 2 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +1 +create temporary table if not exists t1 (a int) select 3 as a; +select * from t1; +a +3 +# Note: an essential warning. +create temporary table if not exists t1 (a int) select 4 as a; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +3 +drop temporary table t1; +drop view t1; +# +# 6. Test of unique_table(). +# +create table t1 (a int) select 1 as a; +create temporary table if not exists t1 (a int) select * from t1; +create temporary table if not exists t1 (a int) select * from t1; +ERROR HY000: Can't reopen table: 't1' +select * from t1; +a +1 +drop temporary table t1; +select * from t1; +a +1 +drop table t1; +create temporary table t1 (a int) select 1 as a; +create table if not exists t1 (a int) select * from t1; +create table if not exists t1 (a int) select * from t1; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +a +1 +drop temporary table t1; +select * from t1; +a +1 +drop table t1; +create table if not exists t1 (a int) select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +# +# 7. Test of non-matching columns, REPLACE and IGNORE. +# +create table t1 (a int) select 1 as b, 2 as c; +select * from t1; +a b c +NULL 1 2 +drop table t1; +create table if not exists t1 (a int, b date, c date) select 1 as b, 2 as c; +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'c' at row 1 +select * from t1; +a b c +NULL 0000-00-00 0000-00-00 +drop table t1; +set @@session.sql_mode='STRICT_ALL_TABLES'; +create table if not exists t1 (a int, b date, c date) select 1 as b, 2 as c; +ERROR 22007: Incorrect date value: '1' for column 'b' at row 1 +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +create table if not exists t1 (a int, b date, c date) +replace select 1 as b, 2 as c; +ERROR 22007: Incorrect date value: '1' for column 'b' at row 1 +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +create table if not exists t1 (a int, b date, c date) +ignore select 1 as b, 2 as c; +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'c' at row 1 +select * from t1; +a b c +NULL 0000-00-00 0000-00-00 +set @@session.sql_mode=default; +drop table t1; +create table if not exists t1 (a int unique, b int) +replace select 1 as a, 1 as b union select 1 as a, 2 as b; +select * from t1; +a b +1 2 +drop table t1; +create table if not exists t1 (a int unique, b int) +ignore select 1 as a, 1 as b union select 1 as a, 2 as b; +select * from t1; +a b +1 1 +drop table t1; +# diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 76a4d0f3cf3..0e8fe328589 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2598,6 +2598,156 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) binary binary # +# Bug#54916 GROUP_CONCAT + IFNULL truncates output +# +SELECT @@collation_connection; +@@collation_connection +binary +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +GROUP_CONCAT(IFNULL(a,'')) +1234567 +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +GROUP_CONCAT(IF(a,a,'')) +1234567 +SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1; +GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) +1234567 +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,'') 253 9 7 Y 128 31 63 +COALESCE(a,'') +1234567 +# All columns must be VARCHAR(9) with the same length: +CREATE TABLE t2 AS +SELECT +CONCAT(a), +IFNULL(a,''), +IF(a,a,''), +CASE WHEN a THEN a ELSE '' END, +COALESCE(a,'') +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(a)` varbinary(9) DEFAULT NULL, + `IFNULL(a,'')` varbinary(9) NOT NULL DEFAULT '', + `IF(a,a,'')` varbinary(9) DEFAULT NULL, + `CASE WHEN a THEN a ELSE '' END` varbinary(9) DEFAULT NULL, + `COALESCE(a,'')` varbinary(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT_WS(1,2,3)` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `INSERT(1133,3,0,22)` varbinary(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LCASE(a)` varbinary(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `UCASE(a)` varbinary(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPEAT(1,2)` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LEFT(123,2)` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RIGHT(123,2)` varbinary(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LTRIM(123)` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RTRIM(123)` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ELT(1,111,222,333)` varbinary(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPLACE(111,2,3)` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SUBSTRING_INDEX(111,111,1)` varbinary(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAKE_SET(111,222,3)` varbinary(5) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SOUNDEX(1)` varbinary(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `EXPORT_SET(1,'Y','N','',8)` varbinary(64) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +# +# End of Bug#54916 +# +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index f93cb5f9a12..b1e9ff38d26 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2680,6 +2680,156 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) cp1251 cp1251_general_ci # +# Bug#54916 GROUP_CONCAT + IFNULL truncates output +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +GROUP_CONCAT(IFNULL(a,'')) +1234567 +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +GROUP_CONCAT(IF(a,a,'')) +1234567 +SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1; +GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) +1234567 +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,'') 253 9 7 Y 0 31 51 +COALESCE(a,'') +1234567 +# All columns must be VARCHAR(9) with the same length: +CREATE TABLE t2 AS +SELECT +CONCAT(a), +IFNULL(a,''), +IF(a,a,''), +CASE WHEN a THEN a ELSE '' END, +COALESCE(a,'') +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL, + `IFNULL(a,'')` varchar(9) CHARACTER SET cp1251 NOT NULL DEFAULT '', + `IF(a,a,'')` varchar(9) CHARACTER SET cp1251 DEFAULT NULL, + `CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET cp1251 DEFAULT NULL, + `COALESCE(a,'')` varchar(9) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LCASE(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `UCASE(a)` varchar(9) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPEAT(1,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LEFT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RIGHT(123,2)` varchar(2) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RTRIM(123)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ELT(1,111,222,333)` varchar(3) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPLACE(111,2,3)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SOUNDEX(1)` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET cp1251 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +# +# End of Bug#54916 +# +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index 2794538e097..8331e18f3f4 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -47,7 +47,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293 -master-bin.000001 # Query # # use `test`; DROP TABLE t4 +master-bin.000001 # Query # # use `test`; DROP TABLE `t4` /* generated by server */ End of 5.0 tests SHOW BINLOG EVENTS FROM 490; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 43ee365cd53..6216819d172 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3008,6 +3008,156 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) latin1 latin1_swedish_ci # +# Bug#54916 GROUP_CONCAT + IFNULL truncates output +# +SELECT @@collation_connection; +@@collation_connection +latin1_swedish_ci +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +GROUP_CONCAT(IFNULL(a,'')) +1234567 +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +GROUP_CONCAT(IF(a,a,'')) +1234567 +SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1; +GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) +1234567 +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,'') 253 9 7 Y 0 31 8 +COALESCE(a,'') +1234567 +# All columns must be VARCHAR(9) with the same length: +CREATE TABLE t2 AS +SELECT +CONCAT(a), +IFNULL(a,''), +IF(a,a,''), +CASE WHEN a THEN a ELSE '' END, +COALESCE(a,'') +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(a)` varchar(9) DEFAULT NULL, + `IFNULL(a,'')` varchar(9) NOT NULL DEFAULT '', + `IF(a,a,'')` varchar(9) DEFAULT NULL, + `CASE WHEN a THEN a ELSE '' END` varchar(9) DEFAULT NULL, + `COALESCE(a,'')` varchar(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT_WS(1,2,3)` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `INSERT(1133,3,0,22)` varchar(6) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LCASE(a)` varchar(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `UCASE(a)` varchar(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPEAT(1,2)` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LEFT(123,2)` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RIGHT(123,2)` varchar(2) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LTRIM(123)` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RTRIM(123)` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ELT(1,111,222,333)` varchar(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPLACE(111,2,3)` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SUBSTRING_INDEX(111,111,1)` varchar(3) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAKE_SET(111,222,3)` varchar(5) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SOUNDEX(1)` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `EXPORT_SET(1,'Y','N','',8)` varchar(64) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +# +# End of Bug#54916 +# +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 7bb27e03acc..1215eb1db02 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -3840,6 +3840,153 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) ucs2 ucs2_general_ci # +# Bug#54916 GROUP_CONCAT + IFNULL truncates output +# +SELECT @@collation_connection; +@@collation_connection +ucs2_general_ci +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +GROUP_CONCAT(IFNULL(a,'')) +1234567 +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +GROUP_CONCAT(IF(a,a,'')) +1234567 +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,'') 253 9 7 Y 0 31 8 +COALESCE(a,'') +1234567 +# All columns must be VARCHAR(9) with the same length: +CREATE TABLE t2 AS +SELECT +CONCAT(a), +IFNULL(a,''), +IF(a,a,''), +CASE WHEN a THEN a ELSE '' END, +COALESCE(a,'') +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL, + `IFNULL(a,'')` varchar(9) CHARACTER SET ucs2 NOT NULL DEFAULT '', + `IF(a,a,'')` varchar(9) CHARACTER SET ucs2 DEFAULT NULL, + `CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET ucs2 DEFAULT NULL, + `COALESCE(a,'')` varchar(9) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LCASE(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `UCASE(a)` varchar(9) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPEAT(1,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LEFT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RIGHT(123,2)` varchar(2) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RTRIM(123)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ELT(1,111,222,333)` varchar(3) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPLACE(111,2,3)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SOUNDEX(1)` varchar(4) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +# +# End of Bug#54916 +# +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index c5fd7ef1439..7cee15aecef 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -611,6 +611,31 @@ utf16_bin 00610009 utf16_bin 0061 utf16_bin 00610020 drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +0385 CE85 +D800DF84 F0908E84 +DBC0DC00 F4808080 +FF9D EFBE9D +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +0385 CE85 +D800DF84 F0908E84 +DBC0DC00 F4808080 +FF9D EFBE9D +DROP TABLE IF EXISTS t1; select @@collation_connection; @@collation_connection utf16_bin diff --git a/mysql-test/r/ctype_utf16_def.result b/mysql-test/r/ctype_utf16_def.result new file mode 100644 index 00000000000..6514734cb38 --- /dev/null +++ b/mysql-test/r/ctype_utf16_def.result @@ -0,0 +1,9 @@ +SHOW VARIABLES LIKE 'collation_server'; +Variable_name Value +collation_server utf16_general_ci +SHOW VARIABLES LIKE 'character_set_server'; +Variable_name Value +character_set_server utf16 +SHOW VARIABLES LIKE 'ft_stopword_file'; +Variable_name Value +ft_stopword_file (built-in) diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 9f395f87be7..37d5aa98be3 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -610,6 +610,31 @@ utf32_bin 0000006100000009 utf32_bin 00000061 utf32_bin 0000006100000020 drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +00000385 CE85 +0000FF9D EFBE9D +00010384 F0908E84 +00100000 F4808080 +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +00000385 CE85 +0000FF9D EFBE9D +00010384 F0908E84 +00100000 F4808080 +DROP TABLE IF EXISTS t1; select @@collation_connection; @@collation_connection utf32_bin @@ -1091,5 +1116,41 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t2; # +# Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT +# +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col; +SELECT * FROM t1; +my_col +00 +DROP TABLE t1; +# +# Bug#55912 FORMAT with locale set fails for numbers < 1000 +# +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT format(123,2,'no_NO'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `format(123,2,'no_NO')` varchar(37) CHARACTER SET utf32 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1; +format(123,2,'no_NO') +123,00 +DROP TABLE t1; +# +# Bug#42511 mysqld: ctype-ucs2.c:2044: my_strnncollsp_utf32: Assertion (tlen % 4) == 0' faied +# +CREATE TABLE t1 ( +b char(250) CHARACTER SET utf32, +key (b) +) ENGINE=MYISAM; +INSERT INTO t1 VALUES ('d'),('f'); +SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z'; +b +d +f +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index a4e7c4ef53a..e14b54b59a3 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -2087,6 +2087,2772 @@ t2 CREATE TABLE `t2` ( `CONCAT(s1)` varchar(255) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t2; +SET NAMES utf8; +# +# Start of WL#2649 Number-to-string conversions +# +select hex(concat(1)); +hex(concat(1)) +31 +create table t1 as select concat(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +31 +drop table t1; +select hex(concat(18446744073709551615)); +hex(concat(18446744073709551615)) +3138343436373434303733373039353531363135 +create table t1 as select concat(18446744073709551615) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +3138343436373434303733373039353531363135 +drop table t1; +select hex(concat(1.1)); +hex(concat(1.1)) +312E31 +create table t1 as select concat(1.1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1; +hex(c1) +312E31 +drop table t1; +select hex(concat('a', 1+2)), charset(concat(1+2)); +hex(concat('a', 1+2)) charset(concat(1+2)) +6133 utf8 +create table t1 as select concat(1+2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1-2)); +hex(concat(1-2)) +2D31 +create table t1 as select concat(1-2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1*2)); +hex(concat(1*2)) +32 +create table t1 as select concat(1*2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1/2)); +hex(concat(1/2)) +302E35303030 +create table t1 as select concat(1/2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 div 2)); +hex(concat(1 div 2)) +30 +create table t1 as select concat(1 div 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1 % 2)); +hex(concat(1 % 2)) +31 +create table t1 as select concat(1 % 2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-1)); +hex(concat(-1)) +2D31 +create table t1 as select concat(-1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(-(1+2))); +hex(concat(-(1+2))) +2D33 +create table t1 as select concat(-(1+2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1|2)); +hex(concat(1|2)) +33 +create table t1 as select concat(1|2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(1&2)); +hex(concat(1&2)) +30 +create table t1 as select concat(1&2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_count(12))); +hex(concat(bit_count(12))) +32 +create table t1 as select concat(bit_count(12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2<<1)); +hex(concat(2<<1)) +34 +create table t1 as select concat(2<<1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(2>>1)); +hex(concat(2>>1)) +31 +create table t1 as select concat(2>>1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(~0)); +hex(concat(~0)) +3138343436373434303733373039353531363135 +create table t1 as select concat(~0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(3^2)); +hex(concat(3^2)) +31 +create table t1 as select concat(3^2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(abs(-2))); +hex(concat(abs(-2))) +32 +create table t1 as select concat(abs(-2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(exp(2)),1)); +hex(left(concat(exp(2)),1)) +37 +create table t1 as select concat(exp(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log(2)),1)); +hex(left(concat(log(2)),1)) +30 +create table t1 as select concat(log(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log2(2)),1)); +hex(left(concat(log2(2)),1)) +31 +create table t1 as select concat(log2(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(log10(2)),1)); +hex(left(concat(log10(2)),1)) +30 +create table t1 as select concat(log10(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sqrt(2)),1)); +hex(left(concat(sqrt(2)),1)) +31 +create table t1 as select concat(sqrt(2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(pow(2,2)),1)); +hex(left(concat(pow(2,2)),1)) +34 +create table t1 as select concat(pow(2,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(acos(0.5)),1)); +hex(left(concat(acos(0.5)),1)) +31 +create table t1 as select concat(acos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(asin(0.5)),1)); +hex(left(concat(asin(0.5)),1)) +30 +create table t1 as select concat(asin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(atan(0.5)),1)); +hex(left(concat(atan(0.5)),1)) +30 +create table t1 as select concat(atan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(cos(0.5)),1)); +hex(left(concat(cos(0.5)),1)) +30 +create table t1 as select concat(cos(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(sin(0.5)),1)); +hex(left(concat(sin(0.5)),1)) +30 +create table t1 as select concat(sin(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(tan(0.5)),1)); +hex(left(concat(tan(0.5)),1)) +30 +create table t1 as select concat(tan(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(degrees(0))); +hex(concat(degrees(0))) +30 +create table t1 as select concat(degrees(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(radians(0))); +hex(concat(radians(0))) +30 +create table t1 as select concat(radians(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ceiling(0.5))); +hex(concat(ceiling(0.5))) +31 +create table t1 as select concat(ceiling(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(floor(0.5))); +hex(concat(floor(0.5))) +30 +create table t1 as select concat(floor(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(round(0.5))); +hex(concat(round(0.5))) +31 +create table t1 as select concat(round(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sign(0.5))); +hex(concat(sign(0.5))) +31 +create table t1 as select concat(sign(0.5)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(rand()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(length('a'))); +hex(concat(length('a'))) +31 +create table t1 as select concat(length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(char_length('a'))); +hex(concat(char_length('a'))) +31 +create table t1 as select concat(char_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(bit_length('a'))); +hex(concat(bit_length('a'))) +38 +create table t1 as select concat(bit_length('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coercibility('a'))); +hex(concat(coercibility('a'))) +34 +create table t1 as select concat(coercibility('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(locate('a','a'))); +hex(concat(locate('a','a'))) +31 +create table t1 as select concat(locate('a','a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(field('c','a','b','c'))); +hex(concat(field('c','a','b','c'))) +33 +create table t1 as select concat(field('c','a','b','c')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ascii(61))); +hex(concat(ascii(61))) +3534 +create table t1 as select concat(ascii(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ord(61))); +hex(concat(ord(61))) +3534 +create table t1 as select concat(ord(61)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(find_in_set('b','a,b,c,d'))); +hex(concat(find_in_set('b','a,b,c,d'))) +32 +create table t1 as select concat(find_in_set('b','a,b,c,d')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select md5('a'), hex(md5('a')); +md5('a') hex(md5('a')) +0cc175b9c0f1b6a831c399e269772661 3063633137356239633066316236613833316333393965323639373732363631 +create table t1 as select md5('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select old_password('a'), hex(old_password('a')); +old_password('a') hex(old_password('a')) +60671c896665c3fa 36303637316338393636363563336661 +create table t1 as select old_password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(16) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select password('a'), hex(password('a')); +password('a') hex(password('a')) +*667F407DE7C6AD07358FA38DAED7828A72014B4E 2A36363746343037444537433641443037333538464133384441454437383238413732303134423445 +create table t1 as select password('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(41) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha('a'), hex(sha('a')); +sha('a') hex(sha('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select sha1('a'), hex(sha1('a')); +sha1('a') hex(sha1('a')) +86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 38366637653433376661613561376663653135643164646362396561656165613337373636376238 +create table t1 as select sha1('a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('-1' as signed))); +hex(concat(cast('-1' as signed))) +2D31 +create table t1 as select concat(cast('-1' as signed)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('1' as unsigned))); +hex(concat(cast('1' as unsigned))) +31 +create table t1 as select concat(cast('1' as unsigned)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast(1/2 as decimal(5,5)))); +hex(concat(cast(1/2 as decimal(5,5)))) +302E3530303030 +create table t1 as select concat(cast(1/2 as decimal(5,5))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(7) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as date))); +hex(concat(cast('2001-01-02 03:04:05' as date))) +323030312D30312D3032 +create table t1 as select concat(cast('2001-01-02 03:04:05' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 +drop table t1; +select hex(concat(cast('2001-01-02 03:04:05' as time))); +hex(concat(cast('2001-01-02 03:04:05' as time))) +30333A30343A3035 +create table t1 as select concat(cast('2001-01-02 03:04:05' as time)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +03:04:05 +drop table t1; +select hex(concat(cast('2001-01-02' as datetime))); +hex(concat(cast('2001-01-02' as datetime))) +323030312D30312D30322030303A30303A3030 +create table t1 as select concat(cast('2001-01-02' as datetime)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2001-01-02 00:00:00 +drop table t1; +select hex(concat(least(1,2))); +hex(concat(least(1,2))) +31 +create table t1 as select concat(least(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(greatest(1,2))); +hex(concat(greatest(1,2))) +32 +create table t1 as select concat(greatest(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(case when 11 then 22 else 33 end)); +hex(concat(case when 11 then 22 else 33 end)) +3232 +create table t1 as select concat(case when 11 then 22 else 33 end) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(coalesce(1,2))); +hex(concat(coalesce(1,2))) +31 +create table t1 as select concat(coalesce(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat_ws(1,2,3)); +hex(concat_ws(1,2,3)) +323133 +create table t1 as select concat_ws(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(group_concat(1,2,3)); +hex(group_concat(1,2,3)) +313233 +create table t1 as select group_concat(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(342) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select 1 as c1 union select 'a'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select hex(c1) from t1 order by c1; +hex(c1) +31 +61 +drop table t1; +create table t1 as select concat(last_insert_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(benchmark(0,0))); +hex(concat(benchmark(0,0))) +30 +create table t1 as select concat(benchmark(0,0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sleep(0))); +hex(concat(sleep(0))) +30 +create table t1 as select concat(sleep(0)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(is_free_lock('xxxx'))); +hex(concat(is_free_lock('xxxx'))) +31 +create table t1 as select concat(is_free_lock('xxxx')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(is_used_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(release_lock('a')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(crc32(''))); +hex(concat(crc32(''))) +30 +create table t1 as select concat(crc32('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(uncompressed_length(''))); +hex(concat(uncompressed_length(''))) +30 +create table t1 as select concat(uncompressed_length('')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(connection_id()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_aton('127.1.1.1'))); +hex(concat(inet_aton('127.1.1.1'))) +32313330373732323235 +create table t1 as select concat(inet_aton('127.1.1.1')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(inet_ntoa(2130772225))); +hex(concat(inet_ntoa(2130772225))) +3132372E312E312E31 +create table t1 as select concat(inet_ntoa(2130772225)) as c1; +select * from t1; +c1 +127.1.1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(31) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select 1; +1 +1 +select hex(concat(row_count())); +hex(concat(row_count())) +2D31 +create table t1 as select concat(row_count()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(found_rows())); +hex(concat(found_rows())) +30 +create table t1 as select concat(found_rows()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid_short()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(uuid()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select coercibility(uuid()), coercibility(cast('a' as char character set latin1)); +coercibility(uuid()) coercibility(cast('a' as char character set latin1)) +4 2 +select charset(concat(uuid(), cast('a' as char character set latin1))); +charset(concat(uuid(), cast('a' as char character set latin1))) +latin1 +create table t1 as select concat(uuid(), cast('a' as char character set latin1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(master_pos_wait('non-existent',0,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1)); +hex(concat(@a1:=1)) +31 +create table t1 as select concat(@a2:=2) as c1, @a3:=3 as c2; +select hex(c1) from t1; +hex(c1) +32 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '', + `c2` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1; +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET utf8 DEFAULT NULL, + `c2` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=sqrt(1))); +hex(concat(@a1:=sqrt(1))) +31 +create table t1 as select concat(@a2:=sqrt(1)) as c1, @a3:=sqrt(1) as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=sqrt(1); +select hex(concat(@a2)); +hex(concat(@a2)) +31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL, + `c2` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@a1:=1.1)); +hex(concat(@a1:=1.1)) +312E31 +create table t1 as select concat(@a2:=1.1) as c1, @a3:=1.1 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '', + `c2` decimal(2,1) NOT NULL DEFAULT '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @a2=1.1; +select hex(concat(@a2)); +hex(concat(@a2)) +312E31 +create table t1 as select concat(@a2) as c1, @a2 as c2; +select hex(c1) from t1; +hex(c1) +312E31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(83) CHARACTER SET utf8 DEFAULT NULL, + `c2` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(@@ft_max_word_len)); +hex(concat(@@ft_max_word_len)) +3834 +create table t1 as select concat(@@ft_max_word_len) as c1; +select hex(c1) from t1; +hex(c1) +3834 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS TRUE)); +hex(concat('a'='a' IS TRUE)) +31 +create table t1 as select concat('a'='a' IS TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a'='a' IS NOT TRUE)); +hex(concat('a'='a' IS NOT TRUE)) +30 +create table t1 as select concat('a'='a' IS NOT TRUE) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NOT 'a'='a')); +hex(concat(NOT 'a'='a')) +30 +create table t1 as select concat(NOT 'a'='a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NULL)); +hex(concat('a' IS NULL)) +30 +create table t1 as select concat('a' IS NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' IS NOT NULL)); +hex(concat('a' IS NOT NULL)) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' rlike 'a')); +hex(concat('a' rlike 'a')) +31 +create table t1 as select concat('a' IS NOT NULL) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(strcmp('a','b'))); +hex(concat(strcmp('a','b'))) +2D31 +create table t1 as select concat(strcmp('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' like 'a')); +hex(concat('a' like 'a')) +31 +create table t1 as select concat('a' like 'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' between 'b' and 'c')); +hex(concat('a' between 'b' and 'c')) +30 +create table t1 as select concat('a' between 'b' and 'c') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat('a' in ('a','b'))); +hex(concat('a' in ('a','b'))) +31 +create table t1 as select concat('a' in ('a','b')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(interval(23, 1, 15, 17, 30, 44, 200))); +hex(concat(interval(23, 1, 15, 17, 30, 44, 200))) +33 +create table t1 as select concat(interval(23, 1, 15, 17, 30, 44, 200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a varchar(10), fulltext key(a)); +insert into t1 values ('a'); +select hex(concat(match (a) against ('a'))) from t1; +hex(concat(match (a) against ('a'))) +30 +create table t2 as select concat(match (a) against ('a')) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +select hex(ifnull(1,'a')); +hex(ifnull(1,'a')) +31 +create table t1 as select ifnull(1,'a') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1,1))); +hex(concat(ifnull(1,1))) +31 +create table t1 as select concat(ifnull(1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(ifnull(1.1,1.1))); +hex(concat(ifnull(1.1,1.1))) +312E31 +create table t1 as select concat(ifnull(1.1,1.1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,'b',1)); +hex(if(1,'b',1)) +62 +create table t1 as select if(1,'b',1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(if(1,1,'b')); +hex(if(1,1,'b')) +31 +create table t1 as select if(1,1,'b') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(if(1,1,1))); +hex(concat(if(1,1,1))) +31 +create table t1 as select concat(if(1,1,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(nullif(1,2))); +hex(concat(nullif(1,2))) +31 +create table t1 as select concat(nullif(1,2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))); +hex(concat(Dimension(GeomFromText('LINESTRING(0 0,10 10)')))) +31 +create table t1 as select concat(Dimension(GeomFromText('LINSTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +32 +create table t1 as select concat(NumGeometries(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))); +hex(concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)')))) +32 +create table t1 as select concat(NumPoints(MultiPointFromText('LINESTRING(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))); +hex(concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)')))) +30 +create table t1 as select concat(SRID(MultiPointFromText('MULTIPOINT(0 0,10 10)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))); +hex(concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')))) +31 +create table t1 as select concat(NumInteriorRings(PolygonFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))); +hex(concat(IsEmpty(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsEmpty(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsSimple(GeomFromText('POINT(1 1)')))); +hex(concat(IsSimple(GeomFromText('POINT(1 1)')))) +30 +create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))); +hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))) +30 +create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))); +hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)')))) +31 +create table t1 as select concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))) as c1; +drop table t1; +select hex(concat(x(GeomFromText('Point(1 2)')))); +hex(concat(x(GeomFromText('Point(1 2)')))) +31 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(y(GeomFromText('Point(1 2)')))); +hex(concat(y(GeomFromText('Point(1 2)')))) +32 +create table t1 as select concat(x(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))); +hex(concat(GLength(GeomFromText('LineString(1 2,2 2)')))) +31 +create table t1 as select concat(GLength(GeomFromText('LineString(1 2, 2 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))); +hex(concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))')))) +31 +create table t1 as select concat(Area(GeomFromText('Polygon((0 0,1 0,1 1,0 1,0 0))'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(GeometryType(GeomFromText('Point(1 2)')))); +hex(concat(GeometryType(GeomFromText('Point(1 2)')))) +504F494E54 +create table t1 as select concat(GeometryType(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(AsText(GeomFromText('Point(1 2)')))); +hex(concat(AsText(GeomFromText('Point(1 2)')))) +504F494E542831203229 +create table t1 as select concat(AsText(GeomFromText('Point(1 2)'))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` longtext CHARACTER SET utf8 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_add(200902, 2))); +hex(concat(period_add(200902, 2))) +323030393034 +create table t1 as select concat(period_add(200902, 2)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(period_diff(200902, 200802))); +hex(concat(period_diff(200902, 200802))) +3132 +create table t1 as select concat(period_add(200902, 200802)) as c1; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(to_days(20090224))); +hex(concat(to_days(20090224))) +373333383237 +create table t1 as select concat(to_days(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofmonth(20090224))); +hex(concat(dayofmonth(20090224))) +3234 +create table t1 as select concat(dayofmonth(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofyear(20090224))); +hex(concat(dayofyear(20090224))) +3535 +create table t1 as select concat(dayofyear(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(hour('10:11:12'))); +hex(concat(hour('10:11:12'))) +3130 +create table t1 as select concat(hour('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(minute('10:11:12'))); +hex(concat(minute('10:11:12'))) +3131 +create table t1 as select concat(minute('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(second('10:11:12'))); +hex(concat(second('10:11:12'))) +3132 +create table t1 as select concat(second('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(quarter(20090224))); +hex(concat(quarter(20090224))) +31 +create table t1 as select concat(quarter(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(week(20090224))); +hex(concat(week(20090224))) +38 +create table t1 as select concat(week(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(yearweek(20090224))); +hex(concat(yearweek(20090224))) +323030393038 +create table t1 as select concat(yearweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(year(20090224))); +hex(concat(year(20090224))) +32303039 +create table t1 as select concat(year(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(weekday(20090224))); +hex(concat(weekday(20090224))) +31 +create table t1 as select concat(weekday(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(dayofweek(20090224))); +hex(concat(dayofweek(20090224))) +33 +create table t1 as select concat(dayofweek(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(unix_timestamp(20090224))); +hex(concat(unix_timestamp(20090224))) +31323335343232383030 +create table t1 as select concat(unix_timestamp(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(time_to_sec('10:11:12'))); +hex(concat(time_to_sec('10:11:12'))) +3336363732 +create table t1 as select concat(time_to_sec('10:11:12')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(extract(year from 20090702))); +hex(concat(extract(year from 20090702))) +32303039 +create table t1 as select concat(extract(year from 20090702)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(microsecond('12:00:00.123456'))); +hex(concat(microsecond('12:00:00.123456'))) +313233343536 +create table t1 as select concat(microsecond('12:00:00.123456')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(month(20090224))); +hex(concat(month(20090224))) +32 +create table t1 as select concat(month(20090224)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(last_day('2003-02-05')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2003-02-28 323030332D30322D3238 +drop table t1; +create table t1 as select concat(from_days(730669)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select c1, hex(c1) from t1; +c1 hex(c1) +2000-07-03 323030302D30372D3033 +drop table t1; +create table t1 as select concat(curdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_date()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(curtime()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat('a',20) as c1 limit 0; +set timestamp=1216359724; +insert into t1 values (current_date); +insert into t1 values (current_time); +select c1, hex(c1) from t1; +c1 hex(c1) +2008-07-18 323030382D30372D3138 +08:42:04 30383A34323A3034 +drop table t1; +create table t1 as select concat(utc_time()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(8) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(sec_to_time(2378))); +hex(concat(sec_to_time(2378))) +30303A33393A3338 +create table t1 as select concat(sec_to_time(2378)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))); +hex(concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00'))) +32343A30303A3030 +create table t1 as select concat(timediff('2001-01-02 00:00:00', '2001-01-01 00:00:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(maketime(10,11,12))); +hex(concat(maketime(10,11,12))) +31303A31313A3132 +create table t1 as select concat(maketime(10,11,12)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(23) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(get_format(DATE,'USA')); +hex(get_format(DATE,'USA')) +256D2E25642E2559 +create table t1 as select get_format(DATE,'USA') as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(17) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(concat(from_unixtime(1111885200)),4)); +hex(left(concat(from_unixtime(1111885200)),4)) +32303035 +create table t1 as select concat(from_unixtime(1111885200)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))); +hex(concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00'))) +323030332D31322D33312032303A30303A3030 +create table t1 as select concat(convert_tz('2004-01-01 12:00:00','+10:00','-6:00')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))); +hex(concat(date_add('2004-01-01 12:00:00', interval 1 day))) +323030342D30312D30322031323A30303A3030 +create table t1 as select concat(date_add('2004-01-01 12:00:00', interval 1 day)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2004-01-02 12:00:00 +drop table t1; +select hex(concat(makedate(2009,1))); +hex(concat(makedate(2009,1))) +323030392D30312D3031 +create table t1 as select concat(makedate(2009,1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +c1 +2009-01-01 +drop table t1; +create table t1 as select concat(now()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(utc_timestamp()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(sysdate()) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(addtime('00:00:00','11:22:33'))); +hex(concat(addtime('00:00:00','11:22:33'))) +31313A32323A3333 +create table t1 as select concat(addtime('00:00:00','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(concat(subtime('23:59:59','11:22:33'))); +hex(concat(subtime('23:59:59','11:22:33'))) +31323A33373A3236 +create table t1 as select concat(subtime('23:59:59','11:22:33')) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(29) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(elt(1,2,3)); +hex(elt(1,2,3)) +32 +create table t1 as select elt(1,2,3) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(export_set(1,2,3,4,2)); +hex(export_set(1,2,3,4,2)) +323433 +create table t1 as select export_set(1,2,3,4,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(127) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(insert(1133,3,0,22)); +hex(insert(1133,3,0,22)) +313132323333 +create table t1 as select insert(1133,3,0,22) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lcase(123)); +hex(lcase(123)) +313233 +create table t1 as select lcase(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(left(123,1)); +hex(left(123,1)) +31 +create table t1 as select left(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lower(123)); +hex(lower(123)) +313233 +create table t1 as select lower(123) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(lpad(1,2,0)); +hex(lpad(1,2,0)) +3031 +create table t1 as select lpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ltrim(1)); +hex(ltrim(1)) +31 +create table t1 as select ltrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(mid(1,1,1)); +hex(mid(1,1,1)) +31 +create table t1 as select mid(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(repeat(1,2)); +hex(repeat(1,2)) +3131 +create table t1 as select repeat(1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(replace(1,1,2)); +hex(replace(1,1,2)) +32 +create table t1 as select replace(1,1,2) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(reverse(12)); +hex(reverse(12)) +3231 +create table t1 as select reverse(12) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(right(123,1)); +hex(right(123,1)) +33 +create table t1 as select right(123,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rpad(1,2,0)); +hex(rpad(1,2,0)) +3130 +create table t1 as select rpad(1,2,0) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(rtrim(1)); +hex(rtrim(1)) +31 +create table t1 as select rtrim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(soundex(1)); +hex(soundex(1)) + +create table t1 as select soundex(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(substring(1,1,1)); +hex(substring(1,1,1)) +31 +create table t1 as select substring(1,1,1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(trim(1)); +hex(trim(1)) +31 +create table t1 as select trim(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(ucase(1)); +hex(ucase(1)) +31 +create table t1 as select ucase(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select hex(upper(1)); +hex(upper(1)) +31 +create table t1 as select upper(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select repeat(' ', 64) as a limit 0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ("1.1"), ("2.1"); +select a, hex(a) from t1; +a hex(a) +1.1 312E31 +2.1 322E31 +update t1 set a= a + 0.1; +select a, hex(a) from t1; +a hex(a) +1.2000000000000002 312E32303030303030303030303030303032 +2.2 322E32 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303031 001 +303130 010 +313030 100 +drop table t1; +create table t1 (a tinyint(4) zerofill); +insert into t1 values (1), (10), (100); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303031 0001 +30303130 0010 +30313030 0100 +drop table t1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E3435 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(6) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303031 00001 +3030303130 00010 +3030313030 00100 +3031303030 01000 +3130303030 10000 +drop table t1; +create table t1 (a mediumint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(9) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303031 00000001 +3030303030303130 00000010 +3030303030313030 00000100 +3030303031303030 00001000 +3030303130303030 00010000 +drop table t1; +create table t1 (a int); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(11) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303031 0000000001 +30303030303030303130 0000000010 +30303030303030313030 0000000100 +30303030303031303030 0000001000 +30303030303130303030 0000010000 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +31 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(20) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +select hex(concat(a)), a from t1; +hex(concat(a)) a +3030303030303030303030303030303030303031 00000000000000000001 +3030303030303030303030303030303030303130 00000000000000000010 +3030303030303030303030303030303030313030 00000000000000000100 +3030303030303030303030303030303031303030 00000000000000001000 +3030303030303030303030303030303130303030 00000000000000010000 +drop table t1; +create table t1 (a float); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(12) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +303030303030303030312E31 0000000001.1 +303030303030303031302E31 0000000010.1 +303030303030303130302E31 0000000100.1 +303030303030313030302E31 0000001000.1 +303030303031303030302E31 0000010000.1 +drop table t1; +create table t1 (a double); +insert into t1 values (123.456); +select hex(concat(a)) from t1; +hex(concat(a)) +3132332E343536 +select concat(a) from t1; +concat(a) +123.456 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(22) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +select hex(concat(a)), a from t1; +hex(concat(a)) a +30303030303030303030303030303030303030312E31 00000000000000000001.1 +30303030303030303030303030303030303031302E31 00000000000000000010.1 +30303030303030303030303030303030303130302E31 00000000000000000100.1 +30303030303030303030303030303030313030302E31 00000000000000001000.1 +30303030303030303030303030303031303030302E31 00000000000000010000.1 +drop table t1; +create table t1 (a year(2)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +3031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(2) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a year); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +32303031 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(4) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a bit(64)); +insert into t1 values (1); +select hex(concat(a)) from t1; +hex(concat(a)) +0000000000000001 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varbinary(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +select hex(concat(a)) from t1; +hex(concat(a)) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +select concat(a) from t1; +concat(a) +0000-00-00 00:00:00 +2001-02-03 04:05:06 +1980-02-03 04:05:06 +2001-02-03 04:05:06 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D3033 +323030312D30322D3033 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +select hex(concat(a)) from t1; +hex(concat(a)) +30303A30303A3031 +30313A30323A3033 +select concat(a) from t1; +concat(a) +00:00:01 +01:02:03 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +select hex(concat(a)) from t1; +hex(concat(a)) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +create table t2 as select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(19) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 (a tinyint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a tinyint zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(3) YES NULL +select hex(a) from v1; +hex(a) +303031 +303130 +313030 +drop table t1; +drop view v1; +create table t1 (a tinyint(30) zerofill); +insert into t1 values (1), (10), (100); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(30) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030303030303030303030303030303030303030303031 +303030303030303030303030303030303030303030303030303030303130 +303030303030303030303030303030303030303030303030303030313030 +drop table t1; +drop view v1; +create table t1 (a decimal(10,2)); +insert into t1 values (123.45); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E3435 +drop table t1; +drop view v1; +create table t1 (a smallint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(6) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a smallint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(5) YES NULL +select hex(a) from v1; +hex(a) +3030303031 +3030303130 +3030313030 +3031303030 +3130303030 +drop table t1; +drop view v1; +create table t1 (a mediumint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(9) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a mediumint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +3030303030303031 +3030303030303130 +3030303030313030 +3030303031303030 +3030303130303030 +drop table t1; +drop view v1; +create table t1 (a int); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(11) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a int zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303031 +30303030303030303130 +30303030303030313030 +30303030303031303030 +30303030303130303030 +drop table t1; +drop view v1; +create table t1 (a bigint); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +31 +drop table t1; +drop view v1; +create table t1 (a bigint zerofill); +insert into t1 values (1), (10), (100), (1000), (10000); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(20) YES NULL +select hex(a) from v1; +hex(a) +3030303030303030303030303030303030303031 +3030303030303030303030303030303030303130 +3030303030303030303030303030303030313030 +3030303030303030303030303030303031303030 +3030303030303030303030303030303130303030 +drop table t1; +drop view v1; +create table t1 (a float); +insert into t1 values (123.456); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a float zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(12) YES NULL +select hex(a) from v1; +hex(a) +303030303030303030312E31 +303030303030303031302E31 +303030303030303130302E31 +303030303030313030302E31 +303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a double); +insert into t1 values (123.456); +select concat(a) from t1; +concat(a) +123.456 +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +3132332E343536 +drop table t1; +drop view v1; +create table t1 (a double zerofill); +insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(22) YES NULL +select hex(a) from v1; +hex(a) +30303030303030303030303030303030303030312E31 +30303030303030303030303030303030303031302E31 +30303030303030303030303030303030303130302E31 +30303030303030303030303030303030313030302E31 +30303030303030303030303030303031303030302E31 +drop table t1; +drop view v1; +create table t1 (a year(2)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(2) YES NULL +select hex(a) from v1; +hex(a) +3031 +drop table t1; +drop view v1; +create table t1 (a year); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(4) YES NULL +select hex(a) from v1; +hex(a) +32303031 +drop table t1; +drop view v1; +create table t1 (a bit(64)); +insert into t1 values (1); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varbinary(64) YES NULL +select hex(a) from v1; +hex(a) +0000000000000001 +drop table t1; +drop view v1; +create table t1 (a timestamp); +insert into t1 values (0); +insert into t1 values (20010203040506); +insert into t1 values (19800203040506); +insert into t1 values ('2001-02-03 04:05:06'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) NO +select hex(a) from v1; +hex(a) +303030302D30302D30302030303A30303A3030 +323030312D30322D30332030343A30353A3036 +313938302D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create table t1 (a date); +insert into t1 values ('2001-02-03'); +insert into t1 values (20010203); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(10) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D3033 +323030312D30322D3033 +drop table t1; +drop view v1; +create table t1 (a time); +insert into t1 values (1); +insert into t1 values ('01:02:03'); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(8) YES NULL +select hex(a) from v1; +hex(a) +30303A30303A3031 +30313A30323A3033 +drop table t1; +drop view v1; +create table t1 (a datetime); +insert into t1 values ('2001-02-03 04:05:06'); +insert into t1 values (20010203040506); +create view v1(a) as select concat(a) from t1; +show columns from v1; +Field Type Null Key Default Extra +a varchar(19) YES NULL +select hex(a) from v1; +hex(a) +323030312D30322D30332030343A30353A3036 +323030312D30322D30332030343A30353A3036 +drop table t1; +drop view v1; +create function f1 (par1 int) returns int +begin +return concat(par1); +end| +set @a= f1(1); +select hex(@a); +hex(@a) +1 +select hex(concat(f1(1))); +hex(concat(f1(1))) +31 +create table t1 as select f1(1) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(1)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(1)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(11) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 decimal(18,2)) returns decimal(18,2) +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` decimal(18,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(20) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 float) returns float +begin +return concat(par1); +end| +set @a= f1(123.45); +select hex(@a); +hex(@a) +7B +select hex(concat(f1(123.45))); +hex(concat(f1(123.45))) +3132332E3435 +create table t1 as select f1(123.45) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(123.45)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(12) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(123.45)) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(12) YES NULL +drop table t1; +drop view v1; +drop function f1; +create function f1 (par1 date) returns date +begin +return concat(par1); +end| +set @a= f1(cast('2001-01-02' as date)); +select hex(@a); +hex(@a) +323030312D30312D3032 +select hex(concat(f1(cast('2001-01-02' as date)))); +hex(concat(f1(cast('2001-01-02' as date)))) +323030312D30312D3032 +create table t1 as select f1(cast('2001-01-02' as date)) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create view v1 as select concat(f1(cast('2001-01-02' as date))) as c1; +show columns from v1; +Field Type Null Key Default Extra +c1 varchar(10) YES NULL +drop table t1; +drop view v1; +drop function f1; +# +# End of WL#2649 Number-to-string conversions +# +# +# Bug#54668 User variable assignments get wrong type +# +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +utf8 utf8_general_ci +# +# Bug#54916 GROUP_CONCAT + IFNULL truncates output +# +SELECT @@collation_connection; +@@collation_connection +utf8_general_ci +CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1234567); +SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1; +GROUP_CONCAT(IFNULL(a,'')) +1234567 +SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1; +GROUP_CONCAT(IF(a,a,'')) +1234567 +SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1; +GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) +1234567 +SELECT COALESCE(a,'') FROM t1 GROUP BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,'') 253 27 7 Y 0 31 33 +COALESCE(a,'') +1234567 +# All columns must be VARCHAR(9) with the same length: +CREATE TABLE t2 AS +SELECT +CONCAT(a), +IFNULL(a,''), +IF(a,a,''), +CASE WHEN a THEN a ELSE '' END, +COALESCE(a,'') +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(a)` varchar(9) CHARACTER SET utf8 DEFAULT NULL, + `IFNULL(a,'')` varchar(9) CHARACTER SET utf8 NOT NULL DEFAULT '', + `IF(a,a,'')` varchar(9) CHARACTER SET utf8 DEFAULT NULL, + `CASE WHEN a THEN a ELSE '' END` varchar(9) CHARACTER SET utf8 DEFAULT NULL, + `COALESCE(a,'')` varchar(9) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT CONCAT_WS(1,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT_WS(1,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT INSERT(1133,3,0,22) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `INSERT(1133,3,0,22)` varchar(6) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LCASE(a)` varchar(9) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT UCASE(a) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `UCASE(a)` varchar(9) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPEAT(1,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPEAT(1,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LEFT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LEFT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RIGHT(123,2) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RIGHT(123,2)` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT LTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `LTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT RTRIM(123) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `RTRIM(123)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT ELT(1,111,222,333) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ELT(1,111,222,333)` varchar(3) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT REPLACE(111,2,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `REPLACE(111,2,3)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SUBSTRING_INDEX(111,111,1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SUBSTRING_INDEX(111,111,1)` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT MAKE_SET(111,222,3) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAKE_SET(111,222,3)` varchar(5) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT SOUNDEX(1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `SOUNDEX(1)` varchar(4) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t2 AS SELECT EXPORT_SET(1,'Y','N','',8); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `EXPORT_SET(1,'Y','N','',8)` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +# +# End of Bug#54916 +# +# +# Bug#52159 returning time type from function and empty left join causes debug assertion +# +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +f1() +00:00:01 +DROP FUNCTION f1; +DROP TABLE t1; +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +maketime(`a`,`a`,`a`) +00:00:00 +DROP TABLE t1; +SET sql_mode=default; # # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result index 454c9d4bfbb..3b9abbc5412 100644 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@ -987,6 +987,31 @@ utf8mb4_bin 6109 utf8mb4_bin 61 utf8mb4_bin 6120 drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +CE85 CE85 +EFBE9D EFBE9D +F0908E84 F0908E84 +F4808080 F4808080 +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +CE85 CE85 +EFBE9D EFBE9D +F0908E84 F0908E84 +F4808080 F4808080 +DROP TABLE IF EXISTS t1; select @@collation_connection; @@collation_connection utf8mb4_bin diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 2bc77c52bec..4cb97719ff2 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -345,3 +345,80 @@ CREATE TABLE t1 LIKE t2; ERROR 42S01: Table 't1' already exists DROP TABLE t2; DROP TABLE t1; +# +# Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED +# +# This test is not supposed to work under --ps-protocol since +# INSERT DELAYED doesn't work under LOCK TABLES with this protocol. +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE TABLE t3 (a INT); +# Test 1: Using LOCK TABLE +# Connection con1 +LOCK TABLE t1 WRITE; +# Connection default +LOCK TABLE t2 WRITE; +# Sending: +INSERT DELAYED INTO t1 VALUES (1); +# Connection con1 +# Wait until INSERT DELAYED is blocked on table 't1'. +INSERT DELAYED INTO t2 VALUES (1); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +UNLOCK TABLES; +# Connection default +# Reaping: INSERT DELAYED INTO t1 VALUES (1) +UNLOCK TABLES; +# Test 2: Using ALTER TABLE +START TRANSACTION; +SELECT * FROM t1 WHERE a=0; +a +# Connection con1 +# Sending: +ALTER TABLE t1 COMMENT 'test'; +# Connection default +# Wait until ALTER TABLE is blocked on table 't1'. +INSERT DELAYED INTO t1 VALUES (3); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +# Connection con1 +# Reaping: ALTER TABLE t1 COMMENT 'test' +# Test 3: Using RENAME TABLE +# Connection default +START TRANSACTION; +INSERT INTO t2 VALUES (1); +# Connection con1 +# Sending: +RENAME TABLE t1 to t5, t2 to t4; +# Connection default +# Wait until RENAME TABLE is blocked on table 't1'. +INSERT DELAYED INTO t1 VALUES (4); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +# Connection con1 +# Reaping: RENAME TABLE t1 to t5, t2 to t4 +# Connection default +# Reverting the renames +RENAME TABLE t5 to t1, t4 to t2; +# Test 4: Two INSERT DELAYED on the same table +START TRANSACTION; +INSERT INTO t2 VALUES (1); +# Connection con2 +LOCK TABLE t1 WRITE, t2 WRITE; +# Connection con1 +# Wait until LOCK TABLE is blocked on table 't2'. +INSERT DELAYED INTO t1 VALUES (5); +# Connection default +# Wait until INSERT DELAYED is blocked on table 't1'. +INSERT DELAYED INTO t1 VALUES (6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +# Connection con2 +# Reaping: LOCK TABLE t1 WRITE, t2 WRITE +UNLOCK TABLES; +# Connection con1 +# Reaping: INSERT DELAYED INTO t1 VALUES (5) +# Connection con2 +# Connection con1 +# Connection default +DROP TABLE t1, t2, t3; diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 0c9b0d7d2e5..702b9348b7d 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -499,4 +499,13 @@ INDEX(a), INDEX(b), INDEX(c)); INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9); DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; DROP TABLE t1; +# +# Bug #53034: Multiple-table DELETE statements not accepting +# "Access compatibility" syntax +# +CREATE TABLE t1 (id INT); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a; +DROP TABLE t1, t2, t3; End of 5.1 tests diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result index 9c8d12362c4..4eca88774b4 100644 --- a/mysql-test/r/endspace.result +++ b/mysql-test/r/endspace.result @@ -54,8 +54,8 @@ text1 like 'teststring_%' ORDER BY text1; text1 teststring teststring -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; -concat('|', text1, '|') +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; +c |teststring | |teststring| select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; @@ -105,11 +105,11 @@ select concat('|', text1, '|') from t1 where text1 like 'teststring_%'; concat('|', text1, '|') |teststring | |teststring | -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; -concat('|', text1, '|') +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; +c |teststring | -|teststring| |teststring | +|teststring| select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; concat('|', text1, '|') |teststring| @@ -123,8 +123,8 @@ concat('|', text1, '|') drop table t1; create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0; insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; -concat('|', text1, '|') +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; +c |teststring | |teststring| select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t'; @@ -203,13 +203,13 @@ teststring teststring select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%'; text1 length(text1) -teststring 11 teststring 10 +teststring 11 teststring 11 select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t'; text1 length(text1) -teststring 11 teststring 10 +teststring 11 teststring 11 select concat('|', text1, '|') from t1 order by text1; concat('|', text1, '|') diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result index 16ec64b4c50..37951c30787 100644 --- a/mysql-test/r/events_trans.result +++ b/mysql-test/r/events_trans.result @@ -116,3 +116,22 @@ OK: create event: database does not exist delete from t1; commit work; drop database events_test; +# +# Bug#54105 assert in MDL_context::release_locks_stored_before +# +USE test; +DROP TABLE IF EXISTS t1, t2; +DROP EVENT IF EXISTS e1; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT); +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SAVEPOINT A; +SHOW CREATE EVENT e1; +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT * FROM t2; +a +ROLLBACK WORK TO SAVEPOINT A; +DROP TABLE t1, t2; diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index 3702443d04a..aee18d91edf 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -205,6 +205,51 @@ a insert into t2 (a) values (3); # --> connection default; unlock tables; +# +# Check that "FLUSH TABLES WITH READ LOCK" is +# compatible with active "FLUSH TABLES WITH READ LOCK". +# Vice versa it is not true, since tables read-locked by +# "FLUSH TABLES WITH READ LOCK" can't be flushed. +flush tables with read lock; +# --> connection con1; +flush table t1 with read lock; +select * from t1; +a +1 +unlock tables; +# --> connection default; +unlock tables; +# +# Check that FLUSH TABLES t1 WITH READ LOCK +# does not conflict with an existing FLUSH TABLES t2 +# WITH READ LOCK. +# +flush table t1 with read lock; +# --> connection con1 +flush table t2 with read lock; +unlock tables; +# --> connection default +unlock tables; +# +# Check that FLUSH TABLES t1 WITH READ LOCK +# does not conflict with SET GLOBAL read_only=1. +# +set global read_only=1; +# connection con1 +flush table t1 with read lock; +unlock tables; +# connection default +set global read_only=0; +# +# Check that it's possible to read-lock +# tables locked with FLUSH TABLE WITH READ LOCK. +# +flush tables t1, t2 with read lock; +# connection con1 +lock table t1 read, t2 read; +unlock tables; +# connection default +unlock tables; # --> connection con1 drop table t1, t2, t3; # @@ -234,3 +279,97 @@ drop temporary table v1; unlock tables; drop view v2, v3; drop table t1, v1; +# +# FLUSH TABLES WITH READ LOCK and HANDLER +# +drop table if exists t1; +create table t1 (a int, key a (a)); +insert into t1 (a) values (1), (2), (3); +handler t1 open; +handler t1 read a next; +a +1 +handler t1 read a next; +a +2 +flush tables t1 with read lock; +handler t1 read a next; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +# +# Sic: lost handler position. +# +handler t1 read a next; +a +1 +handler t1 close; +drop table t1; +# +# Bug#52117 Pending FLUSH TALBES aborts +# transactions unnecessarily. +# +drop table if exists t1; +# --> conection default +create table t1 (a int); +begin; +select * from t1; +a +# --> connection con1 +# +# Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN +# or a long-running select -- anything that +# prevents FLUSH TABLE t1 from immediate completion would do. +# +lock table t1 read; +# --> connection con2 +# +# FLUSH TABLE expels the table definition from the cache. +# Sending 'flush table t1'... +flush table t1; +# --> connection default +# Let flush table sync in. +select * from t1; +# --> connection con1 +select * from t1; +a +unlock tables; +# --> connection con2 +# Reaping 'flush table t1'... +# --> connection default +# Reaping 'select * from t1'... +a +commit; +# +# Repeat the same test but with FLUSH TABLES +# +begin; +select * from t1; +a +# --> connection con1 +# +# Issue a LOCK TABLE t1 READ. +# +lock table t1 read; +# --> connection con2 +# +# FLUSH TABLES expels the table definition from the cache. +# Sending 'flush tables'... +flush tables; +# --> connection default +# Let flush table sync in. +select * from t1; +# --> connection con1 +select * from t1; +a +unlock tables; +# --> connection con2 +# Reaping 'flush tables'... +# --> connection default +# Reaping 'select * from t1'... +a +commit; +# Cleanup +# --> connection con1 +# --> connection con2 +# --> connection default +drop table t1; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 1a393b3cdd5..302de9de9f7 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1003,6 +1003,7 @@ SELECT 1 FROM 1 1 DROP TABLE t1; +End of 5.0 tests # # Bug #52397: another crash with explain extended and group_concat # @@ -1019,6 +1020,25 @@ Warnings: Note 1003 select 1 AS `1` from dual DROP TABLE t1; End of 5.0 tests +# +# Bug #54476: crash when group_concat and 'with rollup' in prepared statements +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2); +PREPARE stmt FROM "SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP"; +EXECUTE stmt; +GROUP_CONCAT(t1.a ORDER BY t1.a) +1,1 +2,2 +1,1,2,2 +EXECUTE stmt; +GROUP_CONCAT(t1.a ORDER BY t1.a) +1,1 +2,2 +1,1,2,2 +DEALLOCATE PREPARE stmt; +DROP TABLE t1; +End of 5.1 tests DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a VARCHAR(6), b INT); CREATE TABLE t2 (a VARCHAR(6), b INT); diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 45c93971852..5f874f4665d 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1713,9 +1713,20 @@ f1 f2 f3 f4 f1 = f2 NULL NULL NULL NULL NULL drop table t1; # +# Bug #54465: assert: field_types == 0 || field_types[field_pos] == +# MYSQL_TYPE_LONGLONG +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2); +SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1 +ORDER BY t1.a; +m +1 +DROP TABLE t1; +# End of 5.1 tests # -# Bug#55648: Server crash on MIX/MAX on maximum time value +# Bug#55648: Server crash on MIN/MAX on maximum time value # CREATE TABLE t1(c1 TIME NOT NULL); INSERT INTO t1 VALUES('837:59:59'); @@ -1725,3 +1736,13 @@ MAX(c1) 838:59:59 DROP TABLE t1; # End of the bug#55648 +# +# Bug#56120: Failed assertion on MIN/MAX on negative time value +# +CREATE TABLE t1(c1 TIME NOT NULL); +INSERT INTO t1 VALUES('-00:00:01'); +SELECT MAX(c1),MIN(c1) FROM t1; +MAX(c1) MIN(c1) +-00:00:01 -00:00:01 +DROP TABLE t1; +# End of the bug#56120 diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 955a784f04c..c70589a27b7 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -186,3 +186,13 @@ MAX(IFNULL(CAST(c AS UNSIGNED), 0)) 12345678901234567890 DROP TABLE t1; End of 5.0 tests +# +# Bug#55077: Assertion failed: width > 0 && to != ((void *)0), file .\dtoa.c +# +CREATE TABLE t1 (a LONGBLOB, b DOUBLE); +INSERT INTO t1 VALUES (NULL, 0), (NULL, 1); +SELECT IF(b, (SELECT a FROM t1 LIMIT 1), b) c FROM t1 GROUP BY c; +c +NULL +0 +DROP TABLE t1; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index e21e7903459..1eb4153eb8b 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -337,6 +337,21 @@ select connection_id() > 0; connection_id() > 0 1 # +# Bug #54461: crash with longblob and union or update with subquery +# +CREATE TABLE t1 (a INT, b LONGBLOB); +INSERT INTO t1 VALUES (1, '2'), (2, '3'), (3, '2'); +SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1; +LEAST(a, (SELECT b FROM t1 LIMIT 1)) +1 +2 +SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1; +GREATEST(a, (SELECT b FROM t1 LIMIT 1)) +2 +3 +1 +DROP TABLE t1; +# # Bug #52165: Assertion failed: file .\dtoa.c, line 465 # CREATE TABLE t1 (a SET('a'), b INT); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 7539cf43dd9..f01d46a9f41 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2734,3 +2734,28 @@ format(123, 1, 'Non-existent-locale') Warnings: Warning 1649 Unknown locale: 'Non-existent-locale' End of 5.4 tests +# +# Start of 5.5 tests +# +# +# Bug#55912 FORMAT with locale set fails for numbers < 1000 +# +SELECT FORMAT(123.33, 2, 'no_NO'), FORMAT(1123.33, 2, 'no_NO'); +FORMAT(123.33, 2, 'no_NO') FORMAT(1123.33, 2, 'no_NO') +123,33 1.123,33 +SELECT FORMAT(12333e-2, 2, 'no_NO'), FORMAT(112333e-2, 2, 'no_NO'); +FORMAT(12333e-2, 2, 'no_NO') FORMAT(112333e-2, 2, 'no_NO') +123,33 1.123,33 +CREATE TABLE t1 AS SELECT format(123,2,'no_NO'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `format(123,2,'no_NO')` varchar(37) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1; +format(123,2,'no_NO') +123,00 +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index c3f210edee5..9ba1ae489ca 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1305,4 +1305,12 @@ date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND) select date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND) 0168-12-31 23:59:59 +CREATE TABLE t1(a DOUBLE NOT NULL); +INSERT INTO t1 VALUES (0),(9.216e-096); +# should not crash +SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a); +1 +1 +1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 3416e368dff..2621f69da06 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1811,6 +1811,41 @@ MAX(t2.a) 2 DROP TABLE t1, t2; # +# Bug#55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results +# +CREATE TABLE t1 (a text, b varchar(10)); +INSERT INTO t1 VALUES (repeat('1', 1300),'one'), (repeat('1', 1300),'two'); +EXPLAIN +SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a; +id 1 +select_type SIMPLE +table t1 +type ALL +possible_keys NULL +key NULL +key_len NULL +ref NULL +rows 2 +Extra Using filesort +SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a; +SUBSTRING(a,1,10) LENGTH(a) GROUP_CONCAT(b) +1111111111 1300 one,two +EXPLAIN +SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a; +id 1 +select_type SIMPLE +table t1 +type ALL +possible_keys NULL +key NULL +key_len NULL +ref NULL +rows 2 +Extra Using temporary; Using filesort +SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a; +SUBSTRING(a,1,10) LENGTH(a) +1111111111 1300 +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/handler_read_last.result b/mysql-test/r/handler_read_last.result new file mode 100644 index 00000000000..a21e9ed9564 --- /dev/null +++ b/mysql-test/r/handler_read_last.result @@ -0,0 +1,60 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT, INDEX (a)); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a LIMIT 1; +a +NULL +SHOW STATUS LIKE 'HANDLER_READ%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a DESC LIMIT 1; +a +NULL +SHOW STATUS LIKE 'HANDLER_READ%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_last 1 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a LIMIT 3; +a +NULL +NULL +NULL +SHOW STATUS LIKE 'HANDLER_READ%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_last 0 +Handler_read_next 2 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a DESC LIMIT 3; +a +NULL +NULL +NULL +SHOW STATUS LIKE 'HANDLER_READ%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_last 1 +Handler_read_next 0 +Handler_read_prev 2 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1; diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index fbb7e7e8397..838a7ad5162 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -89,3 +89,15 @@ UNIQUE_CONSTRAINT_NAME NULL drop table t2; set foreign_key_checks = 1; +# +# Bug#55973 Assertion `thd->transaction.stmt.is_empty()' +# on CREATE TABLE .. SELECT I_S.PART +# +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +CREATE VIEW v1 AS SELECT 1; +CREATE TABLE t1 engine = InnoDB AS +SELECT * FROM information_schema.partitions +WHERE table_schema= 'test' AND table_name= 'v1'; +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index b322c5da73a..655303be7f4 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -671,3 +671,18 @@ drop table t1; # # End of 5.4 tests # +# +# Bug#54106 assert in Protocol::end_statement, +# INSERT IGNORE ... SELECT ... UNION SELECT ... +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT); +INSERT INTO t1 (a, a) VALUES (1, 1); +ERROR 42000: Column 'a' specified twice +INSERT IGNORE t1 (a, a) VALUES (1, 1); +ERROR 42000: Column 'a' specified twice +INSERT IGNORE t1 (a, a) SELECT 1,1; +ERROR 42000: Column 'a' specified twice +INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2; +ERROR 42000: Column 'a' specified twice +DROP TABLE t1; diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index f12c9a0a61a..b0858894b71 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -694,6 +694,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 9f87ea082db..260f7170fc5 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -854,6 +854,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 847a00cad94..0af32d8f749 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1238,6 +1238,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 5 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/locale.result b/mysql-test/r/locale.result index b52ed8070f9..aa61d8cd86f 100644 --- a/mysql-test/r/locale.result +++ b/mysql-test/r/locale.result @@ -44,7 +44,7 @@ a abmon mon 2006-12-01 Δεκ Δεκέμβριος SELECT format(123456.789, 3, 'el_GR'); format(123456.789, 3, 'el_GR') -123456.789 +123456,789 DROP TABLE t1; # # Bug#46633 Obsolete Serbian locale name diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index 0fd408b0208..d484ab77701 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -2034,6 +2034,155 @@ set debug_sync='now SIGNAL go2'; # Switching to connection 'default'. # Reaping ALTER. It should succeed and not produce ER_LOCK_DEADLOCK. drop table t1; +# +# Now, test for a situation in which deadlock involves waiting not +# only in MDL subsystem but also for TDC. Such deadlocks should be +# successfully detected. If possible, they should be resolved without +# resorting to ER_LOCK_DEADLOCK error. +# +create table t1(i int); +create table t2(j int); +# +# First, let us check how we handle a simple scenario involving +# waits in MDL and TDC. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con1'. +# Start a statement, which will acquire SR metadata lock on t1, open it +# and then stop, before trying to acquire SW lock on t2 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# Sending: +select * from t1 where i in (select j from t2 for update); +# Switching to connection 'deadlock_con2'. +# Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t1 and t2 and wait till SELECT closes t1. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'deadlock_con3'. +# Wait until FLUSH TABLES WITH t1, t2 READ LOCK starts waiting +# for SELECT to close t1. +# Resume SELECT, so it tries to acquire SW lock on t1 and blocks, +# creating a deadlock. This deadlock should be detected and resolved +# by backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +unlock tables; +# Switching to connection 'deadlock_con1'. +# Reap SELECT. +i +# +# The same scenario with a slightly different order of events +# which emphasizes that setting correct deadlock detector weights +# for flush waits is important. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con2'. +set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WAIT_FOR go'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t1 and t2 and wait on debug sync point. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'deadlock_con1'. +# Wait till FLUSH TABLE WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; +# Start statement which will acquire SR metadata lock on t1, open +# it and then will block while trying to acquire SW lock on t2. +# Sending: +select * from t1 where i in (select j from t2 for update); +# Switching to connection 'deadlock_con3'. +# Wait till the above SELECT blocks. +# Resume FLUSH TABLES, so it tries to flush t1, thus creating +# a deadlock. This deadlock should be detected and resolved by +# backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +unlock tables; +# Switching to connection 'deadlock_con1'. +# Reap SELECT. +i +# +# Now a more complex scenario involving two connections +# waiting for MDL and one for TDC. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con1'. +# Start a statement which will acquire SR metadata lock on t2, open it +# and then stop, before trying to acquire SR on t1 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# Sending: +select * from t2, t1; +# Switching to connection 'deadlock_con2'. +# Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t2 and wait till SELECT closes t2. +# Sending: +flush tables t2 with read lock; +# Switching to connection 'deadlock_con3'. +# Wait until FLUSH TABLES WITH READ LOCK starts waiting +# for SELECT to close t2. +# The below DROP TABLES should acquire X lock on t1 and start +# waiting for X lock on t2. +# Sending: +drop tables t1, t2; +# Switching to connection 'default'. +# Wait until DROP TABLES starts waiting for X lock on t2. +# Resume SELECT, so it tries to acquire SR lock on t1 and blocks, +# creating a deadlock. This deadlock should be detected and resolved +# by backing-off SELECT. As a result, FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +# Unblock DROP TABLES. +unlock tables; +# Switching to connection 'deadlock_con3'. +# Reap DROP TABLES. +# Switching to connection 'deadlock_con1'. +# Reap SELECT. It should emit error about missing table. +ERROR 42S02: Table 'test.t2' doesn't exist +# Switching to connection 'default'. +set debug_sync= 'RESET'; +# +# Test for a scenario in which FLUSH TABLES WITH READ LOCK +# used to erroneously release metadata locks. +# +drop tables if exists t1, t2; +set debug_sync= 'RESET'; +create table t1(i int); +create table t2(j int); +# Switching to connection 'con2'. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t1 and t2, open table t1 and block on the debug +# sync point. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'con1'. +# Wait till FLUSH TABLES WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; +# Start a statement which will flush all tables and thus +# invalidate table t1 open by FLUSH TABLES WITH READ LOCK. +# Sending: +flush tables; +# Switching to connection 'default'. +# Wait till the above FLUSH TABLES blocks. +# Resume FLUSH TABLES WITH READ LOCK, so it tries to open t2 +# discovers that its t1 is obsolete and tries to reopen all tables. +# Such reopen should not cause releasing of SNW metadata locks +# which would result in assertion failures. +set debug_sync='now SIGNAL go'; +# Switching to connection 'con2'. +# Reap FLUSH TABLES WITH READ LOCK. +unlock tables; +# Switching to connection 'con1'. +# Reap FLUSH TABLES. +# Clean-up. +# Switching to connection 'default'. +drop tables t1, t2; set debug_sync= 'RESET'; # # Test for bug #46748 "Assertion in MDL_context::wait_for_locks() diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index f7f0cea3b19..c7e54288f8b 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -933,7 +933,8 @@ DROP TABLE tm1, t1, t2; CREATE TABLE t1(c1 INT); CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST; CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +Warnings: +Note 1050 Table 't1' already exists DROP TABLE t1, t2; CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MyISAM; CREATE TABLE t2 LIKE t1; diff --git a/mysql-test/r/mysql_client_test.result b/mysql-test/r/mysql_client_test.result index f30c64f6bef..7875464ebe2 100644 --- a/mysql-test/r/mysql_client_test.result +++ b/mysql-test/r/mysql_client_test.result @@ -1,4 +1,5 @@ SET @old_general_log= @@global.general_log; +SET @old_slow_query_log= @@global.slow_query_log; ok # cat MYSQL_TMP_DIR/test_wl4435.out.log @@ -120,3 +121,4 @@ mysql_stmt_next_result(): 0; field_count: 0 # ------------------------------------ SET @@global.general_log= @old_general_log; +SET @@global.slow_query_log= @old_slow_query_log; diff --git a/mysql-test/r/mysql_not_windows.result b/mysql-test/r/mysql_not_windows.result new file mode 100644 index 00000000000..d5670a1a9ca --- /dev/null +++ b/mysql-test/r/mysql_not_windows.result @@ -0,0 +1,5 @@ +Bug #54466 client 5.5 built from source lacks "pager" support +a +1 + +End of tests diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index e728eb8244d..51fad679909 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -28,7 +28,7 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -drop table if exists t1,t2,t3,t4,t5,t03,t04 +DROP TABLE IF EXISTS `t1`,`t2`,`t3`,`t4`,`t5`,`t03`,`t04` /* generated by server */ /*!*/; SET TIMESTAMP=1000000000/*!*/; create table t1 (word varchar(20)) @@ -229,7 +229,7 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -drop table if exists t1,t2,t3,t4,t5,t03,t04 +DROP TABLE IF EXISTS `t1`,`t2`,`t3`,`t4`,`t5`,`t03`,`t04` /* generated by server */ /*!*/; SET TIMESTAMP=1000000000/*!*/; create table t1 (word varchar(20)) @@ -628,7 +628,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; SET TIMESTAMP=1000000000/*!*/; -drop table t1 +DROP TABLE `t1` /* generated by server */ /*!*/; DELIMITER ; # End of log file diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result index 85416138c6d..7ae1ea36899 100644 --- a/mysql-test/r/mysqlbinlog_row.result +++ b/mysql-test/r/mysqlbinlog_row.result @@ -385,7 +385,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -567,7 +567,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -595,7 +595,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -673,7 +673,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -759,7 +759,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -806,7 +806,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -850,7 +850,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -894,7 +894,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -960,7 +960,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1004,7 +1004,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1070,7 +1070,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1114,7 +1114,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1180,7 +1180,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1224,7 +1224,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1290,7 +1290,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1334,7 +1334,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1378,7 +1378,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1439,7 +1439,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1483,7 +1483,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1527,7 +1527,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1572,7 +1572,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1616,7 +1616,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1660,7 +1660,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1704,7 +1704,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1748,7 +1748,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1792,7 +1792,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1836,7 +1836,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1880,7 +1880,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1924,7 +1924,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -1968,7 +1968,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2032,7 +2032,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2076,7 +2076,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2120,7 +2120,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2164,7 +2164,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2230,7 +2230,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2274,7 +2274,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2318,7 +2318,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2362,7 +2362,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2406,7 +2406,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2450,7 +2450,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2494,7 +2494,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2558,7 +2558,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2622,7 +2622,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2666,7 +2666,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2710,7 +2710,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2754,7 +2754,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2798,7 +2798,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2876,7 +2876,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2920,7 +2920,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -2998,7 +2998,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3076,7 +3076,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3120,7 +3120,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3198,7 +3198,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3276,7 +3276,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3320,7 +3320,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3364,7 +3364,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3408,7 +3408,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3452,7 +3452,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3496,7 +3496,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3540,7 +3540,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3584,7 +3584,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3628,7 +3628,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3672,7 +3672,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3716,7 +3716,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3760,7 +3760,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3804,7 +3804,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3848,7 +3848,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -3994,7 +3994,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1 +DROP TABLE `t1` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -4127,7 +4127,7 @@ COMMIT # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -DROP TABLE t1,t2 +DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Rotate to master-bin.000002 pos: 4 diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 533f35c1113..025f67082ec 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -688,7 +688,7 @@ The following options may be given as the first argument: How many threads we should keep in a cache for reuse --thread-handling=name Define threads usage for handling queries, one of - one-thread-per-connection, no-threads + one-thread-per-connection, no-threads, loaded-dynamically --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are @@ -860,9 +860,9 @@ performance-schema-max-file-classes 50 performance-schema-max-file-handles 32768 performance-schema-max-file-instances 10000 performance-schema-max-mutex-classes 200 -performance-schema-max-mutex-instances 1000 -performance-schema-max-rwlock-classes 20 -performance-schema-max-rwlock-instances 1000 +performance-schema-max-mutex-instances 1000000 +performance-schema-max-rwlock-classes 30 +performance-schema-max-rwlock-instances 1000000 performance-schema-max-table-handles 100000 performance-schema-max-table-instances 50000 performance-schema-max-thread-classes 50 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 9b6b0f53b01..e1098b71e25 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -692,7 +692,7 @@ The following options may be given as the first argument: How many threads we should keep in a cache for reuse --thread-handling=name Define threads usage for handling queries, one of - one-thread-per-connection, no-threads + one-thread-per-connection, no-threads, loaded-dynamically --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are @@ -864,9 +864,9 @@ performance-schema-max-file-classes 50 performance-schema-max-file-handles 32768 performance-schema-max-file-instances 10000 performance-schema-max-mutex-classes 200 -performance-schema-max-mutex-instances 1000 -performance-schema-max-rwlock-classes 20 -performance-schema-max-rwlock-instances 1000 +performance-schema-max-mutex-instances 1000000 +performance-schema-max-rwlock-classes 30 +performance-schema-max-rwlock-instances 1000000 performance-schema-max-table-handles 100000 performance-schema-max-table-instances 50000 performance-schema-max-thread-classes 50 diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index fc3e0d64b5e..2c48f56d578 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -21,23 +21,17 @@ Table Op Msg_type Msg_text test.t1 repair Error Unknown storage engine 'partition' test.t1 repair error Corrupt ALTER TABLE t1 REPAIR PARTITION ALL; -Table Op Msg_type Msg_text -test.t1 repair Error Unknown storage engine 'partition' -test.t1 repair error Corrupt +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 CHECK PARTITION ALL; -Table Op Msg_type Msg_text -test.t1 check Error Unknown storage engine 'partition' -test.t1 check error Corrupt +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 OPTIMIZE PARTITION ALL; -Table Op Msg_type Msg_text -test.t1 optimize Error Unknown storage engine 'partition' -test.t1 optimize error Corrupt +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 ANALYZE PARTITION ALL; -Table Op Msg_type Msg_text -test.t1 analyze Error Unknown storage engine 'partition' -test.t1 analyze error Corrupt +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 REBUILD PARTITION ALL; ERROR 42000: Unknown storage engine 'partition' +ALTER TABLE t1 TRUNCATE PARTITION ALL; +ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working ALTER TABLE t1 ENGINE Memory; ERROR 42000: Unknown storage engine 'partition' ALTER TABLE t1 ADD (new INT); diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 58c587fe588..fd523168e7c 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -424,6 +424,7 @@ SHOW STATUS LIKE "handler_read%"; Variable_name Value Handler_read_first 0 Handler_read_key 6 +Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 55366bd2e07..dfcd9dde73d 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -359,6 +359,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -377,6 +378,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -407,6 +409,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 @@ -423,6 +426,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 @@ -439,6 +443,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 @@ -455,6 +460,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/partition_disabled.result b/mysql-test/r/partition_disabled.result index df36f56a328..507c6ebe9e9 100644 --- a/mysql-test/r/partition_disabled.result +++ b/mysql-test/r/partition_disabled.result @@ -3,7 +3,7 @@ FLUSH TABLES; SELECT * FROM t1; ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement TRUNCATE TABLE t1; -ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement +ERROR 42S02: Table 'test.t1' doesn't exist ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze Error The MySQL server is running with the --skip-partition option so it cannot execute this statement diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 58d014938bf..93cb1617d2f 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -1,5 +1,103 @@ drop table if exists t1, t2; # +# Bug#54747: Deadlock between REORGANIZE PARTITION and +# SELECT is not detected +# +SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency; +SET GLOBAL innodb_thread_concurrency = 1; +CREATE TABLE t1 +(user_num BIGINT, +hours SMALLINT, +KEY user_num (user_num)) +ENGINE = InnoDB +PARTITION BY RANGE COLUMNS (hours) +(PARTITION hour_003 VALUES LESS THAN (3), +PARTITION hour_004 VALUES LESS THAN (4), +PARTITION hour_005 VALUES LESS THAN (5), +PARTITION hour_last VALUES LESS THAN (MAXVALUE)); +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +BEGIN; +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +# con1 +# SEND a ALTER PARTITION which waits on the ongoing transaction. +ALTER TABLE t1 +REORGANIZE PARTITION hour_003, hour_004 INTO +(PARTITION oldest VALUES LESS THAN (4)); +# Connection default wait until the ALTER is in 'waiting for table...' +# state and then continue the transaction by trying a SELECT +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +COMMIT; +# con1, reaping ALTER. +# Disconnecting con1 and switching to default. Cleaning up. +SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; +DROP TABLE t1; +# +# Bug#50418: DROP PARTITION does not interact with transactions +# +CREATE TABLE t1 ( +id INT AUTO_INCREMENT NOT NULL, +name CHAR(50) NOT NULL, +myDate DATE NOT NULL, +PRIMARY KEY (id, myDate), +INDEX idx_date (myDate) +) ENGINE=InnoDB +PARTITION BY RANGE ( TO_DAYS(myDate) ) ( +PARTITION p0 VALUES LESS THAN (734028), +PARTITION p1 VALUES LESS THAN (734029), +PARTITION p2 VALUES LESS THAN (734030), +PARTITION p3 VALUES LESS THAN MAXVALUE +) ; +INSERT INTO t1 VALUES +(NULL, 'Lachlan', '2009-09-13'), +(NULL, 'Clint', '2009-09-13'), +(NULL, 'John', '2009-09-14'), +(NULL, 'Dave', '2009-09-14'), +(NULL, 'Jeremy', '2009-09-15'), +(NULL, 'Scott', '2009-09-15'), +(NULL, 'Jeff', '2009-09-16'), +(NULL, 'Joe', '2009-09-16'); +SET AUTOCOMMIT=0; +SELECT * FROM t1 FOR UPDATE; +id name myDate +1 Lachlan 2009-09-13 +2 Clint 2009-09-13 +3 John 2009-09-14 +4 Dave 2009-09-14 +5 Jeremy 2009-09-15 +6 Scott 2009-09-15 +7 Jeff 2009-09-16 +8 Joe 2009-09-16 +UPDATE t1 SET name = 'Mattias' WHERE id = 7; +SELECT * FROM t1 WHERE id = 7; +id name myDate +7 Mattias 2009-09-16 +# Connection con1 +SET lock_wait_timeout = 1; +# After the patch it will wait and fail on timeout. +ALTER TABLE t1 DROP PARTITION p3; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SHOW WARNINGS; +Level Code Message +Error 1205 Lock wait timeout exceeded; try restarting transaction +# Connection default +SELECT * FROM t1; +id name myDate +1 Lachlan 2009-09-13 +2 Clint 2009-09-13 +3 John 2009-09-14 +4 Dave 2009-09-14 +5 Jeremy 2009-09-15 +6 Scott 2009-09-15 +7 Mattias 2009-09-16 +8 Joe 2009-09-16 +# No changes. +COMMIT; +DROP TABLE t1; +# # Bug#51830: Incorrect partition pruning on range partition (regression) # CREATE TABLE t1 (a INT NOT NULL) diff --git a/mysql-test/r/partition_not_blackhole.result b/mysql-test/r/partition_not_blackhole.result new file mode 100644 index 00000000000..dc0339f8c48 --- /dev/null +++ b/mysql-test/r/partition_not_blackhole.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +# +# Bug#46086: crash when dropping a partitioned table and +# the original engine is disabled +# Copy a .frm and .par file which was created with: +# create table `t1` (`id` int primary key) engine=blackhole +# partition by key () partitions 1; +SHOW TABLES; +Tables_in_test +t1 +SHOW CREATE TABLE t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +DROP TABLE t1; +ERROR 42S02: Unknown table 't1' +t1.frm +t1.par diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index a080f7ff9f7..d37281d9638 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -938,3 +938,47 @@ select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 200703 sum(count) 579 drop table t1, t2; +# +# Bug#50939: Loose Index Scan unduly relies on engine to remember range +# endpoints +# +CREATE TABLE t1 ( +a INT, +b INT, +KEY ( a, b ) +) PARTITION BY HASH (a) PARTITIONS 1; +CREATE TABLE t2 ( +a INT, +b INT, +KEY ( a, b ) +); +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); +INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; +INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; +INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; +INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; +INSERT INTO t2 SELECT * FROM t1; +# plans should be identical +EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by +EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by +FLUSH status; +SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; +a MAX(b) +10 10 +# Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; +Variable_name Value +Handler_read_key 4 +FLUSH status; +SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; +a MAX(b) +10 10 +# Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; +Variable_name Value +Handler_read_key 4 +DROP TABLE t1, t2; diff --git a/mysql-test/r/partition_truncate.result b/mysql-test/r/partition_truncate.result index 8f594a319df..66c0cd3d9da 100644 --- a/mysql-test/r/partition_truncate.result +++ b/mysql-test/r/partition_truncate.result @@ -16,3 +16,11 @@ subpartitions 1 alter table t1 truncate partition sp1; ERROR HY000: Incorrect partition name drop table t1; +create table t1 (a int); +insert into t1 values (1), (3), (8); +alter table t1 truncate partition p0; +ERROR HY000: Partition management on a not partitioned table is not possible +select count(*) from t1; +count(*) +3 +drop table t1; diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result index 9752c5160a6..76d6c735f43 100644 --- a/mysql-test/r/ps_ddl.result +++ b/mysql-test/r/ps_ddl.result @@ -1833,7 +1833,6 @@ SUCCESS select * from t2; a 1 -1 execute stmt; Warnings: Note 1050 Table 't2' already exists @@ -1843,8 +1842,6 @@ SUCCESS select * from t2; a 1 -1 -1 drop table t2; create temporary table t2 (a varchar(10)); execute stmt; @@ -1852,7 +1849,6 @@ Warnings: Note 1050 Table 't2' already exists select * from t2; a -1 call p_verify_reprepare_count(1); SUCCESS diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 112a86e0c88..f209e401764 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -701,6 +701,7 @@ drop table t1,t2,t3,t4; set query_cache_wlock_invalidate=1; create table t1 (a int not null); create table t2 (a int not null); +create view v1 as select * from t1; select * from t1; a select * from t2; @@ -713,6 +714,17 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 unlock table; +select * from t1; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +lock table v1 write; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +unlock table; +drop view v1; drop table t1,t2; set query_cache_wlock_invalidate=default; CREATE TABLE t1 (id INT PRIMARY KEY); @@ -853,7 +865,7 @@ Variable_name Value Qcache_queries_in_cache 0 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 18 +Qcache_inserts 19 show status like "Qcache_hits"; Variable_name Value Qcache_hits 6 @@ -866,7 +878,7 @@ Variable_name Value Qcache_queries_in_cache 1 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 19 +Qcache_inserts 20 show status like "Qcache_hits"; Variable_name Value Qcache_hits 7 diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 4587a60ca0d..62acb2a7710 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1654,47 +1654,16 @@ a b 1 1 DROP TABLE t1; # -# Bug#50939: Loose Index Scan unduly relies on engine to remember range -# endpoints +# Bug #54802: 'NOT BETWEEN' evaluation is incorrect # -CREATE TABLE t1 ( -a INT, -b INT, -KEY ( a, b ) -) PARTITION BY HASH (a) PARTITIONS 1; -CREATE TABLE t2 ( -a INT, -b INT, -KEY ( a, b ) -); -INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); -INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; -INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; -INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; -INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; -INSERT INTO t2 SELECT * FROM t1; -# plans should be identical -EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; +CREATE TABLE t1 (c_key INT, c_notkey INT, KEY(c_key)); +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3); +EXPLAIN SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by -EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by -FLUSH status; -SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; -a MAX(b) -10 10 -# Should be no more than 4 reads. -SHOW status LIKE 'handler_read_key'; -Variable_name Value -Handler_read_key 4 -FLUSH status; -SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; -a MAX(b) -10 10 -# Should be no more than 4 reads. -SHOW status LIKE 'handler_read_key'; -Variable_name Value -Handler_read_key 4 -DROP TABLE t1, t2; +1 SIMPLE t1 ALL c_key NULL NULL NULL 3 Using where +SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key; +c_key c_notkey +1 1 +3 3 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/rowid_order_innodb.result b/mysql-test/r/rowid_order_innodb.result index e0796cd7ab5..dc339304041 100644 --- a/mysql-test/r/rowid_order_innodb.result +++ b/mysql-test/r/rowid_order_innodb.result @@ -15,7 +15,7 @@ insert into t1 values (-5, 1, 1), (10, 1, 1); explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 4 Using sort_union(key1,key2); Using where +1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 5 Using sort_union(key1,key2); Using where select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; pk1 key1 key2 -100 1 1 diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result index 853c3bcf575..809d652053e 100644 --- a/mysql-test/r/schema.result +++ b/mysql-test/r/schema.result @@ -16,21 +16,19 @@ drop schema foo; # Bug #48940 MDL deadlocks against mysql_rm_db # DROP SCHEMA IF EXISTS schema1; -DROP SCHEMA IF EXISTS schema2; # Connection default CREATE SCHEMA schema1; -CREATE SCHEMA schema2; CREATE TABLE schema1.t1 (a INT); SET autocommit= FALSE; INSERT INTO schema1.t1 VALUES (1); # Connection 2 DROP SCHEMA schema1; # Connection default -ALTER SCHEMA schema2 DEFAULT CHARACTER SET utf8; +ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8; +Got one of the listed errors SET autocommit= TRUE; # Connection 2 # Connection default -DROP SCHEMA schema2; # # Bug #49988 MDL deadlocks with mysql_create_db, reload_acl_and_cache # diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index b193a269288..e8628d72a46 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4338,6 +4338,7 @@ SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/single_delete_update.result b/mysql-test/r/single_delete_update.result index 921d308097c..72419c6ec9d 100644 --- a/mysql-test/r/single_delete_update.result +++ b/mysql-test/r/single_delete_update.result @@ -25,6 +25,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -41,6 +42,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -74,6 +76,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -90,6 +93,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 5 @@ -120,6 +124,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -136,6 +141,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -170,6 +176,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -186,6 +193,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -214,6 +222,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -230,6 +239,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -256,6 +266,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -272,6 +283,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -301,6 +313,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 7 Handler_read_prev 0 Handler_read_rnd 4 @@ -322,6 +335,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 7 Handler_read_prev 0 Handler_read_rnd 8 @@ -357,6 +371,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -373,6 +388,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -406,6 +422,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -422,6 +439,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 5 @@ -464,6 +482,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -486,6 +505,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 1 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -502,6 +522,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 1 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -536,6 +557,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -552,6 +574,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 5 @@ -590,6 +613,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -606,6 +630,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 5 @@ -641,6 +666,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -657,6 +683,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -691,6 +718,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -707,6 +735,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 5 @@ -735,6 +764,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -751,6 +781,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -778,6 +809,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -794,6 +826,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -824,6 +857,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 7 Handler_read_prev 0 Handler_read_rnd 4 @@ -845,6 +879,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 7 Handler_read_prev 0 Handler_read_rnd 8 @@ -884,6 +919,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -900,6 +936,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 5 @@ -938,6 +975,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -954,6 +992,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 5 @@ -990,6 +1029,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 Handler_read_rnd 0 @@ -1012,6 +1052,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 1 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 0 @@ -1028,6 +1069,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 1 Handler_read_next 0 Handler_read_prev 4 Handler_read_rnd 5 diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index a4933ee9800..32d0e39c5af 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -134,3 +134,19 @@ Warning 1405 Failed to revoke all privileges to dropped routine # Restore the procs_priv table RENAME TABLE procs_priv_backup TO mysql.procs_priv; FLUSH TABLE mysql.procs_priv; +# +# Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from +# 5.1.50 to 5.5.6". +# +drop database if exists mysqltest; +# Backup mysql.proc. +flush table mysql.proc; +create database mysqltest; +# Corrupt mysql.proc to make it unusable by current version of server. +alter table mysql.proc drop column type; +# The below statement should not cause assertion failure. +drop database mysqltest; +Warnings: +Error 1547 Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted +# Restore mysql.proc. +drop table mysql.proc; diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result index a7823175b3c..0d3e87f17e2 100644 --- a/mysql-test/r/sp-lock.result +++ b/mysql-test/r/sp-lock.result @@ -148,12 +148,12 @@ f1() # Sending 'drop procedure p1'... drop procedure p1; # --> connection con2 -# Waitng for 'drop procedure t1' to get blocked on MDL lock... +# Waiting for 'drop procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -174,12 +174,12 @@ f1() # Sending 'create procedure p1'... create procedure p1() begin end; # --> connection con2 -# Waitng for 'create procedure t1' to get blocked on MDL lock... +# Waiting for 'create procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -200,12 +200,12 @@ f1() # Sending 'alter procedure p1'... alter procedure p1 contains sql; # --> connection con2 -# Waitng for 'alter procedure t1' to get blocked on MDL lock... +# Waiting for 'alter procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -226,12 +226,12 @@ f1() # Sending 'drop function f1'... drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -252,12 +252,12 @@ f1() # Sending 'create function f1'... create function f1() returns int return 2; # --> connection con2 -# Waitng for 'create function f1' to get blocked on MDL lock... +# Waiting for 'create function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -279,12 +279,12 @@ f1() # Sending 'alter function f1'... alter function f1 contains sql; # --> connection con2 -# Waitng for 'alter function f1' to get blocked on MDL lock... +# Waiting for 'alter function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -360,7 +360,7 @@ insert into t1 (a) values (1); # Sending 'drop function f1' drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -379,7 +379,7 @@ a # Sending 'drop function f1' drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -403,7 +403,7 @@ a # Sending 'drop procedure p1' drop procedure p1; # --> connection con2 -# Waitng for 'drop procedure p1' to get blocked on MDL lock... +# Waiting for 'drop procedure p1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -424,7 +424,7 @@ insert into t1 (a) values (3); # Sending 'drop function f2' drop function f2; # --> connection con2 -# Waitng for 'drop function f2' to get blocked on MDL lock... +# Waiting for 'drop function f2' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -479,11 +479,11 @@ f2() # Sending 'drop function f1'... drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # Sending 'drop function f2'... drop function f2; # --> connection default -# Waitng for 'drop function f2' to get blocked on MDL lock... +# Waiting for 'drop function f2' to get blocked on MDL lock... rollback to savepoint sv; # --> connection con2 # Reaping 'drop function f2'... @@ -537,10 +537,10 @@ f1() # Sending 'alter function f1 ...'... alter function f1 comment "comment"; # --> connection con2 -# Waitng for 'alter function f1 ...' to get blocked on MDL lock... +# Waiting for 'alter function f1 ...' to get blocked on MDL lock... # Sending 'call p1()'... call p1(); -# Waitng for 'call p1()' to get blocked on MDL lock on f1... +# Waiting for 'call p1()' to get blocked on MDL lock on f1... # Let 'alter function f1 ...' go through... commit; # --> connection con1 @@ -573,7 +573,7 @@ f1() # Sending 'alter function f1 ...'... alter function f1 comment "comment"; # --> connection con2 -# Waitng for 'alter function f1 ...' to get blocked on MDL lock... +# Waiting for 'alter function f1 ...' to get blocked on MDL lock... # # We just mention p1() in the body of f2() to make # sure that p1() is prelocked for f2(). @@ -595,7 +595,7 @@ select f2() into @var; end| # Sending 'call p1()'... call p1(); -# Waitng for 'call p1()' to get blocked on MDL lock on f1... +# Waiting for 'call p1()' to get blocked on MDL lock on f1... # Let 'alter function f1 ...' go through... commit; # --> connection con1 @@ -634,7 +634,7 @@ get_lock("30977", 0) # Sending 'select f3()'... select f3(); # --> connection con1 -# Waitng for 'select f3()' to get blocked on the user level lock... +# Waiting for 'select f3()' to get blocked on the user level lock... # Do something to change the cache version. create function f4() returns int return 4; drop function f4; diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result index a14d099c673..9b458e25615 100644 --- a/mysql-test/r/sp-threads.result +++ b/mysql-test/r/sp-threads.result @@ -35,7 +35,7 @@ call bug9486(); show processlist; Id User Host db Command Time State Info # root localhost test Sleep # NULL -# root localhost test Query # Waiting for table update t1, t2 set val= 1 where id1=id2 +# root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 # root localhost test Query # NULL show processlist # root localhost test Sleep # NULL unlock tables; diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 586e2e7822b..2962a12d9a2 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -113,6 +113,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index dd4bf599ad0..2e638ddb9ab 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -60,6 +60,27 @@ FROM t3 WHERE 1 = 0 GROUP BY 1; DROP TABLE t1,t2,t3; End of 5.0 tests. # +# Bug#54568: create view cause Assertion failed: 0, +# file .\item_subselect.cc, line 836 +# +EXPLAIN SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1249 Select 2 was reduced during optimization +DESCRIBE SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1249 Select 2 was reduced during optimization +# None of the below should crash +CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) ); +DROP VIEW v1, v2; +# +# End of 5.1 tests. +# +# # Bug#53236 Segfault in DTCollation::set(DTCollation&) # CREATE TABLE t1 ( diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 36d82e4045f..b9b1c94ce1a 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1420,9 +1420,7 @@ create trigger t1_ai after insert on t1 for each row set @a := 7; create table t2 (j int); insert into t2 values (1), (2); set @a:=""; -create table if not exists t1 select * from t2; -Warnings: -Note 1050 Table 't1' already exists +insert into t1 select * from t2; select * from t1; i 7 @@ -1434,9 +1432,7 @@ drop trigger t1_bi; drop trigger t1_ai; create table t3 (isave int); create trigger t1_bi before insert on t1 for each row insert into t3 values (new.i); -create table if not exists t1 select * from t2; -Warnings: -Note 1050 Table 't1' already exists +insert into t1 select * from t2; select * from t1; i 7 @@ -1622,10 +1618,8 @@ After DELETE, old=REPLACE, inserting a new key After INSERT, new=REPLACE, deleting the duplicate truncate t1; truncate t1_op_log; -create table if not exists t1 +insert into t1 select NULL, "CREATE TABLE ... SELECT, inserting a new key"; -Warnings: -Note 1050 Table 't1' already exists set @id=last_insert_id(); select * from t1; id operation @@ -1635,10 +1629,8 @@ operation Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key After INSERT, new=CREATE TABLE ... SELECT, inserting a new key truncate t1_op_log; -create table if not exists t1 replace +replace into t1 select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; -Warnings: -Note 1050 Table 't1' already exists select * from t1; id operation 1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key @@ -1817,10 +1809,8 @@ After DELETE, old=REPLACE, inserting a new key After INSERT, new=REPLACE, deleting the duplicate truncate t1; truncate t1_op_log; -create table if not exists v1 +insert into v1 select NULL, "CREATE TABLE ... SELECT, inserting a new key"; -Warnings: -Note 1050 Table 'v1' already exists set @id=last_insert_id(); select * from t1; id operation @@ -1830,10 +1820,8 @@ operation Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key After INSERT, new=CREATE TABLE ... SELECT, inserting a new key truncate t1_op_log; -create table if not exists v1 replace +replace into v1 select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; -Warnings: -Note 1050 Table 'v1' already exists select * from t1; id operation 1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key @@ -2083,7 +2071,8 @@ BEGIN UPDATE a_nonextisting_table SET a = 1; END// CREATE TABLE IF NOT EXISTS t2 ( a INT, b INT ) SELECT a, b FROM t1; -ERROR 42S02: Table 'test.a_nonextisting_table' doesn't exist +Warnings: +Note 1050 Table 't2' already exists SELECT * FROM t2; a b DROP TABLE t1, t2; diff --git a/mysql-test/r/type_bit_innodb.result b/mysql-test/r/type_bit_innodb.result index a9c3cae1770..909db576b27 100644 --- a/mysql-test/r/type_bit_innodb.result +++ b/mysql-test/r/type_bit_innodb.result @@ -233,7 +233,7 @@ a+0 b+0 127 403 explain select a+0, b+0 from t1 where a > 40 and b > 200 order by 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 2 NULL 19 Using where; Using index; Using filesort +1 SIMPLE t1 range a a 2 NULL 27 Using where; Using index; Using filesort select a+0, b+0 from t1 where a > 40 and b > 200 order by 1; a+0 b+0 44 307 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 2080f4e8b61..33fc4333d1c 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -428,7 +428,7 @@ ERROR 42000: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS' create temporary table t1 select a from t1 union select a from t2; drop temporary table t1; create table t1 select a from t1 union select a from t2; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR 42S01: Table 't1' already exists select a from t1 union select a from t2 order by t2.a; ERROR 42S22: Unknown column 't2.a' in 'order clause' drop table t1,t2; diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 05ab1b71018..54170ae3dad 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -273,6 +273,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -284,6 +285,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 2 @@ -294,6 +296,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -304,6 +307,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 1 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -315,6 +319,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 0 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 @@ -368,6 +373,7 @@ show status like 'handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 Handler_read_rnd 1 @@ -405,6 +411,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 1 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -415,6 +422,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 2 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -424,6 +432,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 3 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 @@ -433,6 +442,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 Handler_read_key 3 +Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 diff --git a/mysql-test/std_data/parts/t1_blackhole.frm b/mysql-test/std_data/parts/t1_blackhole.frm new file mode 100644 index 00000000000..be77b7a041a Binary files /dev/null and b/mysql-test/std_data/parts/t1_blackhole.frm differ diff --git a/mysql-test/std_data/parts/t1_blackhole.par b/mysql-test/std_data/parts/t1_blackhole.par new file mode 100644 index 00000000000..6528edf190c Binary files /dev/null and b/mysql-test/std_data/parts/t1_blackhole.par differ diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem index 06e118cf034..e71ba5722b9 100644 --- a/mysql-test/std_data/server8k-cert.pem +++ b/mysql-test/std_data/server8k-cert.pem @@ -1,125 +1,51 @@ -Certificate: - Data: - Version: 1 (0x0) - Serial Number: 1048579 (0x100003) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB - Validity - Not Before: Jan 29 12:01:53 2010 GMT - Not After : Jan 28 12:01:53 2015 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (8192 bit) - Modulus: - 00:ca:aa:1d:c4:11:ec:91:f0:c7:ff:5f:90:92:fc: - 40:0c:5e:b7:3d:00:c5:20:d5:0f:89:31:07:d7:41: - 4c:8b:60:80:aa:38:14:de:93:6b:9c:74:88:41:68: - b5:02:41:01:2d:86:a2:7a:95:53:5e:7b:67:2f:6c: - 1e:29:51:f9:44:fd:4a:80:be:b2:23:a1:3e:1b:38: - cf:88:c4:71:ee:f8:6b:41:c5:2d:c0:c3:52:ac:59: - 7d:81:34:19:95:32:b8:9a:51:b6:41:36:d4:c4:a1: - ae:84:e6:38:b9:e8:bf:96:be:19:7a:6b:77:4d:e0: - de:e6:b3:b6:6b:bc:3d:dd:68:bc:4b:c4:eb:f5:36: - 93:ed:56:a2:15:50:8a:10:e8:d6:22:ed:6c:b1:cd: - c3:18:c9:f6:0a:e1:de:61:65:62:d6:14:41:8c:b5: - fb:14:68:c1:cf:12:5d:41:21:9d:57:11:43:7d:bb: - 43:2c:21:bb:c3:44:7d:a8:cf:1f:c3:71:75:b5:47: - c2:7d:ce:38:3c:73:64:9e:15:d8:a7:27:cf:bd:40: - c8:45:08:e3:c8:39:a8:0b:8e:c2:5b:7b:f1:47:91: - 12:91:cc:e1:00:e0:94:5b:bd:32:e4:0c:8d:c3:be: - cc:76:32:52:12:69:b0:18:e0:b0:c2:76:34:5a:5f: - 79:d9:f6:81:9d:02:0a:61:69:1c:33:ce:49:fa:76: - 03:1e:07:5b:27:0b:bf:34:9e:34:96:b8:03:9b:50: - 3a:6a:2f:17:7a:14:cf:65:63:00:37:52:a8:73:ce: - 4b:14:40:f4:d2:9a:56:54:33:b8:77:2e:42:5b:8f: - ec:1f:18:f4:ad:ab:8a:4a:8d:6d:70:25:f3:58:e7: - cb:66:51:14:7d:16:f4:eb:6d:56:76:76:51:6e:d6: - 1d:da:d3:8d:c0:64:5a:67:4e:af:e2:bf:33:d1:b8: - f6:2a:fc:57:87:a7:35:5e:80:c9:ac:fc:87:c9:71: - 17:91:bf:b7:4d:a3:ed:3c:1b:27:f4:66:a0:f9:46: - 03:27:cc:ea:80:f6:4b:40:f6:41:94:cd:bd:0a:b3: - ef:26:be:de:6f:69:ae:0f:3f:1c:55:63:33:90:9b: - ed:ca:5a:12:4d:de:4b:06:c2:a2:92:b0:42:3d:31: - af:a4:15:12:15:f8:8a:e9:88:8d:cf:fd:85:66:50: - 6f:11:f1:9f:48:f3:b5:ba:9d:86:68:24:a2:5d:a8: - 7c:54:42:fa:d8:b5:c5:f2:dd:0e:0f:d0:68:e4:54: - 7e:c5:b9:a0:9b:65:2d:77:f4:8f:b9:30:0a:d5:86: - 5c:ed:c9:7c:d1:da:9d:0d:63:50:ee:e5:1e:92:63: - cc:a2:0c:e8:4a:96:02:4d:dc:8f:df:7c:8f:08:18: - a8:30:88:d7:af:89:ad:fc:57:4b:10:f9:f1:cb:48: - e8:b6:3b:c8:3f:fc:c2:d3:d1:4a:10:3c:1b:6b:64: - dc:e5:65:1e:5b:b2:da:b1:e2:24:97:8f:ee:c0:4b: - 8e:18:83:7c:17:a6:3c:45:b3:60:06:23:f2:2f:18: - 13:9e:17:8a:c6:72:79:8c:4d:04:f3:9d:ea:e0:25: - d3:33:8c:1e:11:47:63:1f:a5:45:3f:bd:85:b3:fe: - a5:68:ee:48:b7:0c:a4:c9:7f:72:d0:75:66:9b:6a: - f9:a0:50:f3:a8:59:6d:a3:dd:38:4f:70:2b:bb:ff: - 92:2e:71:ab:ef:e9:00:ed:0d:d1:b4:6f:f0:8e:b2: - 09:fb:4d:61:0d:d9:10:d5:54:11:cd:03:94:84:fd: - a8:68:e4:45:6e:1e:6a:1e:2f:85:a1:6d:f5:b6:c0: - f1:ee:f7:36:e9:fe:c2:f7:ad:cc:13:46:5b:88:42: - f0:2d:1f:b5:0e:7e:b5:2b:e4:8d:ab:b9:87:30:6a: - 3d:12:f4:ad:f3:1c:ac:cc:1a:48:29:2a:96:7b:80: - 00:0b:6e:59:87:bf:a3:ca:70:99:1b:1c:fd:72:3d: - b2:d3:94:4a:cf:55:75:be:1f:40:ec:55:35:48:2d: - 55:f0:00:da:3c:b0:60:ba:11:32:66:54:0b:be:06: - a4:5e:b7:c9:59:bb:4d:f4:92:06:26:48:6e:c2:12: - d4:7c:f0:20:b8:a2:e1:bc:6a:b6:19:0e:37:47:55: - c9:f2:49:0d:96:75:a2:84:64:bf:34:fc:be:b2:41: - e4:f5:88:eb:e1:b7:26:a5:e5:41:c2:20:0c:f6:e2: - a8:a5:e7:76:54:a5:fb:4b:80:05:7d:18:85:7a:ba: - bc:b7:ad:c0:2f:60:85:cc:15:12:1c:2f:0a:9e:f3: - 7c:40:cf:f4:3e:23:d2:95:ca:d0:06:58:52:f0:84: - d8:0f:3d:eb:ff:12:68:94:79:8f:be:40:29:5f:98: - c8:90:6c:05:2f:99:8c:2a:63:78:1f:23:b1:29:c5: - e7:49:c9:b2:92:0f:53:0b:d5:71:28:17:c2:19:bf: - 60:bf:7c:87:a8:ab:c1:f4:0a:c1:b8:d2:68:ee:c1: - ce:a7:13:13:17:6d:24:5d:a2:37:a6:d7:7d:48:8b: - 2b:74:2d:40:2e:ca:19:d5:b6:3e:6c:42:71:fa:cf: - 85:87:f9:de:80:73:8b:89:f4:70:f0:d8:d7:ff:40: - 41:9c:c7:15:6d:9b:6e:4c:b5:52:02:99:79:32:73: - ca:26:a0:ac:31:6f:c4:b0:f5:da:bb:c2:1f:e0:9f: - 44:ba:25:f7:9f - Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 08:75:dc:b9:3f:aa:b6:7e:81:7a:39:d1:ee:ed:44:b6:ce:1b: - 37:c4:4c:19:d0:66:e6:eb:b5:4f:2a:ef:95:58:64:21:55:01: - 12:30:ac:8a:95:d1:06:de:29:46:a4:f1:7d:7f:b0:1e:d2:4e: - fb:f6:fa:9a:74:be:85:62:db:0b:82:90:58:62:c5:5f:f1:80: - 02:9f:c5:fb:f3:6b:b0:b4:3b:04:b1:e5:53:c2:d0:00:a1:1a: - 9d:65:60:6f:73:98:67:e0:9c:c8:12:94:79:59:bf:43:7b:f5: - 77:c8:8f:df:b1:cd:11:1c:01:19:99:c2:22:42:f7:41:ae:b4: - b8:1a -----BEGIN CERTIFICATE----- -MIIFfDCCBOUCAxAAAzANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G -A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg -QUIwHhcNMTAwMTI5MTIwMTUzWhcNMTUwMTI4MTIwMTUzWjBDMQswCQYDVQQGEwJT -RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxDzANBgNVBAMT -BnNlcnZlcjCCBCIwDQYJKoZIhvcNAQEBBQADggQPADCCBAoCggQBAMqqHcQR7JHw -x/9fkJL8QAxetz0AxSDVD4kxB9dBTItggKo4FN6Ta5x0iEFotQJBAS2GonqVU157 -Zy9sHilR+UT9SoC+siOhPhs4z4jEce74a0HFLcDDUqxZfYE0GZUyuJpRtkE21MSh -roTmOLnov5a+GXprd03g3uaztmu8Pd1ovEvE6/U2k+1WohVQihDo1iLtbLHNwxjJ -9grh3mFlYtYUQYy1+xRowc8SXUEhnVcRQ327Qywhu8NEfajPH8NxdbVHwn3OODxz -ZJ4V2Kcnz71AyEUI48g5qAuOwlt78UeREpHM4QDglFu9MuQMjcO+zHYyUhJpsBjg -sMJ2NFpfedn2gZ0CCmFpHDPOSfp2Ax4HWycLvzSeNJa4A5tQOmovF3oUz2VjADdS -qHPOSxRA9NKaVlQzuHcuQluP7B8Y9K2rikqNbXAl81jny2ZRFH0W9OttVnZ2UW7W -HdrTjcBkWmdOr+K/M9G49ir8V4enNV6Ayaz8h8lxF5G/t02j7TwbJ/RmoPlGAyfM -6oD2S0D2QZTNvQqz7ya+3m9prg8/HFVjM5Cb7cpaEk3eSwbCopKwQj0xr6QVEhX4 -iumIjc/9hWZQbxHxn0jztbqdhmgkol2ofFRC+ti1xfLdDg/QaORUfsW5oJtlLXf0 -j7kwCtWGXO3JfNHanQ1jUO7lHpJjzKIM6EqWAk3cj998jwgYqDCI16+JrfxXSxD5 -8ctI6LY7yD/8wtPRShA8G2tk3OVlHluy2rHiJJeP7sBLjhiDfBemPEWzYAYj8i8Y -E54XisZyeYxNBPOd6uAl0zOMHhFHYx+lRT+9hbP+pWjuSLcMpMl/ctB1Zptq+aBQ -86hZbaPdOE9wK7v/ki5xq+/pAO0N0bRv8I6yCftNYQ3ZENVUEc0DlIT9qGjkRW4e -ah4vhaFt9bbA8e73Nun+wvetzBNGW4hC8C0ftQ5+tSvkjau5hzBqPRL0rfMcrMwa -SCkqlnuAAAtuWYe/o8pwmRsc/XI9stOUSs9Vdb4fQOxVNUgtVfAA2jywYLoRMmZU -C74GpF63yVm7TfSSBiZIbsIS1HzwILii4bxqthkON0dVyfJJDZZ1ooRkvzT8vrJB -5PWI6+G3JqXlQcIgDPbiqKXndlSl+0uABX0YhXq6vLetwC9ghcwVEhwvCp7zfEDP -9D4j0pXK0AZYUvCE2A896/8SaJR5j75AKV+YyJBsBS+ZjCpjeB8jsSnF50nJspIP -UwvVcSgXwhm/YL98h6irwfQKwbjSaO7BzqcTExdtJF2iN6bXfUiLK3QtQC7KGdW2 -PmxCcfrPhYf53oBzi4n0cPDY1/9AQZzHFW2bbky1UgKZeTJzyiagrDFvxLD12rvC -H+CfRLol958CAwEAATANBgkqhkiG9w0BAQQFAAOBgQAIddy5P6q2foF6OdHu7US2 -zhs3xEwZ0Gbm67VPKu+VWGQhVQESMKyKldEG3ilGpPF9f7Ae0k779vqadL6FYtsL -gpBYYsVf8YACn8X782uwtDsEseVTwtAAoRqdZWBvc5hn4JzIEpR5Wb9De/V3yI/f -sc0RHAEZmcIiQvdBrrS4Gg== +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 +/w8pMRr8gEuRqpL2WdJiKGG6lhMHLVFo -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem index faf4b43fa56..99e7417733e 100644 --- a/mysql-test/std_data/server8k-key.pem +++ b/mysql-test/std_data/server8k-key.pem @@ -1,99 +1,99 @@ -----BEGIN RSA PRIVATE KEY----- -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 -----END RSA PRIVATE KEY----- diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 33ae6c05ed2..b6299f9a940 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -36,7 +36,8 @@ master-bin.000001 # Query # # drop database if exists mysqltest1 master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table tt1, t1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; set binlog_format=mixed; reset master; @@ -76,7 +77,8 @@ master-bin.000001 # Query # # drop database if exists mysqltest1 master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table tt1, t1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; set binlog_format=row; reset master; @@ -117,8 +119,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; show databases; Database diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result index ab9a3c8cdec..093628c29cc 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -45,7 +45,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ ############################################### RESET MASTER; CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB; diff --git a/mysql-test/suite/binlog/r/binlog_mixed_load_data.result b/mysql-test/suite/binlog/r/binlog_mixed_load_data.result new file mode 100644 index 00000000000..840257f11ff --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mixed_load_data.result @@ -0,0 +1,10 @@ +RESET MASTER; +CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=MYISAM; +LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 8ba70fb8311..3c4668b72bb 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -234,7 +234,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; drop table t1 +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; reset master; @@ -256,7 +256,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @bcs = @@binlog_cache_size; set global binlog_cache_size=4096; reset master; @@ -1086,7 +1086,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE bug39182; @@ -1194,7 +1194,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( @@ -1229,7 +1229,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( @@ -1251,8 +1251,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result index 8b32e9e5a45..15e6679fa25 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result @@ -13,4 +13,4 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index 24e779eee8e..d5986809a7c 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -28,11 +28,13 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test` master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` DROP DATABASE `drop-temp+table-test`; RESET MASTER; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 52065ef1a3d..dbedb21c33d 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -286,7 +286,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t0 (n int) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t0) @@ -321,7 +321,8 @@ Note 1051 Unknown table 't2' CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb; INSERT INTO t1 VALUES (4,4); CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists SELECT * from t2; a b TRUNCATE table t2; @@ -339,11 +340,13 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back INSERT INTO t1 values (8,8); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists COMMIT; INSERT INTO t1 values (9,9); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -367,11 +370,13 @@ a b 10 10 INSERT INTO t2 values (100,100); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists COMMIT; INSERT INTO t2 values (101,101); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists ROLLBACK; SELECT * from t2; a b @@ -383,12 +388,12 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -399,7 +404,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE t2 +master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -413,43 +418,15 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS `t2` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index fd036643b4b..b96707f994c 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -143,7 +143,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; drop table t1 +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; reset master; @@ -162,7 +162,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (1) master-bin.000001 # Query # # use `test`; insert into t1 values (2) master-bin.000001 # Query # # use `test`; insert into t1 values (3) master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @bcs = @@binlog_cache_size; set global binlog_cache_size=4096; reset master; @@ -591,7 +591,7 @@ master-bin.000001 # Query # # use `test`; create table t1 (a bigint unsigned, b master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (9999999999999999,14632475938453979136) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE bug39182; @@ -637,7 +637,7 @@ DROP TEMPORARY TABLE tmp1; END master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1 SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%") -master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE tmp1 +master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE `tmp1` /* generated by server */ DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; @@ -701,7 +701,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=127 master-bin.000001 # Query # # use `test`; insert into t1 values(null) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) @@ -728,7 +728,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=127 master-bin.000001 # Query # # use `test`; insert into t1 values(null) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) @@ -742,7 +742,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index 21798ea2456..7e79186e7bc 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -107,7 +107,7 @@ select * from t3; a show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; delete from t1 where a=10 diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result index 260092e5561..3355396aa49 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result @@ -12,4 +12,4 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 79f09b2d1ee..9c5575840d0 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -34,12 +34,14 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp, tmp1 -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE tmp3 -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` DROP DATABASE `drop-temp+table-test`; RESET MASTER; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 7c83c1c13a5..958643c3314 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -270,7 +270,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t2 values (20) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb master-bin.000001 # Query # # ROLLBACK @@ -315,7 +315,8 @@ Note 1051 Unknown table 't2' CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb; INSERT INTO t1 VALUES (4,4); CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists SELECT * from t2; a b TRUNCATE table t2; @@ -335,11 +336,13 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back INSERT INTO t1 values (8,8); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists COMMIT; INSERT INTO t1 values (9,9); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -363,11 +366,13 @@ a b 10 10 INSERT INTO t2 values (100,100); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists COMMIT; INSERT INTO t2 values (101,101); CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +Warnings: +Note 1050 Table 't2' already exists ROLLBACK; SELECT * from t2; a b @@ -378,11 +383,11 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (1,1),(1,2) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4) @@ -391,7 +396,7 @@ master-bin.000001 # Query # # use `test`; TRUNCATE table t2 master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE t2 +master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6) master-bin.000001 # Query # # COMMIT @@ -412,10 +417,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (101,101) -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # use `test`; DROP TABLE t1,t2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `t2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result index ff3293b9315..58911374e6d 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_row.result +++ b/mysql-test/suite/binlog/r/binlog_stm_row.result @@ -59,8 +59,8 @@ RELEASE_LOCK('Bug#34306') # Show binlog events show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1 master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index f271c34d29d..2bccc2ccb30 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -1,5 +1,5 @@ -- source include/have_debug.inc --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_statement.inc # # bug#27571 asynchronous setting mysql_$query()'s local error and # Query_log_event::error_code diff --git a/mysql-test/suite/binlog/t/binlog_mixed_load_data.test b/mysql-test/suite/binlog/t/binlog_mixed_load_data.test new file mode 100644 index 00000000000..7e7cb973c1b --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_mixed_load_data.test @@ -0,0 +1,15 @@ +# +# Bug #34283 mysqlbinlog leaves tmpfile after termination +# if binlog contains load data infile, so in mixed mode we +# go to row-based for avoiding the problem. +# + +--source include/have_binlog_format_mixed.inc +--source include/have_log_bin.inc + +RESET MASTER; +CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=MYISAM; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; +--source include/show_binlog_events.inc +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_stm_blackhole.test b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test index 02ba2be095b..6047d8ca2fc 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_blackhole.test +++ b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test @@ -2,5 +2,5 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/not_embedded.inc --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_statement.inc -- source extra/binlog_tests/blackhole.test diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test index 6165048c7d4..87758d57725 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_row.test +++ b/mysql-test/suite/binlog/t/binlog_stm_row.test @@ -60,7 +60,7 @@ let $wait_condition= --echo # con1 let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE - state = "Table lock" and info = "INSERT INTO t2 VALUES (3)"; + state = "Waiting for table level lock" and info = "INSERT INTO t2 VALUES (3)"; --source include/wait_condition.inc SELECT RELEASE_LOCK('Bug#34306'); --connection con2 diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index 9c6bd585fde..1327338e761 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -367,14 +367,14 @@ echo ; connection default; echo -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. ; let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL AND STATE = 'Waiting for table'; + WHERE INFO IS NOT NULL AND STATE = 'Waiting for table metadata lock'; --source include/wait_condition.inc # -# Expect to see the state 'Waiting for table' for the third connection because the SELECT -# collides with the WRITE TABLE LOCK. +# Expect to see the state 'Waiting for table metadata lock' for the third +# connection because the SELECT collides with the WRITE TABLE LOCK. --replace_column 1 3 6