1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge branch '11.6' into 11.7

This commit is contained in:
Oleksandr Byelkin
2024-11-09 19:01:12 +01:00
789 changed files with 10342 additions and 4415 deletions

View File

@@ -2105,7 +2105,7 @@ static MYSQL* connect_to_db(char *host, char *user,char *passwd)
goto err;
/* Set server side timeout between client commands to server compiled-in default */
if(mysql_query_with_error_report(con,0, "/*!100100 SET WAIT_TIMEOUT=DEFAULT */"))
if(mysql_query_with_error_report(con,0, "/*M!100100 SET WAIT_TIMEOUT=DEFAULT */"))
goto err;
DBUG_RETURN(con);
@@ -4435,7 +4435,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
if (versioned && !opt_xml && opt_dump_history)
{
fprintf(md_result_file,"/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;\n");
fprintf(md_result_file,"/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;\n");
check_io(md_result_file);
}
if (opt_lock)
@@ -4737,7 +4737,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
}
if (versioned && !opt_xml && opt_dump_history)
{
fprintf(md_result_file,"/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;\n");
fprintf(md_result_file,"/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;\n");
check_io(md_result_file);
}
mysql_free_result(res);

View File

@@ -1507,7 +1507,10 @@ void free_used_memory()
DBUG_ENTER("free_used_memory");
if (connections)
{
close_connections();
cur_con= NULL;
}
close_files();
my_hash_free(&var_hash);
@@ -3941,9 +3944,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;
}
@@ -8027,6 +8030,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.
*/
@@ -8036,11 +8053,16 @@ static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql)
if (!(mysql->server_status & SERVER_SESSION_STATE_CHANGED))
return;
#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))
@@ -8056,26 +8078,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("<NULL>"));
dynstr_append_mem(ds_type, STRING_WITH_LEN("<NULL>"));
}
else
dynstr_append_mem(ds, data, data_length);
dynstr_append_mem(ds_type, data, data_length);
}
dynstr_append_mem(ds, STRING_WITH_LEN("\n\n"));
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);
}
else
dynstr_append_mem(ds, STRING_WITH_LEN("\n\n"));
}
#endif /* EMBEDDED_LIBRARY */
}
@@ -12220,7 +12272,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()

View File

@@ -172,12 +172,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()

View File

@@ -249,7 +249,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)

View File

@@ -15,8 +15,8 @@ MACRO(BUNDLE_LIBFMT)
ExternalProject_Add(
libfmt
PREFIX "${dir}"
URL "https://github.com/fmtlib/fmt/releases/download/11.0.1/fmt-11.0.1.zip"
URL_MD5 5f3915e2eff60e7f70c558120592100d
URL "https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip"
URL_MD5 c622dca45ec3fc95254c48370a9f7a1d
INSTALL_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View File

@@ -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})

View File

@@ -37,6 +37,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})

View File

@@ -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

View File

@@ -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_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)

View File

@@ -519,7 +519,7 @@ static bool is_page_corrupted(byte *buf, bool is_encrypted, uint32_t flags)
normal method. */
if (is_encrypted && key_version != 0) {
is_corrupted = use_full_crc32
? buf_page_is_corrupted(true, buf, flags)
? !!buf_page_is_corrupted(false, buf, flags)
: !fil_space_verify_crypt_checksum(buf, zip_size);
if (is_corrupted && log_file) {

View File

@@ -283,7 +283,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
}
if (space->full_crc32()) {
return buf_page_is_corrupted(true, page, space->flags);
return buf_page_is_corrupted(false, page, space->flags);
}
/* Validate encrypted pages. The first page is never encrypted.
@@ -316,7 +316,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
}
if (page_type != FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
return buf_page_is_corrupted(true, tmp_page,
return buf_page_is_corrupted(false, tmp_page,
space->flags);
}
}
@@ -336,11 +336,11 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
&& cursor->zip_size)
|| page_type == FIL_PAGE_PAGE_COMPRESSED
|| page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
|| buf_page_is_corrupted(true, tmp_page,
|| buf_page_is_corrupted(false, tmp_page,
space->flags));
}
return buf_page_is_corrupted(true, page, space->flags);
return buf_page_is_corrupted(false, page, space->flags);
}
PRAGMA_REENABLE_CHECK_STACK_FRAME

View File

@@ -1185,27 +1185,25 @@ static void backup_file_op_fail(uint32_t space_id, int type,
const byte* new_name, ulint new_len)
{
bool fail = false;
switch(type) {
const static std::string spacename{filename_to_spacename(name, len)};
switch (type) {
case FILE_CREATE:
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str());
fail = !check_if_skip_table(spacename.c_str());
break;
case FILE_MODIFY:
break;
case FILE_RENAME:
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str())
fail = !check_if_skip_table(spacename.c_str())
|| !check_if_skip_table(
filename_to_spacename(new_name, new_len).c_str());
break;
case FILE_DELETE:
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str())
&& !check_if_fts_table(reinterpret_cast<const char*>(name));
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
fail = !check_if_skip_table(spacename.c_str())
&& !check_if_fts_table(spacename.c_str());
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
break;
default:
ut_ad(0);
@@ -2651,7 +2649,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
@@ -2676,13 +2674,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;
@@ -3426,7 +3420,8 @@ static bool xtrabackup_copy_mmap_logfile()
recv_sys_t::parse_mtr_result r;
const byte *start= &log_sys.buf[recv_sys.offset];
if (recv_sys.parse_mmap<false>(false) == recv_sys_t::OK)
if (recv_sys.parse_mmap<recv_sys_t::store::BACKUP>(false) ==
recv_sys_t::OK)
{
const byte *end;
@@ -3446,7 +3441,8 @@ static bool xtrabackup_copy_mmap_logfile()
start = seq + 1;
}
}
while ((r= recv_sys.parse_mmap<false>(false)) == recv_sys_t::OK);
while ((r= recv_sys.parse_mmap<recv_sys_t::store::BACKUP>(false)) ==
recv_sys_t::OK);
end= &log_sys.buf[recv_sys.offset];
@@ -3551,7 +3547,8 @@ static bool xtrabackup_copy_logfile()
if (log_sys.buf[recv_sys.offset] <= 1)
break;
if (recv_sys.parse_mtr<false>(false) == recv_sys_t::OK)
if (recv_sys.parse_mtr<recv_sys_t::store::BACKUP>(false) ==
recv_sys_t::OK)
{
do
{
@@ -3561,7 +3558,8 @@ static bool xtrabackup_copy_logfile()
sequence_offset));
*seq= 1;
}
while ((r= recv_sys.parse_mtr<false>(false)) == recv_sys_t::OK);
while ((r= recv_sys.parse_mtr<recv_sys_t::store::BACKUP>(false)) ==
recv_sys_t::OK);
if (ds_write(dst_log_file, log_sys.buf + start_offset,
recv_sys.offset - start_offset))
@@ -3909,16 +3907,18 @@ static void xb_load_single_table_tablespace(const char *dirname,
if (is_remote) {
RemoteDatafile* rf = new RemoteDatafile();
if (!rf->open_link_file(n)) {
die("Can't open datafile %s", name);
}
file = rf;
if (!rf->open_link_file(n)) {
goto cant_open;
}
} else {
file = new Datafile();
file->make_filepath(".", n, IBD);
}
if (file->open_read_only(true) != DB_SUCCESS) {
cant_open:
delete file;
// Ignore FTS tables, as they can be removed for intermediate tables,
// this code must be executed under stronger or equal to BLOCK_DDL lock,
// so there must not be errors for non-intermediate FTS tables.
@@ -3929,7 +3929,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
for (int i = 0; i < 10; i++) {
file->m_defer = false;
err = file->validate_first_page();
err = file->validate_first_page(file->get_first_page());
if (file->m_defer) {
if (defer_space_id) {
@@ -3971,7 +3971,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
skip_node_page0 ? file->detach() : pfs_os_file_t(),
0, false, false);
node->deferred= defer;
if (!space->read_page0())
if (!space->read_page0(nullptr, true))
err = DB_CANNOT_OPEN_FILE;
mysql_mutex_unlock(&fil_system.mutex);
@@ -6863,8 +6863,10 @@ error:
goto error;
}
ok = fil_system.sys_space->open(false)
&& xtrabackup_apply_deltas();
mysql_mutex_lock(&recv_sys.mutex);
ok = fil_system.sys_space->open(false);
mysql_mutex_unlock(&recv_sys.mutex);
if (ok) ok = xtrabackup_apply_deltas();
xb_data_files_close();
@@ -7547,7 +7549,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)
@@ -7558,8 +7559,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 )
@@ -7852,32 +7853,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<uint32_t>(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. */

View File

@@ -289,12 +289,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;
@@ -310,7 +317,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);
}

View File

@@ -835,7 +835,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

View File

@@ -17,6 +17,65 @@
#ifndef _my_stack_alloc_h
#define _my_stack_alloc_h
#ifdef _MSC_VER
#include <intrin.h> // For MSVC-specific intrinsics
#else
#include <sys/resource.h>
#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 cant 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);

View File

@@ -683,6 +683,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);

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\fBMARIADB-DUMP\fR" "1" "3 September 2024" "MariaDB 11.4" "MariaDB Database System"
.TH "\fBMARIADB-DUMP\fR" "1" "8 October 2024" "MariaDB 11.6" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -739,6 +739,26 @@ statement to the server after performing the dump operation\&. This option autom
.sp -1
.IP \(bu 2.3
.\}
.\" mariadb-dump: dir option
.\" dirs option: mariadb-dump
\fB\-\-dir\fR
.sp
Parallel dump of multiple databases. Works just like \fB\-\-tab\fR, with regard to output
(sql file for table definition and tab-separated for data, same options, e.g \fB\-\-parallel\fR)\&.
It also allows the \fB\-\-databases\fR and \fB\-\-all-databases\fR options\&. When \fB\-\-dir\fR is used,
it creates the directory structure in the output directory pointed to by \fB\-\-dir\fR\&. For
every database to be dumped, there will be a directory with the database name\&. All
options that \fB\-\-tab\fR supports are also supported by \fB\-\-dir\fR, in particular \fB\-\-parallel\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mariadb-dump: disable-keys option
.\" disable-keys option: mariadb-dump
\fB\-\-disable\-keys\fR,

View File

@@ -464,6 +464,22 @@ first argument\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mariadb-import: parallel option
.\" paralle option: mariadb-import
\fB\-\-parallel=\fR\fB\fIN\fR\fR,
\fB\-j \fR\fB\fIN\fR\fR\fR
.sp
Number of LOAD DATA jobs executed in parallel. \-\-use-threads is a synonym\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mariadb-import: password option
.\" password option: mariadb-import
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
@@ -792,7 +808,7 @@ The MariaDB user name to use when connecting to the server\&.
.sp
Load files in parallel using
\fIN\fR
threads\&.
threads\&. Synonym for \-j, \-\-parallel=num
.RE
.sp
.RS 4

View File

@@ -0,0 +1,28 @@
--source include/linux.inc
--error 0,1
perl;
use strict;
use warnings;
use File::Spec;
# Read the cgroup file
my $cgroup_file = '/proc/self/cgroup';
open my $fh, '<', $cgroup_file or exit 1;
my $line = <$fh>;
close $fh;
# Process the cgroup file content
$line =~ s/^0:://;
chomp($line);
# Construct the path
my $path = File::Spec->catdir('/sys/fs/cgroup', $line, 'memory.pressure');
# Check if the file is writable exists
exit 0 if -w $path;
exit 1;
EOF
if ($errno)
{
--skip Requires cgroupv2
}

View File

@@ -0,0 +1,201 @@
--echo #
--echo # WHERE <search condition>
--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 <search condition>
--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 # <join condition> := ON <search condition>
--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 # <delete statement: searched>
--echo # DELETE FROM <target table> [ WHERE <search condition> ]
--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 # <update statement: searched>
--echo # UPDATE <target table> SET <set clause list> [ WHERE <search condition> ]
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 # <check constraint definition>
--echo # CHECK <left paren> <search condition> <right paren>
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 # <case expression>
--echo # WHEN <search condition> THEN <result>
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;

View File

@@ -18,6 +18,10 @@
# Optionally, SEARCH_ABORT can be set to "FOUND" or "NOT FOUND" and this
# will abort if the search result doesn't match the requested one.
#
# Optionally, SEARCH_WAIT can be set to "FOUND" or "NOT FOUND", and this
# will wait for the condition to occur. The timeout can be set in
# SEARCH_TIMEOUT, default is 60 seconds.
#
# Optionally, SEARCH_OUTPUT can be set to control the format of output.
# Supported formats:
# - (default) : "FOUND n /pattern/ in FILE " or "NOT FOUND ..."
@@ -55,31 +59,50 @@ perl;
my @search_files= glob($ENV{SEARCH_FILE});
my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{SEARCH_RANGE};
my $content;
foreach my $search_file (@search_files) {
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
my $file_content;
if ($search_range > 0) {
read(FILE, $file_content, $search_range, 0);
} elsif ($search_range < 0) {
my $size= -s $search_file;
$search_range = -$size if $size > -$search_range;
seek(FILE, $search_range, 2);
read(FILE, $file_content, -$search_range, 0);
} else {
while(<FILE>) { # error log
if (/^CURRENT_TEST:/) {
$content='';
my $timeout= $ENV{SEARCH_TIMEOUT} || 60;
my @matches;
my $res;
my $start_time= time();
for (;;) {
my $content;
foreach my $search_file (@search_files) {
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
my $file_content;
if ($search_range > 0) {
read(FILE, $file_content, $search_range, 0);
} elsif ($search_range < 0) {
my $size= -s $search_file;
$search_range = -$size if $size > -$search_range;
seek(FILE, $search_range, 2);
read(FILE, $file_content, -$search_range, 0);
} else {
$content.=$_;
while(<FILE>) { # error log
if (/^CURRENT_TEST:/) {
$content='';
} else {
$content.=$_;
}
}
}
}
close(FILE);
$content.= $file_content;
}
close(FILE);
$content.= $file_content;
@matches= ($content =~ /$search_pattern/gs);
$res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
if (($ENV{SEARCH_WAIT} eq 'FOUND' && $res eq 'NOT FOUND') ||
($ENV{SEARCH_WAIT} eq 'NOT FOUND' && $res =~ m{^FOUND })) {
if (time() - $start_time < $timeout) {
# Millisceond sleep emulated with select
select(undef, undef, undef, 0.1);
next;
}
die "Timeout waiting for $ENV{SEARCH_WAIT} ".
"for /$search_pattern/ in $ENV{SEARCH_FILE}\n";
}
last;
}
my @matches= ($content =~ /$search_pattern/gs);
my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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 '',

View File

@@ -690,7 +690,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;

View File

@@ -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)));

View File

@@ -30,7 +30,7 @@ drop table t;
create table t (c double precision key,c2 char,c3 year);
insert into t values (7,3,1);
select a from t where a=all (select a from t where b=2 union select a from t where b=2);
ERROR 42S22: Unknown column 'a' in 'field list'
ERROR 42S22: Unknown column 'a' in 'SELECT'
insert into t values (3,1,1);
alter table t change c c date,add key(c);
ERROR 22007: Incorrect date value: '7' for column `test`.`t`.`c` at row 1

View File

@@ -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

View File

@@ -2958,10 +2958,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));
@@ -2969,5 +2967,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)` mediumtext DEFAULT NULL,
`c` text /*M!100301 COMPRESSED*/ DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
drop table t1, t2;
# End of 10.5 tests

View File

@@ -458,10 +458,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
@@ -481,5 +478,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

View File

@@ -2169,7 +2169,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

View File

@@ -1,5 +1,7 @@
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
SET @save_snapshot_isolation = @@GLOBAL.innodb_snapshot_isolation;
SET GLOBAL innodb_snapshot_isolation = OFF;
SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
connection default;
@@ -792,3 +794,4 @@ drop user mysqltest@localhost;
SET SQL_MODE=default;
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
SET GLOBAL transaction_isolation = @save_isolation;
SET GLOBAL innodb_snapshot_isolation = @save_snapshot_isolation;

View File

@@ -18,6 +18,8 @@ let $engine_type= InnoDB;
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
SET @save_snapshot_isolation = @@GLOBAL.innodb_snapshot_isolation;
SET GLOBAL innodb_snapshot_isolation = OFF;
SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
--disable_service_connection
@@ -25,3 +27,4 @@ SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
--enable_service_connection
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
SET GLOBAL transaction_isolation = @save_isolation;
SET GLOBAL innodb_snapshot_isolation = @save_snapshot_isolation;

View File

@@ -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

View File

@@ -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;

View File

@@ -748,7 +748,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
@@ -760,11 +760,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;
@@ -1887,13 +1887,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)
@@ -1912,7 +1912,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)
@@ -1939,7 +1939,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
@@ -1960,7 +1960,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;
#

View File

@@ -4744,33 +4744,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;

View File

@@ -423,7 +423,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select hex(concat(coercibility('a')));
hex(concat(coercibility('a')))
35
36
create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
@@ -811,7 +811,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
6 4
7 4
select charset(concat(uuid(), cast('a' as char character set latin1)));
charset(concat(uuid(), cast('a' as char character set latin1)))
latin1

View File

@@ -516,7 +516,7 @@ Variable_name Value
character_set_client latin1
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
charset('a') collation('a') coercibility('a') 'a'='A'
latin1 latin1_swedish_ci 5 1
latin1 latin1_swedish_ci 6 1
explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -527,7 +527,7 @@ SHOW VARIABLES LIKE 'collation_client';
Variable_name Value
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
charset('a') collation('a') coercibility('a') 'a'='A'
latin1 latin1_swedish_ci 5 1
latin1 latin1_swedish_ci 6 1
SET @@collation_database=@collation_database;
SET CHARACTER SET 'DEFAULT';
ERROR 42000: Unknown character set: 'DEFAULT'
@@ -687,7 +687,7 @@ RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_swedish_ci 5
Testtext latin1 latin1_swedish_ci 6
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
ERROR HY000: Illegal mix of collations for operation 'UNION'
DROP FUNCTION getText;
@@ -700,7 +700,7 @@ RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_german2_ci 5
Testtext latin1 latin1_german2_ci 6
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
SHOW CREATE TABLE t1;
Table Create Table
@@ -718,7 +718,7 @@ RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_german2_ci 5
Testtext latin1 latin1_german2_ci 6
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
SHOW CREATE TABLE t1;
Table Create Table

View File

@@ -835,7 +835,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select hex(concat(coercibility('a')));
hex(concat(coercibility('a')))
35
36
create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
@@ -1223,7 +1223,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
6 4
7 4
select charset(concat(uuid(), cast('a' as char character set latin1)));
charset(concat(uuid(), cast('a' as char character set latin1)))
latin1

File diff suppressed because it is too large Load Diff

View File

@@ -1144,7 +1144,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select hex(concat(coercibility('a')));
hex(concat(coercibility('a')))
35
36
create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
@@ -1532,7 +1532,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
6 4
7 4
select charset(concat(uuid(), cast('a' as char character set latin1)));
charset(concat(uuid(), cast('a' as char character set latin1)))
latin1

View File

@@ -585,31 +585,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
latin2
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5
6
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
binary
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
6
7
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
latin2
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
latin2
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
latin2
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
323030312D30312D30312030303A30303A3030
@@ -618,7 +618,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
latin2
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
323030312D30312D30312030303A30303A3030

View File

@@ -2027,7 +2027,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select hex(concat(coercibility('a')));
hex(concat(coercibility('a')))
0035
0036
create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
@@ -2415,7 +2415,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
6 4
7 4
select charset(concat(uuid(), cast('a' as char character set latin1)));
charset(concat(uuid(), cast('a' as char character set latin1)))
latin1
@@ -5194,31 +5194,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
ucs2
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5
6
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
binary
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
6
7
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
ucs2
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
ucs2
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
ucs2
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030
@@ -5227,7 +5227,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
ucs2
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030

View File

@@ -1395,31 +1395,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
utf16
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5
6
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
binary
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
6
7
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf16
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf16
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf16
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030
@@ -1428,7 +1428,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf16
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030

View File

@@ -1666,31 +1666,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
utf16le
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5
6
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
binary
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
6
7
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf16le
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf16le
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf16le
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
32003000300031002D00300031002D00300031002000300030003A00300030003A0030003000
@@ -1699,7 +1699,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf16le
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
32003000300031002D00300031002D00300031002000300030003A00300030003A0030003000

View File

@@ -1339,31 +1339,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
utf32
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5
6
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
binary
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
6
7
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf32
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
utf32
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5
6
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf32
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
000000320000003000000030000000310000002D00000030000000310000002D00000030000000310000002000000030000000300000003A00000030000000300000003A0000003000000030
@@ -1372,7 +1372,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
utf32
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5
6
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
000000320000003000000030000000310000002D00000030000000310000002D00000030000000310000002000000030000000300000003A00000030000000300000003A0000003000000030
@@ -3267,6 +3267,15 @@ HEX(DATE_FORMAT(TIME'11:22:33',@format))
# End of 10.4 tests
#
#
# MDEV-31221 UBSAN runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int' in my_strtoll10_utf32
#
SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
c1
-9223372036854775808
#
# End of 10.5 tests
#
#
# Start of 10.11 tests
#
#

View File

@@ -1163,6 +1163,16 @@ SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
--echo # End of 10.4 tests
--echo #
--echo #
--echo # MDEV-31221 UBSAN runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int' in my_strtoll10_utf32
--echo #
SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
--echo #
--echo # End of 10.5 tests
--echo #
--echo #
--echo # Start of 10.11 tests
--echo #

View File

@@ -1892,7 +1892,7 @@ insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
5 utf8mb3_general_ci
6 utf8mb3_general_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)
@@ -2772,7 +2772,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select hex(concat(coercibility('a')));
hex(concat(coercibility('a')))
35
36
create table t1 as select concat(coercibility('a')) as c1;
show create table t1;
Table Create Table
@@ -3160,7 +3160,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
6 4
7 4
select charset(concat(uuid(), cast('a' as char character set latin1)));
charset(concat(uuid(), cast('a' as char character set latin1)))
latin1
@@ -10805,3 +10805,23 @@ DROP TABLE t1;
#
# End of 10.9 tests
#
#
# Start of 11.6 tests
#
#
# MDEV-35041 Simple comparison causes "Illegal mix of collations" even with default server settings
#
CREATE TABLE t1 (a INT);
SET NAMES utf8mb3;
SELECT COLUMN_TYPE INTO @col_type FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='t1';
SELECT @col_type != 'binary(128)';
@col_type != 'binary(128)'
1
SELECT COERCIBILITY(@col_type), COERCIBILITY('binary(128)');
COERCIBILITY(@col_type) COERCIBILITY('binary(128)')
5 6
DROP TABLE t1;
#
# End of 11.6 tests
#

View File

@@ -2535,3 +2535,25 @@ DROP TABLE t1;
--echo #
--echo # End of 10.9 tests
--echo #
--echo #
--echo # Start of 11.6 tests
--echo #
--echo #
--echo # MDEV-35041 Simple comparison causes "Illegal mix of collations" even with default server settings
--echo #
CREATE TABLE t1 (a INT);
SET NAMES utf8mb3;
SELECT COLUMN_TYPE INTO @col_type FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='t1';
SELECT @col_type != 'binary(128)';
SELECT COERCIBILITY(@col_type), COERCIBILITY('binary(128)');
DROP TABLE t1;
--echo #
--echo # End of 11.6 tests
--echo #

View File

@@ -1918,7 +1918,7 @@ insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
5 utf8mb4_general_ci
6 utf8mb4_general_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)

View File

@@ -1882,7 +1882,7 @@ insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
5 utf8mb4_uca1400_ai_ci
6 utf8mb4_uca1400_ai_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)

View File

@@ -2008,7 +2008,7 @@ insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
5 utf8mb4_uca1400_ai_ci
6 utf8mb4_uca1400_ai_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)

View File

@@ -2015,7 +2015,7 @@ insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
5 utf8mb4_uca1400_ai_ci
6 utf8mb4_uca1400_ai_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)

View File

@@ -2970,7 +2970,7 @@ t1 CREATE TABLE `t1` (
INSERT INTO t1 (a) VALUES ('test');
SELECT * FROM t1;
a b c
test 2 6
test 2 7
DROP TABLE t1;
#
# String result metadata functions

View File

@@ -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;

View File

@@ -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,
@@ -236,11 +236,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

View File

@@ -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)

View File

@@ -6,9 +6,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);
@@ -28,18 +28,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
@@ -155,13 +155,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;
@@ -278,7 +278,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
@@ -286,7 +286,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',
@@ -478,7 +478,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
@@ -1364,7 +1364,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);
@@ -1378,7 +1378,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
@@ -1864,6 +1864,22 @@ deallocate prepare stmt;
drop table t1,t2,t3;
# End of MariaDB 11.1 tests
#
# MDEV-34880: Incorrect result for query with derived table having TEXT field
#
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, notes TEXT NOT NULL);
INSERT INTO t1 VALUES (1, 'test1'), (2, 'test2');
SELECT dt.* FROM (SELECT * FROM t1 UNION SELECT * FROM t1) dt WHERE id = 1;
id notes
1 test1
SELECT dt.* FROM (SELECT * FROM t1 UNION SELECT * FROM t1) dt WHERE id = 1 AND
notes = 'test1';
id notes
1 test1
DROP TABLE t1;
#
# End of 11.2 tests
#
#
# MDEV-31466 Add optional correlation column list for derived tables
#
# simple examples of renaming a TVC
@@ -3312,7 +3328,7 @@ on a1=b1
select * from (values (3,4),(5,6)) as foo(Col1, Col1);
ERROR 42S21: Duplicate column name 'Col1'
select * from ( select c1, c2, c3 from t1 ) as d1 (a1, a2, a3) where c1 = 1;
ERROR 42S22: Unknown column 'c1' in 'where clause'
ERROR 42S22: Unknown column 'c1' in 'WHERE'
select * from ( select c1, c2, c3 from t1 ) as d1 (a1, a2) where c1 = 1;
ERROR HY000: Incorrect column name count for derived table
select * from ( select c1, c2 from t1 union select c1, c2 from t1) as d1 (a1);
@@ -3324,7 +3340,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
select * from ( select c1, c2, c3 from t1 ) as d1 (a1, a2, a3)
join ( select c1, c2, c3 from t1 ) as d2 (a1, a2, a3)
where d1.a1=a1;
ERROR 23000: Column 'a1' in where clause is ambiguous
ERROR 23000: Column 'a1' in WHERE is ambiguous
# We expect to see the results of the 1st select in the union as names
# check wildcard expansion and name resolution in the outer select list
select *, a1 from

View File

@@ -1517,6 +1517,23 @@ drop table t1,t2,t3;
--echo # End of MariaDB 11.1 tests
--echo #
--echo # MDEV-34880: Incorrect result for query with derived table having TEXT field
--echo #
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, notes TEXT NOT NULL);
INSERT INTO t1 VALUES (1, 'test1'), (2, 'test2');
SELECT dt.* FROM (SELECT * FROM t1 UNION SELECT * FROM t1) dt WHERE id = 1;
SELECT dt.* FROM (SELECT * FROM t1 UNION SELECT * FROM t1) dt WHERE id = 1 AND
notes = 'test1';
DROP TABLE t1;
--echo #
--echo # End of 11.2 tests
--echo #
--echo #
--echo # MDEV-31466 Add optional correlation column list for derived tables
--echo #

View File

@@ -23563,6 +23563,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

View File

@@ -4389,6 +4389,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 #

View File

@@ -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

View File

@@ -45,7 +45,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_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;

View File

@@ -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='';

View File

@@ -11,5 +11,5 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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));

View File

@@ -424,7 +424,7 @@ coercibility(json_unquote(json_object('bar', c))) as coer_json_unquote,
coercibility('bar') as coer_literal
from t1 limit 1;
coll_json_unquote coer_json_unquote coer_literal
utf8mb3_general_ci 4 5
utf8mb3_general_ci 4 6
create table t2 as select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld from t1 limit 0;
show create table t2;
Table Create Table

View File

@@ -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;

View File

@@ -1477,10 +1477,10 @@ COERCIBILITY(NAME_CONST('name','test'))
2
SELECT COERCIBILITY(NAME_CONST('name',TIME'00:00:00'));
COERCIBILITY(NAME_CONST('name',TIME'00:00:00'))
6
7
SELECT COERCIBILITY(NAME_CONST('name',15));
COERCIBILITY(NAME_CONST('name',15))
6
7
SELECT CONCAT(NAME_CONST('name',15),'오');
CONCAT(NAME_CONST('name',15),'오')
15오

View File

@@ -869,12 +869,21 @@ SELECT 0xE001 REGEXP CAST(@regCheck AS CHAR);
Warnings:
Warning 1139 Regex error 'UTF-8 error: 1 byte missing at end'
SELECT 0xE001 REGEXP CAST(@regCheck AS CHAR);
0xE001 REGEXP CAST(@regCheck AS CHAR)
0
0xE001 REGEXP CAST(@regCheck AS CHAR)
0
Warnings:
Warning 1139 Regex error 'UTF-8 error: 1 byte missing at end'
# Since 11.5 (MDEV-25829) user variables have DERIVATION_COERCIBLE
# so a user variable and a literal in the pattern gave equal results
# But since 11.6 (MDEV-35041) user variables have DERIVATION_USERVAR
# so the query with a literal is performece as binary:
SELECT 0xE001 REGEXP '\\xE0\\x01' AS c1;
c1
Warning 1139 Regex error 'UTF-8 error: 1 byte missing at end'
# Since 11.4 user variables have DERIVATION_COERCIBLE
# so a user variable and a literal in the pattern give equal results
1
# while the query with a user variable is performed as string
# with a warning, like in 11.4
SET @regCheck= '\\xE0\\x01';
SELECT 0xE001 REGEXP @regCheck AS c2;
c2
0
Warnings:

View File

@@ -420,10 +420,16 @@ SET @regCheck= '\\xE0\\x01';
SELECT 0xE001 REGEXP @regCheck COLLATE latin1_bin;
SELECT 0xE001 REGEXP CAST(@regCheck AS CHAR);
--echo # Since 11.4 user variables have DERIVATION_COERCIBLE
--echo # so a user variable and a literal in the pattern give equal results
--echo # Since 11.5 (MDEV-25829) user variables have DERIVATION_COERCIBLE
--echo # so a user variable and a literal in the pattern gave equal results
--echo # But since 11.6 (MDEV-35041) user variables have DERIVATION_USERVAR
--echo # so the query with a literal is performece as binary:
SELECT 0xE001 REGEXP '\\xE0\\x01' AS c1;
--echo # while the query with a user variable is performed as string
--echo # with a warning, like in 11.4
SET @regCheck= '\\xE0\\x01';
SELECT 0xE001 REGEXP '\\xE0\\x01' AS c1, 0xE001 REGEXP @regCheck AS c2;
SELECT 0xE001 REGEXP @regCheck AS c2;
--echo # Testing workaround N1: This makes the pattern to be a binary string:
SET NAMES latin1;

View File

@@ -609,103 +609,103 @@ select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE la
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_swedish_ci,COERCIBLE), (latin1_bin,EXPLICIT) for operation 'in'
select collation(bin(130)), coercibility(bin(130));
collation(bin(130)) coercibility(bin(130))
latin1_swedish_ci 5
latin1_swedish_ci 6
select collation(oct(130)), coercibility(oct(130));
collation(oct(130)) coercibility(oct(130))
latin1_swedish_ci 5
latin1_swedish_ci 6
select collation(conv(130,16,10)), coercibility(conv(130,16,10));
collation(conv(130,16,10)) coercibility(conv(130,16,10))
latin1_swedish_ci 5
latin1_swedish_ci 6
select collation(hex(130)), coercibility(hex(130));
collation(hex(130)) coercibility(hex(130))
latin1_swedish_ci 5
latin1_swedish_ci 6
select collation(char(130)), coercibility(hex(130));
collation(char(130)) coercibility(hex(130))
binary 5
binary 6
select collation(format(130,10)), coercibility(format(130,10));
collation(format(130,10)) coercibility(format(130,10))
latin1_swedish_ci 5
latin1_swedish_ci 6
select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a'));
collation(lcase(_latin2'a')) coercibility(lcase(_latin2'a'))
latin2_general_ci 5
latin2_general_ci 6
select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a'));
collation(ucase(_latin2'a')) coercibility(ucase(_latin2'a'))
latin2_general_ci 5
latin2_general_ci 6
select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1));
collation(left(_latin2'a',1)) coercibility(left(_latin2'a',1))
latin2_general_ci 5
latin2_general_ci 6
select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1));
collation(right(_latin2'a',1)) coercibility(right(_latin2'a',1))
latin2_general_ci 5
latin2_general_ci 6
select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1));
collation(substring(_latin2'a',1,1)) coercibility(substring(_latin2'a',1,1))
latin2_general_ci 5
latin2_general_ci 6
select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b'));
collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2'b'))
latin2_general_ci 5
latin2_general_ci 6
select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b'));
collation(lpad(_latin2'a',4,_latin2'b')) coercibility(lpad(_latin2'a',4,_latin2'b'))
latin2_general_ci 5
latin2_general_ci 6
select collation(lpad(_latin2'a',4)), coercibility(lpad(_latin2'a',4));
collation(lpad(_latin2'a',4)) coercibility(lpad(_latin2'a',4))
latin2_general_ci 5
latin2_general_ci 6
select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b'));
collation(rpad(_latin2'a',4,_latin2'b')) coercibility(rpad(_latin2'a',4,_latin2'b'))
latin2_general_ci 5
latin2_general_ci 6
select collation(rpad(_latin2'a',4)), coercibility(rpad(_latin2'a',4));
collation(rpad(_latin2'a',4)) coercibility(rpad(_latin2'a',4))
latin2_general_ci 5
latin2_general_ci 6
select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b'));
collation(concat_ws(_latin2'a',_latin2'b')) coercibility(concat_ws(_latin2'a',_latin2'b'))
latin2_general_ci 5
latin2_general_ci 6
select collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')), coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c'));
collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')) coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c'))
latin2_general_ci 5
latin2_general_ci 6
select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '));
collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')) coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '))
latin2_general_ci 5
latin2_general_ci 6
select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a '));
collation(trim(_latin2' a ')) coercibility(trim(_latin2' a '))
latin2_general_ci 5
latin2_general_ci 6
select collation(ltrim(_latin2' a ')), coercibility(ltrim(_latin2' a '));
collation(ltrim(_latin2' a ')) coercibility(ltrim(_latin2' a '))
latin2_general_ci 5
latin2_general_ci 6
select collation(rtrim(_latin2' a ')), coercibility(rtrim(_latin2' a '));
collation(rtrim(_latin2' a ')) coercibility(rtrim(_latin2' a '))
latin2_general_ci 5
latin2_general_ci 6
select collation(trim(LEADING _latin2' ' FROM _latin2'a')), coercibility(trim(LEADING _latin2'a' FROM _latin2'a'));
collation(trim(LEADING _latin2' ' FROM _latin2'a')) coercibility(trim(LEADING _latin2'a' FROM _latin2'a'))
latin2_general_ci 5
latin2_general_ci 6
select collation(trim(TRAILING _latin2' ' FROM _latin2'a')), coercibility(trim(TRAILING _latin2'a' FROM _latin2'a'));
collation(trim(TRAILING _latin2' ' FROM _latin2'a')) coercibility(trim(TRAILING _latin2'a' FROM _latin2'a'))
latin2_general_ci 5
latin2_general_ci 6
select collation(trim(BOTH _latin2' ' FROM _latin2'a')), coercibility(trim(BOTH _latin2'a' FROM _latin2'a'));
collation(trim(BOTH _latin2' ' FROM _latin2'a')) coercibility(trim(BOTH _latin2'a' FROM _latin2'a'))
latin2_general_ci 5
latin2_general_ci 6
select collation(repeat(_latin2'a',10)), coercibility(repeat(_latin2'a',10));
collation(repeat(_latin2'a',10)) coercibility(repeat(_latin2'a',10))
latin2_general_ci 5
latin2_general_ci 6
select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab'));
collation(reverse(_latin2'ab')) coercibility(reverse(_latin2'ab'))
latin2_general_ci 5
latin2_general_ci 6
select collation(quote(_latin2'ab')), coercibility(quote(_latin2'ab'));
collation(quote(_latin2'ab')) coercibility(quote(_latin2'ab'))
latin2_general_ci 5
latin2_general_ci 6
select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab'));
collation(soundex(_latin2'ab')) coercibility(soundex(_latin2'ab'))
latin2_general_ci 5
latin2_general_ci 6
select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1));
collation(substring(_latin2'ab',1)) coercibility(substring(_latin2'ab',1))
latin2_general_ci 5
latin2_general_ci 6
select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef'));
collation(insert(_latin2'abcd',2,3,_latin2'ef')) coercibility(insert(_latin2'abcd',2,3,_latin2'ef'))
latin2_general_ci 5
latin2_general_ci 6
select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'));
collation(replace(_latin2'abcd',_latin2'b',_latin2'B')) coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B'))
latin2_general_ci 5
latin2_general_ci 6
select collation(encode('abcd','ab')), coercibility(encode('abcd','ab'));
collation(encode('abcd','ab')) coercibility(encode('abcd','ab'))
binary 5
binary 6
create table t1
select
bin(130),
@@ -788,7 +788,7 @@ latin2 latin2_general_ci 2
drop table t1;
select charset(null), collation(null), coercibility(null);
charset(null) collation(null) coercibility(null)
binary binary 7
binary binary 8
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int);
INSERT INTO t1 VALUES (1,1),(2,2);
@@ -804,7 +804,7 @@ a b a b
1 1 NULL NULL
2 2 2 2
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where coercibility(t2.a) = 6 order by t1.a,t2.a;
where coercibility(t2.a) = 7 order by t1.a,t2.a;
a b a b
1 1 NULL NULL
2 2 2 2

View File

@@ -474,7 +474,7 @@ where collation(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where charset(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where coercibility(t2.a) = 6 order by t1.a,t2.a;
where coercibility(t2.a) = 7 order by t1.a,t2.a;
DROP TABLE t1, t2;
#

View File

@@ -618,7 +618,7 @@ LOWER(MONTHNAME(19700101))
january
SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
COERCIBILITY(MONTHNAME('1970-01-01')) COERCIBILITY(DAYNAME('1970-01-01'))
5 5
6 6
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;

View File

@@ -69,7 +69,7 @@ weight_string reverse
1 2
select coercibility(weight_string('test'));
coercibility(weight_string('test'))
5
6
select coercibility(weight_string('test' collate latin1_swedish_ci));
coercibility(weight_string('test' collate latin1_swedish_ci))
0

View File

@@ -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

View File

@@ -4876,7 +4876,7 @@ UNCOMPRESSED_LENGTH(POINT(1,1))
0
SELECT COERCIBILITY(POINT(1,1));
COERCIBILITY(POINT(1,1))
5
6
SELECT ASCII(POINT(1,1));
ASCII(POINT(1,1))
0
@@ -5426,8 +5426,25 @@ 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=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
drop table t1, t2;
# End of 10.5 tests
#
# Start of 11.5 tests
#
@@ -5498,6 +5515,4 @@ CREATE TABLE t1 (a INT, b POINT GENERATED ALWAYS AS (a));
ERROR HY000: Cannot cast 'int' as 'point' in assignment of `test`.`t1`.`b`
CREATE TABLE t1 (a POINT, b INT GENERATED ALWAYS AS (a));
ERROR HY000: Cannot cast 'point' as 'int' in assignment of `test`.`t1`.`b`
#
# End of 11.5 tests
#

View File

@@ -3434,8 +3434,18 @@ 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
--echo #
--echo # Start of 11.5 tests
@@ -3505,7 +3515,4 @@ CREATE TABLE t1 (a INT, b POINT GENERATED ALWAYS AS (a));
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CREATE TABLE t1 (a POINT, b INT GENERATED ALWAYS AS (a));
--echo #
--echo # End of 11.5 tests
--echo #

View File

@@ -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';
@@ -348,7 +349,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
@@ -394,7 +395,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
@@ -463,6 +464,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

View File

@@ -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
@@ -310,7 +311,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';
@@ -332,7 +333,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;
@@ -419,6 +420,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

View File

@@ -0,0 +1,15 @@
#
# 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;
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

View File

@@ -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

View File

@@ -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
@@ -1029,7 +1029,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)
@@ -1071,7 +1071,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
@@ -2576,7 +2576,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
@@ -3007,6 +3007,18 @@ 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: Unknown column 'c' in 'SET'
UPDATE t1 SET c=1 ORDER BY (SELECT c);
ERROR 42S22: Unknown column 'c' in 'SET'
DROP TABLE t1;
#
# End of 10.5 tests
#
#
# Test new group_min_max optimization
#
create table t1 (a int, b int, c int, key(a,b,c));

View File

@@ -2151,6 +2151,21 @@ drop table t20, t21, t22;
--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_BAD_FIELD_ERROR
UPDATE t1 SET c=1 ORDER BY (SELECT c);
--error ER_BAD_FIELD_ERROR
UPDATE t1 SET c=1 ORDER BY (SELECT c);
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #
--echo #
--echo # Test new group_min_max optimization
--echo #

View File

@@ -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');

View File

@@ -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;

View File

@@ -119,9 +119,9 @@ SELECT 'a' AS ı FROM t1 GROUP BY I;
ı
a
SELECT 'a' AS İ FROM t1 GROUP BY i;
ERROR 42S22: Unknown column 'i' in 'group statement'
ERROR 42S22: Unknown column 'i' in 'GROUP BY'
SELECT 'a' AS i FROM t1 GROUP BY İ;
ERROR 42S22: Unknown column 'İ' in 'group statement'
ERROR 42S22: Unknown column 'İ' in 'GROUP BY'
DROP TABLE t1;
#
# End of 11.5 tests

View File

@@ -768,14 +768,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
@@ -783,7 +783,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

View File

@@ -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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

Some files were not shown because too many files have changed in this diff Show More