diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 5b4225f63dfd8..863fe766ba7fc 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -3933,9 +3933,9 @@ void do_move_file(struct st_command *command) is_sub_path(ds_to_file.str, to_plen, vardir)) || (is_sub_path(ds_from_file.str, from_plen, tmpdir) && is_sub_path(ds_to_file.str, to_plen, tmpdir)))) { - report_or_die("Paths '%s' and '%s' are not both under MYSQLTEST_VARDIR '%s'" - "or both under MYSQL_TMP_DIR '%s'", - ds_from_file, ds_to_file, vardir, tmpdir); + report_or_die("Paths '%s' and '%s' are not both under " + "MYSQLTEST_VARDIR '%s' or both under MYSQL_TMP_DIR '%s'", + ds_from_file.str, ds_to_file.str, vardir, tmpdir); DBUG_VOID_RETURN; } @@ -7974,6 +7974,20 @@ static const char *trking_info_desc[SESSION_TRACK_END + 1]= /** @brief Append state change information (received through Ok packet) to the output. + @details The appended string is lines prefixed with "-- ". Only + tracking types with info sent from the server are displayed. For + each tracking type, the first line is the type name e.g. + "-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES". + + The subsequent lines are the actual tracking info. When type is + SESSION_TRACK_SYSTEM_VARIABLES, the actual tracking info is a list + of name-value pairs of lines, sorted by name, e.g. if the info + received from the server is "autocommit=ON;time_zone=SYSTEM", the + corresponding string is + + -- autocommit: ON + -- time_zone: SYSTEM + @param [in,out] ds Dynamic string to hold the content to be printed. @param [in] mysql Connection handle. */ @@ -7981,11 +7995,16 @@ static const char *trking_info_desc[SESSION_TRACK_END + 1]= static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql) { #ifndef EMBEDDED_LIBRARY + DYNAMIC_STRING ds_sort, *ds_type= NULL; for (unsigned int type= SESSION_TRACK_BEGIN; type <= SESSION_TRACK_END; type++) { const char *data; size_t data_length; + /* + Append the tracking type line, if any corresponding tracking + info is received. + */ if (!mysql_session_track_get_first(mysql, (enum_session_state_type) type, &data, &data_length)) @@ -8001,26 +8020,56 @@ static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql) DBUG_ASSERT(0); dynstr_append_mem(ds, STRING_WITH_LEN("Tracker???\n")); } - - dynstr_append_mem(ds, STRING_WITH_LEN("-- ")); - dynstr_append_mem(ds, data, data_length); } else continue; + + /* + The remaining of this function: format and append the actual + tracking info. + */ + if (type == SESSION_TRACK_SYSTEM_VARIABLES) + { + /* Prepare a string to be sorted before being appended. */ + if (init_dynamic_string(&ds_sort, "", 1024, 1024)) + die("Out of memory"); + ds_type= &ds_sort; + } + else + ds_type= ds; + /* Append the first piece of info */ + dynstr_append_mem(ds_type, STRING_WITH_LEN("-- ")); + dynstr_append_mem(ds_type, data, data_length); + /* Whether we are appending the value of a variable */ + bool appending_value= type == SESSION_TRACK_SYSTEM_VARIABLES; + /* Append remaining pieces */ while (!mysql_session_track_get_next(mysql, (enum_session_state_type) type, &data, &data_length)) { - dynstr_append_mem(ds, STRING_WITH_LEN("\n-- ")); + if (appending_value) + dynstr_append_mem(ds_type, STRING_WITH_LEN(": ")); + else + dynstr_append_mem(ds_type, STRING_WITH_LEN("\n-- ")); + appending_value= !appending_value && type == SESSION_TRACK_SYSTEM_VARIABLES; if (data == NULL) { DBUG_ASSERT(data_length == 0); - dynstr_append_mem(ds, STRING_WITH_LEN("")); + dynstr_append_mem(ds_type, STRING_WITH_LEN("")); } else - dynstr_append_mem(ds, data, data_length); + dynstr_append_mem(ds_type, data, data_length); + } + DBUG_ASSERT(!appending_value); + if (type == SESSION_TRACK_SYSTEM_VARIABLES) + { + dynstr_append_mem(ds_type, STRING_WITH_LEN("\n")); + dynstr_append_sorted(ds, ds_type, false); + dynstr_append_mem(ds, STRING_WITH_LEN("\n")); + dynstr_free(&ds_sort); } - dynstr_append_mem(ds, STRING_WITH_LEN("\n\n")); + else + dynstr_append_mem(ds, STRING_WITH_LEN("\n\n")); } #endif /* EMBEDDED_LIBRARY */ } @@ -12174,7 +12223,8 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val) /* Build a list of pointer to each line in ds_input, sort the list and use the sorted list to append the strings - sorted to the output ds + sorted to the output ds. The string ds_input needs to + end with a newline. SYNOPSIS dynstr_append_sorted() diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 961db1b13b073..612c0c829e751 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -113,6 +113,9 @@ ELSEIF(RPM) IF(RPM MATCHES "opensuse|sles|centos|rhel|rocky|alma") SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "") ENDIF() + IF(RPM MATCHES "rhel8") + SET(WITH_READLINE ON CACHE BOOL "") + ENDIF() ELSEIF(DEB) SET(WITH_SSL system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "") @@ -172,12 +175,12 @@ IF(UNIX) # Default GCC flags IF(CMAKE_COMPILER_IS_GNUCC) - SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized") + SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized") SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}") SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") ENDIF() IF(CMAKE_COMPILER_IS_GNUCXX) - SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized") + SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized") SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF() diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 4214a9965b2df..5e8966ec7bbb3 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -229,7 +229,8 @@ IF(WITH_WSREP) SETA(CPACK_RPM_server_PACKAGE_REQUIRES "galera-4" "rsync" "grep" "gawk" "iproute" "coreutils" "findutils" "tar") - SETA(CPACK_RPM_server_PACKAGE_RECOMMENDS "lsof" "pv") + SETA(CPACK_RPM_server_PACKAGE_RECOMMENDS "lsof" "socat" "pv") + SETA(CPACK_RPM_test_PACKAGE_REQUIRES "socat") ENDIF() SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 3263c08ec4485..8fd8f32366006 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -89,7 +89,7 @@ MACRO(CREATE_EXPORTS_FILE VAR TARGET API_FUNCTIONS) CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS}) # Avoid "function redeclared as variable" error # when using gcc/clang option -flto(link time optimization) - IF(" ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} " MATCHES " -flto") + IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") SET_SOURCE_FILES_PROPERTIES(${EXPORTS} PROPERTIES COMPILE_FLAGS "-fno-lto") ENDIF() SET(${VAR} ${EXPORTS}) diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake index 9b4f25498fd99..aff69b3ba17f8 100644 --- a/cmake/mariadb_connector_c.cmake +++ b/cmake/mariadb_connector_c.cmake @@ -32,6 +32,10 @@ ELSE() SET(CONC_INSTALL_LAYOUT "DEFAULT") ENDIF() +IF(WITH_BOOST_CONTEXT) + SET(CONC_WITH_BOOST_CONTEXT ON) +ENDIF() + SET(PLUGIN_INSTALL_DIR ${INSTALL_PLUGINDIR}) SET(MARIADB_UNIX_ADDR ${MYSQL_UNIX_ADDR}) diff --git a/config.h.cmake b/config.h.cmake index b81c4148ccb9c..15f02d0e9161d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -195,6 +195,7 @@ #cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#cmakedefine HAVE_PTHREAD_GETATTR_NP 1 #cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1 #cmakedefine HAVE_PTHREAD_GETAFFINITY_NP 1 #cmakedefine HAVE_PTHREAD_KEY_DELETE 1 diff --git a/configure.cmake b/configure.cmake index 474c82cb59c49..027a810ed0e6a 100644 --- a/configure.cmake +++ b/configure.cmake @@ -380,6 +380,7 @@ CHECK_FUNCTION_EXISTS (pthread_attr_getguardsize HAVE_PTHREAD_ATTR_GETGUARDSIZE) CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE) CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE) CHECK_FUNCTION_EXISTS (pthread_getaffinity_np HAVE_PTHREAD_GETAFFINITY_NP) +CHECK_FUNCTION_EXISTS (pthread_getattr_np HAVE_PTHREAD_GETATTR_NP) CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE) CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK) CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK) diff --git a/debian/rules b/debian/rules index bdf21e0cfb09c..f8f260f741f6f 100644 --- a/debian/rules +++ b/debian/rules @@ -4,11 +4,6 @@ # https://wiki.debian.org/Hardening export DEB_BUILD_MAINT_OPTIONS = hardening=+all -# Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633 -ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes), yes) - export DEB_BUILD_MAINT_OPTIONS += optimize=-lto -endif - DPKG_EXPORT_BUILDFLAGS = 1 # Include all defaults, including buildflags.mk include /usr/share/dpkg/default.mk diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 21fd8b1117965..6364082f700d5 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -2662,7 +2662,7 @@ static bool innodb_init() const std::string ib_logfile0{get_log_file_path()}; os_file_delete_if_exists_func(ib_logfile0.c_str(), nullptr); os_file_t file= os_file_create_func(ib_logfile0.c_str(), - OS_FILE_CREATE, OS_FILE_NORMAL, + OS_FILE_CREATE, #if defined _WIN32 || defined O_DIRECT OS_DATA_FILE_NO_O_DIRECT, #else @@ -2687,13 +2687,9 @@ static bool innodb_init() mach_write_to_4(b + 12, my_crc32c(0, b, 11)); static_assert(12 + 4 == SIZE_OF_FILE_CHECKPOINT, "compatibility"); -#ifdef _WIN32 - DWORD len; - ret= WriteFile(file, log_hdr_buf, sizeof log_hdr_buf, - &len, nullptr) && len == sizeof log_hdr_buf; -#else - ret= sizeof log_hdr_buf == write(file, log_hdr_buf, sizeof log_hdr_buf); -#endif + ret = os_file_write_func(IORequestWrite, ib_logfile0.c_str(), file, + log_hdr_buf, 0, + sizeof(log_hdr_buf)) == DB_SUCCESS; if (!os_file_close_func(file) || !ret) goto invalid_log; return false; @@ -7536,7 +7532,6 @@ void handle_options(int argc, char **argv, char ***argv_server, } static int main_low(char** argv); -static int get_exepath(char *buf, size_t size, const char *argv0); /* ================= main =================== */ int main(int argc, char **argv) @@ -7547,8 +7542,8 @@ int main(int argc, char **argv) my_getopt_prefix_matching= 0; - if (get_exepath(mariabackup_exe,FN_REFLEN, argv[0])) - strncpy(mariabackup_exe,argv[0], FN_REFLEN-1); + if (my_get_exepath(mariabackup_exe, FN_REFLEN, argv[0])) + strncpy(mariabackup_exe, argv[0], FN_REFLEN-1); if (argc > 1 ) @@ -7845,32 +7840,6 @@ static int main_low(char** argv) } -static int get_exepath(char *buf, size_t size, const char *argv0) -{ -#ifdef _WIN32 - DWORD ret = GetModuleFileNameA(NULL, buf, (DWORD)size); - if (ret > 0) - return 0; -#elif defined(__linux__) - ssize_t ret = readlink("/proc/self/exe", buf, size-1); - if(ret > 0) - return 0; -#elif defined(__APPLE__) - size_t ret = proc_pidpath(getpid(), buf, static_cast(size)); - if (ret > 0) { - buf[ret] = 0; - return 0; - } -#elif defined(__FreeBSD__) - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; - if (sysctl(mib, 4, buf, &size, NULL, 0) == 0) { - return 0; - } -#endif - - return my_realpath(buf, argv0, 0); -} - #if defined (__SANITIZE_ADDRESS__) && defined (__linux__) /* Avoid LeakSanitizer's false positives. */ diff --git a/include/m_string.h b/include/m_string.h index 11fdbaec9974d..4a2d8c8e5871e 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -285,12 +285,19 @@ static inline void safe_strcpy(char *dst, size_t dst_size, const char *src) static inline int safe_strcpy_truncated(char *dst, size_t dst_size, const char *src) { - DBUG_ASSERT(dst_size > 0); - strncpy(dst, src, dst_size); - if (dst[dst_size - 1]) + DBUG_ASSERT(dst_size > 0); + if (dst_size == 0) + return 1; + /* + We do not want to use strncpy() as we do not want to rely on + strncpy() filling the unused dst with 0. + We cannot use strmake() here as it in debug mode fills the buffers + with 'Z'. + */ + if (strnmov(dst, src, dst_size) == dst+dst_size) { - dst[dst_size - 1]= 0; + dst[dst_size-1]= 0; return 1; } return 0; @@ -306,7 +313,7 @@ static inline int safe_strcpy_truncated(char *dst, size_t dst_size, static inline int safe_strcat(char *dst, size_t dst_size, const char *src) { size_t init_len= strlen(dst); - if (init_len > dst_size) + if (init_len >= dst_size) return 1; return safe_strcpy_truncated(dst + init_len, dst_size - init_len, src); } diff --git a/include/my_global.h b/include/my_global.h index 7da8b73c239cf..e75889a232f24 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -834,7 +834,6 @@ typedef long long my_ptrdiff_t; #define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A), sizeof(double))) #define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) -#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1)) /* Custom version of standard offsetof() macro which can be used to get diff --git a/include/my_stack_alloc.h b/include/my_stack_alloc.h index 95e746d6fe75a..796bb69f877d4 100644 --- a/include/my_stack_alloc.h +++ b/include/my_stack_alloc.h @@ -17,6 +17,65 @@ #ifndef _my_stack_alloc_h #define _my_stack_alloc_h +#ifdef _MSC_VER +#include // For MSVC-specific intrinsics +#else +#include +#endif + + +/* + Get the address of the current stack. + This will fallback to using an estimate for the stack pointer + in the cases where either the compiler or the architecture is + not supported. +*/ + +static inline void *my_get_stack_pointer(void *default_stack) +{ + void *stack_ptr= NULL; + +#if defined(__GNUC__) || defined(__clang__) /* GCC and Clang compilers */ +#if defined(__i386__) /* Intel x86 (32-bit) */ + __asm__ volatile ("movl %%esp, %0" : "=r" (stack_ptr)); +#elif defined(__x86_64__) /* Intel x86-64 (64-bit) */ + __asm__ volatile ("movq %%rsp, %0" : "=r" (stack_ptr)); +#elif defined(__powerpc__) /* PowerPC (32-bit) */ + __asm__ volatile ("mr %0, 1" : "=r" (stack_ptr)); /* GPR1 is the stack pointer */ +#elif defined(__ppc64__) /* PowerPC (64-bit) */ + __asm__ volatile ("mr %0, 1" : "=r" (stack_ptr)); +#elif defined(__arm__) /* ARM 32-bit */ + __asm__ volatile ("mov %0, sp" : "=r" (stack_ptr)); +#elif defined(__aarch64__) /* ARM 64-bit */ + __asm__ volatile ("mov %0, sp" : "=r" (stack_ptr)); +#elif defined(__sparc__) /* SPARC 32-bit */ + __asm__ volatile ("mov %%sp, %0" : "=r" (stack_ptr)); +#elif defined(__sparc64__) /* SPARC 64-bit */ + __asm__ volatile ("mov %%sp, %0" : "=r" (stack_ptr)); +#elif defined(__s390x__) + stack_ptr= __builtin_frame_address(0); +#else + /* Generic fallback for unsupported architectures in GCC/Clang */ + stack_ptr= default_stack ? default_stack : (void*) &stack_ptr; +#endif +#elif defined(_MSC_VER) /* MSVC compiler (Intel only) */ +#if defined(_M_IX86) /* Intel x86 (32-bit) */ + __asm { mov stack_ptr, esp } +#elif defined(_M_X64) /* Intel x86-64 (64-bit) */ + /* rsp can’t be accessed directly in MSVC x64 */ + stack_ptr= _AddressOfReturnAddress(); +#else + /* Generic fallback for unsupported architectures in MSVC */ + stack_ptr= default_stack ? default_stack : (void*) &stack_ptr; +#endif +#else + /* Generic fallback for unsupported compilers */ + stack_ptr= default_stack ? default_stack : (void*) &stack_ptr; +#endif + return stack_ptr; +} + + /* Do allocation through alloca if there is enough stack available. If not, use my_malloc() instead. @@ -42,7 +101,7 @@ /* Allocate small blocks as long as there is this much left */ #define STACK_ALLOC_SMALL_BLOCK 1024*32 -/* Allocate small blocks as long as there is this much left */ +/* Allocate small blocks as long as the block size is not bigger than */ #define STACK_ALLOC_SMALL_BLOCK_SIZE 4096 /* @@ -56,11 +115,11 @@ do \ { \ size_t alloc_size= (size); \ - size_t stack_left= available_stack_size(&alloc_size, (stack_end)); \ - if (stack_left > alloc_size && \ - (STACK_ALLOC_BIG_BLOCK < stack_left - alloc_size || \ - ((STACK_ALLOC_SMALL_BLOCK < stack_left - alloc_size) && \ - (STACK_ALLOC_SMALL_BLOCK_SIZE <= alloc_size)))) \ + void *stack= my_get_stack_pointer(0); \ + size_t stack_left= available_stack_size(stack, (stack_end)); \ + if (stack_left > alloc_size + STACK_ALLOC_SMALL_BLOCK && \ + (stack_left > alloc_size + STACK_ALLOC_BIG_BLOCK || \ + (STACK_ALLOC_SMALL_BLOCK_SIZE >= alloc_size))) \ { \ (must_be_freed)= 0; \ (res)= alloca(size); \ @@ -90,3 +149,16 @@ static inline void stack_alloc_free(void *res, my_bool must_be_freed) my_free(res); } #endif /* _my_stack_alloc_h */ + + +/* Get start and end of stack */ + +/* + This is used in the case when we not know the exact stack start + and have to estimate stack start with get_stack_pointer() +*/ +#define MY_STACK_SAFE_MARGIN 8192 + +extern void my_get_stack_bounds(void **stack_start, void **stack_end, + void *fallback_stack_start, + size_t fallback_stack_size); diff --git a/include/my_sys.h b/include/my_sys.h index 0797f96607e03..6357761108297 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -657,6 +657,8 @@ extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags); extern void (*my_sleep_for_space)(unsigned int seconds); +extern int my_get_exepath(char *buf, size_t size, const char *argv0); + /* implemented in my_memmem.c */ extern void *my_memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); diff --git a/libmariadb b/libmariadb index 486ce75d6426c..3f2196d84e20d 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 486ce75d6426c20c4e9f8e7fe4df8ddec193d7e2 +Subproject commit 3f2196d84e20dd89c682fde6154849ec5bb36c85 diff --git a/mysql-test/include/search_condition.inc b/mysql-test/include/search_condition.inc new file mode 100644 index 0000000000000..2e050e90af74b --- /dev/null +++ b/mysql-test/include/search_condition.inc @@ -0,0 +1,201 @@ +--echo # +--echo # WHERE +--echo # + +let datatype=`SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_NAME='t0' AND COLUMN_NAME='c'`; +let use_string_func=0; +let use_field=1; +let update_source=c+11; + +if ($datatype == 'varchar') +{ + let use_string_func=1; +} + +if ($datatype == 'datetime') +{ + let update_source=c+0.1; +} + +if ($datatype == 'inet6') +{ + let use_field=0; + let update_source=concat(c,'77'); +} + + +CREATE TABLE t1 AS SELECT * FROM t0; +if ($use_field) +{ + SELECT * FROM t1 WHERE c; +} +SELECT * FROM t1 WHERE c IS FALSE; +SELECT * FROM t1 WHERE c IS TRUE; +SELECT * FROM t1 WHERE COALESCE(c); +if ($use_string_func) +{ + SELECT * FROM t1 WHERE CONCAT(c); + SELECT * FROM t1 WHERE LEFT(c,100); +} +DROP TABLE t1; + + +--echo # +--echo # HAVING +--echo # + +CREATE TABLE t1 AS SELECT * FROM t0; +if ($use_field) +{ + SELECT COALESCE(c,c) AS c2 FROM t1 GROUP BY c2 HAVING c2; +} +SELECT COALESCE(c,c) AS c2 FROM t1 GROUP BY c2 HAVING c2 IS FALSE; +SELECT COALESCE(c,c) AS c2 FROM t1 GROUP BY c2 HAVING c2 IS TRUE; +SELECT COALESCE(c,c) AS c2 FROM t1 GROUP BY c2 HAVING COALESCE(c2); +if ($use_string_func) +{ + SELECT CONCAT(c,'0') AS c2 FROM t1 GROUP BY c2 HAVING LEFT(c2,100); +} +DROP TABLE t1; + + +--echo # +--echo # := ON +--echo # + +CREATE TABLE t1 AS SELECT * FROM t0; +if ($use_field) +{ + SELECT t1.c FROM t1 JOIN t1 AS t2 ON (t1.c); +} +SELECT t1.c FROM t1 JOIN t1 AS t2 ON (t1.c IS FALSE); +SELECT t1.c FROM t1 JOIN t1 AS t2 ON (t1.c IS TRUE); +SELECT t1.c FROM t1 JOIN t1 AS t2 ON (COALESCE(t1.c)); +if ($use_string_func) +{ + SELECT t1.c FROM t1 JOIN t1 AS t2 ON (CONCAT(t1.c)); +} +DROP TABLE t1; + + +--echo # +--echo # +--echo # DELETE FROM [ WHERE ] +--echo # + +if ($use_field) +{ + CREATE TABLE t1 AS SELECT * FROM t0; + DELETE FROM t1 WHERE c; + SELECT * FROM t1; + DROP TABLE t1; +} + +CREATE TABLE t1 AS SELECT * FROM t0; +DELETE FROM t1 WHERE c IS FALSE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT * FROM t0; +DELETE FROM t1 WHERE c IS TRUE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT * FROM t0; +DELETE FROM t1 WHERE COALESCE(c); +SELECT * FROM t1; +DROP TABLE t1; + +if ($use_string_func) +{ + CREATE TABLE t1 AS SELECT * FROM t0; + DELETE FROM t1 WHERE CONCAT(c); + SELECT * FROM t1; + DROP TABLE t1; +} + + +--echo # +--echo # +--echo # UPDATE SET [ WHERE ] + +if ($use_field) +{ + CREATE TABLE t1 AS SELECT * FROM t0; + eval UPDATE t1 SET c=$update_source WHERE c; + SELECT * FROM t1; + DROP TABLE t1; +} + +CREATE TABLE t1 AS SELECT * FROM t0; +eval UPDATE t1 SET c=$update_source WHERE c IS FALSE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT * FROM t0; +eval UPDATE t1 SET c=$update_source WHERE c IS TRUE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT * FROM t0; +eval UPDATE t1 SET c=$update_source WHERE COALESCE(c); +SELECT * FROM t1; +DROP TABLE t1; + +if ($use_string_func) +{ + CREATE TABLE t1 AS SELECT * FROM t0; + eval UPDATE t1 SET c=$update_source WHERE COALESCE(c); + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # +--echo # CHECK + +if ($use_field) +{ + CREATE TABLE t1 LIKE t0; + ALTER TABLE t1 ADD CONSTRAINT check0 CHECK(c); +--error ER_CONSTRAINT_FAILED + INSERT INTO t1 SELECT * FROM t0 WHERE NOT c; + INSERT INTO t1 SELECT * FROM t0 WHERE c; + SELECT * FROM t1; + DROP TABLE t1; +} + +CREATE TABLE t1 LIKE t0; +ALTER TABLE t1 ADD CONSTRAINT check0 CHECK(c IS FALSE); +INSERT INTO t1 SELECT * FROM t0 WHERE c IS FALSE; +--error ER_CONSTRAINT_FAILED +INSERT INTO t1 SELECT * FROM t0 WHERE c IS TRUE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 LIKE t0; +ALTER TABLE t1 ADD CONSTRAINT check0 CHECK(c IS TRUE); +--error ER_CONSTRAINT_FAILED +INSERT INTO t1 SELECT * FROM t0 WHERE c IS FALSE; +INSERT INTO t1 SELECT * FROM t0 WHERE c IS TRUE; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 LIKE t0; +ALTER TABLE t1 ADD CONSTRAINT check0 CHECK(COALESCE(c)); +--error ER_CONSTRAINT_FAILED +INSERT INTO t1 SELECT * FROM t0 WHERE c IS FALSE; +INSERT INTO t1 SELECT * FROM t0 WHERE c IS TRUE; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # +--echo # WHEN THEN + +CREATE TABLE t1 AS SELECT * FROM t0; +SELECT c, CASE WHEN c THEN 'true' ELSE 'false' END AS c2 FROM t1; +SELECT c, CASE WHEN COALESCE(c) THEN 'true' ELSE 'false' END AS c2 FROM t1; +DROP TABLE t1; diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm index 1cd01cb0ca967..91ebdc8fe11c0 100644 --- a/mysql-test/lib/My/SafeProcess/Base.pm +++ b/mysql-test/lib/My/SafeProcess/Base.pm @@ -114,6 +114,10 @@ sub create_process { lock($win32_spawn_lock); + # STDOUT/STDERR are temporarily reassigned, avoid prevent + # output from another thread + lock($mtr_report::flush_lock); + #printf STDERR "stdin %d, stdout %d, stderr %d\n", # fileno STDIN, fileno STDOUT, fileno STDERR; diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 0c3c45f3b1886..308dbb77a3ef9 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -88,7 +88,7 @@ sub flush_out { } use if $^O eq "MSWin32", "threads::shared"; -my $flush_lock :shared; +our $flush_lock :shared; # Print to stdout sub print_out { diff --git a/mysql-test/main/alias.result b/mysql-test/main/alias.result index e6387de50a71a..171509137616b 100644 --- a/mysql-test/main/alias.result +++ b/mysql-test/main/alias.result @@ -59,7 +59,7 @@ SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA', Kundentyp kategorie Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1052 Column 'kundentyp' in group statement is ambiguous +Warning 1052 Column 'kundentyp' in GROUP BY is ambiguous drop table t1; CREATE TABLE t1 ( AUFNR varchar(12) NOT NULL default '', diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result index 949f36e24b395..64d3d8c0c3e0e 100644 --- a/mysql-test/main/alter_table.result +++ b/mysql-test/main/alter_table.result @@ -712,7 +712,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp alter table table_24562 order by (select 12 from dual); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select 12 from dual)' at line 1 alter table table_24562 order by no_such_col; -ERROR 42S22: Unknown column 'no_such_col' in 'order clause' +ERROR 42S22: Unknown column 'no_such_col' in 'ORDER BY' drop table table_24562; create table t1 (mycol int(10) not null); alter table t1 alter column mycol set default 0; diff --git a/mysql-test/main/alter_table_combinations.result b/mysql-test/main/alter_table_combinations.result index cd47c78d40449..cbf98f620efc8 100644 --- a/mysql-test/main/alter_table_combinations.result +++ b/mysql-test/main/alter_table_combinations.result @@ -228,7 +228,7 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function UPDATE t2 SET f = f + 10; ERROR 42S22: Unknown column 'd' in 'NEW' CALL sp1(); -ERROR 42S22: Unknown column 'd' in 'field list' +ERROR 42S22: Unknown column 'd' in 'INSERT INTO' DROP TRIGGER trg1; DROP PROCEDURE sp1; CREATE TABLE t_gen(a INT, b DOUBLE GENERATED ALWAYS AS (SQRT(a))); diff --git a/mysql-test/main/analyze_stmt.result b/mysql-test/main/analyze_stmt.result index c5d35759c9c62..2db78ec75d0c7 100644 --- a/mysql-test/main/analyze_stmt.result +++ b/mysql-test/main/analyze_stmt.result @@ -204,17 +204,17 @@ drop table t0, t1; create table t1 (i int); insert into t1 values (1),(2); analyze select a from t1; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' analyze delete from t1 where a=2; -ERROR 42S22: Unknown column 'a' in 'where clause' +ERROR 42S22: Unknown column 'a' in 'WHERE' analyze update t1 set a=2; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SET' create table t2 like t1; insert into t2 select * from t1; analyze update t2,t1 set t2.i=5 where t2.a=t1.a; -ERROR 42S22: Unknown column 't2.a' in 'where clause' +ERROR 42S22: Unknown column 't2.a' in 'WHERE' analyze delete t1 from t2,t1 where t2.a=t1.a; -ERROR 42S22: Unknown column 't2.a' in 'where clause' +ERROR 42S22: Unknown column 't2.a' in 'WHERE' drop table t1, t2; # # MDEV-6395: ANALYZE UPDATE/DELETE with impossible where does not produce any output diff --git a/mysql-test/main/column_compression.result b/mysql-test/main/column_compression.result index 4ac35912072ee..e68d9385f1e98 100644 --- a/mysql-test/main/column_compression.result +++ b/mysql-test/main/column_compression.result @@ -2918,10 +2918,8 @@ CREATE TABLE t1 (a VARCHAR(500) COMPRESSED CHARACTER SET utf8mb3) ENGINE=InnoDB; INSERT INTO t1 SET a=REPEAT('x',127); ALTER TABLE t1 FORCE, ALGORITHM=COPY; DROP TABLE t1; -# # End of 10.4 tests # -# # MDEV-19727 Add Type_handler::Key_part_spec_init_ft # CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED, FULLTEXT INDEX(a)); @@ -2929,5 +2927,20 @@ ERROR HY000: Compressed column 'a' can't be used in key specification CREATE TABLE t1 (a TEXT COMPRESSED, FULLTEXT INDEX(a)); ERROR HY000: Compressed column 'a' can't be used in key specification # -# End of 10.5 tests +# MDEV-16699 heap-use-after-free in group_concat with compressed or GIS columns # +create table t1 (c text compressed); +insert into t1 values ('foo'),(repeat('a',55000)); +select length(group_concat(c order by 1)) from t1; +length(group_concat(c order by 1)) +55004 +create table t2 as select group_concat(c order by 1), concat(c), c from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `group_concat(c order by 1)` mediumtext DEFAULT NULL, + `concat(c)` text DEFAULT NULL, + `c` text /*M!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +drop table t1, t2; +# End of 10.5 tests diff --git a/mysql-test/main/column_compression.test b/mysql-test/main/column_compression.test index 5fa8192df3b8c..01b408f362e1a 100644 --- a/mysql-test/main/column_compression.test +++ b/mysql-test/main/column_compression.test @@ -453,10 +453,7 @@ INSERT INTO t1 SET a=REPEAT('x',127); ALTER TABLE t1 FORCE, ALGORITHM=COPY; DROP TABLE t1; - ---echo # --echo # End of 10.4 tests ---echo # --echo # --echo # MDEV-19727 Add Type_handler::Key_part_spec_init_ft @@ -476,5 +473,13 @@ CREATE TABLE t1 (a TEXT COMPRESSED, FULLTEXT INDEX(a)); --disable_prepare_warnings --echo # ---echo # End of 10.5 tests +--echo # MDEV-16699 heap-use-after-free in group_concat with compressed or GIS columns --echo # +create table t1 (c text compressed); +insert into t1 values ('foo'),(repeat('a',55000)); +select length(group_concat(c order by 1)) from t1; +create table t2 as select group_concat(c order by 1), concat(c), c from t1; +show create table t2; +drop table t1, t2; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/compress.result b/mysql-test/main/compress.result index 2497934614961..0e555b9fa704c 100644 --- a/mysql-test/main/compress.result +++ b/mysql-test/main/compress.result @@ -2162,7 +2162,7 @@ SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA', Kundentyp kategorie Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1052 Column 'kundentyp' in group statement is ambiguous +Warning 1052 Column 'kundentyp' in GROUP BY is ambiguous drop table t1; SHOW STATUS LIKE 'Compression'; Variable_name Value diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result index e84a93317ab47..2b8be7b0518aa 100644 --- a/mysql-test/main/connect.result +++ b/mysql-test/main/connect.result @@ -461,11 +461,13 @@ Connection_errors_max_connections 0 Connection_errors_peer_address 0 Connection_errors_select 0 Connection_errors_tcpwrap 0 +show global status like 'Threads_connected'; +Variable_name Value +Threads_connected 1 set @max_con.save= @@max_connections; set global max_connections= 10; # ERROR 1040 # ERROR 1040 -connection default; show global status like 'Connection_errors%'; Variable_name Value Connection_errors_accept 0 diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test index ab69d32eedf19..6370c6991ae14 100644 --- a/mysql-test/main/connect.test +++ b/mysql-test/main/connect.test @@ -517,6 +517,7 @@ SET GLOBAL connect_timeout= @save_connect_timeout; flush status; show global status like 'Connection_errors%'; +show global status like 'Threads_connected'; set @max_con.save= @@max_connections; set global max_connections= 10; @@ -534,9 +535,25 @@ while ($n) --dec $n } +connection default; +let $n= 10; +let $c= 12; +while ($n) +{ + disconnect con$c; + --dec $n + --dec $c +} + +# Wait until all connections has terminated to ensure +# that Connection_errors is correct + +let $status_var=Threads_connected; +let $status_var_value= 1; +--source include/wait_for_status_var.inc + --enable_result_log --enable_query_log ---connection default show global status like 'Connection_errors%'; set global max_connections= @max_con.save; diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result index 67a38ce076b77..00447082a67f5 100644 --- a/mysql-test/main/cte_nonrecursive.result +++ b/mysql-test/main/cte_nonrecursive.result @@ -750,7 +750,7 @@ ERROR HY000: No anchors for recursive WITH element 's' #erroneous definition of unreferenced with table t with t as (select count(*) from t1 where d>='f' group by a) select t1.b from t2,t1 where t1.a = t2.c; -ERROR 42S22: Unknown column 'd' in 'where clause' +ERROR 42S22: Unknown column 'd' in 'WHERE' with t as (select count(*) from t1 where b>='f' group by a) select t1.b from t2,t1 where t1.a = t2.c; b @@ -762,11 +762,11 @@ ggg with t(d) as (select count(*) from t1 where b<='ccc' group by b), s as (select * from t1 where a in (select t2.d from t2,t where t2.c=t.d)) select t1.b from t1,t2 where t1.a=t2.c; -ERROR 42S22: Unknown column 't2.d' in 'field list' +ERROR 42S22: Unknown column 't2.d' in 'SELECT' with t(d) as (select count(*) from t1 where b<='ccc' group by b), s as (select * from t1 where a in (select t2.c from t2,t where t2.c=t.c)) select t1.b from t1,t2 where t1.a=t2.c; -ERROR 42S22: Unknown column 't.c' in 'where clause' +ERROR 42S22: Unknown column 't.c' in 'WHERE' with t(d) as (select count(*) from t1 where b<='ccc' group by b), s as (select * from t1 where a in (select t2.c from t2,t where t2.c=t.d)) select t1.b from t1,t2 where t1.a=t2.c; @@ -1889,13 +1889,13 @@ cte1(a) as (select * from t1 where c1 <= 2), cte2(b) as (select * from cte1 where c1 >= 2), cte3 as (select * from cte1,cte2 where cte1.a < cte2.b) select * from t2; -ERROR 42S22: Unknown column 'c1' in 'where clause' +ERROR 42S22: Unknown column 'c1' in 'WHERE' with cte1(a) as (select * from t1 where c1 <= 2), cte2(b) as (select * from cte1 where a >= 2), cte3 as (select * from cte1,cte2 where cte1.a < cte2.c1) select * from t2; -ERROR 42S22: Unknown column 'cte2.c1' in 'where clause' +ERROR 42S22: Unknown column 'cte2.c1' in 'WHERE' with cte1 as (select * from t1 where c1 <= 2), cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1) @@ -1914,7 +1914,7 @@ with cte1 as (select * from t1 where c1 <= 2), cte2(a,b) as (select * from cte1 as s1, cte1 as s2 where s1.c1=c1) select * from t2; -ERROR 23000: Column 'c1' in where clause is ambiguous +ERROR 23000: Column 'c1' in WHERE is ambiguous with cte3 as ( with cte2(a,b) as ( with cte1 as (select * from t1 where c1 <= 2) @@ -1941,7 +1941,7 @@ with cte3 as select * from cte1 as s1, cte1 as s2 where s1.c1=s2.c1) select r1.c1,r2.c1 from cte2 as r1, cte2 as r2) select * from t2; -ERROR 42S22: Unknown column 'r1.c1' in 'field list' +ERROR 42S22: Unknown column 'r1.c1' in 'SELECT' create procedure p1() begin insert into t2 @@ -1962,7 +1962,7 @@ with cte1 as (select a from t1) select * from t1 as s, t1 as t where s.c1=t.c1 and s.c1 <= 2 and t.c1 >= 2; end | call p1(); -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' drop procedure p1; drop table t1,t2; # diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index ef0920bf9c33d..76eb492dc5154 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -4655,33 +4655,33 @@ insert into t1 values (3), (7), (1); with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b) select * from t1 as t; -ERROR 42S22: Unknown column 'r.b' in 'where clause' +ERROR 42S22: Unknown column 'r.b' in 'WHERE' explain with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b) select * from t1 as t; -ERROR 42S22: Unknown column 'r.b' in 'where clause' +ERROR 42S22: Unknown column 'r.b' in 'WHERE' create procedure sp1() with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b) select * from t1 as t; call sp1(); -ERROR 42S22: Unknown column 'r.b' in 'where clause' +ERROR 42S22: Unknown column 'r.b' in 'WHERE' call sp1(); -ERROR 42S22: Unknown column 'r.b' in 'where clause' +ERROR 42S22: Unknown column 'r.b' in 'WHERE' with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a) select * from t1 as t; -ERROR 42S22: Unknown column 's1.b' in 'where clause' +ERROR 42S22: Unknown column 's1.b' in 'WHERE' explain with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a) select * from t1 as t; -ERROR 42S22: Unknown column 's1.b' in 'where clause' +ERROR 42S22: Unknown column 's1.b' in 'WHERE' create procedure sp2() with recursive r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a) select * from t1 as t; call sp2(); -ERROR 42S22: Unknown column 's1.b' in 'where clause' +ERROR 42S22: Unknown column 's1.b' in 'WHERE' call sp2(); -ERROR 42S22: Unknown column 's1.b' in 'where clause' +ERROR 42S22: Unknown column 's1.b' in 'WHERE' drop procedure sp1; drop procedure sp2; drop table t1; diff --git a/mysql-test/main/ctype_gbk_export_import.result b/mysql-test/main/ctype_gbk_export_import.result index 664f515b35c8e..73c8f12c31979 100644 --- a/mysql-test/main/ctype_gbk_export_import.result +++ b/mysql-test/main/ctype_gbk_export_import.result @@ -304,14 +304,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=auto } @@ -324,14 +324,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET gbk} @@ -344,14 +344,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET utf8} @@ -384,14 +384,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=gbk } @@ -404,14 +404,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET gbk} @@ -424,14 +424,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET utf8} @@ -464,14 +464,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=utf8 } @@ -484,14 +484,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET gbk} @@ -504,14 +504,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=auto CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET utf8} @@ -1264,14 +1264,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=auto } @@ -1284,14 +1284,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET gbk} @@ -1304,14 +1304,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET utf8} @@ -1344,14 +1344,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=gbk } @@ -1364,14 +1364,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET gbk} @@ -1384,14 +1384,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET utf8} @@ -1424,14 +1424,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=utf8 } @@ -1444,14 +1444,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET gbk} @@ -1464,14 +1464,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET utf8} @@ -1984,8 +1984,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2004,8 +2004,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2024,14 +2024,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 }{--default-character-set=auto CHARACTER SET utf8} @@ -2064,8 +2064,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2084,8 +2084,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2104,14 +2104,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 }{--default-character-set=gbk CHARACTER SET utf8} @@ -2144,8 +2144,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2164,8 +2164,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2184,14 +2184,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 }{--default-character-set=utf8 CHARACTER SET utf8} @@ -2224,14 +2224,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=auto } @@ -2244,14 +2244,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET gbk} @@ -2264,14 +2264,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=auto CHARACTER SET utf8} @@ -2304,14 +2304,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=gbk } @@ -2324,14 +2324,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET gbk} @@ -2344,14 +2344,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=gbk CHARACTER SET utf8} @@ -2384,14 +2384,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=utf8 } @@ -2404,14 +2404,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET gbk} @@ -2424,14 +2424,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET gbk}{--default-character-set=utf8 CHARACTER SET utf8} @@ -2704,8 +2704,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2724,8 +2724,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2744,14 +2744,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET binary}{--default-character-set=auto CHARACTER SET utf8} @@ -2784,8 +2784,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2804,8 +2804,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2824,14 +2824,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET binary}{--default-character-set=gbk CHARACTER SET utf8} @@ -2864,8 +2864,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2884,8 +2884,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2904,14 +2904,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=utf8 CHARACTER SET binary}{--default-character-set=utf8 CHARACTER SET utf8} @@ -2947,8 +2947,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2967,8 +2967,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -2987,14 +2987,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=binary}{--default-character-set=auto CHARACTER SET utf8} @@ -3027,8 +3027,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3047,8 +3047,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3067,14 +3067,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=binary}{--default-character-set=binary CHARACTER SET utf8} @@ -3107,8 +3107,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3127,8 +3127,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3147,14 +3147,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=binary}{--default-character-set=gbk CHARACTER SET utf8} @@ -3187,8 +3187,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3207,8 +3207,8 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 EE5C a2 E9978B3F BAD-TEXT-UTF8 -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 EE5C5C @@ -3227,14 +3227,14 @@ file 31-EE5C-E9A0AB-EE5C5C-24|32-EE5C5C5C-E9A0AB5C5C-EE5C5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 E9A0AB -b1 EE5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C +eol 24 --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 E9A0AB5C -b1 EE5C5C0924 BAD-BLOB -eol BAD-EOL +b1 EE5C5C +eol 24 --- --- End of {zh_CN.gbk}{--default-character-set=binary}{--default-character-set=utf8 CHARACTER SET utf8} @@ -3267,14 +3267,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=auto } @@ -3287,14 +3287,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=auto CHARACTER SET gbk} @@ -3307,14 +3307,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=auto CHARACTER SET utf8} @@ -3347,14 +3347,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=binary } @@ -3367,14 +3367,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=binary CHARACTER SET gbk} @@ -3387,14 +3387,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=binary CHARACTER SET utf8} @@ -3427,14 +3427,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=gbk } @@ -3447,14 +3447,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=gbk CHARACTER SET gbk} @@ -3467,14 +3467,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=gbk CHARACTER SET utf8} @@ -3507,14 +3507,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=utf8 } @@ -3527,14 +3527,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 EE5C a2 E9A0AB -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 EE5C5C a2 E9A0AB5C -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=utf8 CHARACTER SET gbk} @@ -3547,14 +3547,14 @@ file 31-EE5C-EE5C-EE5C-24|32-EE5C5C5C-EE5C5C5C-EE5C5C5C-24| id 1 a1 3F5C BAD-TEXT-GBK a2 3F5C BAD-TEXT-UTF8 -b1 EE5C -eol 24 +b1 EE0924 BAD-BLOB +eol BAD-EOL --- --- id 2 a1 3F5C5C BAD-TEXT-GBK a2 3F5C5C BAD-TEXT-UTF8 -b1 EE5C5C -eol 24 +b1 EE5C0924 BAD-BLOB +eol BAD-EOL --- --- End of {zh_CN.gbk}{--default-character-set=gbk}{--default-character-set=utf8 CHARACTER SET utf8} diff --git a/mysql-test/main/delayed.result b/mysql-test/main/delayed.result index 2facd37263f7a..73e1ed40c6a58 100644 --- a/mysql-test/main/delayed.result +++ b/mysql-test/main/delayed.result @@ -253,7 +253,7 @@ CREATE TABLE t1 (a INT); INSERT DELAYED INTO t1 SET a= b(); ERROR 42000: FUNCTION test.b does not exist INSERT DELAYED INTO t1 SET b= 1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'INSERT INTO' INSERT DELAYED INTO t1 SET b= b(); ERROR 42000: FUNCTION test.b does not exist DROP TABLE t1; diff --git a/mysql-test/main/delete.result b/mysql-test/main/delete.result index 5bfe8e7b70932..9db350210c7aa 100644 --- a/mysql-test/main/delete.result +++ b/mysql-test/main/delete.result @@ -53,7 +53,7 @@ CREATE TABLE `t1` ( PRIMARY KEY (`i`) ); DELETE FROM t1 USING t1 WHERE post='1'; -ERROR 42S22: Unknown column 'post' in 'where clause' +ERROR 42S22: Unknown column 'post' in 'WHERE' drop table t1; CREATE TABLE t1 ( bool char(0) default NULL, @@ -229,11 +229,11 @@ drop table t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); DELETE FROM t1 ORDER BY x; -ERROR 42S22: Unknown column 'x' in 'order clause' +ERROR 42S22: Unknown column 'x' in 'ORDER BY' DELETE FROM t1 ORDER BY t2.x; -ERROR 42S22: Unknown column 't2.x' in 'order clause' +ERROR 42S22: Unknown column 't2.x' in 'ORDER BY' DELETE FROM t1 ORDER BY (SELECT x); -ERROR 42S22: Unknown column 'x' in 'field list' +ERROR 42S22: Unknown column 'x' in 'SELECT' DROP TABLE t1; CREATE TABLE t1 ( a INT diff --git a/mysql-test/main/delete_returning.result b/mysql-test/main/delete_returning.result index 3a95de0cdcaa6..fc6e61fce83aa 100644 --- a/mysql-test/main/delete_returning.result +++ b/mysql-test/main/delete_returning.result @@ -42,7 +42,7 @@ a b 5 EEEEE 7 GGGGGGG DELETE FROM t1 WHERE a=2 RETURNING c; -ERROR 42S22: Unknown column 'c' in 'field list' +ERROR 42S22: Unknown column 'c' in 'RETURNING' INSERT INTO t1 VALUES (2,'BB'), (2,'bb'); DELETE FROM t1 WHERE a=2 RETURNING a, UPPER(b); a UPPER(b) diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index aad5e510473fc..f2561a2569ff8 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -5,9 +5,9 @@ select * from (select 2 from DUAL) b; 2 2 SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' CREATE TABLE t1 (a int not null, b char (10) not null); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); CREATE TABLE t2 (a int not null, b char (10) not null); @@ -27,18 +27,18 @@ a y 3 3 3 3 SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b; -ERROR 42S22: Unknown column 'a' in 'having clause' +ERROR 42S22: Unknown column 'a' in 'HAVING' SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1; -ERROR 23000: Column 'a' in having clause is ambiguous +ERROR 23000: Column 'a' in HAVING is ambiguous SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2; a a 1 2 SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=1; a a SELECT 1 FROM (SELECT 1) a WHERE a=2; -ERROR 42S22: Unknown column 'a' in 'where clause' +ERROR 42S22: Unknown column 'a' in 'WHERE' SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) as a; -ERROR 42S22: Unknown column 'a' in 'having clause' +ERROR 42S22: Unknown column 'a' in 'HAVING' select * from t1 as x1, (select * from t1) as x2; a b a b 1 a 1 a @@ -154,13 +154,13 @@ select * from (select 1 as a) b left join (select 2 as a) c using(a); a 1 SELECT * FROM (SELECT 1 UNION SELECT a) b; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' select 1 from (select 2) a order by 0; -ERROR 42S22: Unknown column '0' in 'order clause' +ERROR 42S22: Unknown column '0' in 'ORDER BY' create table t1 (id int); insert into t1 values (1),(2),(3); describe select * from (select * from t1 group by id) bar; @@ -277,7 +277,7 @@ N M UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2; ERROR HY000: The target table P2 of the UPDATE is not updatable UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; -ERROR 42S22: Unknown column 'aaaa' in 'field list' +ERROR 42S22: Unknown column 'aaaa' in 'SELECT' delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; select * from t1; N M @@ -285,7 +285,7 @@ N M delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N; ERROR HY000: The target table p2 of the DELETE is not updatable delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; -ERROR 42S22: Unknown column 'aaa' in 'field list' +ERROR 42S22: Unknown column 'aaa' in 'SELECT' drop table t1; CREATE TABLE t1 ( OBJECTID int(11) NOT NULL default '0', @@ -468,7 +468,7 @@ t1.id=t3.val set t1.val=t3.val ; -ERROR 42S22: Unknown column 'v.val' in 'field list' +ERROR 42S22: Unknown column 'v.val' in 'SELECT' drop table t1, t2; # # MDEV-5353: server crash on subselect if WHERE applied to some @@ -1337,7 +1337,7 @@ DROP TABLE t1; SELECT 1 FROM ( SELECT 1 UNION SELECT 2 ORDER BY (SELECT 1 FROM DUAL WHERE xxx = 0) ) dt; -ERROR 42S22: Unknown column 'xxx' in 'where clause' +ERROR 42S22: Unknown column 'xxx' in 'WHERE' create table t1 (a int, b int); insert into t1 values (3,8), (7,2), (1,4), (5,9); create table t2 (a int, b int); @@ -1351,7 +1351,7 @@ union select a,b from t2 where t2.b < 6 order by (a - b / (select a + max(c) from t3 where d = x)) ) dt; -ERROR 42S22: Unknown column 'x' in 'where clause' +ERROR 42S22: Unknown column 'x' in 'WHERE' drop table t1,t2,t3; # # End of 10.3 tests diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index be62fe77fab60..d8dd6b0fd9cda 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -21588,6 +21588,33 @@ EXPLAIN } } drop table t1, t2; +# +# MDEV-35276: Assertion failure in find_producing_item upon a query +# from a view +# +# Note: for all followng queries with DEFAULT(f) hishdown is +# prohibited +CREATE VIEW v AS select 0 AS f; +SELECT * FROM v WHERE f = DEFAULT(f); +f +0 +CREATE TABLE t1 (c int DEFAULT 0); +insert into t1 values (0), (1); +SELECT * FROM v,t1 WHERE f = DEFAULT(c); +f c +0 0 +0 1 +ALTER TABLE t1 ALTER c SET DEFAULT 1; +SELECT * FROM v,t1 WHERE f = DEFAULT(c); +f c +drop table t1; +create table t1 (a int, c int DEFAULT a); +insert into t1 values (0, -1), (1, -2); +SELECT * FROM v,t1 WHERE f = DEFAULT(c); +f a c +0 0 -1 +DROP VIEW v; +DROP TABLE t1; # End of 10.5 tests # # MDEV-28958: condition pushable into view after simplification diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index dd4922bc93790..417faac0dc292 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -4189,6 +4189,36 @@ execute stmt; drop table t1, t2; +--echo # +--echo # MDEV-35276: Assertion failure in find_producing_item upon a query +--echo # from a view +--echo # +--echo # Note: for all followng queries with DEFAULT(f) hishdown is +--echo # prohibited + +CREATE VIEW v AS select 0 AS f; + +SELECT * FROM v WHERE f = DEFAULT(f); + +CREATE TABLE t1 (c int DEFAULT 0); +insert into t1 values (0), (1); + +SELECT * FROM v,t1 WHERE f = DEFAULT(c); + +ALTER TABLE t1 ALTER c SET DEFAULT 1; + +SELECT * FROM v,t1 WHERE f = DEFAULT(c); + +drop table t1; +create table t1 (a int, c int DEFAULT a); +insert into t1 values (0, -1), (1, -2); + +SELECT * FROM v,t1 WHERE f = DEFAULT(c); + +DROP VIEW v; +DROP TABLE t1; + + --echo # End of 10.5 tests --echo # diff --git a/mysql-test/main/dyncol.result b/mysql-test/main/dyncol.result index d0a34a10ab04b..562e0ef835b41 100644 --- a/mysql-test/main/dyncol.result +++ b/mysql-test/main/dyncol.result @@ -1621,7 +1621,7 @@ ex # as a dynamic column name # select COLUMN_CREATE(color, "black"); -ERROR 42S22: Unknown column 'color' in 'field list' +ERROR 42S22: Unknown column 'color' in 'SELECT' # # MDEV-489 Assertion `offset < 0x1f' failed in # type_and_offset_store on COLUMN_ADD diff --git a/mysql-test/main/enforce_storage_engine.result b/mysql-test/main/enforce_storage_engine.result index cc91daa73b9cf..37f22cf4331bb 100644 --- a/mysql-test/main/enforce_storage_engine.result +++ b/mysql-test/main/enforce_storage_engine.result @@ -45,7 +45,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci INSERT INTO t1 values (1,'abba'); CREATE TABLE t2 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory; -ERROR 42000: Unknown storage engine 'MEMORY' +ERROR HY000: The MariaDB server is running with the NO_ENGINE_SUBSTITUTION option so it cannot execute this statement SET SESSION sql_mode=''; SET SESSION enforce_storage_engine=MyISAM; select @@session.enforce_storage_engine; diff --git a/mysql-test/main/enforce_storage_engine.test b/mysql-test/main/enforce_storage_engine.test index 7768ed1bf46d3..55bba15a34330 100644 --- a/mysql-test/main/enforce_storage_engine.test +++ b/mysql-test/main/enforce_storage_engine.test @@ -26,7 +26,7 @@ CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISA SHOW CREATE TABLE t1; INSERT INTO t1 values (1,'abba'); ---error 1286 +--error ER_OPTION_PREVENTS_STATEMENT CREATE TABLE t2 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory; SET SESSION sql_mode=''; diff --git a/mysql-test/main/enforce_storage_engine_opt.result b/mysql-test/main/enforce_storage_engine_opt.result index 5f709427457b1..ba18a1bf16987 100644 --- a/mysql-test/main/enforce_storage_engine_opt.result +++ b/mysql-test/main/enforce_storage_engine_opt.result @@ -11,5 +11,5 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci set session sql_mode='no_engine_substitution'; create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; -ERROR 42000: Unknown storage engine 'MEMORY' +ERROR HY000: The MariaDB server is running with the NO_ENGINE_SUBSTITUTION option so it cannot execute this statement drop table t1; diff --git a/mysql-test/main/enforce_storage_engine_opt.test b/mysql-test/main/enforce_storage_engine_opt.test index 7ca7f94d3dccb..90c4a44a4521f 100644 --- a/mysql-test/main/enforce_storage_engine_opt.test +++ b/mysql-test/main/enforce_storage_engine_opt.test @@ -2,6 +2,6 @@ SET SQL_MODE=""; create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; show create table t1; set session sql_mode='no_engine_substitution'; ---error 1286 +--error ER_OPTION_PREVENTS_STATEMENT create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; drop table t1; diff --git a/mysql-test/main/errors.result b/mysql-test/main/errors.result index baa2e0ad3c0a8..3f5827c16ed4d 100644 --- a/mysql-test/main/errors.result +++ b/mysql-test/main/errors.result @@ -7,21 +7,21 @@ update t1 set a=1; ERROR 42S02: Table 'test.t1' doesn't exist create table t1 (a int); select count(test.t1.b) from t1; -ERROR 42S22: Unknown column 'test.t1.b' in 'field list' +ERROR 42S22: Unknown column 'test.t1.b' in 'SELECT' select count(not_existing_database.t1) from t1; -ERROR 42S22: Unknown column 'not_existing_database.t1' in 'field list' +ERROR 42S22: Unknown column 'not_existing_database.t1' in 'SELECT' select count(not_existing_database.t1.a) from t1; -ERROR 42S22: Unknown column 'not_existing_database.t1.a' in 'field list' +ERROR 42S22: Unknown column 'not_existing_database.t1.a' in 'SELECT' select count(not_existing_database.t1.a) from not_existing_database.t1; Got one of the listed errors select 1 from t1 order by 2; -ERROR 42S22: Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'ORDER BY' select 1 from t1 group by 2; -ERROR 42S22: Unknown column '2' in 'group statement' +ERROR 42S22: Unknown column '2' in 'GROUP BY' select 1 from t1 order by t1.b; -ERROR 42S22: Unknown column 't1.b' in 'order clause' +ERROR 42S22: Unknown column 't1.b' in 'ORDER BY' select count(*),b from t1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' drop table t1; create table t1 (a int(256)); ERROR 42000: Display width out of range for 'a' (max = 255) @@ -45,17 +45,17 @@ Warning 1365 Division by 0 DROP TABLE t1; CREATE TABLE t1( a INT ); SELECT b FROM t1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' SHOW ERRORS; Level Code Message -Error 1054 Unknown column 'b' in 'field list' +Error 1054 Unknown column 'b' in 'SELECT' CREATE TABLE t2 SELECT b FROM t1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' SHOW ERRORS; Level Code Message -Error 1054 Unknown column 'b' in 'field list' +Error 1054 Unknown column 'b' in 'SELECT' INSERT INTO t1 SELECT b FROM t1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' DROP TABLE t1; flush status; drop table if exists t1, t2; diff --git a/mysql-test/main/explain.result b/mysql-test/main/explain.result index 75d46110c3516..ab69ea174ba34 100644 --- a/mysql-test/main/explain.result +++ b/mysql-test/main/explain.result @@ -205,7 +205,7 @@ INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet)); EXPLAIN SELECT DISTINCT 1 FROM t1, (SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) as d1 WHERE t1.a = d1.a; -ERROR 42S22: Unknown column 'd1.a' in 'where clause' +ERROR 42S22: Unknown column 'd1.a' in 'WHERE' DROP TABLE t1; # # Bug#48295: diff --git a/mysql-test/main/failed_auth_unixsocket.result b/mysql-test/main/failed_auth_unixsocket.result index 7e8b8fe70b907..084eb2fab64c5 100644 --- a/mysql-test/main/failed_auth_unixsocket.result +++ b/mysql-test/main/failed_auth_unixsocket.result @@ -8,3 +8,11 @@ ERROR 28000: Access denied for user 'USER'@'localhost' replace mysql.global_priv select * from global_priv_backup; flush privileges; drop table global_priv_backup; +# +# MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +# +CREATE USER foo; +GRANT EXECUTE ON * TO foo IDENTIFIED WITH unix_socket AS PASSWORD('bar'); +ERROR HY000: SET PASSWORD is not applicable for users authenticating via unix_socket plugin +DROP USER foo; +# End of 10.5 tests diff --git a/mysql-test/main/failed_auth_unixsocket.test b/mysql-test/main/failed_auth_unixsocket.test index fe80d947036c6..5a77e1cdbda16 100644 --- a/mysql-test/main/failed_auth_unixsocket.test +++ b/mysql-test/main/failed_auth_unixsocket.test @@ -27,3 +27,17 @@ change_user $USER; replace mysql.global_priv select * from global_priv_backup; flush privileges; drop table global_priv_backup; + + +--echo # +--echo # MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +--echo # + +CREATE USER foo; +--error ER_SET_PASSWORD_AUTH_PLUGIN +GRANT EXECUTE ON * TO foo IDENTIFIED WITH unix_socket AS PASSWORD('bar'); + +# Cleanup +DROP USER foo; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/fulltext_order_by.result b/mysql-test/main/fulltext_order_by.result index 35ae8789c7d92..e3476bd2f5ec3 100644 --- a/mysql-test/main/fulltext_order_by.result +++ b/mysql-test/main/fulltext_order_by.result @@ -126,7 +126,7 @@ group by a.text, b.id, b.betreff order by match(b.betreff) against ('+abc' in boolean mode) desc; -ERROR 42000: Table 'b' from one of the SELECTs cannot be used in order clause +ERROR 42000: Table 'b' from one of the SELECTs cannot be used in ORDER BY select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join @@ -142,7 +142,7 @@ where match(c.beitrag) against ('+abc' in boolean mode) order by match(b.betreff) against ('+abc' in boolean mode) desc; -ERROR 42000: Table 'b' from one of the SELECTs cannot be used in order clause +ERROR 42000: Table 'b' from one of the SELECTs cannot be used in ORDER BY select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join diff --git a/mysql-test/main/func_gconcat.result b/mysql-test/main/func_gconcat.result index 6226f95df2323..d725029a5335a 100644 --- a/mysql-test/main/func_gconcat.result +++ b/mysql-test/main/func_gconcat.result @@ -160,7 +160,7 @@ set group_concat_max_len = 1024; select group_concat(sum(c)) from t1 group by grp; ERROR HY000: Invalid use of group function select grp,group_concat(c order by 2) from t1 group by grp; -ERROR 42S22: Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'ORDER BY' drop table t1; create table t1 ( URL_ID int(11), URL varchar(80)); create table t2 ( REQ_ID int(11), URL_ID int(11)); diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result index 5422cae4ee786..665acfb445c13 100644 --- a/mysql-test/main/func_math.result +++ b/mysql-test/main/func_math.result @@ -154,7 +154,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` select rand(rand); -ERROR 42S22: Unknown column 'rand' in 'field list' +ERROR 42S22: Unknown column 'rand' in 'SELECT' create table t1 (col1 int, col2 decimal(60,30)); insert into t1 values(1,1234567890.12345); select format(col2,7) from t1; diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result index 48eab8e07341d..32f4feb030437 100644 --- a/mysql-test/main/get_diagnostics.result +++ b/mysql-test/main/get_diagnostics.result @@ -134,7 +134,7 @@ DROP PROCEDURE p1; GET DIAGNOSTICS CONDITION; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 GET DIAGNOSTICS CONDITION a; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'GET DIAGNOSTICS' GET DIAGNOSTICS CONDITION 1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 GET DIAGNOSTICS CONDITION 1 @var; @@ -213,9 +213,9 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp GET DIAGNOSTICS CONDITION (1) @var = CLASS_ORIGIN; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(1) @var = CLASS_ORIGIN' at line 1 GET DIAGNOSTICS CONDITION p1() @var = CLASS_ORIGIN; -ERROR 42S22: Unknown column 'p1' in 'field list' +ERROR 42S22: Unknown column 'p1' in 'GET DIAGNOSTICS' GET DIAGNOSTICS CONDITION ABS(2) @var = CLASS_ORIGIN; -ERROR 42S22: Unknown column 'ABS' in 'field list' +ERROR 42S22: Unknown column 'ABS' in 'GET DIAGNOSTICS' GET DIAGNOSTICS CONDITION 1.1 @var = CLASS_ORIGIN; GET DIAGNOSTICS CONDITION "1" @var = CLASS_ORIGIN; SELECT COUNT(max_questions) INTO @var FROM mysql.user; @@ -227,7 +227,7 @@ Warnings: Error 1758 Invalid condition number Error 1758 Invalid condition number GET DIAGNOSTICS CONDITION a @var = CLASS_ORIGIN; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'GET DIAGNOSTICS' SELECT COUNT(max_questions) INTO @var FROM mysql.user; SET @cond = 1; GET DIAGNOSTICS CONDITION @cond @var1 = CLASS_ORIGIN; @@ -1502,13 +1502,13 @@ SELECT @var119; @var119 0 INSERT INTO t1 VALUES (1) RETURNING id2; -ERROR 42S22: Unknown column 'id2' in 'field list' +ERROR 42S22: Unknown column 'id2' in 'RETURNING' GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER; SELECT @var120; @var120 0 INSERT INTO t1(id2) VALUES(1); -ERROR 42S22: Unknown column 'id2' in 'field list' +ERROR 42S22: Unknown column 'id2' in 'INSERT INTO' GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER; SELECT @var121; @var121 @@ -1544,13 +1544,13 @@ SELECT @var125; @var125 0 REPLACE INTO t1 VALUES (1) RETURNING id2; -ERROR 42S22: Unknown column 'id2' in 'field list' +ERROR 42S22: Unknown column 'id2' in 'RETURNING' GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER; SELECT @var126; @var126 0 REPLACE INTO t1(id2) VALUES(1); -ERROR 42S22: Unknown column 'id2' in 'field list' +ERROR 42S22: Unknown column 'id2' in 'INSERT INTO' GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER; SELECT @var127; @var127 diff --git a/mysql-test/main/gis.result b/mysql-test/main/gis.result index 8097c7a8ba809..be1a6dd18a2f2 100644 --- a/mysql-test/main/gis.result +++ b/mysql-test/main/gis.result @@ -5435,5 +5435,22 @@ AsText(g) POINT(1 1) DROP TABLE t1; # -# End of 10.5 tests +# MDEV-16699 heap-use-after-free in group_concat with compressed or GIS columns # +create table t1 (c polygon); +insert into t1 values +(PolygonFromText('POLYGON((1 2,1 2))')), +(PolygonFromText('POLYGON((0 0,1 1,0 0))')); +select length(group_concat(c, c order by 1,2)) from t1; +length(group_concat(c, c order by 1,2)) +229 +create table t2 as select group_concat(c, c order by 1,2), concat(c), c from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `group_concat(c, c order by 1,2)` mediumblob DEFAULT NULL, + `concat(c)` longblob DEFAULT NULL, + `c` polygon DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +drop table t1, t2; +# End of 10.5 tests diff --git a/mysql-test/main/gis.test b/mysql-test/main/gis.test index db03da3dbede1..a908c3c6dda39 100644 --- a/mysql-test/main/gis.test +++ b/mysql-test/main/gis.test @@ -3445,5 +3445,15 @@ SELECT AsText(g) FROM t1; DROP TABLE t1; --echo # ---echo # End of 10.5 tests +--echo # MDEV-16699 heap-use-after-free in group_concat with compressed or GIS columns --echo # +create table t1 (c polygon); +insert into t1 values + (PolygonFromText('POLYGON((1 2,1 2))')), + (PolygonFromText('POLYGON((0 0,1 1,0 0))')); +select length(group_concat(c, c order by 1,2)) from t1; +create table t2 as select group_concat(c, c order by 1,2), concat(c), c from t1; +show create table t2; +drop table t1, t2; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result index 76a5f5375e905..5aeedb8940933 100644 --- a/mysql-test/main/grant5.result +++ b/mysql-test/main/grant5.result @@ -38,6 +38,7 @@ connection default; disconnect u1; drop user u1@localhost; drop database mysqltest1; +use test; # # MDEV-22313: Neither SHOW CREATE USER nor SHOW GRANTS prints a user's default role # @@ -173,7 +174,7 @@ drop user 'O\'Brien'@'localhost'; # CREATE USER 'test-user'; CREATE ROLE `r``o'l"e`; -select user from mysql.user where is_role='Y'; +select user as User from mysql.user where is_role='Y'; User r`o'l"e GRANT `r``o'l"e` TO 'test-user'; @@ -345,7 +346,7 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number set password for u7@h = old_password('pwd'); create user u8@h identified with 'mysql_old_password'; set password for u8@h = '78a302dd267f6044'; -select user,host,plugin,authentication_string from mysql.user where host='h'; +select user as User,host as Host,plugin,authentication_string from mysql.user where host='h'; User Host plugin authentication_string u1 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD u2 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD @@ -391,7 +392,7 @@ grant select on *.* to u5@h; grant select on *.* to u6@h; grant select on *.* to u7@h; grant select on *.* to u8@h; -select user,select_priv,plugin,authentication_string from mysql.user where user like 'u_'; +select user as User,select_priv as Select_priv,plugin,authentication_string from mysql.user where user like 'u_'; User Select_priv plugin authentication_string u1 Y mysql_native_password bad u2 Y mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD @@ -460,6 +461,14 @@ create table mysql.host (host char(60) binary default '' not null, db char(64) b insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','N'); flush privileges; drop table mysql.host; -# # End of 10.4 tests # +# MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +# +CREATE USER foo@localhost; +GRANT FILE ON *.* TO foo@localhost IDENTIFIED VIA not_installed_plugin; +ERROR HY000: Plugin 'not_installed_plugin' is not loaded +DROP USER foo@localhost; +CREATE USER foo@localhost IDENTIFIED VIA not_installed_plugin; +ERROR HY000: Plugin 'not_installed_plugin' is not loaded +# End of 10.5 tests diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test index 49e0ab1abf16c..a33cecbfc6dc7 100644 --- a/mysql-test/main/grant5.test +++ b/mysql-test/main/grant5.test @@ -50,6 +50,7 @@ connection default; disconnect u1; drop user u1@localhost; drop database mysqltest1; +use test; --echo # --echo # MDEV-22313: Neither SHOW CREATE USER nor SHOW GRANTS prints a user's default role @@ -130,7 +131,7 @@ drop user 'O\'Brien'@'localhost'; CREATE USER 'test-user'; CREATE ROLE `r``o'l"e`; -select user from mysql.user where is_role='Y'; +select user as User from mysql.user where is_role='Y'; GRANT `r``o'l"e` TO 'test-user'; SET DEFAULT ROLE `r``o'l"e` FOR 'test-user'; # it is expected that quotes won't be shown correctly @@ -309,7 +310,7 @@ set password for u7@h = old_password('pwd'); create user u8@h identified with 'mysql_old_password'; eval set password for u8@h = '$p'; sorted_result; -select user,host,plugin,authentication_string from mysql.user where host='h'; +select user as User,host as Host,plugin,authentication_string from mysql.user where host='h'; # test with invalid entries update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'bad') where user='u1'; update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'bad') where user='u5'; @@ -331,7 +332,7 @@ grant select on *.* to u5@h; grant select on *.* to u6@h; grant select on *.* to u7@h; grant select on *.* to u8@h; -select user,select_priv,plugin,authentication_string from mysql.user where user like 'u_'; +select user as User,select_priv as Select_priv,plugin,authentication_string from mysql.user where user like 'u_'; # but they still can be dropped drop user u1@h, u2@h, u3@h, u4@h, u5@h, u6@h, u7@h, u8@h; @@ -418,6 +419,20 @@ insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y',' flush privileges; drop table mysql.host; ---echo # --echo # End of 10.4 tests + --echo # +--echo # MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +--echo # + +CREATE USER foo@localhost; +--error ER_PLUGIN_IS_NOT_LOADED +GRANT FILE ON *.* TO foo@localhost IDENTIFIED VIA not_installed_plugin; + +# Cleanup +DROP USER foo@localhost; + +--error ER_PLUGIN_IS_NOT_LOADED +CREATE USER foo@localhost IDENTIFIED VIA not_installed_plugin; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/grant_plugin.result b/mysql-test/main/grant_plugin.result new file mode 100644 index 0000000000000..bf5b42b28b6a4 --- /dev/null +++ b/mysql-test/main/grant_plugin.result @@ -0,0 +1,17 @@ +# +# MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +# +install soname 'auth_0x0100'; +CREATE USER foo@localhost IDENTIFIED VIA auth_0x0100; +uninstall plugin auth_0x0100; +select Priv from mysql.global_priv where User = "foo" and host="localhost" +into @priv; +Warnings: +Warning 1287 ' INTO FROM...' instead +SET PASSWORD FOR foo@localhost = "1111"; +ERROR HY000: Plugin 'auth_0x0100' is not loaded +select Priv = @priv as "Nothing changed" from mysql.global_priv where User = "foo" and host="localhost"; +Nothing changed +1 +DROP USER foo@localhost; +# End of 10.5 tests diff --git a/mysql-test/main/grant_plugin.test b/mysql-test/main/grant_plugin.test new file mode 100644 index 0000000000000..92d76040c0bba --- /dev/null +++ b/mysql-test/main/grant_plugin.test @@ -0,0 +1,26 @@ + +--source include/not_embedded.inc + +if (!$AUTH_0X0100_SO) { + skip No auth_0x0100 plugin; +} + +--echo # +--echo # MDEV-18151: Skipped error returning for GRANT/SET PASSWORD +--echo # + +install soname 'auth_0x0100'; +CREATE USER foo@localhost IDENTIFIED VIA auth_0x0100; +uninstall plugin auth_0x0100; + +--disable_ps_protocol +select Priv from mysql.global_priv where User = "foo" and host="localhost" +into @priv; +--enable_ps_protocol +--error ER_PLUGIN_IS_NOT_LOADED +SET PASSWORD FOR foo@localhost = "1111"; +select Priv = @priv as "Nothing changed" from mysql.global_priv where User = "foo" and host="localhost"; + +DROP USER foo@localhost; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result index b7bbab6dd47af..0a012e203a14b 100644 --- a/mysql-test/main/group_by.result +++ b/mysql-test/main/group_by.result @@ -790,7 +790,7 @@ SELECT n+1 AS n FROM t1 GROUP BY n; n 2 Warnings: -Warning 1052 Column 'n' in group statement is ambiguous +Warning 1052 Column 'n' in GROUP BY is ambiguous DROP TABLE t1; create table t1(f1 varchar(5) key); insert into t1 values (1),(2); @@ -877,10 +877,10 @@ c2 aaa aaa Warnings: -Warning 1052 Column 'c2' in group statement is ambiguous +Warning 1052 Column 'c2' in GROUP BY is ambiguous show warnings; Level Code Message -Warning 1052 Column 'c2' in group statement is ambiguous +Warning 1052 Column 'c2' in GROUP BY is ambiguous select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by t1.c1; c2 @@ -1028,7 +1028,7 @@ FROM t1 AS t1_outer GROUP BY t1_outer.b; ERROR 42000: 'test.t1_outer.a' isn't in GROUP BY SELECT 1 FROM t1 as t1_outer GROUP BY a HAVING (SELECT t1_outer.b FROM t1 AS t1_inner LIMIT 1); -ERROR 42S22: Unknown column 'test.t1_outer.b' in 'field list' +ERROR 42S22: Unknown column 'test.t1_outer.b' in 'SELECT' SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner LIMIT 1) FROM t1 AS t1_outer GROUP BY t1_outer.b; (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner LIMIT 1) @@ -1070,7 +1070,7 @@ SELECT 1 FROM t1 GROUP BY b HAVING ROW (b,b) = ROW (1,1); 1 1 SELECT 1 FROM t1 GROUP BY b HAVING a = 2; -ERROR 42S22: Unknown column 'a' in 'having clause' +ERROR 42S22: Unknown column 'a' in 'HAVING' SELECT 1 FROM t1 GROUP BY SUM(b); ERROR HY000: Invalid use of group function SELECT b FROM t1 AS t1_outer GROUP BY a HAVING t1_outer.a IN @@ -2559,7 +2559,7 @@ DROP TABLE t1,t2; # MDEV-5104 crash in Item_field::used_tables with broken order by # (select 1 order by x(y)) order by 1; -ERROR 42S22: Unknown column 'y' in 'order clause' +ERROR 42S22: Unknown column 'y' in 'ORDER BY' # End of 5.3 tests # # Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00 @@ -2987,3 +2987,15 @@ drop table t20, t21, t22; # # End of 10.3 tests # +# +# MDEV-29351 SIGSEGV when doing forward reference of item in select list +# +CREATE TABLE t1 (a INT); +UPDATE t1 SET c=1 ORDER BY (SELECT c); +ERROR 42S22: Reference 'c' not supported (forward reference in item list) +UPDATE t1 SET c=1 ORDER BY (SELECT c); +ERROR 42S22: Reference 'c' not supported (forward reference in item list) +DROP TABLE t1; +# +# End of 10.5 tests +# diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test index 6c2b99c90becb..eaa0d060fe9d9 100644 --- a/mysql-test/main/group_by.test +++ b/mysql-test/main/group_by.test @@ -2140,3 +2140,18 @@ drop table t20, t21, t22; --echo # --echo # End of 10.3 tests --echo # + +--echo # +--echo # MDEV-29351 SIGSEGV when doing forward reference of item in select list +--echo # + +CREATE TABLE t1 (a INT); +--error ER_ILLEGAL_REFERENCE +UPDATE t1 SET c=1 ORDER BY (SELECT c); +--error ER_ILLEGAL_REFERENCE +UPDATE t1 SET c=1 ORDER BY (SELECT c); +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # diff --git a/mysql-test/main/having.result b/mysql-test/main/having.result index 3e69b3bf2c888..f1f3190a08e32 100644 --- a/mysql-test/main/having.result +++ b/mysql-test/main/having.result @@ -200,7 +200,7 @@ select count(*) from t1 group by col2 having col2 = 'hello'; count(*) 3 select count(*) from t1 group by col2 having col1 = 10; -ERROR 42S22: Unknown column 'col1' in 'having clause' +ERROR 42S22: Unknown column 'col1' in 'HAVING' select col1 as count_col1 from t1 as tmp1 group by col1 having col1 = 10; count_col1 10 @@ -241,7 +241,7 @@ select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 =10 co2 cc 40 4 select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10; -ERROR 42S22: Unknown column 't1.col1' in 'having clause' +ERROR 42S22: Unknown column 't1.col1' in 'HAVING' select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 @@ -279,7 +279,7 @@ select t1.col1 as tmp_col from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having tmp_col <= 10); -ERROR 42S22: Unknown column 'tmp_col' in 'having clause' +ERROR 42S22: Unknown column 'tmp_col' in 'HAVING' select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 @@ -301,7 +301,7 @@ where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) having col_t1 <= 20; -ERROR 42S22: Unknown column 'col_t1' in 'having clause' +ERROR 42S22: Unknown column 'col_t1' in 'HAVING' select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 @@ -322,7 +322,7 @@ select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 group by t2.col2, t2.col1 having t2.col1 = t1.col1); -ERROR 42S22: Unknown column 't1.col1' in 'having clause' +ERROR 42S22: Unknown column 't1.col1' in 'HAVING' select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 @@ -333,10 +333,10 @@ sum(col1) 30 select t1.col1, t2.col1 from t1, t2 where t1.col1 = t2.col1 group by t1.col1, t2.col1 having col1 = 2; -ERROR 23000: Column 'col1' in having clause is ambiguous +ERROR 23000: Column 'col1' in HAVING is ambiguous select t1.col1*10+t2.col1 from t1,t2 where t1.col1=t2.col1 group by t1.col1, t2.col1 having col1 = 2; -ERROR 23000: Column 'col1' in having clause is ambiguous +ERROR 23000: Column 'col1' in HAVING is ambiguous drop table t1, t2, t3; create table t1 (s1 int); insert into t1 values (1),(2),(3); @@ -348,8 +348,8 @@ s1 0 0 Warnings: -Warning 1052 Column 's1' in group statement is ambiguous -Warning 1052 Column 's1' in having clause is ambiguous +Warning 1052 Column 's1' in GROUP BY is ambiguous +Warning 1052 Column 's1' in HAVING is ambiguous select s1*0 from t1 group by s1 having s1 = 0; s1*0 select s1 from t1 group by 1 having 1 = 0; @@ -362,7 +362,7 @@ count(s1) 1 1 select * from t1 a, t1 b group by a.s1 having s1 is null; -ERROR 23000: Column 's1' in having clause is ambiguous +ERROR 23000: Column 's1' in HAVING is ambiguous drop table t1; create table t1 (s1 char character set latin1 collate latin1_german1_ci); insert ignore into t1 values ('ü'),('y'); diff --git a/mysql-test/main/host_cache_size_functionality.result b/mysql-test/main/host_cache_size_functionality.result index f5d7e7ee109b3..844339acea7bf 100644 --- a/mysql-test/main/host_cache_size_functionality.result +++ b/mysql-test/main/host_cache_size_functionality.result @@ -68,6 +68,6 @@ COUNT(@@GLOBAL.Host_Cache_Size) 1 1 Expected SELECT Host_Cache_Size = @@SESSION.Host_Cache_Size; -ERROR 42S22: Unknown column 'Host_Cache_Size' in 'field list' +ERROR 42S22: Unknown column 'Host_Cache_Size' in 'SELECT' Expected error 'Unknown column Host_Cache_Size in field list' SET @@GLOBAL.Host_Cache_Size=DEFAULT; diff --git a/mysql-test/main/insert.result b/mysql-test/main/insert.result index 586dbbff1533c..f1eb9801e2a5d 100644 --- a/mysql-test/main/insert.result +++ b/mysql-test/main/insert.result @@ -766,14 +766,14 @@ create table t3 (c int); create table t4 (d1 int, d2 int); insert into t4 select * from t1 left join t2 on (select t1.i from t3); -ERROR 42S22: Unknown column 't1.i' in 'field list' +ERROR 42S22: Unknown column 't1.i' in 'SELECT' replace t4 select * from t1 left join t2 on (select t1.i from t3); -ERROR 42S22: Unknown column 't1.i' in 'field list' +ERROR 42S22: Unknown column 't1.i' in 'SELECT' drop table t1,t2,t3,t4; create table t (a int); select 1 in (select count(*) from t t1 join (t t2 join t t3 on (t1.a != 0))); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' drop table t; # # MDEV-28578 Server crashes in Item_field::fix_outer_field after CREATE SELECT @@ -781,7 +781,7 @@ drop table t; create table t1 (i int) ; create table t2 (j int) ; create table t4 select * from t1 join t2 on (select t3.i); -ERROR 42S22: Unknown column 't3.i' in 'field list' +ERROR 42S22: Unknown column 't3.i' in 'SELECT' drop table t1, t2; # # End of 10.4 tests diff --git a/mysql-test/main/insert_returning.result b/mysql-test/main/insert_returning.result index b2ed9c90e51ee..b35fd3bf35f20 100644 --- a/mysql-test/main/insert_returning.result +++ b/mysql-test/main/insert_returning.result @@ -482,7 +482,7 @@ INSERT INTO t1 VALUES(1,'a'),(2,'b'),(3,'c'); # SIMLPE INSERT STATEMENT # INSERT INTO t2(id2,val2) VALUES(1,'a') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' INSERT INTO t2(id2,val2) values(2,'b') RETURNING SUM(id2); ERROR HY000: Invalid use of group function INSERT INTO t2(id2,val2) VALUES(3,'c') RETURNING (SELECT id1 FROM t1); @@ -504,7 +504,7 @@ ERROR 42S02: Unknown table 'test.t1' # Multiple rows in single insert statement # INSERT INTO t2 VALUES(1,'a'),(2,'b') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' INSERT INTO t2 VALUES(3,'c'),(4,'d') RETURNING MAX(id2); ERROR HY000: Invalid use of group function INSERT INTO t2 VALUES(5,'c'),(6,'f') RETURNING (SELECT id1 FROM t1); @@ -527,7 +527,7 @@ ERROR 42S02: Unknown table 'test.t1' # INSERT ... SET # INSERT INTO t2 SET id2=1, val2='a' RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' INSERT INTO t2 SET id2=2, val2='b' RETURNING COUNT(id2); ERROR HY000: Invalid use of group function INSERT INTO t2 SET id2=3, val2='c' RETURNING (SELECT id1 FROM t1); @@ -550,7 +550,7 @@ ERROR 42S02: Unknown table 'test.t1' # INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b' RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b' RETURNING MAX(id); ERROR HY000: Invalid use of group function @@ -565,7 +565,7 @@ RETURNING (SELECT * FROM ins_duplicate); ERROR 21000: Operand should contain 1 column(s) INSERT INTO ins_duplicate VALUES(2,'b') ON DUPLICATE KEY UPDATE val='b' RETURNING id2, (SELECT id1+id FROM t1 WHERE id1=1); -ERROR 42S22: Unknown column 'id2' in 'field list' +ERROR 42S22: Unknown column 'id2' in 'RETURNING' INSERT INTO ins_duplicate VALUES(2,'b') ON DUPLICATE KEY UPDATE val='b' RETURNING (SELECT id FROM ins_duplicate); ERROR HY000: Table 'ins_duplicate' is specified twice, both as a target for 'INSERT' and as a separate source for data @@ -576,7 +576,7 @@ ERROR 42S02: Unknown table 'test.t1' # INSERT...SELECT # INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=1 RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING MAX(id2); ERROR HY000: Invalid use of group function INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING (SELECT diff --git a/mysql-test/main/insert_select.result b/mysql-test/main/insert_select.result index 463f571b096ab..eba5d4bbf9e8d 100644 --- a/mysql-test/main/insert_select.result +++ b/mysql-test/main/insert_select.result @@ -666,11 +666,11 @@ a 10 insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10; insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b; -ERROR 23000: Column 'a' in field list is ambiguous +ERROR 23000: Column 'a' in UPDATE is ambiguous insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b; -ERROR 42S22: Unknown column 't2.a' in 'field list' +ERROR 42S22: Unknown column 't2.a' in 'UPDATE' insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b; -ERROR 42S22: Unknown column 't2.b' in 'field list' +ERROR 42S22: Unknown column 't2.b' in 'UPDATE' drop table t1,t2,t3; create table t1(f1 varchar(5) key); insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; @@ -686,9 +686,9 @@ create table t1(x int, y int); create table t2(x int, z int); insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x); insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z); -ERROR 42S22: Unknown column 'z' in 'field list' +ERROR 42S22: Unknown column 'z' in 'UPDATE' insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x); -ERROR 42S22: Unknown column 't2.x' in 'field list' +ERROR 42S22: Unknown column 't2.x' in 'UPDATE' drop table t1,t2; CREATE TABLE t1 (a int PRIMARY KEY); INSERT INTO t1 values (1), (2); diff --git a/mysql-test/main/insert_update.result b/mysql-test/main/insert_update.result index 3cbc1944b5ef1..3549aba9446a7 100644 --- a/mysql-test/main/insert_update.result +++ b/mysql-test/main/insert_update.result @@ -158,7 +158,7 @@ a b c 5 0 30 8 9 60 INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in UPDATE is ambiguous INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a); SELECT *, VALUE(a) FROM t1; a b c VALUE(a) @@ -191,9 +191,9 @@ a 2 3 insert into t1 select a from t1 on duplicate key update a=a+1 ; -ERROR 23000: Column 'a' in field list is ambiguous +ERROR 23000: Column 'a' in UPDATE is ambiguous insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; -ERROR 23000: Column 't1.a' in field list is ambiguous +ERROR 23000: Column 't1.a' in UPDATE is ambiguous drop table t1; CREATE TABLE t1 ( a BIGINT(20) NOT NULL DEFAULT 0, @@ -225,7 +225,7 @@ a b DROP TABLE t1; CREATE TABLE t1 (i INT PRIMARY KEY, j INT); INSERT INTO t1 SELECT 1, j; -ERROR 42S22: Unknown column 'j' in 'field list' +ERROR 42S22: Unknown column 'j' in 'SELECT' DROP TABLE t1; CREATE TABLE t1 (i INT PRIMARY KEY, j INT); CREATE TABLE t2 (a INT, b INT); @@ -238,7 +238,7 @@ CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (1, 1); INSERT INTO t2 VALUES (1), (3); INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'UPDATE' DROP TABLE t1,t2; SET SQL_MODE = 'TRADITIONAL'; CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); diff --git a/mysql-test/main/invisible_field.result b/mysql-test/main/invisible_field.result index 7aa88e7787eb4..30f0564a34bc3 100644 --- a/mysql-test/main/invisible_field.result +++ b/mysql-test/main/invisible_field.result @@ -234,7 +234,7 @@ a d e f 1 d blob 3 1 1 d blob 41 1 select a,b,c,d,e,f from t2; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' drop table t2; #now this will copy invisible fields create table t2 as select a,b,c,d,e,f from t1; @@ -310,7 +310,7 @@ a d e f 1 d blob 41 1 #v does not have invisible column; select a,b,c,d,e,f from v; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' insert into v values(1,21,32,4); select * from v; a d e f @@ -321,7 +321,7 @@ a d e f 1 d blob 41 1 1 21 32 4 insert into v(a,b,c,d,e,f) values(1,12,3,4,5,6); -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'INSERT INTO' drop view v; create view v as select a,b,c,d,e,f from t1; desc v; diff --git a/mysql-test/main/invisible_field_debug.result b/mysql-test/main/invisible_field_debug.result index 344a0b860fc6b..882b7404ea868 100644 --- a/mysql-test/main/invisible_field_debug.result +++ b/mysql-test/main/invisible_field_debug.result @@ -16,16 +16,16 @@ select a , invisible from t1; a invisible 1 9 insert into t1(a, invisible) values(99,99); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'INSERT INTO' select default(invisible) from t1; -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SELECT' insert into t1(invisible) values(99); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'INSERT INTO' insert into t_tmp select a, invisible from t1; insert into t1 select * from t_tmp; ERROR 21S01: Column count doesn't match value count at row 1 insert into t1(a,invisible) select * from t_tmp; -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'INSERT INTO' select a , invisible from t1; a invisible 1 9 @@ -45,22 +45,22 @@ select a , invisible from t1; a invisible 109 9 update t1 set invisible = 23 where a=(select a from t1 limit 1); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SET' update t1 set invisible = 101 where a=(select a from t1 limit 1); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SET' update t1 set invisible = (select invisible+100 from t1 limit 1) where a=(select invisible from t1 limit 1); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SET' select a , invisible from t1; a invisible 109 9 set @a=12; update t1 set invisible = (select @a from dual) where a=(select a from t1 limit 1); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SET' select a , invisible from t1; a invisible 109 9 update t1 set invisible = (select invisible+100 from t1 limit 1) where a=(select a from t1 limit 1); -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SET' select a , invisible from t1; a invisible 109 9 @@ -100,7 +100,7 @@ select * from t1; a 1 select invisible ,a from t1; -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SELECT' set debug_dbug= "+d,test_completely_invisible"; select invisible ,a from t1; invisible a @@ -108,9 +108,9 @@ invisible a set debug_dbug=@old_debug; create table t2 (invisible int); select * from t1 join t2 using (invisible); -ERROR 42S22: Unknown column 'invisible' in 'from clause' +ERROR 42S22: Unknown column 'invisible' in 'FROM' select * from t2 join t1 using (invisible); -ERROR 42S22: Unknown column 'invisible' in 'from clause' +ERROR 42S22: Unknown column 'invisible' in 'FROM' insert t2 values (8),(9); select * from t1 natural join t2; a invisible diff --git a/mysql-test/main/invisible_field_grant_completely.result b/mysql-test/main/invisible_field_grant_completely.result index f0992baf7b14b..ac24aee2fb8ef 100644 --- a/mysql-test/main/invisible_field_grant_completely.result +++ b/mysql-test/main/invisible_field_grant_completely.result @@ -39,7 +39,7 @@ a 2 3 select invisible,a from t1; -ERROR 42S22: Unknown column 'invisible' in 'field list' +ERROR 42S22: Unknown column 'invisible' in 'SELECT' delete from t1 where a =1; update t1 set a=1 where a=3; select * from t1; diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result index d7e8a746a8c50..ecee13990d9c1 100644 --- a/mysql-test/main/join.result +++ b/mysql-test/main/join.result @@ -727,31 +727,31 @@ b c a c b y 1 10 2 3 1 2 1 3 2 3 1 2 select * from t1 natural join (t3 cross join t4); -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from (t3 cross join t4) natural join t1; -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from t1 join (t2, t3) using (b); -ERROR 23000: Column 'b' in from clause is ambiguous +ERROR 23000: Column 'b' in FROM is ambiguous select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6; -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6; -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from t6 natural join ((t1 natural join t2), (t3 natural join t4)); -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4); -ERROR 23000: Column 'b' in from clause is ambiguous +ERROR 23000: Column 'b' in FROM is ambiguous select * from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b); -ERROR 23000: Column 'b' in from clause is ambiguous +ERROR 23000: Column 'b' in FROM is ambiguous select * from (t3 join (t4 natural join t5) on (b < z)) natural join (t1 natural join t2); -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select * from (t1 natural join t2) natural join (t3 join (t4 natural join t5) on (b < z)); -ERROR 23000: Column 'c' in from clause is ambiguous +ERROR 23000: Column 'c' in FROM is ambiguous select t1.b from v1a; -ERROR 42S22: Unknown column 't1.b' in 'field list' +ERROR 42S22: Unknown column 't1.b' in 'SELECT' select * from v1a join v1b on t1.b = t2.b; -ERROR 42S22: Unknown column 't1.b' in 'on clause' +ERROR 42S22: Unknown column 't1.b' in 'ON' select statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT, columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT @@ -1519,12 +1519,12 @@ SET optimizer_switch=@save_optimizer_switch; CREATE TABLE t (i INT); CREATE PROCEDURE p() SELECT t1.f FROM t AS t1 JOIN t AS t2 USING (f); CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +ERROR 42S22: Unknown column 'f' in 'FROM' CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +ERROR 42S22: Unknown column 'f' in 'FROM' FLUSH TABLES; CALL p; -ERROR 42S22: Unknown column 'f' in 'from clause' +ERROR 42S22: Unknown column 'f' in 'FROM' DROP TABLE t; CREATE TABLE t (f INT); CALL p; @@ -1532,9 +1532,9 @@ f DROP TABLE t; CREATE TABLE t (i INT); CALL p; -ERROR 42S22: Unknown column 't1.f' in 'field list' +ERROR 42S22: Unknown column 't1.f' in 'SELECT' CALL p; -ERROR 42S22: Unknown column 't1.f' in 'field list' +ERROR 42S22: Unknown column 't1.f' in 'SELECT' DROP PROCEDURE p; DROP TABLE t; CREATE TABLE t1 (a INT, b INT); @@ -1545,9 +1545,9 @@ CREATE TABLE t5 (a INT, c INT); CREATE PROCEDURE p1() SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); CALL p1; -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous CALL p1; -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous DROP PROCEDURE p1; DROP TABLE t1,t2,t3,t4,t5; # @@ -3579,3 +3579,35 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE seq ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) drop table t1,t2; set @@optimizer_adjust_secondary_key_costs=default; +# +# MDEV-35180: ref_to_range rewrite causes poor query plan +# +create table t1 (a int); +insert into t1 select seq from seq_1_to_100; +create table t2 ( +kp1 int, +kp2 int, +filler char(100), +key(kp1, kp2) +); +insert into t2 +select +seq, seq, +'filler-data' +from seq_1_to_10000; +analyze table t1,t2; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +# For t2, this must use type=ref, key_len=5 (not type=range, key_len=10) +explain +select * +from t1, t2 +where +t2.kp1=t1.a and t2.kp1<=100 and t2.kp2<=20; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 ref kp1 kp1 5 test.t1.a 1 Using index condition +drop table t1,t2; diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test index 1920d954356ee..4106b07a16bfc 100644 --- a/mysql-test/main/join.test +++ b/mysql-test/main/join.test @@ -1986,3 +1986,32 @@ explain select count(*) from t1, t2 as seq where a=11 and b=seq.seq; drop table t1,t2; set @@optimizer_adjust_secondary_key_costs=default; + +--echo # +--echo # MDEV-35180: ref_to_range rewrite causes poor query plan +--echo # +create table t1 (a int); +insert into t1 select seq from seq_1_to_100; + +create table t2 ( + kp1 int, + kp2 int, + filler char(100), + key(kp1, kp2) +); +insert into t2 +select + seq, seq, + 'filler-data' +from seq_1_to_10000; + +analyze table t1,t2; + +--echo # For t2, this must use type=ref, key_len=5 (not type=range, key_len=10) +explain +select * +from t1, t2 +where + t2.kp1=t1.a and t2.kp1<=100 and t2.kp2<=20; + +drop table t1,t2; diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 6c67f32cce41b..c93446e610381 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6186,7 +6186,7 @@ explain format=json select * from t1 a, t3 b where -b.kp1=a.a and +b.kp1+1=a.a+1 and b.kp1 <= 10 and b.kp2 <= 10 and b.col1 +1 < 33333; @@ -6198,14 +6198,12 @@ EXPLAIN { "table": { "table_name": "a", - "access_type": "range", - "possible_keys": ["PRIMARY"], + "access_type": "index", "key": "PRIMARY", "key_length": "4", "used_key_parts": ["a"], "rows": 10, "filtered": 100, - "attached_condition": "a.a <= 10", "using_index": true } }, @@ -6219,14 +6217,14 @@ EXPLAIN "key_length": "10", "used_key_parts": ["kp1", "kp2"], "rows": 836, - "filtered": 76, - "index_condition": "b.kp2 <= 10", - "attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333" + "filtered": 100, + "index_condition": "b.kp1 <= 10 and b.kp2 <= 10", + "attached_condition": "b.kp1 <= 10 and b.kp2 <= 10 and b.col1 + 1 < 33333" }, "buffer_type": "flat", "buffer_size": "54", "join_type": "BNL", - "attached_condition": "b.kp1 = a.a" + "attached_condition": "b.kp1 + 1 = a.a + 1" } } ] diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index 9c005f24213d3..3d3efa7655fd4 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4169,7 +4169,7 @@ explain format=json select * from t1 a, t3 b where - b.kp1=a.a and + b.kp1+1=a.a+1 and b.kp1 <= 10 and b.kp2 <= 10 and b.col1 +1 < 33333; diff --git a/mysql-test/main/join_nested.result b/mysql-test/main/join_nested.result index fdfc5a2e7f52e..cb9dffc837daf 100644 --- a/mysql-test/main/join_nested.result +++ b/mysql-test/main/join_nested.result @@ -1401,19 +1401,19 @@ SELECT e FROM t5 NATURAL JOIN t6; SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); a SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 't1.x' in 'field list' +ERROR 42S22: Unknown column 't1.x' in 'SELECT' SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; a SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; -ERROR 42S22: Unknown column 't1.x' in 'field list' +ERROR 42S22: Unknown column 't1.x' in 'SELECT' SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); e SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 'v1.x' in 'field list' +ERROR 42S22: Unknown column 'v1.x' in 'SELECT' SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); e SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 'v2.x' in 'field list' +ERROR 42S22: Unknown column 'v2.x' in 'SELECT' DROP VIEW v1, v2; DROP TABLE t1, t2, t3, t4, t5, t6; create table t1 (id1 int(11) not null); @@ -1628,13 +1628,13 @@ LEFT JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous DROP TABLE t1,t2,t3,t4,t5; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT); @@ -1643,7 +1643,7 @@ INSERT INTO t1 VALUES (1,1); INSERT INTO t2 VALUES (1,1); INSERT INTO t3 VALUES (1,1); SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); -ERROR 23000: Column 'a' in from clause is ambiguous +ERROR 23000: Column 'a' in FROM is ambiguous DROP TABLE t1,t2,t3; CREATE TABLE t1 ( carrier char(2) default NULL, diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index 451accd7b1c9f..0bda8d43a6917 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -1410,19 +1410,19 @@ SELECT e FROM t5 NATURAL JOIN t6; SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); a SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 't1.x' in 'field list' +ERROR 42S22: Unknown column 't1.x' in 'SELECT' SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; a SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; -ERROR 42S22: Unknown column 't1.x' in 'field list' +ERROR 42S22: Unknown column 't1.x' in 'SELECT' SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); e SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 'v1.x' in 'field list' +ERROR 42S22: Unknown column 'v1.x' in 'SELECT' SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); e SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); -ERROR 42S22: Unknown column 'v2.x' in 'field list' +ERROR 42S22: Unknown column 'v2.x' in 'SELECT' DROP VIEW v1, v2; DROP TABLE t1, t2, t3, t4, t5, t6; create table t1 (id1 int(11) not null); @@ -1637,13 +1637,13 @@ LEFT JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); -ERROR 23000: Column 'c' in field list is ambiguous +ERROR 23000: Column 'c' in SELECT is ambiguous DROP TABLE t1,t2,t3,t4,t5; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT); @@ -1652,7 +1652,7 @@ INSERT INTO t1 VALUES (1,1); INSERT INTO t2 VALUES (1,1); INSERT INTO t3 VALUES (1,1); SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); -ERROR 23000: Column 'a' in from clause is ambiguous +ERROR 23000: Column 'a' in FROM is ambiguous DROP TABLE t1,t2,t3; CREATE TABLE t1 ( carrier char(2) default NULL, diff --git a/mysql-test/main/join_optimizer.result b/mysql-test/main/join_optimizer.result index ad7267ab6650b..238825ec46f91 100644 --- a/mysql-test/main/join_optimizer.result +++ b/mysql-test/main/join_optimizer.result @@ -35,3 +35,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE a ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using index condition drop table t0,t1,t2,t3; +# +# MDEV-35253: xa_prepare_unlock_unmodified fails: shift exponent 32 is too large +# +set @create= +concat("create table t1(", +(select group_concat(concat("col",seq, " int")) from seq_1_to_32), +",\n index idx1(", +(select group_concat(concat("col",seq)) from seq_1_to_32), +")\n)" + ); +$create_tbl; +insert into t1() values (),(),(); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +# Must not produce a "shift exponent 32 is too large" runtime ubsan error +explain select * from t1 where col1=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref idx1 idx1 5 const 1 Using index +drop table t1; +End of 10.5 tests diff --git a/mysql-test/main/join_optimizer.test b/mysql-test/main/join_optimizer.test index e5f6181944d78..1c55304a2b007 100644 --- a/mysql-test/main/join_optimizer.test +++ b/mysql-test/main/join_optimizer.test @@ -45,3 +45,27 @@ SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt) WHERE g.domain = 'queue' AND g.type = a.type; drop table t0,t1,t2,t3; + +--echo # +--echo # MDEV-35253: xa_prepare_unlock_unmodified fails: shift exponent 32 is too large +--echo # +--source include/have_sequence.inc +set @create= + concat("create table t1(", + (select group_concat(concat("col",seq, " int")) from seq_1_to_32), + ",\n index idx1(", + (select group_concat(concat("col",seq)) from seq_1_to_32), + ")\n)" + ); + +let $create_tbl=`select @create`; +evalp $create_tbl; +insert into t1() values (),(),(); +analyze table t1; + +--echo # Must not produce a "shift exponent 32 is too large" runtime ubsan error +explain select * from t1 where col1=1; + +drop table t1; + +--echo End of 10.5 tests diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result index 4bbc603e9a3d7..c673f31a0836f 100644 --- a/mysql-test/main/join_outer.result +++ b/mysql-test/main/join_outer.result @@ -110,11 +110,11 @@ grp a c id a c d a 3 6 D 3 6 C 6 6 NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.* from t1 inner join t2 using (a); grp a c id a c d 1 1 a 1 1 a 1 @@ -404,7 +404,7 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; -ERROR 42S22: Unknown column 't2.t2_id' in 'on clause' +ERROR 42S22: Unknown column 't2.t2_id' in 'ON' drop table t1,t2,t3,t4,t5; create table t1 (n int, m int, o int, key(n)); create table t2 (n int not null, m int, o int, primary key(n)); @@ -2703,7 +2703,7 @@ join t3 on (t3.f=t1.a) ) on (t2.c=t1.a ); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' explain select * from @@ -2713,7 +2713,7 @@ join t3 on (t3.f=(select max(g) from t4 where t4.h=t1.a)) ) on (t2.c=t1.a ); -ERROR 42S22: Unknown column 't1.a' in 'where clause' +ERROR 42S22: Unknown column 't1.a' in 'WHERE' drop table t1,t2,t3,t4; create table t1 (a int); insert into t1 values (1),(2); @@ -2724,7 +2724,7 @@ insert into t3 values (1),(2); select * from ( select * from t1 left join t2 on b in (select x from t3 as sq1) ) as sq2; -ERROR 42S22: Unknown column 'x' in 'field list' +ERROR 42S22: Unknown column 'x' in 'SELECT' drop table t1,t2,t3; # end of 10.2 tests # diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index c4e02cf0c6f35..270d9a5f10458 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -117,11 +117,11 @@ grp a c id a c d a 3 6 D 3 6 C 6 6 NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); -ERROR 42S22: Unknown column 't3.a' in 'on clause' +ERROR 42S22: Unknown column 't3.a' in 'ON' select t1.*,t2.* from t1 inner join t2 using (a); grp a c id a c d 1 1 a 1 1 a 1 @@ -411,7 +411,7 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; -ERROR 42S22: Unknown column 't2.t2_id' in 'on clause' +ERROR 42S22: Unknown column 't2.t2_id' in 'ON' drop table t1,t2,t3,t4,t5; create table t1 (n int, m int, o int, key(n)); create table t2 (n int not null, m int, o int, primary key(n)); @@ -2710,7 +2710,7 @@ join t3 on (t3.f=t1.a) ) on (t2.c=t1.a ); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' explain select * from @@ -2720,7 +2720,7 @@ join t3 on (t3.f=(select max(g) from t4 where t4.h=t1.a)) ) on (t2.c=t1.a ); -ERROR 42S22: Unknown column 't1.a' in 'where clause' +ERROR 42S22: Unknown column 't1.a' in 'WHERE' drop table t1,t2,t3,t4; create table t1 (a int); insert into t1 values (1),(2); @@ -2731,7 +2731,7 @@ insert into t3 values (1),(2); select * from ( select * from t1 left join t2 on b in (select x from t3 as sq1) ) as sq2; -ERROR 42S22: Unknown column 'x' in 'field list' +ERROR 42S22: Unknown column 'x' in 'SELECT' drop table t1,t2,t3; # end of 10.2 tests # diff --git a/mysql-test/main/keywords.result b/mysql-test/main/keywords.result index 4e246e3829964..8f4ba9bb03c3a 100644 --- a/mysql-test/main/keywords.result +++ b/mysql-test/main/keywords.result @@ -579,62 +579,62 @@ SELECT test.year(); -- FUNCTION test.year does not exist. Check SELECT test.create(); -- FUNCTION test.create does not exist. Che CALL p2('SELECT $(VAR) FROM t1'); -------- -SELECT non_keyword FROM t1; -- Unknown column 'non_keyword' in 'field l +SELECT non_keyword FROM t1; -- Unknown column 'non_keyword' in 'SELECT' -------- -SELECT lpad FROM t1; -- Unknown column 'lpad' in 'field list' +SELECT lpad FROM t1; -- Unknown column 'lpad' in 'SELECT' -------- -SELECT rpad FROM t1; -- Unknown column 'rpad' in 'field list' +SELECT rpad FROM t1; -- Unknown column 'rpad' in 'SELECT' -------- -SELECT adddate FROM t1; -- Unknown column 'adddate' in 'field list' +SELECT adddate FROM t1; -- Unknown column 'adddate' in 'SELECT' -------- -SELECT substr FROM t1; -- Unknown column 'substr' in 'field list' +SELECT substr FROM t1; -- Unknown column 'substr' in 'SELECT' -------- -SELECT substring FROM t1; -- Unknown column 'substring' in 'field lis +SELECT substring FROM t1; -- Unknown column 'substring' in 'SELECT' -------- -SELECT trim_oracle FROM t1; -- Unknown column 'trim_oracle' in 'field l +SELECT trim_oracle FROM t1; -- Unknown column 'trim_oracle' in 'SELECT' -------- -SELECT ascii FROM t1; -- Unknown column 'ascii' in 'field list' +SELECT ascii FROM t1; -- Unknown column 'ascii' in 'SELECT' -------- SELECT replace FROM t1; -- ..syntax.. near 'FROM t1' at line 1 -------- -SELECT weight_string FROM t1; -- Unknown column 'weight_string' in 'field +SELECT weight_string FROM t1; -- Unknown column 'weight_string' in 'SELEC -------- SELECT char FROM t1; -- ..syntax.. near 'FROM t1' at line 1 -------- -SELECT trim FROM t1; -- Unknown column 'trim' in 'field list' +SELECT trim FROM t1; -- Unknown column 'trim' in 'SELECT' -------- -SELECT year FROM t1; -- Unknown column 'year' in 'field list' +SELECT year FROM t1; -- Unknown column 'year' in 'SELECT' -------- SELECT create FROM t1; -- ..syntax.. near 'create FROM t1' at line CALL p2('SELECT t1.$(VAR) FROM t1'); -------- -SELECT t1.non_keyword FROM t1; -- Unknown column 't1.non_keyword' in 'fiel +SELECT t1.non_keyword FROM t1; -- Unknown column 't1.non_keyword' in 'SELE -------- -SELECT t1.lpad FROM t1; -- Unknown column 't1.lpad' in 'field list' +SELECT t1.lpad FROM t1; -- Unknown column 't1.lpad' in 'SELECT' -------- -SELECT t1.rpad FROM t1; -- Unknown column 't1.rpad' in 'field list' +SELECT t1.rpad FROM t1; -- Unknown column 't1.rpad' in 'SELECT' -------- -SELECT t1.adddate FROM t1; -- Unknown column 't1.adddate' in 'field li +SELECT t1.adddate FROM t1; -- Unknown column 't1.adddate' in 'SELECT' -------- -SELECT t1.substr FROM t1; -- Unknown column 't1.substr' in 'field lis +SELECT t1.substr FROM t1; -- Unknown column 't1.substr' in 'SELECT' -------- -SELECT t1.substring FROM t1; -- Unknown column 't1.substring' in 'field +SELECT t1.substring FROM t1; -- Unknown column 't1.substring' in 'SELECT -------- -SELECT t1.trim_oracle FROM t1; -- Unknown column 't1.trim_oracle' in 'fiel +SELECT t1.trim_oracle FROM t1; -- Unknown column 't1.trim_oracle' in 'SELE -------- -SELECT t1.ascii FROM t1; -- Unknown column 't1.ascii' in 'field list +SELECT t1.ascii FROM t1; -- Unknown column 't1.ascii' in 'SELECT' -------- -SELECT t1.replace FROM t1; -- Unknown column 't1.replace' in 'field li +SELECT t1.replace FROM t1; -- Unknown column 't1.replace' in 'SELECT' -------- -SELECT t1.weight_string FROM t1; -- Unknown column 't1.weight_string' in 'fi +SELECT t1.weight_string FROM t1; -- Unknown column 't1.weight_string' in 'SE -------- -SELECT t1.char FROM t1; -- Unknown column 't1.char' in 'field list' +SELECT t1.char FROM t1; -- Unknown column 't1.char' in 'SELECT' -------- -SELECT t1.trim FROM t1; -- Unknown column 't1.trim' in 'field list' +SELECT t1.trim FROM t1; -- Unknown column 't1.trim' in 'SELECT' -------- -SELECT t1.year FROM t1; -- Unknown column 't1.year' in 'field list' +SELECT t1.year FROM t1; -- Unknown column 't1.year' in 'SELECT' -------- -SELECT t1.create FROM t1; -- Unknown column 't1.create' in 'field lis +SELECT t1.create FROM t1; -- Unknown column 't1.create' in 'SELECT' CALL p2('DROP TABLE $(VAR)'); -------- DROP TABLE non_keyword; -- Unknown table 'test.non_keyword' diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result index 797052710e86c..0f14698ef3d60 100644 --- a/mysql-test/main/kill.result +++ b/mysql-test/main/kill.result @@ -184,4 +184,4 @@ DROP TABLE t1, t2; # KILL QUERY ID USER # kill query id user 'foo'; -ERROR 42S22: Unknown column 'user' in 'field list' +ERROR 42S22: Unknown column 'user' in 'KILL' diff --git a/mysql-test/main/loaddata.result b/mysql-test/main/loaddata.result index d00eb03450538..f54192bec034b 100644 --- a/mysql-test/main/loaddata.result +++ b/mysql-test/main/loaddata.result @@ -686,3 +686,40 @@ SELECT * FROM t1; id 1 DROP TABLE t1; +# +# MDEV-34883: LOAD DATA INFILE with geometry data fails +# +CREATE OR REPLACE TABLE t1 ( +p point NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)')); +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; +CREATE OR REPLACE TABLE t2 LIKE t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2; +drop table t1, t2; +CREATE OR REPLACE TABLE t1 ( +p point NOT NULL, +chr char(20) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'),"їєі"); +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; +CREATE OR REPLACE TABLE t2 LIKE t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET latin1; +select ST_AsText(p), chr from t1; +ST_AsText(p) chr +POINT(37.646944 -75.761111) їєі +# incorrect string (but correct geom) +select ST_AsText(p), chr from t2; +ST_AsText(p) chr +POINT(37.646944 -75.761111) їєі +delete from t2; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET utf8mb4; +select ST_AsText(p), chr from t1; +ST_AsText(p) chr +POINT(37.646944 -75.761111) їєі +# all is correct +select ST_AsText(p), chr from t2; +ST_AsText(p) chr +POINT(37.646944 -75.761111) їєі +drop table t1, t2; +# End of 10.5 tests diff --git a/mysql-test/main/loaddata.test b/mysql-test/main/loaddata.test index ef1496787d41b..a625415ad8e09 100644 --- a/mysql-test/main/loaddata.test +++ b/mysql-test/main/loaddata.test @@ -832,3 +832,61 @@ CREATE TABLE t1 (id integer not null auto_increment primary key); LOAD DATA INFILE '../../std_data/loaddata/nl.txt' INTO TABLE t1 FIELDS TERMINATED BY ''; SELECT * FROM t1; DROP TABLE t1; + + +--echo # +--echo # MDEV-34883: LOAD DATA INFILE with geometry data fails +--echo # + +CREATE OR REPLACE TABLE t1 ( + p point NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)')); + +--disable_ps2_protocol +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; +--enable_ps2_protocol + +CREATE OR REPLACE TABLE t2 LIKE t1; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2; + +--remove_file '$MYSQLTEST_VARDIR/tmp/t1.tsv' +drop table t1, t2; + + +CREATE OR REPLACE TABLE t1 ( + p point NOT NULL, + chr char(20) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'),"їєі"); +--disable_ps2_protocol +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' FROM t1; +--enable_ps2_protocol + +CREATE OR REPLACE TABLE t2 LIKE t1; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET latin1; + +select ST_AsText(p), chr from t1; +--echo # incorrect string (but correct geom) +select ST_AsText(p), chr from t2; + +delete from t2; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET utf8mb4; + +select ST_AsText(p), chr from t1; +--echo # all is correct +select ST_AsText(p), chr from t2; + +--remove_file '$MYSQLTEST_VARDIR/tmp/t1.tsv' +drop table t1, t2; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result index b1d41709a9d25..f77498dafe001 100644 --- a/mysql-test/main/locale.result +++ b/mysql-test/main/locale.result @@ -311,7 +311,7 @@ date_format('2001-09-01', '%c %b %M', 'de_CH') # SET lc_messages=ZH_CN; SELECT x; -ERROR 42S22: 未知列'x'在'field list' +ERROR 42S22: 未知列'x'在'SELECT' SET lc_messages=DEFAULT; # # End of 10.4 tests @@ -321,7 +321,7 @@ SET lc_messages=DEFAULT; # SET lc_messages=ka_GE; SELECT x; -ERROR 42S22: უცნობი სვეტი 'x' 'field list'-ში +ERROR 42S22: უცნობი სვეტი 'x' 'SELECT'-ში SET lc_messages=DEFAULT; # # MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str diff --git a/mysql-test/main/log_slow.result b/mysql-test/main/log_slow.result index 2ec8c91e8631f..4e4a4d7158013 100644 --- a/mysql-test/main/log_slow.result +++ b/mysql-test/main/log_slow.result @@ -213,3 +213,14 @@ b`; SET timestamp=1234567890; select count(*) from mysql.global_priv where length(priv)>2 # End of 10.5 tests +# +# MDEV-34251 Conditional jump or move depends on uninitialised value in +# ha_handler_stats::has_stats +# +set @@global.log_slow_verbosity=""; +connect con1,localhost,root,,; +connection con1; +set long_query_time=0.0, log_slow_verbosity='engine'; +connection default; +disconnect con1; +# End of 10.6 tests diff --git a/mysql-test/main/log_slow.test b/mysql-test/main/log_slow.test index 0b713061a4052..3b1281bb8ed98 100644 --- a/mysql-test/main/log_slow.test +++ b/mysql-test/main/log_slow.test @@ -226,3 +226,19 @@ let SEARCH_OUTPUT=matches; source include/search_pattern_in_file.inc; --echo # End of 10.5 tests + +--echo # +--echo # MDEV-34251 Conditional jump or move depends on uninitialised value in +--echo # ha_handler_stats::has_stats +--echo # + +set @@global.log_slow_verbosity=""; +connect (con1,localhost,root,,); +connection con1; + +# valgrind or asan would notice if engine stats are accessed wrong. +set long_query_time=0.0, log_slow_verbosity='engine'; +connection default; +disconnect con1; + +--echo # End of 10.6 tests diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result index 7f8110a283efb..81af999f07f11 100644 --- a/mysql-test/main/long_unique.result +++ b/mysql-test/main/long_unique.result @@ -81,7 +81,7 @@ NULL maria sachin select db_row_hash_1 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' #duplicate entry test; insert into t1 values(2); ERROR 23000: Duplicate entry '2' for key 'a' @@ -154,7 +154,7 @@ ERROR 23000: Duplicate entry '1' for key 'a' insert into t1 values(2,2); ERROR 23000: Duplicate entry '2' for key 'a' select db_row_hash_1 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' #now try to change db_row_hash_1 column; alter table t1 drop column db_row_hash_1; ERROR 42000: Can't DROP COLUMN `db_row_hash_1`; check that it exists @@ -405,11 +405,11 @@ a b c d e maria 345 frter dasd utyuty sachin 341 fdf gfgfgfg hghgr select db_row_hash_1 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' select db_row_hash_2 from t1; -ERROR 42S22: Unknown column 'db_row_hash_2' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_2' in 'SELECT' select db_row_hash_3 from t1; -ERROR 42S22: Unknown column 'db_row_hash_3' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_3' in 'SELECT' #duplicate entry test; insert into t1 values(21,2,3,42,51); ERROR 23000: Duplicate entry '3' for key 'c' @@ -462,7 +462,7 @@ t1 CREATE TABLE `t1` ( insert into t1 values(1,2,3,4,5,6); ERROR 23000: Duplicate entry '1' for key 'a' select db_row_hash_1 , db_row_hash_2, db_row_hash_3 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' #now try to change db_row_hash_1 column; alter table t1 drop column db_row_hash_1, drop column db_row_hash_2, drop column db_row_hash_3; ERROR 42000: Can't DROP COLUMN `db_row_hash_1`; check that it exists @@ -786,11 +786,11 @@ NULL NULL NULL NULL NULL NULL NULL NULL maria 6 maria maria maria maria 6 maria mariadb 7 mariadb mariadb mariadb mariadb 8 mariadb select db_row_hash_1 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' select db_row_hash_2 from t1; -ERROR 42S22: Unknown column 'db_row_hash_2' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_2' in 'SELECT' select db_row_hash_3 from t1; -ERROR 42S22: Unknown column 'db_row_hash_3' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_3' in 'SELECT' #duplicate entry test; #duplicate keys entry; insert into t1 values(1,1,1,0,0,0,0,0); @@ -806,7 +806,7 @@ ERROR 23000: Duplicate entry '1-1-1-1' for key 'e' insert into t1 values(1,1,1,1,1,1,1,1); ERROR 23000: Duplicate entry '1-1-1' for key 'a' select db_row_hash_1,db_row_hash_2,db_row_hash_3,db_row_hash_4,db_row_hash_5 from t1; -ERROR 42S22: Unknown column 'db_row_hash_1' in 'field list' +ERROR 42S22: Unknown column 'db_row_hash_1' in 'SELECT' alter table t1 drop column db_row_hash_1, drop column db_row_hash_2, drop column db_row_hash_3; ERROR 42000: Can't DROP COLUMN `db_row_hash_1`; check that it exists alter table t1 add column dg int , add column ef int , drop column db_row_hash_1; @@ -1170,7 +1170,7 @@ DB_ROW_HASH_1 DB_ROW_HASH_2 33 3 44 4 select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1; -ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'field list' +ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'SELECT' #bug select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2; DB_ROW_HASH_1 DB_ROW_HASH_2 @@ -1191,7 +1191,7 @@ DB_ROW_HASH_1 DB_ROW_HASH_2 44 4 44 4 select * from t1 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2); -ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'IN/ALL/ANY subquery' +ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'IN/ALL/ANY' select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2); DB_ROW_HASH_1 DB_ROW_HASH_2 11 1 @@ -1217,7 +1217,7 @@ DB_ROW_HASH_1 DB_ROW_HASH_2 33 3 44 4 select DB_ROW_HASH_1 from t1,t2 where t1.DB_ROW_HASH_1 = t2.DB_ROW_HASH_2; -ERROR 42S22: Unknown column 't1.DB_ROW_HASH_1' in 'where clause' +ERROR 42S22: Unknown column 't1.DB_ROW_HASH_1' in 'WHERE' select DB_ROW_HASH_1 from t1 inner join t2 on t1.a = t2.DB_ROW_HASH_2; DB_ROW_HASH_1 11 diff --git a/mysql-test/main/mdev6830.result b/mysql-test/main/mdev6830.result index 0048aa174bca5..e0e181334e0dd 100644 --- a/mysql-test/main/mdev6830.result +++ b/mysql-test/main/mdev6830.result @@ -42,7 +42,7 @@ CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM; SELECT * FROM t1; pk SELECT non_existing FROM v2; -ERROR 42S22: Unknown column 'non_existing' in 'field list' +ERROR 42S22: Unknown column 'non_existing' in 'SELECT' SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5; pk f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f1 f2 drop table t1,t2,t3,t4; diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result index 5d62e153ac0c7..6fd221320ea6a 100644 --- a/mysql-test/main/multi_update.result +++ b/mysql-test/main/multi_update.result @@ -993,19 +993,19 @@ create view v2 as select * from t2; create view v3 as select * from t2 where c0 < 3; create procedure sp0() update t1, v2 set v2.pk = 1 where v2.c0 = t1.c1; call sp0(); -ERROR 42S22: Unknown column 't1.c1' in 'where clause' +ERROR 42S22: Unknown column 't1.c1' in 'WHERE' call sp0(); -ERROR 42S22: Unknown column 't1.c1' in 'where clause' +ERROR 42S22: Unknown column 't1.c1' in 'WHERE' create procedure sp1() update (t1 join v2 on v2.c0 = t1.c1) set v2.pk = 1; call sp1(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' call sp1(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' create procedure sp2() update (t1 join v3 on v3.c0 = t1.c1) set v3.pk = 1; call sp2(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' call sp2(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' create procedure sp3() update (t1 join v2 on v2.c0 = t1.id) set v2.c0 = v2.c0+1; select * from t2; @@ -1024,9 +1024,9 @@ pk c0 2 3 create procedure sp4() delete t1 from t1 join v2 on v2.c0 = t1.c1; call sp4(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' call sp4(); -ERROR 42S22: Unknown column 't1.c1' in 'on clause' +ERROR 42S22: Unknown column 't1.c1' in 'ON' drop procedure sp0; drop procedure sp1; drop procedure sp2; diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index e28c2a0fec368..193c58a97878f 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -2927,16 +2927,16 @@ DROP TABLE t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (2), (3); DELETE FROM t1 USING t1 WHERE uknown_column = 12345; -ERROR 42S22: Unknown column 'uknown_column' in 'where clause' +ERROR 42S22: Unknown column 'uknown_column' in 'WHERE' EXPLAIN EXTENDED DELETE FROM t1 USING t1 WHERE uknown_column = 12345; -ERROR 42S22: Unknown column 'uknown_column' in 'where clause' +ERROR 42S22: Unknown column 'uknown_column' in 'WHERE' DROP TABLE t1; #57 CREATE TABLE t1(f1 INT); EXPLAIN EXTENDED UPDATE t1 SET f2=1 ORDER BY f2; -ERROR 42S22: Unknown column 'f2' in 'order clause' +ERROR 42S22: Unknown column 'f2' in 'ORDER BY' UPDATE t1 SET f2=1 ORDER BY f2; -ERROR 42S22: Unknown column 'f2' in 'order clause' +ERROR 42S22: Unknown column 'f2' in 'ORDER BY' DROP TABLE t1; #62 CREATE TABLE t1 (a INT); diff --git a/mysql-test/main/mysql57nopart.test b/mysql-test/main/mysql57nopart.test index 93df68cee5f82..87abf01aed4cf 100644 --- a/mysql-test/main/mysql57nopart.test +++ b/mysql-test/main/mysql57nopart.test @@ -4,8 +4,10 @@ source include/have_innodb.inc; --echo # let $datadir=`select @@datadir`; copy_file std_data/mysql57part.frm $datadir/test/mysql57part.frm; +--disable_view_protocol select table_name, concat('<',table_comment,'>') from information_schema.tables where table_schema='test'; +--enable_view_protocol drop table mysql57part; --echo # End of 10.11 tests diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index b3a60a1a00bc7..373bc32e15c5f 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -1750,7 +1750,7 @@ old-alter-table DEFAULT old-mode UTF8_IS_UTF8MB3 old-passwords FALSE old-style-user-limits FALSE -optimizer-adjust-secondary-key-costs fix_reuse_range_for_ref +optimizer-adjust-secondary-key-costs fix_reuse_range_for_ref,fix_card_multiplier optimizer-extra-pruning-depth 8 optimizer-join-limit-pref-ratio 0 optimizer-max-sel-arg-weight 32000 diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index 2de9bf3ed5492..0c1728c8ad085 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -70,7 +70,7 @@ SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES'; INSERT INTO t1 VALUES (1.2345, 2.3456); INSERT INTO t1 VALUES ('1.2345', 2.3456); INSERT INTO t1 VALUES ("1.2345", 2.3456); -ERROR 42S22: Unknown column '1.2345' in 'field list' +ERROR 42S22: Unknown column '1.2345' in 'VALUES' SET SQL_MODE=@OLD_SQL_MODE; /*M!999999\- enable the sandbox mode */ /*!40101 SET @saved_cs_client = @@character_set_client */; diff --git a/mysql-test/main/mysqldump_restore.result b/mysql-test/main/mysqldump_restore.result index cc4a5cd59657a..315da72ddf998 100644 --- a/mysql-test/main/mysqldump_restore.result +++ b/mysql-test/main/mysqldump_restore.result @@ -34,7 +34,7 @@ SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES'; INSERT INTO t1 VALUES (1.2345, 2.3456); INSERT INTO t1 VALUES ('1.2345', 2.3456); INSERT INTO t1 VALUES ("1.2345", 2.3456); -ERROR 42S22: Unknown column '1.2345' in 'field list' +ERROR 42S22: Unknown column '1.2345' in 'VALUES' SET SQL_MODE=@OLD_SQL_MODE; # Begin testing mysqldump output + restore # Create 'original table name - _orig diff --git a/mysql-test/main/mysqltest.result b/mysql-test/main/mysqltest.result index 73f2c8851f913..478ef82ca1fa0 100644 --- a/mysql-test/main/mysqltest.result +++ b/mysql-test/main/mysqltest.result @@ -8,9 +8,9 @@ select otto from (select 1 as otto) as t1; otto 1 select friedrich from (select 1 as otto) as t1; -mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'friedrich' in 'field list' +mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'friedrich' in 'SELECT' select friedrich from (select 1 as otto) as t1; -ERROR 42S22: Unknown column 'friedrich' in 'field list' +ERROR 42S22: Unknown column 'friedrich' in 'SELECT' select otto from (select 1 as otto) as t1; otto 1 @@ -18,9 +18,9 @@ select otto from (select 1 as otto) as t1; mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22... mysqltest: At line 1: expecting a SQL-state (00000) from query 'remove_file MYSQLTEST_VARDIR/tmp/test_nonexistent.tmp' which cannot produce one... select friedrich from (select 1 as otto) as t1; -ERROR 42S22: Unknown column 'friedrich' in 'field list' +ERROR 42S22: Unknown column 'friedrich' in 'SELECT' select friedrich from (select 1 as otto) as t1; -mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22: 'Unknown column 'friedrich' in 'field list'', instead of 00000... +mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22: 'Unknown column 'friedrich' in 'SELECT'', instead of 00000... select otto from (select 1 as otto) as t1; otto 1 diff --git a/mysql-test/main/mysqltest_cont_on_error.result b/mysql-test/main/mysqltest_cont_on_error.result index 352799deb06c2..32c6bfce4b911 100644 --- a/mysql-test/main/mysqltest_cont_on_error.result +++ b/mysql-test/main/mysqltest_cont_on_error.result @@ -1,7 +1,7 @@ select error; -mysqltest: At line 1: query 'select error' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'error' in 'field list' +mysqltest: At line 1: query 'select error' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'error' in 'SELECT' SELECT ERROR; -mysqltest: At line 1: query 'SELECT ERROR' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'ERROR' in 'field list' +mysqltest: At line 1: query 'SELECT ERROR' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'ERROR' in 'SELECT' SELECT 2; 2 2 diff --git a/mysql-test/main/mysqltest_ps.result b/mysql-test/main/mysqltest_ps.result index 153098ff08853..d6266964e3d77 100644 --- a/mysql-test/main/mysqltest_ps.result +++ b/mysql-test/main/mysqltest_ps.result @@ -7,7 +7,7 @@ create table t (a int primary key, b blob default ''); select a, (2*a) AS a from t group by a; a a Warnings: -Warning 1052 Column 'a' in group statement is ambiguous +Warning 1052 Column 'a' in GROUP BY is ambiguous drop table t; select 1 + "2 a"; 1 + "2 a" @@ -18,8 +18,8 @@ create table t (a int primary key, b blob default ''); select a, (2*a) AS a from t group by a; a a Warnings: -Warning 1052 Column 'a' in group statement is ambiguous -Warning 1052 Column 'a' in group statement is ambiguous +Warning 1052 Column 'a' in GROUP BY is ambiguous +Warning 1052 Column 'a' in GROUP BY is ambiguous drop table t; select 1 + "2 a"; 1 + "2 a" @@ -30,5 +30,5 @@ create table t (a int primary key, b blob default ''); select a, (2*a) AS a from t group by a; a a Warnings: -Warning 1052 Column 'a' in group statement is ambiguous +Warning 1052 Column 'a' in GROUP BY is ambiguous drop table t; diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result index cad96ef80c4bd..7b12ed5bb3022 100644 --- a/mysql-test/main/mysqltest_tracking_info.result +++ b/mysql-test/main/mysqltest_tracking_info.result @@ -6,26 +6,22 @@ SET @@session.session_track_system_variables='character_set_connection'; # tracking info on SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- utf8mb3 +-- character_set_connection: utf8mb3 SET NAMES 'big5'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- big5 +-- character_set_connection: big5 # tracking info on once SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- utf8mb3 +-- character_set_connection: utf8mb3 SET NAMES 'big5'; # tracking info on SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- utf8mb3 +-- character_set_connection: utf8mb3 # tracking info off once SET NAMES 'big5'; @@ -37,8 +33,7 @@ set @save_optimizer_switch=@@optimizer_switch; SET @@session.session_track_system_variables='optimizer_switch'; set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- optimizer_switch --- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off +-- optimizer_switch: index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release @@ -71,13 +66,11 @@ ERROR HY000: Unknown system variable 'a' connect con,localhost,root,,test; SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- utf8mb3 +-- character_set_connection: utf8mb3 SET NAMES 'big5'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_connection --- big5 +-- character_set_connection: big5 select @@session_track_system_variables; @@session_track_system_variables diff --git a/mysql-test/main/named_pipe.result b/mysql-test/main/named_pipe.result index 2baa3471ec9b3..06315d21a9dde 100644 --- a/mysql-test/main/named_pipe.result +++ b/mysql-test/main/named_pipe.result @@ -2156,7 +2156,7 @@ SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA', Kundentyp kategorie Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1052 Column 'kundentyp' in group statement is ambiguous +Warning 1052 Column 'kundentyp' in GROUP BY is ambiguous drop table t1; connection default; disconnect pipe_con; diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index 47a511b0d0b44..7698ae006637c 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -795,18 +795,18 @@ col1 col t2_col 2 2 2 3 3 1 select col1 as col, col from t1 order by col; -ERROR 23000: Column 'col' in order clause is ambiguous +ERROR 23000: Column 'col' in ORDER BY is ambiguous select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2 order by col; -ERROR 23000: Column 'col' in order clause is ambiguous +ERROR 23000: Column 'col' in ORDER BY is ambiguous select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2 order by col; -ERROR 23000: Column 'col' in order clause is ambiguous +ERROR 23000: Column 'col' in ORDER BY is ambiguous select col1 from t1, t2 where t1.col1=t2.col2 order by col; -ERROR 23000: Column 'col' in order clause is ambiguous +ERROR 23000: Column 'col' in ORDER BY is ambiguous select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 order by col; -ERROR 23000: Column 'col' in order clause is ambiguous +ERROR 23000: Column 'col' in ORDER BY is ambiguous select t1.col as t1_col, t2.col from t1, t2 where t1.col1=t2.col2 order by col; t1_col col @@ -957,45 +957,45 @@ num 2 3 SELECT a + 1 AS num, num + 1 FROM t1; -ERROR 42S22: Unknown column 'num' in 'field list' +ERROR 42S22: Unknown column 'num' in 'SELECT' SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1; num (select num + 2 FROM t1 LIMIT 1) 2 4 3 5 SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; -ERROR 42S22: Unknown column 'num' in 'on clause' +ERROR 42S22: Unknown column 'num' in 'ON' DROP TABLE t1; CREATE TABLE bug25126 ( val int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY ); UPDATE bug25126 SET MissingCol = MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'field list' +ERROR 42S22: Unknown column 'MissingCol' in 'SET' UPDATE bug25126 SET val = val ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET val = val ORDER BY val; UPDATE bug25126 SET val = 1 ORDER BY val; UPDATE bug25126 SET val = 1 ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol; -ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +ERROR 42S22: Unknown column 'MissingCol' in 'ORDER BY' DROP TABLE bug25126; CREATE TABLE t1 (a int); SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1; val val1 SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val; -ERROR 23000: Column 'val' in order clause is ambiguous +ERROR 23000: Column 'val' in ORDER BY is ambiguous SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1; -ERROR 23000: Column 'val' in order clause is ambiguous +ERROR 23000: Column 'val' in ORDER BY is ambiguous DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (3), (2), (4), (1); diff --git a/mysql-test/main/order_by_limit_join.result b/mysql-test/main/order_by_limit_join.result index 8fc932b3296c6..f3d75a99009d1 100644 --- a/mysql-test/main/order_by_limit_join.result +++ b/mysql-test/main/order_by_limit_join.result @@ -112,7 +112,7 @@ JS "full_join_cost": "REPLACED", "risk_ratio": 10, "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 972.8224614, + "shortcut_cost_with_risk": 972.8224714, "use_shortcut_cost": true } ] @@ -164,7 +164,7 @@ JS "full_join_cost": "REPLACED", "risk_ratio": 10, "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 20972.81246, + "shortcut_cost_with_risk": 20972.81247, "use_shortcut_cost": true } ] @@ -249,7 +249,7 @@ JS "full_join_cost": "REPLACED", "risk_ratio": 10, "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 240591.2698, + "shortcut_cost_with_risk": 240591.2748, "use_shortcut_cost": false } ] @@ -369,7 +369,7 @@ JS "full_join_cost": "REPLACED", "risk_ratio": 10, "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 982.9697856, + "shortcut_cost_with_risk": 982.9697956, "use_shortcut_cost": true } ] @@ -455,11 +455,58 @@ JS "full_join_cost": "REPLACED", "risk_ratio": 10, "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 972.8224614, + "shortcut_cost_with_risk": 972.8224714, "use_shortcut_cost": true } ] set optimizer_search_depth=@tmp_osd; set optimizer_trace=@tmp_os; -set optimizer_join_limit_pref_ratio=default; +# An extra testcase for MDEV-35164 (its main testcase is below). +alter table t1 add unique key(col2); +insert into t10 select * from t10; +insert into t10 select * from t10; +analyze table t10; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +# This will not crash and also show that sorting is not done when +# ORDER BY only refers to const table columns: +explain +select +* +from +t1 +join t10 on t1.a=t10.a +join t11 on t1.b=t11.b +where +t1.col2=3 +order by +t1.col1 +limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const col2,a,b col2 5 const 1 +1 SIMPLE t11 ref b b 5 const 1 +1 SIMPLE t10 ref a a 5 const 2 drop table t1, t10, t11; +# +# MDEV-35072: Assertion failure with optimizer_join_limit_pref_ratio and 1-table select +# +SET optimizer_join_limit_pref_ratio=1; +CREATE TABLE t1 (c1 INT, INDEX(c1)); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 ORDER BY c1 LIMIT 1; +c1 +1 +DROP TABLE t1; +# +# MDEV-35164: optimizer_join_limit_pref_ratio: assertion when the ORDER BY table becomes constant +# Original testcase: +# +SET optimizer_join_limit_pref_ratio=1; +CREATE TABLE t1 (a INT KEY,b INT, KEY(b)) ; +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (5,NULL); +SELECT * FROM t1 NATURAL JOIN t1 AS t2 WHERE t1.b=NULL ORDER BY t1.a LIMIT 1; +a b +DROP TABLE t1; +set optimizer_join_limit_pref_ratio=default; diff --git a/mysql-test/main/order_by_limit_join.test b/mysql-test/main/order_by_limit_join.test index 3b60581871c03..2ec03a2a10feb 100644 --- a/mysql-test/main/order_by_limit_join.test +++ b/mysql-test/main/order_by_limit_join.test @@ -205,9 +205,49 @@ set @trace=(select trace from information_schema.optimizer_trace); --source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; - set optimizer_search_depth=@tmp_osd; set optimizer_trace=@tmp_os; -set optimizer_join_limit_pref_ratio=default; + +--echo # An extra testcase for MDEV-35164 (its main testcase is below). +alter table t1 add unique key(col2); +insert into t10 select * from t10; +insert into t10 select * from t10; +analyze table t10; + +--echo # This will not crash and also show that sorting is not done when +--echo # ORDER BY only refers to const table columns: +explain +select + * +from + t1 + join t10 on t1.a=t10.a + join t11 on t1.b=t11.b +where + t1.col2=3 +order by + t1.col1 +limit 10; drop table t1, t10, t11; +--echo # +--echo # MDEV-35072: Assertion failure with optimizer_join_limit_pref_ratio and 1-table select +--echo # +SET optimizer_join_limit_pref_ratio=1; +CREATE TABLE t1 (c1 INT, INDEX(c1)); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 ORDER BY c1 LIMIT 1; +DROP TABLE t1; + +--echo # +--echo # MDEV-35164: optimizer_join_limit_pref_ratio: assertion when the ORDER BY table becomes constant +--echo # Original testcase: +--echo # +SET optimizer_join_limit_pref_ratio=1; +CREATE TABLE t1 (a INT KEY,b INT, KEY(b)) ; +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (5,NULL); +SELECT * FROM t1 NATURAL JOIN t1 AS t2 WHERE t1.b=NULL ORDER BY t1.a LIMIT 1; +DROP TABLE t1; + +set optimizer_join_limit_pref_ratio=default; diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result index 1cdf89a273962..b52af23eb4921 100644 --- a/mysql-test/main/parser.result +++ b/mysql-test/main/parser.result @@ -2231,11 +2231,11 @@ drop table t1; # MDEV-19682 sql_mode="oracle" does not support sysdate # SELECT sysdate LIKE '____-__-__ __:__:__'; -ERROR 42S22: Unknown column 'sysdate' in 'field list' +ERROR 42S22: Unknown column 'sysdate' in 'SELECT' SELECT sysdate = sysdate(); -ERROR 42S22: Unknown column 'sysdate' in 'field list' +ERROR 42S22: Unknown column 'sysdate' in 'SELECT' SELECT sysdate = sysdate(0); -ERROR 42S22: Unknown column 'sysdate' in 'field list' +ERROR 42S22: Unknown column 'sysdate' in 'SELECT' CREATE DATABASE sysdate; DROP DATABASE sysdate; CREATE TABLE sysdate (a INT); diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result index 4c762a1d3bdc5..051931553b4f5 100644 --- a/mysql-test/main/partition.result +++ b/mysql-test/main/partition.result @@ -2018,7 +2018,7 @@ PARTITION BY RANGE (t2.b) ( PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20) ) select * from t2; -ERROR 42S22: Unknown column 't2.b' in 'partition function' +ERROR 42S22: Unknown column 't2.b' in 'PARTITION BY' create table t1 (a int) PARTITION BY RANGE (b) ( PARTITION p1 VALUES LESS THAN (10), diff --git a/mysql-test/main/partition_column.result b/mysql-test/main/partition_column.result index c3a2ce872cea6..c3fcd05443e7f 100644 --- a/mysql-test/main/partition_column.result +++ b/mysql-test/main/partition_column.result @@ -572,7 +572,7 @@ create table t1 (a char(6)) partition by range columns(a) (partition p0 values less than (H23456), partition p1 values less than (M23456)); -ERROR 42S22: Unknown column 'H23456' in 'field list' +ERROR 42S22: Unknown column 'H23456' in 'PARTITION BY' create table t1 (a char(6)) partition by range columns(a) (partition p0 values less than (23456), diff --git a/mysql-test/main/partition_error.result b/mysql-test/main/partition_error.result index 0b07fe3013008..13b3d229661fc 100644 --- a/mysql-test/main/partition_error.result +++ b/mysql-test/main/partition_error.result @@ -934,7 +934,7 @@ partitions 3 (partition x1 tablespace ts1, partition x2 tablespace ts2, partition x3 tablespace ts3); -ERROR 42S22: Unknown column 'd' in 'partition function' +ERROR 42S22: Unknown column 'd' in 'PARTITION BY' CREATE TABLE t1 ( a int not null, b int not null, @@ -1156,7 +1156,7 @@ partition by range (a) subpartition by hash (a+d) (partition x1 values less than (1) (subpartition x11, subpartition x12), partition x2 values less than (2) (subpartition x21, subpartition x22)); -ERROR 42S22: Unknown column 'd' in 'partition function' +ERROR 42S22: Unknown column 'd' in 'PARTITION BY' CREATE TABLE t1 ( a int not null, b int not null, @@ -1176,7 +1176,7 @@ partition by range (a+d) partitions 2 (partition x1 values less than (4) tablespace ts1, partition x2 values less than (8) tablespace ts2); -ERROR 42S22: Unknown column 'd' in 'partition function' +ERROR 42S22: Unknown column 'd' in 'PARTITION BY' CREATE TABLE t1 ( a int not null, b int not null, @@ -1375,7 +1375,7 @@ partition by list (a+d) partitions 2 (partition x1 values in (4) tablespace ts1, partition x2 values in (8) tablespace ts2); -ERROR 42S22: Unknown column 'd' in 'partition function' +ERROR 42S22: Unknown column 'd' in 'PARTITION BY' CREATE TABLE t1 ( a int not null, b int not null, @@ -1440,7 +1440,7 @@ partition x2 values in (5))' at line 8 CREATE TABLE t1 (a int) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (x1)); -ERROR 42S22: Unknown column 'x1' in 'partition function' +ERROR 42S22: Unknown column 'x1' in 'PARTITION BY' CREATE TABLE t1(a int) PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5)); insert into t1 values (10); diff --git a/mysql-test/main/partition_mgm_err.result b/mysql-test/main/partition_mgm_err.result index 980cd6523a4fb..ac00d49cf8509 100644 --- a/mysql-test/main/partition_mgm_err.result +++ b/mysql-test/main/partition_mgm_err.result @@ -166,6 +166,6 @@ alter table t1 check partition all for upgrade; Table Op Msg_type Msg_text test.t1 check status OK alter table t1 order by nonexistent; -ERROR 42S22: Unknown column 'nonexistent' in 'order clause' +ERROR 42S22: Unknown column 'nonexistent' in 'ORDER BY' drop table t1; # End of 10.5 tests diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result index 50a82efe55ab7..f2bd64e477545 100644 --- a/mysql-test/main/plugin.result +++ b/mysql-test/main/plugin.result @@ -216,7 +216,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `VAROPT`=33 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `varopt`=33 drop table t1; SET @@SQL_MODE=@OLD_SQL_MODE; select 1; diff --git a/mysql-test/main/plugin_auth.test b/mysql-test/main/plugin_auth.test index 1c471cab9b56f..cbd2be53a2490 100644 --- a/mysql-test/main/plugin_auth.test +++ b/mysql-test/main/plugin_auth.test @@ -34,7 +34,7 @@ connect(plug_con,localhost,plug,plug_dest,"*NO-ONE*"); select USER(),CURRENT_USER(); --echo ## test SET PASSWORD -#--error ER_SET_PASSWORD_AUTH_PLUGIN +# here we set for native password plugin SET PASSWORD = PASSWORD('plug_dest'); connection default; diff --git a/mysql-test/main/pool_of_threads.result b/mysql-test/main/pool_of_threads.result index 91ad7ab098f74..ba74e74cb377b 100644 --- a/mysql-test/main/pool_of_threads.result +++ b/mysql-test/main/pool_of_threads.result @@ -2156,7 +2156,7 @@ SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA', Kundentyp kategorie Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1052 Column 'kundentyp' in group statement is ambiguous +Warning 1052 Column 'kundentyp' in GROUP BY is ambiguous drop table t1; SET optimizer_switch=default; connection default; diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index fb3681ca94462..c36c8307f8637 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -1737,15 +1737,15 @@ create table t1 (id int primary key auto_increment, value varchar(10)); insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD'); prepare stmt from "insert into t1 (id, value) select * from (select 4 as i, 'FOURTH' as v) as y on duplicate key update v = 'DUP'"; execute stmt; -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'UPDATE' execute stmt; -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'UPDATE' deallocate prepare stmt; prepare stmt from "insert into t1 (id, value) select * from (select 4 as id, 'FOURTH' as value) as y on duplicate key update y.value = 'DUP'"; execute stmt; -ERROR 42S22: Unknown column 'y.value' in 'field list' +ERROR 42S22: Unknown column 'y.value' in 'UPDATE' execute stmt; -ERROR 42S22: Unknown column 'y.value' in 'field list' +ERROR 42S22: Unknown column 'y.value' in 'UPDATE' deallocate prepare stmt; drop tables t1; prepare stmt from "create table t1 select ?"; @@ -4933,9 +4933,9 @@ ERROR 42000: EXECUTE IMMEDIATE does not support subqueries or stored functions PREPARE stmt FROM (SELECT 'SELECT 1'); ERROR 42000: PREPARE..FROM does not support subqueries or stored functions EXECUTE IMMEDIATE a; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'EXECUTE IMMEDIATE' PREPARE stmt FROM a; -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'PREPARE..FROM' EXECUTE IMMEDIATE NULL; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NULL' at line 1 PREPARE stmt FROM NULL; @@ -4955,9 +4955,9 @@ ERROR 21000: Operand should contain 1 column(s) EXECUTE IMMEDIATE MAX('SELECT 1 AS c'); ERROR HY000: Invalid use of group function EXECUTE IMMEDIATE DEFAULT(a); -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'EXECUTE IMMEDIATE' EXECUTE IMMEDIATE VALUE(a); -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'EXECUTE IMMEDIATE' CREATE FUNCTION f1() RETURNS VARCHAR(64) RETURN 't1'; EXECUTE IMMEDIATE f1(); ERROR 42000: EXECUTE IMMEDIATE does not support subqueries or stored functions diff --git a/mysql-test/main/ps_1general.result b/mysql-test/main/ps_1general.result index ca2447b6b2618..cb53ae688238d 100644 --- a/mysql-test/main/ps_1general.result +++ b/mysql-test/main/ps_1general.result @@ -91,11 +91,11 @@ prepare stmt1 from @arg01; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NULL' at line 1 prepare stmt1 from ' select * from t1 where a <= 2 ' ; prepare stmt1 from ' select * from t1 where x <= 2 ' ; -ERROR 42S22: Unknown column 'x' in 'where clause' +ERROR 42S22: Unknown column 'x' in 'WHERE' prepare stmt1 from ' insert into t1(a,x) values(?,?) ' ; -ERROR 42S22: Unknown column 'x' in 'field list' +ERROR 42S22: Unknown column 'x' in 'INSERT INTO' prepare stmt1 from ' insert into t1(x,a) values(?,?) ' ; -ERROR 42S22: Unknown column 'x' in 'field list' +ERROR 42S22: Unknown column 'x' in 'INSERT INTO' drop table if exists not_exist ; prepare stmt1 from ' select * from not_exist where a <= 2 ' ; ERROR 42S02: Table 'test.not_exist' doesn't exist diff --git a/mysql-test/main/ps_2myisam.result b/mysql-test/main/ps_2myisam.result index ec36549883371..d6552d81cb925 100644 --- a/mysql-test/main/ps_2myisam.result +++ b/mysql-test/main/ps_2myisam.result @@ -440,7 +440,7 @@ a b 4 four set @arg00=0 ; execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' +ERROR 42S22: Unknown column '?' in 'ORDER BY' set @arg00=1; prepare stmt1 from ' select a,b from t1 order by a limit 1 '; diff --git a/mysql-test/main/ps_3innodb.result b/mysql-test/main/ps_3innodb.result index 1c98a59cff518..320d767fecd3a 100644 --- a/mysql-test/main/ps_3innodb.result +++ b/mysql-test/main/ps_3innodb.result @@ -440,7 +440,7 @@ a b 4 four set @arg00=0 ; execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' +ERROR 42S22: Unknown column '?' in 'ORDER BY' set @arg00=1; prepare stmt1 from ' select a,b from t1 order by a limit 1 '; diff --git a/mysql-test/main/ps_4heap.result b/mysql-test/main/ps_4heap.result index db182536e9374..6c81e1cb0fdeb 100644 --- a/mysql-test/main/ps_4heap.result +++ b/mysql-test/main/ps_4heap.result @@ -441,7 +441,7 @@ a b 4 four set @arg00=0 ; execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' +ERROR 42S22: Unknown column '?' in 'ORDER BY' set @arg00=1; prepare stmt1 from ' select a,b from t1 order by a limit 1 '; diff --git a/mysql-test/main/ps_5merge.result b/mysql-test/main/ps_5merge.result index 963a3a6035944..16c68a3872dcb 100644 --- a/mysql-test/main/ps_5merge.result +++ b/mysql-test/main/ps_5merge.result @@ -484,7 +484,7 @@ a b 4 four set @arg00=0 ; execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' +ERROR 42S22: Unknown column '?' in 'ORDER BY' set @arg00=1; prepare stmt1 from ' select a,b from t1 order by a limit 1 '; @@ -3852,7 +3852,7 @@ a b 4 four set @arg00=0 ; execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' +ERROR 42S22: Unknown column '?' in 'ORDER BY' set @arg00=1; prepare stmt1 from ' select a,b from t1 order by a limit 1 '; diff --git a/mysql-test/main/ps_ddl1.result b/mysql-test/main/ps_ddl1.result index 5178ee64f168c..16776325934ee 100644 --- a/mysql-test/main/ps_ddl1.result +++ b/mysql-test/main/ps_ddl1.result @@ -165,7 +165,7 @@ call p_verify_reprepare_count(1); SUCCESS execute stmt7; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'INSERT INTO' call p_verify_reprepare_count(1); SUCCESS @@ -185,17 +185,17 @@ call p_verify_reprepare_count(1); SUCCESS execute stmt3; -ERROR 42S22: Unknown column 'b' in 'where clause' +ERROR 42S22: Unknown column 'b' in 'WHERE' call p_verify_reprepare_count(1); SUCCESS execute stmt2; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' call p_verify_reprepare_count(1); SUCCESS execute stmt1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' call p_verify_reprepare_count(1); SUCCESS @@ -205,7 +205,7 @@ call p_verify_reprepare_count(1); ERROR Expected: 1, actual: 0 execute stmt7; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'INSERT INTO' call p_verify_reprepare_count(1); SUCCESS @@ -225,17 +225,17 @@ call p_verify_reprepare_count(1); SUCCESS execute stmt3; -ERROR 42S22: Unknown column 'b' in 'where clause' +ERROR 42S22: Unknown column 'b' in 'WHERE' call p_verify_reprepare_count(1); SUCCESS execute stmt2; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' call p_verify_reprepare_count(1); SUCCESS execute stmt1; -ERROR 42S22: Unknown column 'b' in 'field list' +ERROR 42S22: Unknown column 'b' in 'SELECT' call p_verify_reprepare_count(1); SUCCESS diff --git a/mysql-test/main/ps_mem_leaks.result b/mysql-test/main/ps_mem_leaks.result index c5b1a744ebffb..fa4f7e36ed967 100644 --- a/mysql-test/main/ps_mem_leaks.result +++ b/mysql-test/main/ps_mem_leaks.result @@ -325,6 +325,19 @@ PREPARE stmt FROM "UPDATE t SET a = 0 LIMIT ?"; EXECUTE stmt USING 0; EXECUTE stmt USING 1; DROP TABLE t; +# +# MDEV-35249: Assertion `(mem_root->flags & 4) == 0' failed in convert_subq_to_jtbm +# +CREATE TABLE t (a INT, b INT, c INT); +INSERT INTO t VALUES (1,2,3),(4,5,6); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t; +CREATE VIEW v2 AS SELECT * FROM v1; +PREPARE stmt FROM 'UPDATE t SET a = 0 WHERE b IN (SELECT c FROM v2)'; +EXECUTE stmt; +EXECUTE stmt; +DROP VIEW v2; +DROP VIEW v1; +DROP TABLE t; # End of 10.5 tests # # MDEV-33769: Memory leak found in the test main.rownum run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT diff --git a/mysql-test/main/ps_mem_leaks.test b/mysql-test/main/ps_mem_leaks.test index b7d560e2016a1..3374519908fda 100644 --- a/mysql-test/main/ps_mem_leaks.test +++ b/mysql-test/main/ps_mem_leaks.test @@ -323,6 +323,23 @@ EXECUTE stmt USING 1; # CLeanup DROP TABLE t; +--echo # +--echo # MDEV-35249: Assertion `(mem_root->flags & 4) == 0' failed in convert_subq_to_jtbm +--echo # + +CREATE TABLE t (a INT, b INT, c INT); +INSERT INTO t VALUES (1,2,3),(4,5,6); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t; +CREATE VIEW v2 AS SELECT * FROM v1; +PREPARE stmt FROM 'UPDATE t SET a = 0 WHERE b IN (SELECT c FROM v2)'; +EXECUTE stmt; +EXECUTE stmt; + +# Cleanup +DROP VIEW v2; +DROP VIEW v1; +DROP TABLE t; + --echo # End of 10.5 tests --echo # diff --git a/mysql-test/main/query_cache_with_views.result b/mysql-test/main/query_cache_with_views.result index 8cb3d8cb297c2..9cefa0cc6c14d 100644 --- a/mysql-test/main/query_cache_with_views.result +++ b/mysql-test/main/query_cache_with_views.result @@ -205,7 +205,7 @@ CREATE TABLE t2 LIKE t1; SET AUTOCOMMIT=OFF; CREATE VIEW t1_view AS SELECT c1 FROM t1 NATURAL JOIN t2 ; INSERT INTO t1_view (c1, c2) SELECT c1, c2 FROM t1; -ERROR 42S22: Unknown column 'c2' in 'field list' +ERROR 42S22: Unknown column 'c2' in 'INSERT INTO' DROP TABLE t1; DROP TABLE t2; DROP VIEW t1_view; diff --git a/mysql-test/main/replace_returning.result b/mysql-test/main/replace_returning.result index 1bc9bbd4cc55f..fef7aaddaa3fc 100644 --- a/mysql-test/main/replace_returning.result +++ b/mysql-test/main/replace_returning.result @@ -175,7 +175,7 @@ REPLACE INTO t1 VALUES(1,'a'),(2,'b'),(3,'c'); # SIMLPE REPLACE STATEMENT # REPLACE INTO t2(id2,val2) VALUES(1,'a') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2(id2,val2) values(2,'b') RETURNING SUM(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2(id2,val2) VALUES(3,'c') RETURNING (SELECT id1 FROM t1); @@ -197,7 +197,7 @@ ERROR 42S02: Unknown table 'test.t1' # Multiple rows in single insert statement # REPLACE INTO t2 VALUES(1,'a'),(2,'b') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2 VALUES(3,'c'),(4,'d') RETURNING MAX(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2 VALUES(5,'c'),(6,'f') RETURNING (SELECT id1 FROM t1); @@ -220,7 +220,7 @@ ERROR 42S02: Unknown table 'test.t1' # REPLACE ... SET # REPLACE INTO t2 SET id2=1, val2='a' RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2 SET id2=2, val2='b' RETURNING COUNT(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2 SET id2=3, val2='c' RETURNING (SELECT id1 FROM t1); @@ -242,7 +242,7 @@ ERROR 42S02: Unknown table 'test.t1' # REPLACE...SELECT # REPLACE INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=1 RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING MAX(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING (SELECT diff --git a/mysql-test/main/replace_returning_err.result b/mysql-test/main/replace_returning_err.result index 04ccdb6c5a59b..dd9d309d33638 100644 --- a/mysql-test/main/replace_returning_err.result +++ b/mysql-test/main/replace_returning_err.result @@ -5,7 +5,7 @@ INSERT INTO t1 VALUES(1, 'a'), (2, 'b'), (3, 'c'); # SIMLPE REPLACE STATEMENT # REPLACE INTO t2(id2, val2) VALUES(1, 'a') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2(id2, val2) values(2, 'b') RETURNING SUM(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2(id2, val2) VALUES(3, 'c') RETURNING(SELECT id1 FROM t1); @@ -20,7 +20,7 @@ ERROR HY000: Table 't2' is specified twice, both as a target for 'INSERT' and as # Multiple rows in single replace statement # REPLACE INTO t2 VALUES(1, 'a'), (2, 'b') RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2 VALUES(3, 'c'), (4, 'd') RETURNING MAX(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2 VALUES(5, 'c'), (6, 'f') RETURNING(SELECT id1 FROM t1); @@ -35,7 +35,7 @@ ERROR HY000: Table 't2' is specified twice, both as a target for 'INSERT' and as # REPLACE ... SET # REPLACE INTO t2 SET id2 = 1, val2 = 'a' RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2 SET id2 = 2, val2 = 'b' RETURNING COUNT(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2 SET id2 = 3, val2 = 'c' RETURNING(SELECT id1 FROM t1); @@ -50,7 +50,7 @@ ERROR HY000: Table 't2' is specified twice, both as a target for 'INSERT' and as # REPLACE...SELECT # REPLACE INTO t2(id2, val2) SELECT* FROM t1 WHERE id1 = 1 RETURNING id1; -ERROR 42S22: Unknown column 'id1' in 'field list' +ERROR 42S22: Unknown column 'id1' in 'RETURNING' REPLACE INTO t2(id2, val2) SELECT* FROM t1 WHERE id1 = 2 RETURNING MAX(id2); ERROR HY000: Invalid use of group function REPLACE INTO t2(id2, val2) SELECT* FROM t1 WHERE id1 = 2 RETURNING(SELECT id1 diff --git a/mysql-test/main/secondary_key_costs.result b/mysql-test/main/secondary_key_costs.result index 3a5b883068c87..09c6fa31cabf3 100644 --- a/mysql-test/main/secondary_key_costs.result +++ b/mysql-test/main/secondary_key_costs.result @@ -82,7 +82,7 @@ json_detailed(json_extract(@trace, '$**.considered_access_paths')) drop table t1, name, flag2; select @@optimizer_adjust_secondary_key_costs; @@optimizer_adjust_secondary_key_costs -fix_reuse_range_for_ref +fix_reuse_range_for_ref,fix_card_multiplier set @@optimizer_adjust_secondary_key_costs=7; select @@optimizer_adjust_secondary_key_costs; @@optimizer_adjust_secondary_key_costs diff --git a/mysql-test/main/select.result b/mysql-test/main/select.result index 18602caacc1d4..cfa31f507188a 100644 --- a/mysql-test/main/select.result +++ b/mysql-test/main/select.result @@ -2098,7 +2098,7 @@ DO benchmark(100,1+1),1,1; do default; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' +ERROR 42S22: Unknown column 'foobar' in 'DO' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -3090,13 +3090,13 @@ INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (2); INSERT INTO t3 VALUES (3); SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous drop table t1, t2, t3; create table t1 (a int(10),b int(10)); create table t2 (a int(10),b int(10)); @@ -3121,7 +3121,7 @@ select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); a c b b a 1 1 1 1 1 select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); a c b b a c 1 1 1 1 1 1 @@ -5597,7 +5597,7 @@ drop table t1; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10),(2,20); SELECT b, GROUP_CONCAT(b ORDER BY 2), MIN(a) AS f FROM t1 GROUP BY b ORDER BY f; -ERROR 42S22: Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'ORDER BY' DROP TABLE t1; # # Bug MDEV-24560 SIGSEGV in st_join_table::cleanup + server and client diff --git a/mysql-test/main/select_jcl6.result b/mysql-test/main/select_jcl6.result index 4ec370c08ed29..cf8f4f26ae067 100644 --- a/mysql-test/main/select_jcl6.result +++ b/mysql-test/main/select_jcl6.result @@ -2109,7 +2109,7 @@ DO benchmark(100,1+1),1,1; do default; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' +ERROR 42S22: Unknown column 'foobar' in 'DO' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -3101,13 +3101,13 @@ INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (2); INSERT INTO t3 VALUES (3); SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous drop table t1, t2, t3; create table t1 (a int(10),b int(10)); create table t2 (a int(10),b int(10)); @@ -3132,7 +3132,7 @@ select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); a c b b a 1 1 1 1 1 select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); a c b b a c 1 1 1 1 1 1 @@ -5608,7 +5608,7 @@ drop table t1; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10),(2,20); SELECT b, GROUP_CONCAT(b ORDER BY 2), MIN(a) AS f FROM t1 GROUP BY b ORDER BY f; -ERROR 42S22: Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'ORDER BY' DROP TABLE t1; # # Bug MDEV-24560 SIGSEGV in st_join_table::cleanup + server and client diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result index 18602caacc1d4..cfa31f507188a 100644 --- a/mysql-test/main/select_pkeycache.result +++ b/mysql-test/main/select_pkeycache.result @@ -2098,7 +2098,7 @@ DO benchmark(100,1+1),1,1; do default; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' +ERROR 42S22: Unknown column 'foobar' in 'DO' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -3090,13 +3090,13 @@ INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (2); INSERT INTO t3 VALUES (3); SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous +ERROR 23000: Column 'id' in FROM is ambiguous drop table t1, t2, t3; create table t1 (a int(10),b int(10)); create table t2 (a int(10),b int(10)); @@ -3121,7 +3121,7 @@ select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); a c b b a 1 1 1 1 1 select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' +ERROR 42S22: Unknown column 't1.a' in 'ON' select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); a c b b a c 1 1 1 1 1 1 @@ -5597,7 +5597,7 @@ drop table t1; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10),(2,20); SELECT b, GROUP_CONCAT(b ORDER BY 2), MIN(a) AS f FROM t1 GROUP BY b ORDER BY f; -ERROR 42S22: Unknown column '2' in 'order clause' +ERROR 42S22: Unknown column '2' in 'ORDER BY' DROP TABLE t1; # # Bug MDEV-24560 SIGSEGV in st_join_table::cleanup + server and client diff --git a/mysql-test/main/selectivity_innodb_notembedded.result b/mysql-test/main/selectivity_innodb_notembedded.result index 61e6330492a94..7931e28294e6f 100644 --- a/mysql-test/main/selectivity_innodb_notembedded.result +++ b/mysql-test/main/selectivity_innodb_notembedded.result @@ -230,26 +230,28 @@ index (key1, pk), primary key (pk) ); insert into t1 -select +select seq, FLOOR(seq/100), 'filler' -from +from seq_1_to_1000; analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK set optimizer_trace=1; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,key1 PRIMARY 4 NULL 5 Using where +create temporary table opt_trace as +select * from information_schema.optimizer_trace; # Must have a note that "multiplier is too high": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ [ @@ -260,15 +262,17 @@ JS { "index_name": "key1", "selectivity_from_index": 0.399, - "selectivity_multiplier": 90.9091 + "selectivity_multiplier": 90.9091, + "note": "multiplier too high, clipping", + "clipped_multiplier": 2.506265664 } ] ] # Must not include 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ { @@ -277,34 +281,36 @@ JS [ { "access_type": "range", - "resulting_rows": 181.3636545, - "cost": 1.79769e308, + "resulting_rows": 5, + "cost": 6.83879845, "chosen": true } ], "chosen_access_method": { "type": "range", - "records": 181.3636545, - "cost": 1.79769e308, + "records": 5, + "cost": 6.83879845, "uses_join_buffering": false } } ] +drop table opt_trace; # Disable the fix and try the same: set @@optimizer_adjust_secondary_key_costs=''; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,key1 PRIMARY 4 NULL 5 Using where -drop table t1; +create temporary table opt_trace as +select * from information_schema.optimizer_trace; # Shows a high multiplier, without a "note": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ [ @@ -320,10 +326,10 @@ JS ] ] # Includes 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ { @@ -346,7 +352,9 @@ JS } } ] +drop table opt_trace; set optimizer_adjust_secondary_key_costs=default; +drop table t1; # # Clean up # diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result index 262da1d33dfc5..a6f945b5bbc07 100644 --- a/mysql-test/main/selectivity_notembedded.result +++ b/mysql-test/main/selectivity_notembedded.result @@ -225,26 +225,28 @@ index (key1, pk), primary key (pk) ); insert into t1 -select +select seq, FLOOR(seq/100), 'filler' -from +from seq_1_to_1000; analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status Table is already up to date set optimizer_trace=1; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,key1 PRIMARY 4 NULL 5 Using index condition; Using where +create temporary table opt_trace as +select * from information_schema.optimizer_trace; # Must have a note that "multiplier is too high": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ [ @@ -255,15 +257,17 @@ JS { "index_name": "key1", "selectivity_from_index": 0.391, - "selectivity_multiplier": 90.9091 + "selectivity_multiplier": 90.9091, + "note": "multiplier too high, clipping", + "clipped_multiplier": 2.557544757 } ] ] # Must not include 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ { @@ -272,34 +276,36 @@ JS [ { "access_type": "range", - "resulting_rows": 177.7272905, - "cost": 1.79769e308, + "resulting_rows": 5, + "cost": 6.647684891, "chosen": true } ], "chosen_access_method": { "type": "range", - "records": 177.7272905, - "cost": 1.79769e308, + "records": 5, + "cost": 6.647684891, "uses_join_buffering": false } } ] +drop table opt_trace; # Disable the fix and try the same: set @@optimizer_adjust_secondary_key_costs=''; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,key1 PRIMARY 4 NULL 5 Using index condition; Using where -drop table t1; +create temporary table opt_trace as +select * from information_schema.optimizer_trace; # Shows a high multiplier, without a "note": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ [ @@ -315,10 +321,10 @@ JS ] ] # Includes 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from -information_schema.optimizer_trace; +from +opt_trace; JS [ { @@ -341,7 +347,9 @@ JS } } ] +drop table opt_trace; set optimizer_adjust_secondary_key_costs=default; +drop table t1; # # Clean up # diff --git a/mysql-test/main/selectivity_notembedded.test b/mysql-test/main/selectivity_notembedded.test index 2c4431adb2389..d53cb8db7b430 100644 --- a/mysql-test/main/selectivity_notembedded.test +++ b/mysql-test/main/selectivity_notembedded.test @@ -233,50 +233,59 @@ create table t1 ( ); insert into t1 -select +select seq, FLOOR(seq/100), 'filler' -from +from seq_1_to_1000; analyze table t1; set optimizer_trace=1; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; +create temporary table opt_trace as +select * from information_schema.optimizer_trace; + --echo # Must have a note that "multiplier is too high": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from - information_schema.optimizer_trace; +from + opt_trace; --echo # Must not include 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from - information_schema.optimizer_trace; +from + opt_trace; +drop table opt_trace; --echo # Disable the fix and try the same: set @@optimizer_adjust_secondary_key_costs=''; -explain select * from t1 +explain select * from t1 where pk in (1,2,3,4,5) and key1 <= 4; -drop table t1; + +create temporary table opt_trace as +select * from information_schema.optimizer_trace; + --echo # Shows a high multiplier, without a "note": -select +select json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS -from - information_schema.optimizer_trace; +from + opt_trace; --echo # Includes 1.79...e308 as cost: -select +select json_detailed(json_extract(trace,'$**.best_access_path')) as JS -from - information_schema.optimizer_trace; -set optimizer_adjust_secondary_key_costs=default; +from + opt_trace; +drop table opt_trace; +set optimizer_adjust_secondary_key_costs=default; +drop table t1; --echo # --echo # Clean up --echo # diff --git a/mysql-test/main/session_tracker_last_gtid.result b/mysql-test/main/session_tracker_sysvar.result similarity index 57% rename from mysql-test/main/session_tracker_last_gtid.result rename to mysql-test/main/session_tracker_sysvar.result index 5a78d5f03ce90..6b56cb400b862 100644 --- a/mysql-test/main/session_tracker_last_gtid.result +++ b/mysql-test/main/session_tracker_sysvar.result @@ -5,31 +5,35 @@ SET gtid_seq_no=1000; SET @@session.session_track_system_variables='last_gtid'; create table t1 (a int) engine=innodb; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- last_gtid --- 0-1-1000 +-- last_gtid: 0-1-1000 select @@last_gtid; @@last_gtid 0-1-1000 -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- last_gtid --- 0-1-1000 +-- last_gtid: 0-1-1000 insert into t1 values (1); -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- last_gtid --- 0-1-1001 +-- last_gtid: 0-1-1001 select @@last_gtid; @@last_gtid 0-1-1001 -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- last_gtid --- 0-1-1001 +-- last_gtid: 0-1-1001 drop table t1; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- last_gtid --- 0-1-1002 +-- last_gtid: 0-1-1002 reset master; +# +# MDEV-35086 Trying to lock mutex when the mutex was already locked (session_tracker.cc), server hangs +# +set session_track_system_variables='*'; +alter table t1 nowait force; +ERROR 42S02: Table 'test.t1' doesn't exist +use mysql; +set session_track_system_variables=default; +# End of 10.5 tests diff --git a/mysql-test/main/session_tracker_last_gtid.test b/mysql-test/main/session_tracker_sysvar.test similarity index 61% rename from mysql-test/main/session_tracker_last_gtid.test rename to mysql-test/main/session_tracker_sysvar.test index 58aee2de83718..54b69782697d5 100644 --- a/mysql-test/main/session_tracker_last_gtid.test +++ b/mysql-test/main/session_tracker_sysvar.test @@ -18,3 +18,14 @@ drop table t1; --disable_session_track_info reset master; + +--echo # +--echo # MDEV-35086 Trying to lock mutex when the mutex was already locked (session_tracker.cc), server hangs +--echo # +set session_track_system_variables='*'; +--error ER_NO_SUCH_TABLE +alter table t1 nowait force; +use mysql; +set session_track_system_variables=default; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/sp-dynamic.result b/mysql-test/main/sp-dynamic.result index ad11763b52331..c4f6f8cb0f9f9 100644 --- a/mysql-test/main/sp-dynamic.result +++ b/mysql-test/main/sp-dynamic.result @@ -228,9 +228,9 @@ prepare stmt from "select 'dynamic sql:', @a, a"; execute stmt; end| call p1()| -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' call p1()| -ERROR 42S22: Unknown column 'a' in 'field list' +ERROR 42S22: Unknown column 'a' in 'SELECT' set sql_mode= DEFAULT| drop procedure p1| create procedure p1() diff --git a/mysql-test/main/sp-error.result b/mysql-test/main/sp-error.result index c77f58b6a6691..cae89b6b31e63 100644 --- a/mysql-test/main/sp-error.result +++ b/mysql-test/main/sp-error.result @@ -1,4 +1,3 @@ -drop table if exists t1, t2; SELECT * FROM mysql.proc INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/proc.txt'; Warnings: Warning 1287 ' INTO FROM...' instead @@ -9,7 +8,6 @@ create procedure syntaxerror(t int)| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 create procedure syntaxerror(t int)| ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 -drop table if exists t3| create table t3 ( x int )| insert into t3 values (2), (3)| create procedure bad_into(out param int) @@ -166,7 +164,6 @@ open cc; close c; end| ERROR 42000: Undefined CURSOR: cc -drop table if exists t1| create table t1 (val int)| create procedure p() begin @@ -191,7 +188,6 @@ drop procedure p| alter procedure bar3 sql security invoker| ERROR 42000: PROCEDURE test.bar3 does not exist drop table t1| -drop table if exists t1| create table t1 (val int, x float)| insert into t1 values (42, 3.1), (19, 1.2)| create procedure p() @@ -276,7 +272,6 @@ declare continue handler for sqlstate '42S99' set x = 1; declare c cursor for select * from t1; end| ERROR 42000: Cursor declaration after handler declaration -drop procedure if exists p| create procedure p(in x int, inout y int, out z int) begin set y = x+y; @@ -307,7 +302,6 @@ lock tables t1 read, mysql.proc read| unlock tables| lock tables mysql.proc write| unlock tables| -drop function if exists f1| create function f1(i int) returns int begin insert into t1 (val) values (i); @@ -344,16 +338,15 @@ open c; close c; end| call bug1965()| -ERROR 42S22: Unknown column 'valname' in 'order clause' +ERROR 42S22: Unknown column 'valname' in 'ORDER BY' drop procedure bug1965| select 1 into a| ERROR 42000: Undeclared variable: a -drop table if exists t3| create table t3 (column_1_0 int)| create procedure bug1653() update t3 set column_1 = 0| call bug1653()| -ERROR 42S22: Unknown column 'column_1' in 'field list' +ERROR 42S22: Unknown column 'column_1' in 'SET' drop table t3| create table t3 (column_1 int)| call bug1653()| @@ -375,7 +368,7 @@ update t1 set v = 42; end| insert into t1 values (666, 51.3)| call bug2272()| -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'SET' truncate table t1| drop procedure bug2272| create procedure bug2329_1() @@ -389,9 +382,9 @@ declare v int; replace t1 set v = 5; end| call bug2329_1()| -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'INSERT INTO' call bug2329_2()| -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'INSERT INTO' drop procedure bug2329_1| drop procedure bug2329_2| create function bug3287() returns int @@ -415,7 +408,6 @@ end case| call bug3287(2)| ERROR 20000: Case not found for CASE statement drop procedure bug3287| -drop table if exists t3| create table t3 (s1 int, primary key (s1))| insert into t3 values (5),(6)| create procedure bug3279(out y int) @@ -457,7 +449,6 @@ create procedure bug4344() drop procedure bug4344| ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine create procedure bug4344() drop function bug4344| ERROR HY000: Can't drop or alter a FUNCTION from within another stored routine -drop procedure if exists bug3294| create procedure bug3294() begin declare continue handler for sqlexception drop table t5; @@ -468,10 +459,6 @@ create table t5 (x int)| call bug3294()| ERROR 42S02: Unknown table 'test.t5' drop procedure bug3294| -drop procedure if exists bug8776_1| -drop procedure if exists bug8776_2| -drop procedure if exists bug8776_3| -drop procedure if exists bug8776_4| create procedure bug8776_1() begin declare continue handler for sqlstate '42S0200test' begin end; @@ -505,7 +492,6 @@ ERROR 0A000: LOCK is not allowed in stored procedures create procedure bug6600() unlock table t1| ERROR 0A000: UNLOCK is not allowed in stored procedures -drop procedure if exists bug9566| create procedure bug9566() begin select * from t1; @@ -515,7 +501,6 @@ alter procedure bug9566 comment 'Some comment'| ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables| drop procedure bug9566| -drop procedure if exists bug7299| create procedure bug7299() begin declare v int; @@ -556,7 +541,6 @@ declare exit handler for condname1 select 1; declare exit handler for sqlstate '42000' select 2; end| ERROR 42000: Duplicate handler declared in the same block -drop procedure if exists bug9073| create procedure bug9073() begin declare condname1 condition for sqlstate '42000'; @@ -597,8 +581,6 @@ select b; return b; end| ERROR 0A000: Not allowed to return a result set from a function -drop function if exists bug8408_f| -drop procedure if exists bug8408_p| create function bug8408_f() returns int begin call bug8408_p(); @@ -626,11 +608,9 @@ val x bug8408() 7 7 3 drop function bug8408| truncate table t1| -drop procedure if exists bug10537| create procedure bug10537() load data local infile '/tmp/somefile' into table t1| ERROR 0A000: LOAD DATA is not allowed in stored procedures -drop function if exists bug8409| create function bug8409() returns int begin @@ -681,7 +661,6 @@ create procedure bug9529_9012345678901234567890123456789012345678901234567890123 begin end| ERROR 42000: Identifier name 'bug9529_901234567890123456789012345678901234567890123456789012345' is too long -drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234| create procedure bug17015_0123456789012345678901234567890123456789012345678901234() begin end| @@ -689,7 +668,6 @@ show procedure status like 'bug17015%'| Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop procedure bug17015_0123456789012345678901234567890123456789012345678901234| -drop procedure if exists bug10969| create procedure bug10969() begin declare s1 int default 0; @@ -733,10 +711,6 @@ TEMP_SUM ERROR 24000: Cursor is not open drop procedure SP001; drop table t1, t2; -drop function if exists bug11394| -drop function if exists bug11394_1| -drop function if exists bug11394_2| -drop procedure if exists bug11394| create function bug11394(i int) returns int begin if i <= 0 then @@ -784,8 +758,6 @@ CREATE TABLE t_bug_12490(a int); CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures DROP TABLE t_bug_12490; -drop function if exists bug11834_1; -drop function if exists bug11834_2; create function bug11834_1() returns int return 10; create function bug11834_2() returns int return bug11834_1(); prepare stmt from "select bug11834_2()"; @@ -800,14 +772,12 @@ execute stmt; ERROR 42000: FUNCTION test.bug11834_1 does not exist deallocate prepare stmt; drop function bug11834_2; -DROP FUNCTION IF EXISTS bug12953| CREATE FUNCTION bug12953() RETURNS INT BEGIN OPTIMIZE TABLE t1; RETURN 1; END| ERROR 0A000: Not allowed to return a result set from a function -DROP FUNCTION IF EXISTS bug12995| CREATE FUNCTION bug12995() RETURNS INT BEGIN HANDLER t1 OPEN; @@ -828,8 +798,6 @@ END| ERROR 0A000: HANDLER is not allowed in stored procedures SELECT bug12995()| ERROR 42000: FUNCTION test.bug12995 does not exist -drop procedure if exists bug12712; -drop function if exists bug12712; create procedure bug12712() set session autocommit = 0; select @@autocommit; @@ -875,10 +843,6 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger create trigger bug12712 before insert on t1 for each row set session autocommit = 0; ERROR HY000: Not allowed to set autocommit from a stored function or trigger -drop procedure if exists bug13510_1| -drop procedure if exists bug13510_2| -drop procedure if exists bug13510_3| -drop procedure if exists bug13510_4| create procedure bug13510_1() begin declare password varchar(10); @@ -915,7 +879,6 @@ names foo4 drop procedure bug13510_3| drop procedure bug13510_4| -drop function if exists bug_13627_f| CREATE TABLE t1 (a int)| CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; END | ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger @@ -1058,9 +1021,6 @@ select count(*) into param1 from t3; end| ERROR 3D000: No database selected use test; -DROP PROCEDURE IF EXISTS bug13037_p1; -DROP PROCEDURE IF EXISTS bug13037_p2; -DROP PROCEDURE IF EXISTS bug13037_p3; CREATE PROCEDURE bug13037_p1() BEGIN IF bug13037_foo THEN @@ -1078,13 +1038,13 @@ SELECT bug13037_foo; END| CALL bug13037_p2(); -ERROR 42S22: Unknown column 'bug13037_bar' in 'field list' +ERROR 42S22: Unknown column 'bug13037_bar' in 'SET' CALL bug13037_p3(); -ERROR 42S22: Unknown column 'bug13037_foo' in 'field list' +ERROR 42S22: Unknown column 'bug13037_foo' in 'SELECT' CALL bug13037_p2(); -ERROR 42S22: Unknown column 'bug13037_bar' in 'field list' +ERROR 42S22: Unknown column 'bug13037_bar' in 'SET' CALL bug13037_p3(); -ERROR 42S22: Unknown column 'bug13037_foo' in 'field list' +ERROR 42S22: Unknown column 'bug13037_foo' in 'SELECT' DROP PROCEDURE bug13037_p2; DROP PROCEDURE bug13037_p3; create database mysqltest1; @@ -1100,7 +1060,6 @@ Db Name Type Definer Modified Created Security_type Comment character_set_client mysqltest2 p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop database mysqltest2; use test; -DROP FUNCTION IF EXISTS bug13012| CREATE FUNCTION bug13012() RETURNS INT BEGIN REPAIR TABLE t1; @@ -1119,9 +1078,6 @@ ERROR 0A000: Not allowed to return a result set from a function drop table t1| drop procedure bug13012_1| drop function bug13012_2| -drop function if exists bug11555_1; -drop function if exists bug11555_2; -drop view if exists v1, v2, v3, v4; create function bug11555_1() returns int return (select max(i) from t1); create function bug11555_2() returns int return bug11555_1(); create view v1 as select bug11555_1(); @@ -1158,7 +1114,6 @@ ERROR 42S02: Table 'test.t2' doesn't exist drop function bug11555_1; drop table t1; drop view v1; -drop procedure if exists ` bug15658`; create procedure ``() select 1; ERROR 42000: Incorrect routine name '' create procedure ` `() select 1; @@ -1177,8 +1132,6 @@ show procedure status; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci drop procedure ` bug15658`; -drop function if exists bug14270; -drop table if exists t1; create table t1 (s1 int primary key); create function bug14270() returns int begin @@ -1193,7 +1146,6 @@ return 1; end| ERROR 0A000: Not allowed to return a result set from a function drop table t1; -drop procedure if exists bug15091; create procedure bug15091() begin declare selectstr varchar(6000) default ' '; @@ -1204,10 +1156,8 @@ c.operatorid, 'in (',conditionstr, ')'); end| ERROR 42000: Undeclared variable: c -drop function if exists bug16896; create aggregate function bug16896() returns int return 1; ERROR HY000: Aggregate specific instruction(FETCH GROUP NEXT ROW) missing from the aggregate function -DROP PROCEDURE IF EXISTS bug14702; CREATE IF NOT EXISTS PROCEDURE bug14702() BEGIN END; @@ -1218,7 +1168,6 @@ CREATE PROCEDURE IF NOT EXISTS bug14702() BEGIN END; DROP PROCEDURE IF EXISTS bug14702; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (i INT); CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO @a; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a' at line 1 @@ -1242,30 +1191,23 @@ ERROR HY000: View's SELECT contains a variable or parameter PREPARE stmt FROM "CREATE VIEW v AS SELECT ?"; ERROR HY000: View's SELECT contains a variable or parameter DROP TABLE t1; -drop tables if exists t1; -drop procedure if exists bug24491; create table t1 (id int primary key auto_increment, value varchar(10)); insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD'); create procedure bug24491() insert into t1 (id, value) select * from (select 4 as i, 'FOURTH' as v) as y on duplicate key update v = 'DUP'; call bug24491(); -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'UPDATE' call bug24491(); -ERROR 42S22: Unknown column 'v' in 'field list' +ERROR 42S22: Unknown column 'v' in 'UPDATE' drop procedure bug24491; create procedure bug24491() insert into t1 (id, value) select * from (select 4 as id, 'FOURTH' as value) as y on duplicate key update y.value = 'DUP'; call bug24491(); -ERROR 42S22: Unknown column 'y.value' in 'field list' +ERROR 42S22: Unknown column 'y.value' in 'UPDATE' call bug24491(); -ERROR 42S22: Unknown column 'y.value' in 'field list' +ERROR 42S22: Unknown column 'y.value' in 'UPDATE' drop procedure bug24491; drop tables t1; -DROP FUNCTION IF EXISTS bug18914_f1; -DROP FUNCTION IF EXISTS bug18914_f2; -DROP PROCEDURE IF EXISTS bug18914_p1; -DROP PROCEDURE IF EXISTS bug18914_p2; -DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (i INT); CREATE PROCEDURE bug18914_p1() CREATE TABLE t2 (i INT); CREATE PROCEDURE bug18914_p2() DROP TABLE IF EXISTS no_such_table; @@ -1294,9 +1236,6 @@ DROP FUNCTION bug18914_f2; DROP PROCEDURE bug18914_p1; DROP PROCEDURE bug18914_p2; DROP TABLE t1; -drop table if exists bogus_table_20713; -drop function if exists func_20713_a; -drop function if exists func_20713_b; create table bogus_table_20713( id int(10) not null primary key); insert into bogus_table_20713 values (1), (2), (3); create function func_20713_a() returns int(11) @@ -1348,11 +1287,6 @@ select @in_func; 2 drop function if exists func_20713_a; drop function if exists func_20713_b; -drop table if exists table_25345_a; -drop table if exists table_25345_b; -drop procedure if exists proc_25345; -drop function if exists func_25345; -drop function if exists func_25345_b; create table table_25345_a (a int); create table table_25345_b (b int); create procedure proc_25345() @@ -1394,14 +1328,12 @@ drop procedure proc_25345; drop function func_25345; drop function func_25345_b; End of 5.0 tests -drop function if exists bug16164; create function bug16164() returns int begin show authors; return 42; end| ERROR 0A000: Not allowed to return a result set from a function -drop function if exists bug20701; create function bug20701() returns varchar(25) binary return "test"; drop function bug20701; create function bug20701() returns varchar(25) return "test"; @@ -1458,8 +1390,6 @@ end until true end repeat retry; end// ERROR 42000: LEAVE with no matching label: retry -drop procedure if exists proc_28360; -drop function if exists func_28360; CREATE PROCEDURE proc_28360() BEGIN ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; @@ -1471,7 +1401,6 @@ ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; RETURN 0; END// ERROR HY000: Can't drop or alter a DATABASE from within another stored routine -DROP PROCEDURE IF EXISTS p1; CREATE PROCEDURE p1() BEGIN DECLARE c char(100); @@ -1487,7 +1416,6 @@ FETCH cur1 INTO c; select c; CLOSE cur1; END' at line 4 -DROP DATABASE IF EXISTS mysqltest; CREATE DATABASE mysqltest; USE mysqltest; DROP DATABASE mysqltest; @@ -1509,9 +1437,6 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger create trigger t1 before insert on t2 for each row set password = password('foo');| ERROR HY000: Not allowed to set autocommit from a stored function or trigger -drop function if exists f1; -drop function if exists f2; -drop table if exists t1, t2; create function f1() returns int begin drop temporary table t1; @@ -1557,10 +1482,6 @@ drop function f2; drop table t2; ERROR 42S02: Unknown table 'test.t2' End of 5.1 tests -drop procedure if exists proc_33983_a; -drop procedure if exists proc_33983_b; -drop procedure if exists proc_33983_c; -drop procedure if exists proc_33983_d; create procedure proc_33983_a() begin label1: @@ -1612,7 +1533,6 @@ CALL p1((SELECT * FROM t1))| ERROR 21000: Subquery returns more than 1 row DROP PROCEDURE IF EXISTS p1| DROP TABLE t1| -drop procedure if exists p1; create procedure p1() begin create table t1 (a int) engine=MyISAM; @@ -1621,7 +1541,6 @@ end| call p1(); call p1(); drop procedure p1; -drop procedure if exists proc_8759; create procedure proc_8759() begin declare should_be_illegal condition for sqlstate '00000'; @@ -1633,7 +1552,6 @@ begin declare continue handler for sqlstate '00000' set @x=0; end$$ ERROR 42000: Bad SQLSTATE: '00000' -drop procedure if exists proc_36510; create procedure proc_36510() begin declare should_be_illegal condition for sqlstate '00123'; @@ -1656,7 +1574,6 @@ begin declare continue handler for 0 set @x=0; end$$ ERROR HY000: Incorrect CONDITION value: '0' -drop procedure if exists p1; set @old_recursion_depth = @@max_sp_recursion_depth; set @@max_sp_recursion_depth = 255; create procedure p1(a int) @@ -1728,12 +1645,6 @@ End of 5.1 tests # - Case 1 -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; -DROP PROCEDURE IF EXISTS p4; -DROP PROCEDURE IF EXISTS p5; -DROP PROCEDURE IF EXISTS p6; CREATE PROCEDURE p1() BEGIN SELECT CAST('10 ' as unsigned integer); @@ -1827,7 +1738,6 @@ DROP PROCEDURE p6; # - Case 3: check that "Exception trumps No Data". -DROP TABLE IF EXISTS t1; CREATE TABLE t1(a INT); INSERT INTO t1 VALUES (1), (2), (3); CREATE PROCEDURE p1() @@ -1856,8 +1766,6 @@ DROP TABLE t1; # # Bug#36185: Incorrect precedence for warning and exception handlers # -DROP TABLE IF EXISTS t1; -DROP PROCEDURE IF EXISTS p1; CREATE TABLE t1 (a INT, b INT NOT NULL); CREATE PROCEDURE p1() BEGIN @@ -1929,9 +1837,6 @@ SET sql_mode = @sql_mode_saved; # # Bug#55850: Trigger warnings not cleared. # -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP PROCEDURE IF EXISTS p1; CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT); CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT, d SMALLINT, e SMALLINT, f SMALLINT); @@ -2551,8 +2456,6 @@ DROP PROCEDURE p13; # Bug#12731619: NESTED SP HANDLERS CAN TRIGGER ASSERTION -DROP FUNCTION IF EXISTS f1; -DROP TABLE IF EXISTS t1; CREATE TABLE t1(msg VARCHAR(255)); CREATE FUNCTION f1() RETURNS INT BEGIN @@ -2593,13 +2496,6 @@ DROP TABLE t1; # Check that handled SQL-conditions are properly cleared from DA. -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP PROCEDURE IF EXISTS p3; -DROP PROCEDURE IF EXISTS p4; -DROP PROCEDURE IF EXISTS p5; CREATE TABLE t1(a CHAR, b CHAR, c CHAR); CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT); @@ -2769,8 +2665,6 @@ DROP TABLE t2; # Check DECLARE statements that raise conditions before handlers # are declared. -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; SET sql_mode = ''| CREATE PROCEDURE p1() BEGIN @@ -2798,8 +2692,6 @@ DROP PROCEDURE p2; # # Bug#13113222 RQG_SIGNAL_RESIGNAL FAILED WITH ASSERTION. # -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; CREATE PROCEDURE p1() BEGIN DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT 'triggered p1'; @@ -2825,9 +2717,6 @@ DROP PROCEDURE p2; # Bug#12652873: 61392: Continue handler for NOT FOUND being triggered # from internal stored function. -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1, 2); diff --git a/mysql-test/main/sp-error.test b/mysql-test/main/sp-error.test index bb9868be1a180..d8c265335e4ad 100644 --- a/mysql-test/main/sp-error.test +++ b/mysql-test/main/sp-error.test @@ -4,10 +4,6 @@ --source include/default_charset.inc ---disable_warnings -drop table if exists t1, t2; ---enable_warnings - --disable_ps2_protocol # Backup the mysql.proc table --enable_prepare_warnings @@ -25,11 +21,11 @@ delimiter |; # This should give three syntax errors (sometimes crashed; bug #643) # (Unfortunately, this is not a 100% test, on some platforms this # passed despite the bug.) ---error 1064 +--error ER_PARSE_ERROR create procedure syntaxerror(t int)| ---error 1064 +--error ER_PARSE_ERROR create procedure syntaxerror(t int)| ---error 1064 +--error ER_PARSE_ERROR create procedure syntaxerror(t int)| # Check that we get the right error, i.e. UDF declaration parses correctly, @@ -37,13 +33,10 @@ create procedure syntaxerror(t int)| # This generates an error message containing a misleading errno which # might vary between systems (it usually doesn't have anything to do with # the actual failing dlopen()). -#--error 1126 +#--error ER_CANT_OPEN_LIBRARY #create function foo returns real soname "foo.so"| ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( x int )| insert into t3 values (2), (3)| @@ -52,7 +45,7 @@ create procedure bad_into(out param int) select x from t3 into param| --disable_prepare_warnings ---error 1172 +--error ER_TOO_MANY_ROWS call bad_into(@x)| drop procedure bad_into| @@ -66,18 +59,18 @@ create function func1() returns int return 42| # Can't create recursively ---error 1303 +--error ER_SP_NO_RECURSIVE_CREATE create procedure foo() create procedure bar() set @x=3| ---error 1303 +--error ER_SP_NO_RECURSIVE_CREATE create procedure foo() create function bar() returns double return 2.3| # Already exists ---error 1304 +--error ER_SP_ALREADY_EXISTS create procedure proc1() set @x = 42| ---error 1304 +--error ER_SP_ALREADY_EXISTS create function func1() returns int return 42| @@ -85,41 +78,41 @@ drop procedure proc1| drop function func1| # Does not exist ---error 1305 +--error ER_SP_DOES_NOT_EXIST alter procedure foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST alter function foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST drop procedure foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST drop function foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST call foo()| drop procedure if exists foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST show create procedure foo| ---error 1305 +--error ER_SP_DOES_NOT_EXIST show create function foo| # LEAVE/ITERATE with no match ---error 1308 +--error ER_SP_LILABEL_MISMATCH create procedure foo() foo: loop leave bar; end loop| ---error 1308 +--error ER_SP_LILABEL_MISMATCH create procedure foo() foo: loop iterate bar; end loop| ---error 1308 +--error ER_SP_LILABEL_MISMATCH create procedure foo() foo: begin iterate foo; end| # Redefining label ---error 1309 +--error ER_SP_LABEL_REDEFINE create procedure foo() foo: loop foo: loop @@ -128,14 +121,14 @@ foo: loop end loop foo| # End label mismatch ---error 1310 +--error ER_SP_LABEL_MISMATCH create procedure foo() foo: loop set @x=2; end loop bar| # RETURN in FUNCTION only ---error 1313 +--error ER_SP_BADRETURN create procedure foo() return 42| @@ -145,19 +138,19 @@ create procedure p(x int) create function f(x int) returns int return x+42| ---error 1318 +--error ER_SP_WRONG_NO_OF_ARGS call p()| ---error 1318 +--error ER_SP_WRONG_NO_OF_ARGS call p(1, 2)| ---error 1318 +--error ER_SP_WRONG_NO_OF_ARGS select f()| ---error 1318 +--error ER_SP_WRONG_NO_OF_ARGS select f(1, 2)| drop procedure p| drop function f| ---error 1319 +--error ER_SP_COND_MISMATCH create procedure p(val int, out res int) begin declare x int default 0; @@ -171,7 +164,7 @@ begin end if; end| ---error 1319 +--error ER_SP_COND_MISMATCH create procedure p(val int, out res int) begin declare x int default 0; @@ -186,7 +179,7 @@ begin end if; end| ---error 1320 +--error ER_SP_NORETURN create function f(val int) returns int begin declare x int; @@ -204,7 +197,7 @@ begin end if; end| ---error 1321 +--error ER_SP_NORETURNEND select f(10)| drop function f| @@ -218,7 +211,7 @@ begin close c; end| ---error 1323 +--error ER_SP_BAD_CURSOR_SELECT create procedure p() begin declare x int; @@ -228,7 +221,7 @@ begin close c; end| ---error 1324 +--error ER_SP_CURSOR_MISMATCH create procedure p() begin declare c cursor for select * from test.t; @@ -237,9 +230,6 @@ begin close c; end| ---disable_warnings -drop table if exists t1| ---enable_warnings create table t1 (val int)| create procedure p() @@ -250,7 +240,7 @@ begin open c; close c; end| ---error 1325 +--error ER_SP_CURSOR_ALREADY_OPEN call p()| drop procedure p| @@ -262,22 +252,19 @@ begin close c; close c; end| ---error 1326 +--error ER_SP_CURSOR_NOT_OPEN call p()| drop procedure p| ---error 1305 +--error ER_SP_DOES_NOT_EXIST alter procedure bar3 sql security invoker| drop table t1| ---disable_warnings -drop table if exists t1| ---enable_warnings create table t1 (val int, x float)| insert into t1 values (42, 3.1), (19, 1.2)| ---error 1327 +--error ER_SP_UNDECLARED_VAR create procedure p() begin declare x int; @@ -297,7 +284,7 @@ begin fetch c into x; close c; end| ---error 1328 +--error ER_SP_WRONG_NO_OF_FETCH_ARGS call p()| drop procedure p| @@ -312,34 +299,34 @@ begin fetch c into x, y, z; close c; end| ---error 1328 +--error ER_SP_WRONG_NO_OF_FETCH_ARGS call p()| drop procedure p| ---error 1330 +--error ER_SP_DUP_PARAM create procedure p(in x int, x char(10)) begin end| ---error 1330 +--error ER_SP_DUP_PARAM create function p(x int, x char(10)) begin end| ---error 1331 +--error ER_SP_DUP_VAR create procedure p() begin declare x float; declare x int; end| ---error 1332 +--error ER_SP_DUP_COND create procedure p() begin declare c condition for 1064; declare c condition for 1065; end| ---error 1333 +--error ER_SP_DUP_CURS create procedure p() begin declare c cursor for select * from t1; @@ -352,13 +339,13 @@ create procedure u() use sptmp| # Enforced standard order of declarations ---error 1337 +--error ER_SP_VARCOND_AFTER_CURSHNDLR create procedure p() begin declare c cursor for select * from t1; declare x int; end| ---error 1337 +--error ER_SP_VARCOND_AFTER_CURSHNDLR create procedure p() begin declare x int; @@ -366,7 +353,7 @@ begin declare foo condition for sqlstate '42S99'; end| ---error 1338 +--error ER_SP_CURSOR_AFTER_HANDLER create procedure p() begin declare x int; @@ -375,9 +362,6 @@ begin end| # Check in and inout arguments. ---disable_warnings -drop procedure if exists p| ---enable_warnings create procedure p(in x int, inout y int, out z int) begin set y = x+y; @@ -427,9 +411,6 @@ unlock tables| # are used by statements which invoke these functions. # --disable_ps2_protocol ---disable_warnings -drop function if exists f1| ---enable_warnings create function f1(i int) returns int begin insert into t1 (val) values (i); @@ -462,28 +443,25 @@ begin close c; end| ---error 1054 +--error ER_BAD_FIELD_ERROR call bug1965()| drop procedure bug1965| # # BUG#1966 # ---error 1327 +--error ER_SP_UNDECLARED_VAR select 1 into a| # # BUG#1653 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (column_1_0 int)| create procedure bug1653() update t3 set column_1 = 0| ---error 1054 +--error ER_BAD_FIELD_ERROR call bug1653()| drop table t3| create table t3 (column_1 int)| @@ -505,7 +483,7 @@ begin fetch c1 into v1; end| ---error 1326 +--error ER_SP_CURSOR_NOT_OPEN call bug2259()| drop procedure bug2259| @@ -520,7 +498,7 @@ begin end| insert into t1 values (666, 51.3)| ---error 1054 +--error ER_BAD_FIELD_ERROR call bug2272()| truncate table t1| drop procedure bug2272| @@ -542,9 +520,9 @@ begin replace t1 set v = 5; end| ---error 1054 +--error ER_BAD_FIELD_ERROR call bug2329_1()| ---error 1054 +--error ER_BAD_FIELD_ERROR call bug2329_2()| drop procedure bug2329_1| drop procedure bug2329_2| @@ -561,7 +539,7 @@ begin end case; return 2; end| ---error 1339 +--error ER_SP_CASE_NOT_FOUND select bug3287()| drop function bug3287| @@ -572,16 +550,13 @@ when 0 then when 1 then insert into test.t1 values (x, 1.1); end case| ---error 1339 +--error ER_SP_CASE_NOT_FOUND call bug3287(2)| drop procedure bug3287| # # BUG#3297 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (s1 int, primary key (s1))| insert into t3 values (5),(6)| @@ -609,7 +584,7 @@ drop table t3| # # BUG#3339 # ---error 1049 +--error ER_BAD_DB_ERROR create procedure nodb.bug3339() begin end| # @@ -634,17 +609,14 @@ end| # # BUG#4344 # ---error 1357 +--error ER_SP_NO_DROP_SP create procedure bug4344() drop procedure bug4344| ---error 1357 +--error ER_SP_NO_DROP_SP create procedure bug4344() drop function bug4344| # # BUG#3294: Stored procedure crash if table dropped before use # (Actually, when an error occurs within an error handler.) ---disable_warnings -drop procedure if exists bug3294| ---enable_warnings create procedure bug3294() begin declare continue handler for sqlexception drop table t5; @@ -653,7 +625,7 @@ begin end| create table t5 (x int)| ---error 1051 +--error ER_BAD_TABLE_ERROR call bug3294()| drop procedure bug3294| @@ -661,12 +633,6 @@ drop procedure bug3294| # BUG#876: Stored Procedures: Invalid SQLSTATE is allowed in # a DECLARE ? HANDLER FOR stmt. # ---disable_warnings -drop procedure if exists bug8776_1| -drop procedure if exists bug8776_2| -drop procedure if exists bug8776_3| -drop procedure if exists bug8776_4| ---enable_warnings --error ER_SP_BAD_SQLSTATE create procedure bug8776_1() begin @@ -718,9 +684,6 @@ create procedure bug6600() # We should not think that mysql.proc table does not exist if we are unable # to open it under LOCK TABLE or in prelocked mode. # ---disable_warnings -drop procedure if exists bug9566| ---enable_warnings create procedure bug9566() begin select * from t1; @@ -739,9 +702,6 @@ drop procedure bug9566| # # BUG#7299: Stored procedures: exception handler catches not-found conditions # ---disable_warnings -drop procedure if exists bug7299| ---enable_warnings create procedure bug7299() begin declare v int; @@ -791,9 +751,6 @@ begin end| # This should still work. ---disable_warnings -drop procedure if exists bug9073| ---enable_warnings create procedure bug9073() begin declare condname1 condition for sqlstate '42000'; @@ -848,11 +805,6 @@ begin return b; end| ---disable_warnings -drop function if exists bug8408_f| -drop procedure if exists bug8408_p| ---enable_warnings - # Some things must be caught at invokation time create function bug8408_f() returns int begin @@ -888,9 +840,6 @@ truncate table t1| # BUG#10537: Server crashes while loading data file into table through # procedure. # Disable load until it's PS and SP safe ---disable_warnings -drop procedure if exists bug10537| ---enable_warnings --error ER_SP_BADSTATEMENT create procedure bug10537() load data local infile '/tmp/somefile' into table t1| @@ -899,9 +848,6 @@ create procedure bug10537() # # BUG#8409: Stored procedure crash if function contains FLUSH # ---disable_warnings -drop function if exists bug8409| ---enable_warnings --error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG create function bug8409() returns int @@ -961,9 +907,6 @@ create procedure bug9529_9012345678901234567890123456789012345678901234567890123 begin end| ---disable_warnings -drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234| ---enable_warnings # Check the upper limit, just to make sure. create procedure bug17015_0123456789012345678901234567890123456789012345678901234() begin @@ -977,9 +920,6 @@ drop procedure bug17015_0123456789012345678901234567890123456789012345678901234| # # BUG#10969: Stored procedures: crash if default() function # ---disable_warnings -drop procedure if exists bug10969| ---enable_warnings --error ER_WRONG_COLUMN_NAME create procedure bug10969() begin @@ -1032,7 +972,7 @@ P1: BEGIN SELECT 'end of proc'; END P1| delimiter ;| ---error 1326 +--error ER_SP_CURSOR_NOT_OPEN call SP001(); drop procedure SP001; drop table t1, t2; @@ -1042,12 +982,6 @@ drop table t1, t2; # We have to disable recursion since in many cases LEX and many # Item's can't be used in reentrant way nowdays. delimiter |; ---disable_warnings -drop function if exists bug11394| -drop function if exists bug11394_1| -drop function if exists bug11394_2| -drop procedure if exists bug11394| ---enable_warnings create function bug11394(i int) returns int begin if i <= 0 then @@ -1058,7 +992,7 @@ begin end| # If we allow recursive functions without additional modifications # this will crash server since Item for "IN" is not reenterable. ---error 1424 +--error ER_SP_NO_RECURSION select bug11394(2)| drop function bug11394| create function bug11394_1(i int) returns int @@ -1071,7 +1005,7 @@ begin end| # The following statement will crash because some LEX members responsible # for selects cannot be used in reentrant fashion. ---error 1424 +--error ER_SP_NO_RECURSION select bug11394_1(2)| drop function bug11394_1| # Note that the following should be allowed since it does not contains @@ -1111,10 +1045,6 @@ DROP TABLE t_bug_12490; # crashes server". Also tests handling of prepared stmts which use # stored functions but does not require prelocking. # ---disable_warnings -drop function if exists bug11834_1; -drop function if exists bug11834_2; ---enable_warnings create function bug11834_1() returns int return 10; create function bug11834_2() returns int return bug11834_1(); prepare stmt from "select bug11834_2()"; @@ -1137,9 +1067,6 @@ drop function bug11834_2; # Bug#12953 "Stored procedures: crash if OPTIMIZE TABLE in function" # delimiter |; ---disable_warnings -DROP FUNCTION IF EXISTS bug12953| ---enable_warnings --error ER_SP_NO_RETSET CREATE FUNCTION bug12953() RETURNS INT BEGIN @@ -1152,9 +1079,6 @@ delimiter ;| # Bug##12995 "Inside function "Table 't4' was not locked with LOCK TABLES" # delimiter |; ---disable_warnings -DROP FUNCTION IF EXISTS bug12995| ---enable_warnings --error ER_SP_BADSTATEMENT CREATE FUNCTION bug12995() RETURNS INT BEGIN @@ -1173,7 +1097,7 @@ BEGIN HANDLER t1 CLOSE; RETURN 1; END| ---error 1305 +--error ER_SP_DOES_NOT_EXIST SELECT bug12995()| delimiter ;| @@ -1181,10 +1105,6 @@ delimiter ;| # # BUG#12712: SET AUTOCOMMIT should fail within SP/functions/triggers # ---disable_warnings -drop procedure if exists bug12712; -drop function if exists bug12712; ---enable_warnings # Can... create procedure bug12712() set session autocommit = 0; @@ -1238,9 +1158,6 @@ create trigger bug12712 # BUG#9367: Stored procedures: client hang after "show warnings" # --disable_parsing ---disable_warnings -drop procedure if exists bug9367; ---enable_warnings create table t1 (s1 int); select s1 from t1; delimiter |; @@ -1263,13 +1180,6 @@ drop table t1; # BUG#13510: Setting password local variable changes current password # delimiter |; ---disable_warnings -drop procedure if exists bug13510_1| -drop procedure if exists bug13510_2| -drop procedure if exists bug13510_3| -drop procedure if exists bug13510_4| ---enable_warnings - --error ER_SP_BAD_VAR_SHADOW create procedure bug13510_1() begin @@ -1321,10 +1231,6 @@ drop procedure bug13510_4| # containing such statement should produce error (includes test for # bug #13627). # ---disable_warnings -drop function if exists bug_13627_f| ---enable_warnings - CREATE TABLE t1 (a int)| -- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; END | @@ -1505,12 +1411,6 @@ use test; # BUG#13037: undefined variable in IF cause erroneous error-message # ---disable_warnings -DROP PROCEDURE IF EXISTS bug13037_p1; -DROP PROCEDURE IF EXISTS bug13037_p2; -DROP PROCEDURE IF EXISTS bug13037_p3; ---enable_warnings - delimiter |; --error ER_SP_UNDECLARED_VAR @@ -1535,14 +1435,14 @@ delimiter ;| --echo ---error 1054 +--error ER_BAD_FIELD_ERROR CALL bug13037_p2(); ---error 1054 +--error ER_BAD_FIELD_ERROR CALL bug13037_p3(); ---error 1054 +--error ER_BAD_FIELD_ERROR CALL bug13037_p2(); ---error 1054 +--error ER_BAD_FIELD_ERROR CALL bug13037_p3(); DROP PROCEDURE bug13037_p2; @@ -1568,9 +1468,6 @@ use test; # Bug#13012 "SP: REPAIR/BACKUP/RESTORE TABLE crashes the server" # delimiter |; ---disable_warnings -DROP FUNCTION IF EXISTS bug13012| ---enable_warnings --error ER_SP_NO_RETSET CREATE FUNCTION bug13012() RETURNS INT BEGIN @@ -1602,11 +1499,6 @@ delimiter ;| # dropped simultaneously with table (DROP TABLE with CASCADE clause). # So these tests probably should go away once we will implement standard # behavior. ---disable_warnings -drop function if exists bug11555_1; -drop function if exists bug11555_2; -drop view if exists v1, v2, v3, v4; ---enable_warnings create function bug11555_1() returns int return (select max(i) from t1); create function bug11555_2() returns int return bug11555_1(); # It is OK to report name of implicitly used table which is missing @@ -1660,10 +1552,6 @@ drop view v1; # # BUG#15658: Server crashes after creating function as empty string # ---disable_warnings -drop procedure if exists ` bug15658`; ---enable_warnings - --error ER_SP_WRONG_NAME create procedure ``() select 1; --error ER_SP_WRONG_NAME @@ -1686,11 +1574,6 @@ drop procedure ` bug15658`; # # BUG#14270: Stored procedures: crash if load index # ---disable_warnings -drop function if exists bug14270; -drop table if exists t1; ---enable_warnings - create table t1 (s1 int primary key); delimiter |; @@ -1716,10 +1599,6 @@ drop table t1; # BUG#15091: Sp Returns Unknown error in order clause....and # there is no order by clause # ---disable_warnings -drop procedure if exists bug15091; ---enable_warnings - delimiter |; --error ER_SP_UNDECLARED_VAR create procedure bug15091() @@ -1738,9 +1617,6 @@ delimiter ;| # # BUG#16896: Stored function: unused AGGREGATE-clause in CREATE FUNCTION # ---disable_warnings -drop function if exists bug16896; ---enable_warnings --error ER_INVALID_AGGREGATE_FUNCTION create aggregate function bug16896() returns int return 1; @@ -1753,10 +1629,6 @@ create aggregate function bug16896() returns int return 1; # Misleading error message was given when IF NOT EXISTS was used in # CREATE PROCEDURE. # ---disable_warnings -DROP PROCEDURE IF EXISTS bug14702; ---enable_warnings - --error ER_PARSE_ERROR CREATE IF NOT EXISTS PROCEDURE bug14702() BEGIN @@ -1773,10 +1645,6 @@ DROP PROCEDURE IF EXISTS bug14702; # # See test case for what syntax is forbidden in a view. # ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - CREATE TABLE t1 (i INT); # We do not have to drop this procedure and view because they won't be @@ -1811,10 +1679,6 @@ DROP TABLE t1; # # BUG#24491 "using alias from source table in insert ... on duplicate key" # ---disable_warnings -drop tables if exists t1; -drop procedure if exists bug24491; ---enable_warnings create table t1 (id int primary key auto_increment, value varchar(10)); insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD'); # Let us create routine with INSERT ... SELECT ... ON DUPLICATE KEY UPDATE @@ -1848,14 +1712,6 @@ drop tables t1; # DROP TABLE IF EXISTS is also fixed to give correct error instead of # "Table doesn't exist". # ---disable_warnings -DROP FUNCTION IF EXISTS bug18914_f1; -DROP FUNCTION IF EXISTS bug18914_f2; -DROP PROCEDURE IF EXISTS bug18914_p1; -DROP PROCEDURE IF EXISTS bug18914_p2; -DROP TABLE IF EXISTS t1, t2; ---enable_warnings - CREATE TABLE t1 (i INT); CREATE PROCEDURE bug18914_p1() CREATE TABLE t2 (i INT); @@ -1900,12 +1756,6 @@ DROP TABLE t1; # Bug#20713 (Functions will not not continue for SQLSTATE VALUE '42S02') # ---disable_warnings -drop table if exists bogus_table_20713; -drop function if exists func_20713_a; -drop function if exists func_20713_b; ---enable_warnings - create table bogus_table_20713( id int(10) not null primary key); insert into bogus_table_20713 values (1), (2), (3); @@ -1964,14 +1814,6 @@ drop function if exists func_20713_b; # Bug#25345 (Cursors from Functions) # ---disable_warnings -drop table if exists table_25345_a; -drop table if exists table_25345_b; -drop procedure if exists proc_25345; -drop function if exists func_25345; -drop function if exists func_25345_b; ---enable_warnings - create table table_25345_a (a int); create table table_25345_b (b int); @@ -2027,9 +1869,6 @@ drop function func_25345_b; # Bug#16164 "Easter egg": check that SHOW AUTHORS is disabled in # stored functions/triggers # ---disable_warnings -drop function if exists bug16164; ---enable_warnings delimiter |; --error ER_SP_NO_RETSET create function bug16164() returns int @@ -2043,9 +1882,6 @@ delimiter ;| # # BUG#20701: BINARY keyword should be forbidden in stored routines # ---disable_warnings -drop function if exists bug20701; ---enable_warnings create function bug20701() returns varchar(25) binary return "test"; drop function bug20701; create function bug20701() returns varchar(25) return "test"; @@ -2124,11 +1960,6 @@ delimiter ;// # Bug#28360 (RENAME DATABASE destroys routines) # ---disable_warnings -drop procedure if exists proc_28360; -drop function if exists func_28360; ---enable_warnings - delimiter //; --error ER_SP_NO_DROP_SP @@ -2151,9 +1982,6 @@ delimiter ;// # Bug#29223 declare cursor c for SHOW ..... # ---disable_warnings -DROP PROCEDURE IF EXISTS p1; ---enable_warnings --delimiter | --error ER_PARSE_ERROR CREATE PROCEDURE p1() @@ -2172,9 +2000,6 @@ END| # Bug#29816 Syntactically wrong query fails with misleading error message # ---disable_warnings -DROP DATABASE IF EXISTS mysqltest; ---enable_warnings CREATE DATABASE mysqltest; USE mysqltest; DROP DATABASE mysqltest; @@ -2214,12 +2039,6 @@ delimiter ;| # Bug#30882 Dropping a temporary table inside a stored function may cause a server crash # ---disable_warnings -drop function if exists f1; -drop function if exists f2; -drop table if exists t1, t2; ---enable_warnings - delimiter |; create function f1() returns int begin @@ -2284,13 +2103,6 @@ drop table t2; # Bug#33983 (Stored Procedures: wrong end