1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge branch '10.11 into 11.4

This commit is contained in:
Sergei Golubchik
2025-01-30 11:59:53 +01:00
344 changed files with 9076 additions and 2409 deletions

View File

@ -507,7 +507,9 @@ IF(UNIX)
ADD_SUBDIRECTORY(man)
ENDIF()
IF (NOT WITHOUT_ABI_CHECK)
INCLUDE(cmake/abi_check.cmake)
ENDIF()
INCLUDE(cmake/tags.cmake)
INCLUDE(for_clients)
ADD_SUBDIRECTORY(scripts)

View File

@ -162,6 +162,8 @@ static Server_gtid_event_filter *server_id_gtid_filter= NULL;
static char *start_datetime_str, *stop_datetime_str;
static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX;
static my_time_t last_processed_datetime= MY_TIME_T_MAX;
static ulonglong rec_count= 0;
static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0;
@ -867,6 +869,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
DBUG_ENTER("process_event");
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
my_time_t ev_when= ev->when;
/*
We use Gtid_list_log_event information to determine if there is missing
@ -1367,6 +1370,7 @@ err:
end:
rec_count++;
end_skip_count:
last_processed_datetime= ev_when;
DBUG_PRINT("info", ("end event processing"));
/*
@ -2924,6 +2928,7 @@ static Exit_status check_header(IO_CACHE* file,
uchar buf[PROBE_HEADER_LEN];
my_off_t tmp_pos, pos;
MY_STAT my_file_stat;
int read_error;
delete glob_description_event;
if (!(glob_description_event= new Format_description_log_event(4)))
@ -3006,7 +3011,8 @@ static Exit_status check_header(IO_CACHE* file,
Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(new_description_event= (Format_description_log_event*)
Log_event::read_log_event(file, glob_description_event,
Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum)))
/* EOF can't be hit here normally, so it's a real error */
{
@ -3039,7 +3045,8 @@ static Exit_status check_header(IO_CACHE* file,
{
Log_event *ev;
my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(ev= Log_event::read_log_event(file, glob_description_event,
if (!(ev= Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum)))
{
/* EOF can't be hit here normally, so it's a real error */
@ -3079,7 +3086,6 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
IO_CACHE cache,*file= &cache;
uchar tmp_buff[BIN_LOG_HEADER_SIZE];
Exit_status retval= OK_CONTINUE;
my_time_t last_ev_when= MY_TIME_T_MAX;
if (logname && strcmp(logname, "-") != 0)
{
@ -3153,8 +3159,10 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
{
char llbuff[21];
my_off_t old_off = my_b_tell(file);
int read_error;
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
Log_event* ev = Log_event::read_log_event(file, &read_error,
glob_description_event,
opt_verify_binlog_checksum);
if (!ev)
{
@ -3163,15 +3171,15 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
about a corruption, but treat it as EOF and move to the next binlog.
*/
if (glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
file->error= 0;
else if (file->error)
read_error= 0;
else if (read_error)
{
error("Could not read entry at offset %s: "
"Error in log format or read error.",
llstr(old_off,llbuff));
goto err;
}
// else file->error == 0 means EOF, that's OK, we break in this case
// else read_error == 0 means EOF, that's OK, we break in this case
/*
Emit a warning in the event that we finished processing input
@ -3185,21 +3193,8 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
"end of input", stop_position);
}
/*
Emit a warning in the event that we finished processing input
before reaching the boundary indicated by --stop-datetime.
*/
if (stop_datetime != MY_TIME_T_MAX &&
stop_datetime > last_ev_when)
{
retval = OK_STOP;
warning("Did not reach stop datetime '%s' "
"before end of input", stop_datetime_str);
}
goto end;
}
last_ev_when= ev->when;
if ((retval= process_event(print_event_info, ev, old_off, logname)) !=
OK_CONTINUE)
goto end;
@ -3378,6 +3373,11 @@ int main(int argc, char** argv)
start_position= BIN_LOG_HEADER_SIZE;
}
if (stop_datetime != MY_TIME_T_MAX &&
stop_datetime > last_processed_datetime)
warning("Did not reach stop datetime '%s' before end of input",
stop_datetime_str);
/*
If enable flashback, need to print the events from the end to the
beginning

View File

@ -3266,7 +3266,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
fprintf(sql_file,
"SET @saved_cs_client = @@character_set_client;\n"
"SET character_set_client = utf8;\n"
"SET character_set_client = utf8mb4;\n"
"/*!50001 CREATE VIEW %s AS SELECT\n",
result_table);
@ -3334,7 +3334,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
{
fprintf(sql_file,
"/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
"/*!40101 SET character_set_client = utf8 */;\n"
"/*!40101 SET character_set_client = utf8mb4 */;\n"
"%s%s;\n"
"/*!40101 SET character_set_client = @saved_cs_client */;\n",
is_log_table ? "CREATE TABLE IF NOT EXISTS " : "",

View File

@ -173,13 +173,21 @@ IF(UNIX)
# Default GCC flags
IF(CMAKE_COMPILER_IS_GNUCC)
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}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${COMMON_C_FLAGS}")
# MariaDB uses -O3 for release builds
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
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}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMMON_CXX_FLAGS}")
# MariaDB uses -O3 for release builds
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
ENDIF()
# IBM Z flags
@ -193,10 +201,12 @@ IF(UNIX)
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${z_flags}${CMAKE_C_FLAGS_RELWITHDEBINFO}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " ${z_flags}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${z_flags}")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${z_flags}${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " ${z_flags}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${z_flags}")
ENDIF()
UNSET(z_flags)
ENDIF()
@ -207,11 +217,13 @@ IF(UNIX)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
SET(COMMON_C_FLAGS "+DSitanium2 -mt -AC99")
SET(COMMON_CXX_FLAGS "+DSitanium2 -mt -Aa")
SET(CMAKE_C_FLAGS_DEBUG "+O0 -g ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "+O0 -g ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " +O0 -g ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " +O0 -g ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " +O0 -g ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " +O0 -g ${COMMON_CXX_FLAGS}")
# We have seen compiler bugs with optimisation and -g, so disabled for now
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " +O2 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " +O2 ${COMMON_CXX_FLAGS}")
ENDIF()
ENDIF()
SET(WITH_SSL no)
@ -226,10 +238,18 @@ IF(UNIX)
SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -no-ftz -no-prefetch")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -no-ftz -no-prefetch")
ENDIF()
SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " -unroll2 -ip ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " -unroll2 -ip ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -unroll2 -ip ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -unroll2 -ip ${COMMON_CXX_FLAGS}")
# MariaDB uses -O3 for release builds.
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
SET(WITH_SSL no)
ENDIF()
ENDIF()
@ -237,13 +257,21 @@ IF(UNIX)
# Default Clang flags
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-parentheses-equality -Wno-string-plus-int")
SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${COMMON_C_FLAGS}")
# MariaDB uses -O3 for release builds.
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
ENDIF()
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-parentheses-equality -Wno-string-plus-int")
SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMMON_CXX_FLAGS}")
# MariaDB uses -O3 for release builds.
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
STRING(REGEX REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
ENDIF()
# Solaris flags
@ -256,27 +284,33 @@ IF(UNIX)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-xO1 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " -xO1 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " -xO1 ${COMMON_CXX_FLAGS}")
IF(32BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " -xO2 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " -xO2 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -xO2 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -xO2 ${COMMON_CXX_FLAGS}")
ELSEIF(64BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " -xO3 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " -xO3 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_CXX_FLAGS}")
ENDIF()
ELSE()
# Assume !x86 is SPARC
SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
SET(COMMON_CXX_FLAGS "-g0 -noex -mt")
IF(32BIT)
SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
STRING(APPEND COMMON_C_FLAGS " -xarch=sparc")
STRING(APPEND COMMON_CXX_FLAGS " -xarch=sparc")
ENDIF()
SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_DEBUG " ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELEASE " -xO3 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELEASE " -xO3 ${COMMON_CXX_FLAGS}")
STRING(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_C_FLAGS}")
STRING(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -xO3 ${COMMON_CXX_FLAGS}")
ENDIF()
ENDIF()
ENDIF()

View File

@ -22,8 +22,8 @@ then
. /etc/default/mariadb
fi
MARIADB="/usr/bin/mariadb --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mariadb-admin --defaults-file=/etc/mysql/debian.cnf"
MARIADB="/usr/bin/mariadb --defaults-extra-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mariadb-admin --defaults-extra-file=/etc/mysql/debian.cnf"
# Don't run full mariadb-upgrade on every server restart, use --version-check to do it only once
MYUPGRADE="/usr/bin/mariadb-upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check --silent"
MYCHECK_SUBJECT="WARNING: mariadb-check has found corrupt tables"

View File

@ -130,6 +130,9 @@ if(MSVC)
if(CMAKE_C_COMPILER_ID MATCHES Clang)
target_compile_options(wolfssl PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-incompatible-function-pointer-types>)
endif()
remove_definitions(-DHAVE_CONFIG_H)
target_compile_definitions(wolfssl PRIVATE
WOLFSSL_HAVE_MIN WOLFSSL_HAVE_MAX)
endif()
CONFIGURE_FILE(user_settings.h.in user_settings.h)

View File

@ -3,7 +3,21 @@
#define HAVE_CRL
#define WOLFSSL_HAVE_ERROR_QUEUE
/*
Workaround bug in 5.7.6
WOLFSSL_MYSQL_COMPATIBLE breaks building wolfssl
But it is needed to avoid redefinition of protocol_version
when its public header ssl.h is included
*/
#ifndef BUILDING_WOLFSSL
#define WOLFSSL_MYSQL_COMPATIBLE
#endif
#define SP_INT_BITS 8192
#define HAVE_EMPTY_AGGREGATES 0
#define HAVE_ECC
#define ECC_TIMING_RESISTANT
#define HAVE_HASHDRBG
@ -24,7 +38,8 @@
#define HAVE_THREAD_LS
#define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB
#define OPENSSL_ALL
// #define OPENSSL_ALL
#define OPENSSL_EXTRA
#define WOLFSSL_ALLOW_TLSV10
#define NO_OLD_TIMEVAL_NAME
#define HAVE_SECURE_RENEGOTIATION

View File

@ -94,20 +94,13 @@ static inline void MY_RELAX_CPU(void)
__asm__ __volatile__ ("pause");
#endif
#elif defined(_ARCH_PWR8)
#ifdef __FreeBSD__
uint64_t __tb;
__asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
#else
/* Changed from __ppc_get_timebase for musl compatibility */
/* Changed from __ppc_get_timebase for musl and clang compatibility */
__builtin_ppc_get_timebase();
#endif
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#elif defined __GNUC__ && defined __riscv
__builtin_riscv_pause();
#elif defined __GNUC__
/* Mainly, prevent the compiler from optimizing away delay loops */
__asm__ __volatile__ ("":::"memory");
#else
int32 var, oldval = 0;
my_atomic_cas32_strong_explicit(&var, &oldval, 1, MY_MEMORY_ORDER_RELAXED,
MY_MEMORY_ORDER_RELAXED);
#endif
}

View File

@ -639,6 +639,13 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
#endif
typedef uint64 my_thread_id;
/**
Long-standing formats (such as the client-server protocol and the binary log)
hard-coded `my_thread_id` to 32 bits in practice. (Though not all
`thread_id`s are typed as such, @ref my_thread_id itself among those.)
@see MDEV-35706
*/
#define MY_THREAD_ID_MAX UINT32_MAX
extern void my_threadattr_global_init(void);
extern my_bool my_thread_global_init(void);

View File

@ -44,7 +44,8 @@ class THD;
class Item;
#define MYSQL_THD THD*
#else
#define MYSQL_THD void*
struct THD;
typedef struct THD* MYSQL_THD;
#endif
typedef char my_bool;

View File

@ -1018,7 +1018,7 @@ inline_mysql_file_create(
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_file_key key, const char *src_file, uint src_line,
#endif
const char *filename, int create_flags, int access_flags, myf myFlags)
const char *filename, mode_t create_flags, int access_flags, myf myFlags)
{
File file;
#ifdef HAVE_PSI_FILE_INTERFACE
@ -1344,7 +1344,7 @@ inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_file_key key, const char *src_file, uint src_line,
#endif
const char *linkname, const char *filename, int create_flags,
const char *linkname, const char *filename, mode_t create_flags,
int access_flags, myf flags)
{
File file;

View File

@ -351,7 +351,11 @@ extern void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t);
#endif /* defined(ENABLED_DEBUG_SYNC) */
/* compatibility macro */
#ifdef __cplusplus
#define DEBUG_SYNC_C(name) DEBUG_SYNC(nullptr, name)
#else
#define DEBUG_SYNC_C(name) DEBUG_SYNC(NULL, name)
#endif
#ifdef __cplusplus
}

View File

@ -32,6 +32,11 @@ public:
{
}
template <typename F>
scope_exit(F &&f, bool engaged) : function_(std::forward<F>(f)), engaged_(engaged)
{
}
scope_exit(scope_exit &&rhs)
: function_(std::move(rhs.function_)), engaged_(rhs.engaged_)
{
@ -43,6 +48,7 @@ public:
scope_exit &operator=(const scope_exit &)= delete;
void release() { engaged_= false; }
void engage() { DBUG_ASSERT(!engaged_); engaged_= true; }
~scope_exit()
{
@ -58,17 +64,103 @@ private:
} // end namespace detail
template <typename Callable>
detail::scope_exit<typename std::decay<Callable>::type>
make_scope_exit(Callable &&f)
inline
::detail::scope_exit<typename std::decay<Callable>::type>
make_scope_exit(Callable &&f, bool engaged= true)
{
return detail::scope_exit<typename std::decay<Callable>::type>(
std::forward<Callable>(f));
return ::detail::scope_exit<typename std::decay<Callable>::type>(
std::forward<Callable>(f), engaged);
}
#define CONCAT_IMPL(x, y) x##y
#define CONCAT(x, y) CONCAT_IMPL(x, y)
#define ANONYMOUS_VARIABLE CONCAT(_anonymous_variable, __LINE__)
#define SCOPE_EXIT auto ANONYMOUS_VARIABLE= make_scope_exit
#define IF_CLASS(C) typename std::enable_if<std::is_class<C>::value>::type
#define IF_NOT_CLASS(C) typename std::enable_if<!std::is_class<C>::value>::type
namespace detail
{
template <typename T>
class Scope_value
{
public:
// Use SFINAE for passing structs by reference and plain types by value.
// This ctor is defined only if T is a class or struct:
template <typename U = T, typename = IF_CLASS(U)>
Scope_value(T &variable, const T &scope_value)
: variable_(&variable), saved_value_(variable)
{
variable= scope_value;
}
// This ctor is defined only if T is NOT a class or struct:
template <typename U = T, typename = IF_NOT_CLASS(U)>
Scope_value(T &variable, const T scope_value)
: variable_(&variable), saved_value_(variable)
{
variable= scope_value;
}
Scope_value(Scope_value &&rhs)
: variable_(rhs.variable_), saved_value_(rhs.saved_value_)
{
rhs.variable_= NULL;
}
Scope_value(const Scope_value &)= delete;
Scope_value &operator=(const Scope_value &)= delete;
Scope_value &operator=(Scope_value &&)= delete;
~Scope_value()
{
if (variable_)
*variable_= saved_value_;
}
private:
T *variable_;
T saved_value_;
};
} // namespace detail
// Use like this:
// auto _= make_scope_value(var, tmp_value);
template <typename T, typename = IF_CLASS(T)>
inline
::detail::Scope_value<T> make_scope_value(T &variable, const T &scope_value)
{
return ::detail::Scope_value<T>(variable, scope_value);
}
template <typename T, typename = IF_NOT_CLASS(T)>
inline
::detail::Scope_value<T> make_scope_value(T &variable, T scope_value)
{
return ::detail::Scope_value<T>(variable, scope_value);
}
/*
Note: perfect forwarding version can not pass const:
template <typename T, typename U>
inline
detail::Scope_value<T> make_scope_value(T &variable, U &&scope_value)
{
return detail::Scope_value<T>(variable, std::forward<U>(scope_value));
}
as `const U &&` fails with error `expects an rvalue for 2nd argument`. That
happens because const U && is treated as rvalue only (this is the exact syntax
for declaring rvalues).
*/
#define SCOPE_VALUE auto ANONYMOUS_VARIABLE= make_scope_value
#define SCOPE_SET(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR | MASK)
#define SCOPE_CLEAR(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR & ~MASK)

View File

@ -43,9 +43,9 @@
#define VERSION_thd_wait 0x0100
#define VERSION_wsrep 0x0500
#define VERSION_json 0x0100
#define VERSION_sql_service 0x0102
#define VERSION_thd_mdl 0x0100
#define VERSION_print_check_msg 0x0100
#define VERSION_sql_service 0x0102
#define VERSION_provider_bzip2 0x0100
#define VERSION_provider_lz4 0x0100

View File

@ -0,0 +1,26 @@
--eval CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) $table_charset
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
--eval CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) $table_charset
SHOW CREATE TABLE t2;
INSERT INTO t2 VALUES ();
SELECT * FROM t2;
--eval CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) $table_charset
SHOW CREATE TABLE t3;
INSERT INTO t3 VALUES ();
SELECT * FROM t3;
--eval CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) $table_charset
SHOW CREATE TABLE t4;
INSERT INTO t4 (a) VALUES ('');
SELECT * FROM t4;
--eval CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) $table_charset
SHOW CREATE TABLE t5;
--error ER_CONSTRAINT_FAILED
INSERT INTO t5 VALUES ('','😎😀');
INSERT INTO t5 VALUES ('','😀😎');
SELECT * FROM t5;

View File

@ -1,9 +1,16 @@
--disable_query_log
--let $galera_variables_ok = `SELECT COUNT(*) = 51 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
let $_galera_variables_delta=$galera_variables_delta;
if (!$_galera_variables_delta) {
--let $galera_variables_delta=0
}
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!
--let $galera_variables_expected=`SELECT 51 + $galera_variables_delta`
--let $galera_variables_count=`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if ($galera_variables_count != $galera_variables_expected) {
--skip Galera number of variables has changed! ($galera_variables_count instead of $galera_variables_expected)
}
--enable_query_log

View File

@ -1,9 +1,5 @@
--disable_query_log
# Now the number of variables for the release and debug versions
# of the library is equal to each other...
--let $galera_variables_delta=0
--let $galera_variables_ok = `SELECT COUNT(*) = 51 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!
}
--enable_query_log
--source include/galera_variables_ok.inc

View File

@ -152,6 +152,24 @@ void handle_signal (int signal)
}
}
/**
Sets the append flag (FILE_APPEND_DATA) so that the handle inherited by the
child process will be in append mode.
Workaround for perl bug https://github.com/Perl/perl5/issues/17570
*/
static void fix_file_append_flag_inheritance(DWORD std_handle)
{
HANDLE old_handle = GetStdHandle(std_handle);
HANDLE new_handle = ReOpenFile(old_handle, FILE_APPEND_DATA,
FILE_SHARE_WRITE | FILE_SHARE_READ, 0);
if (new_handle != INVALID_HANDLE_VALUE)
{
SetHandleInformation(new_handle, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
SetStdHandle(std_handle, new_handle);
CloseHandle(old_handle);
}
}
int main(int argc, const char** argv )
{
@ -270,6 +288,9 @@ int main(int argc, const char** argv )
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX
| SEM_NOOPENFILEERRORBOX);
fix_file_append_flag_inheritance(STD_OUTPUT_HANDLE);
fix_file_append_flag_inheritance(STD_ERROR_HANDLE);
#if 0
/* Setup stdin, stdout and stderr redirect */
si.dwFlags= STARTF_USESTDHANDLES;

View File

@ -3081,8 +3081,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`altcol1` blob DEFAULT '',
KEY `altcol1` (`altcol1`(2300)),
KEY `h` (`altcol1`(2300))
KEY `altcol1` (`altcol1`(2300))
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
show create table t2;
Table Create Table

View File

@ -5633,5 +5633,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid big5 character string: '\xA3\xC0'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_big5'' collate big5_chinese_nopad_ci, _big5 0x0001050001) as c1;
c1
-1
select strcmp(_big5'' collate big5_nopad_bin, _big5 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -291,6 +291,13 @@ SET NAMES big5;
SET @seq=_big5 0xA3C0;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_big5'' collate big5_chinese_nopad_ci, _big5 0x0001050001) as c1;
select strcmp(_big5'' collate big5_nopad_bin, _big5 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -928,5 +928,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid cp932 character string: '\x81'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_cp932'' collate cp932_japanese_nopad_ci, _cp932 0x0001050001) as c1;
c1
-1
select strcmp(_cp932'' collate cp932_nopad_bin, _cp932 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -70,6 +70,13 @@ SET NAMES cp932;
SET @seq=_cp932 0x81AD;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_cp932'' collate cp932_japanese_nopad_ci, _cp932 0x0001050001) as c1;
select strcmp(_cp932'' collate cp932_nopad_bin, _cp932 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -34822,5 +34822,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid eucjpms character string: '\x8F\xA1\xA1'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_eucjpms'' collate eucjpms_japanese_nopad_ci, _eucjpms 0x0001050001) as c1;
c1
-1
select strcmp(_eucjpms'' collate eucjpms_nopad_bin, _eucjpms 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -620,6 +620,13 @@ SET NAMES eucjpms;
SET @seq=_eucjpms 0x8FA1A1;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_eucjpms'' collate eucjpms_japanese_nopad_ci, _eucjpms 0x0001050001) as c1;
select strcmp(_eucjpms'' collate eucjpms_nopad_bin, _eucjpms 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -26335,5 +26335,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid euckr character string: '\xA2\xE8'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_euckr'' collate euckr_korean_nopad_ci, _euckr 0x0001050001) as c1;
c1
-1
select strcmp(_euckr'' collate euckr_nopad_bin, _euckr 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -243,6 +243,13 @@ SET NAMES euckr;
SET @seq=_euckr 0xA2E8;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_euckr'' collate euckr_korean_nopad_ci, _euckr 0x0001050001) as c1;
select strcmp(_euckr'' collate euckr_nopad_bin, _euckr 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -5323,5 +5323,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid gb2312 character string: '\xA2\xA1'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_gb2312'' collate gb2312_chinese_nopad_ci, _gb2312 0x0001050001) as c1;
c1
-1
select strcmp(_gb2312'' collate gb2312_nopad_bin, _gb2312 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -200,6 +200,13 @@ SET NAMES gb2312;
SET @seq=_gb2312 0xA2A1;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_gb2312'' collate gb2312_chinese_nopad_ci, _gb2312 0x0001050001) as c1;
select strcmp(_gb2312'' collate gb2312_nopad_bin, _gb2312 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -6787,5 +6787,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid gbk character string: '\xAA\xA1'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_gbk'' collate gbk_chinese_nopad_ci, _gbk 0x0001050001);
strcmp(_gbk'' collate gbk_chinese_nopad_ci, _gbk 0x0001050001)
-1
select strcmp(_gbk'' collate gbk_nopad_bin, _gbk 0x0001050001);
strcmp(_gbk'' collate gbk_nopad_bin, _gbk 0x0001050001)
-1
#
# End of 10.5 tests
#

View File

@ -503,6 +503,13 @@ SET NAMES gbk;
SET @seq=_gbk 0xAAA1;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_gbk'' collate gbk_chinese_nopad_ci, _gbk 0x0001050001);
select strcmp(_gbk'' collate gbk_nopad_bin, _gbk 0x0001050001);
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -19659,5 +19659,14 @@ EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
ERROR HY000: Invalid sjis character string: '<27>_x81'
SET sql_mode=DEFAULT;
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_sjis'' collate sjis_japanese_nopad_ci, _sjis 0x0001050001) as c1;
c1
-1
select strcmp(_sjis'' collate sjis_nopad_bin, _sjis 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -328,6 +328,13 @@ SET NAMES sjis;
SET @seq=_sjis 0x81AD;
--source include/ctype_ident_sys.inc
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_sjis'' collate sjis_japanese_nopad_ci, _sjis 0x0001050001) as c1;
select strcmp(_sjis'' collate sjis_nopad_bin, _sjis 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -0,0 +1,23 @@
# Start of 10.5 tests
#
# MDEV-28328 Assertion failures in btr0cur.cc upon INSERT or in row0sel.cc afterwards
#
SET NAMES utf8mb3;
CREATE TABLE t (
a year(4) DEFAULT NULL,
b varbinary(2545) DEFAULT '',
c mediumtext COLLATE sjis_japanese_nopad_ci NOT NULL,
d decimal(7,7) DEFAULT NULL,
e char(219) COLLATE sjis_japanese_nopad_ci DEFAULT '',
f bigint(25) DEFAULT 0,
g bigint(20) DEFAULT NULL,
h datetime(1) DEFAULT '1900-01-01 00:00:00.0',
PRIMARY KEY (c(25),e)
) ENGINE=InnoDB DEFAULT CHARSET=sjis COLLATE=sjis_japanese_nopad_ci;
INSERT IGNORE INTO t VALUES ... a mixture of non-ASCII and binary content
SELECT * FROM t /*output suppressed, just make sure it does not crash*/;
CHECK TABLE t;
Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
# End of 10.5 tests

File diff suppressed because one or more lines are too long

View File

@ -6552,6 +6552,15 @@ SELECT CAST(CONVERT('-9223372036854775808' USING ucs2) AS SIGNED) AS c1;
c1
-9223372036854775808
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_ucs2'' collate ucs2_general_nopad_ci, _ucs2 0x00000001000500000001) as c1;
c1
-1
select strcmp(_ucs2'' collate ucs2_nopad_bin, _ucs2 0x00000001000500000001) as c1;
c1
-1
#
# End of 10.5 tests
#
#

View File

@ -1236,6 +1236,13 @@ DROP TABLE t1;
SELECT CAST(CONVERT('-9223372036854775808' USING ucs2) AS SIGNED) AS c1;
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_ucs2'' collate ucs2_general_nopad_ci, _ucs2 0x00000001000500000001) as c1;
select strcmp(_ucs2'' collate ucs2_nopad_bin, _ucs2 0x00000001000500000001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -27086,3 +27086,18 @@ SET DEFAULT_STORAGE_ENGINE=Default;
#
# End of 10.2 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_ujis'' collate ujis_japanese_nopad_ci, _ujis 0x0001050001) as c1;
c1
-1
select strcmp(_ujis'' collate ujis_nopad_bin, _ujis 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#

View File

@ -1446,3 +1446,18 @@ let $coll_pad='ujis_bin';
--echo #
--echo # End of 10.2 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_ujis'' collate ujis_japanese_nopad_ci, _ujis 0x0001050001) as c1;
select strcmp(_ujis'' collate ujis_nopad_bin, _ujis 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -3021,22 +3021,80 @@ DATE_FORMAT(TIME'11:22:33',@format)
SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
HEX(DATE_FORMAT(TIME'11:22:33',@format))
31313F3232
#
# 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
#
# MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
#
SET NAMES utf8mb4;
CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) CHARACTER SET utf32;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(8) DEFAULT reverse('aha')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
a
aha
CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) CHARACTER SET utf32;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(8) DEFAULT reverse('åäá')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t2 VALUES ();
SELECT * FROM t2;
a
áäå
CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) CHARACTER SET utf32;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` char(8) DEFAULT reverse('😎😀')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t3 VALUES ();
SELECT * FROM t3;
a
😀😎
CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) CHARACTER SET utf32;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` char(8) DEFAULT NULL,
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t4 (a) VALUES ('');
SELECT * FROM t4;
a b
😀😎
CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) CHARACTER SET utf32;
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TABLE `t5` (
`a` char(8) DEFAULT NULL,
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t5 VALUES ('','😎😀');
ERROR 23000: CONSTRAINT `t5.b` failed for `test`.`t5`
INSERT INTO t5 VALUES ('','😀😎');
SELECT * FROM t5;
a b
😀😎
DROP TABLE t1, t2, t3, t4, t5;
#
# 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
#
#
# MDEV-10865 COLLATE keyword doesn't work in PREPARE query
#
#
@ -3115,28 +3173,12 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET NAMES utf8mb4;
#
# End of 10.11 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 11.4 tests
#
#
# MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
#
SET NAMES utf8mb3, character_set_connection=utf32;
SELECT CONV('-AzL8n0Y58m8', -62, -10);
CONV('-AzL8n0Y58m8', -62, -10)
-9223372036854775808
#
# End of 11.4 tests
#

View File

@ -1157,9 +1157,7 @@ SELECT DATE_FORMAT(TIME'11:22:33',@format);
SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
--enable_view_protocol
--echo #
--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
@ -1168,13 +1166,22 @@ SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
--echo #
--echo # End of 10.5 tests
--echo # MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
--echo #
SET NAMES utf8mb4;
--let $table_charset=CHARACTER SET utf32
--source include/ctype_supplementary_chars.inc
DROP TABLE t1, t2, t3, t4, t5;
--echo #
--echo # Start of 10.11 tests
--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 # End of 10.5 tests
--echo #
--echo # MDEV-10865 COLLATE keyword doesn't work in PREPARE query
--echo #
@ -1243,27 +1250,10 @@ DROP TABLE t1;
SET NAMES utf8mb4;
--echo #
--echo # End of 10.11 tests
--echo #
--enable_service_connection
--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 11.4 tests
--echo #
--echo #
--echo # MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
--echo #
@ -1271,6 +1261,4 @@ SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
SET NAMES utf8mb3, character_set_connection=utf32;
SELECT CONV('-AzL8n0Y58m8', -62, -10);
--echo #
--echo # End of 11.4 tests
--echo #

View File

@ -0,0 +1,106 @@
# Start of 10.5 tests
#
# MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
#
SET NAMES utf8mb4;
CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) CHARACTER SET utf32;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(8) DEFAULT reverse('aha')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
a
aha
CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) CHARACTER SET utf32;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(8) DEFAULT reverse('åäá')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t2 VALUES ();
SELECT * FROM t2;
a
áäå
CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) CHARACTER SET utf32;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` char(8) DEFAULT reverse('😎😀')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t3 VALUES ();
SELECT * FROM t3;
a
😀😎
CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) CHARACTER SET utf32;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` char(8) DEFAULT NULL,
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t4 (a) VALUES ('');
SELECT * FROM t4;
a b
😀😎
CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) CHARACTER SET utf32;
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TABLE `t5` (
`a` char(8) DEFAULT NULL,
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
INSERT INTO t5 VALUES ('','😎😀');
ERROR 23000: CONSTRAINT `t5.b` failed for `test`.`t5`
INSERT INTO t5 VALUES ('','😀😎');
SELECT * FROM t5;
a b
😀😎
# Running dump
DROP TABLE t1, t2, t3, t4, t5;
# Running restore
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(8) DEFAULT reverse('aha')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
SELECT * FROM t1;
a
aha
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(8) DEFAULT reverse('åäá')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
SELECT * FROM t2;
a
áäå
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` char(8) DEFAULT reverse('😎😀')
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
SELECT * FROM t3;
a
😀😎
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`a` char(8) DEFAULT NULL,
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
SELECT * FROM t4;
a b
😀😎
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TABLE `t5` (
`a` char(8) DEFAULT NULL,
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
SELECT * FROM t5;
a b
😀😎
DROP TABLE t1, t2, t3, t4, t5;
# End of 10.5 tests

View File

@ -0,0 +1,38 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
--echo # Start of 10.5 tests
--echo #
--echo # MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
--echo #
SET NAMES utf8mb4;
--let $table_charset=CHARACTER SET utf32
--source include/ctype_supplementary_chars.inc
--echo # Running dump
--let $mysqldumpfile = $MYSQLTEST_VARDIR/tmp/ctype_utf32_not_embedded_dump.sql
--exec $MYSQL_DUMP test > $mysqldumpfile
DROP TABLE t1, t2, t3, t4, t5;
--echo # Running restore
--exec $MYSQL test < $mysqldumpfile
SHOW CREATE TABLE t1;
SELECT * FROM t1;
SHOW CREATE TABLE t2;
SELECT * FROM t2;
SHOW CREATE TABLE t3;
SELECT * FROM t3;
SHOW CREATE TABLE t4;
SELECT * FROM t4;
SHOW CREATE TABLE t5;
SELECT * FROM t5;
DROP TABLE t1, t2, t3, t4, t5;
--error 0,1
--remove_file $mysqldumpfile
--echo # End of 10.5 tests

View File

@ -11651,6 +11651,15 @@ CAST(_utf8 'яяя' AS INT)
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'яяя'
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
select strcmp(_utf8mb3'' collate utf8mb3_general_nopad_ci, _utf8mb3 0x0001050001) as c1;
c1
-1
select strcmp(_utf8mb3'' collate utf8mb3_nopad_bin, _utf8mb3 0x0001050001) as c1;
c1
-1
#
# End of 10.5 tests
#
#

View File

@ -2529,6 +2529,12 @@ SELECT CAST(_utf8 'ëëë' AS INT);
SELECT CAST(_utf8 'œœœ' AS INT);
SELECT CAST(_utf8 'яяя' AS INT);
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
select strcmp(_utf8mb3'' collate utf8mb3_general_nopad_ci, _utf8mb3 0x0001050001) as c1;
select strcmp(_utf8mb3'' collate utf8mb3_nopad_bin, _utf8mb3 0x0001050001) as c1;
--echo #
--echo # End of 10.5 tests

View File

@ -0,0 +1,39 @@
# Start of 10.5 tests
#
# MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
#
CREATE TABLE t (
a INT,
b VARCHAR(16),
c CHAR(8),
PRIMARY KEY (b,c),
KEY(c)
) ENGINE=InnoDB CHARACTER SET utf8mb3 COLLATE utf8mb3_general_nopad_ci;
INSERT INTO t VALUES (1,UNHEX('0001050001'),''),(2,UNHEX('0000'),'x');
UPDATE t SET a = 0;
INSERT INTO t VALUES (0,'','');
CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
#
# MDEV-32190 Index corruption with unique key and nopad collation (without DESC or HASH keys)
#
CREATE TABLE t (
id INT,
b TEXT,
KEY(id),
PRIMARY KEY (b(2),id)
) ENGINE=InnoDB COLLATE utf8mb3_general_nopad_ci;
INSERT INTO t VALUES
(1,''),(2,'x'),(3,'x'),(4,UNHEX('0010')),(5,'x'),(6,'x'),(7,'x'),(8,'x'),
(9,UNHEX('00')),(10,'x'),(11,''),(12,UNHEX('73')),(13,'+'),(14,'N');
CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
test.t check status OK
SELECT id FROM t WHERE id IN (4,8);
id
4
8
DROP TABLE t;
# End of 10.5 tests

View File

@ -0,0 +1,39 @@
--source include/have_innodb.inc
--echo # Start of 10.5 tests
--echo #
--echo # MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in row_ins_sec_index_entry_by_modify
--echo #
CREATE TABLE t (
a INT,
b VARCHAR(16),
c CHAR(8),
PRIMARY KEY (b,c),
KEY(c)
) ENGINE=InnoDB CHARACTER SET utf8mb3 COLLATE utf8mb3_general_nopad_ci;
INSERT INTO t VALUES (1,UNHEX('0001050001'),''),(2,UNHEX('0000'),'x');
UPDATE t SET a = 0;
INSERT INTO t VALUES (0,'','');
CHECK TABLE t EXTENDED;
DROP TABLE t;
--echo #
--echo # MDEV-32190 Index corruption with unique key and nopad collation (without DESC or HASH keys)
--echo #
CREATE TABLE t (
id INT,
b TEXT,
KEY(id),
PRIMARY KEY (b(2),id)
) ENGINE=InnoDB COLLATE utf8mb3_general_nopad_ci;
INSERT INTO t VALUES
(1,''),(2,'x'),(3,'x'),(4,UNHEX('0010')),(5,'x'),(6,'x'),(7,'x'),(8,'x'),
(9,UNHEX('00')),(10,'x'),(11,''),(12,UNHEX('73')),(13,'+'),(14,'N');
CHECK TABLE t EXTENDED;
SELECT id FROM t WHERE id IN (4,8);
DROP TABLE t;
--echo # End of 10.5 tests

View File

@ -1731,13 +1731,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
USE `mysqltest1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `log` (
`msg` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@ -1814,13 +1814,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `log` (
`msg` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

View File

@ -1731,13 +1731,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
USE `mysqltest1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `log` (
`msg` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@ -1814,13 +1814,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `log` (
`msg` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

View File

@ -25,6 +25,33 @@ c1
SET sort_buffer_size=@save_sort_buffer_size;
DROP TABLE t1;
#
# MDEV-35944 DELETE fails to notice transaction abort, violating ACID
#
CREATE TABLE t1 (id INT PRIMARY KEY, col_varchar VARCHAR(8)) ENGINE=InnoDB;
INSERT INTO t1 (id) VALUES (1),(2);
CREATE TABLE t2 (id INT, f INT, s DATE, e DATE, PERIOD FOR p(s,e), PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,0,'2000-01-01','2000-01-02');
CREATE TABLE t3 (id INT, f BLOB, UNIQUE(f)) ENGINE=InnoDB;
connection default;
SET innodb_lock_wait_timeout=1;
START TRANSACTION;
DELETE FROM t1;
connect con1,localhost,root,,;
START TRANSACTION;
UPDATE t2 SET f = 20;
connection default;
DELETE FROM t2 FOR PORTION OF p FROM '2000-01-01' TO '2000-01-02';
connection con1;
INSERT INTO t3 (id) VALUES (1), (2);
UPDATE t1 SET col_varchar = 'bar';
COMMIT;
connection default;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
UPDATE t3 SET f = 'foo' ORDER BY f LIMIT 1;
DROP TABLE t1, t2, t3;
# End of 10.5 tests
#
# MDEV-32212 DELETE with ORDER BY and semijoin optimization causing crash
#
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
@ -583,4 +610,4 @@ count(*)
0
drop database dbt3_s001;
set default_storage_engine=@save_default_storage_engine;
End of 11.1 tests
# End of 11.1 tests

View File

@ -23,10 +23,48 @@ SELECT * FROM t1;
SET sort_buffer_size=@save_sort_buffer_size;
DROP TABLE t1;
--echo #
--echo # MDEV-35944 DELETE fails to notice transaction abort, violating ACID
--echo #
CREATE TABLE t1 (id INT PRIMARY KEY, col_varchar VARCHAR(8)) ENGINE=InnoDB;
INSERT INTO t1 (id) VALUES (1),(2);
CREATE TABLE t2 (id INT, f INT, s DATE, e DATE, PERIOD FOR p(s,e), PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,0,'2000-01-01','2000-01-02');
CREATE TABLE t3 (id INT, f BLOB, UNIQUE(f)) ENGINE=InnoDB;
--connection default
SET innodb_lock_wait_timeout=1;
START TRANSACTION;
DELETE FROM t1;
--connect (con1,localhost,root,,)
START TRANSACTION;
UPDATE t2 SET f = 20;
--connection default
--send
DELETE FROM t2 FOR PORTION OF p FROM '2000-01-01' TO '2000-01-02';
--connection con1
INSERT INTO t3 (id) VALUES (1), (2);
UPDATE t1 SET col_varchar = 'bar';
COMMIT;
--connection default
--error ER_LOCK_DEADLOCK
--reap
COMMIT;
UPDATE t3 SET f = 'foo' ORDER BY f LIMIT 1;
# Cleanup
DROP TABLE t1, t2, t3;
--echo # End of 10.5 tests
--echo #
--echo # MDEV-32212 DELETE with ORDER BY and semijoin optimization causing crash
--echo #
--source include/have_innodb.inc
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c2 INT) ENGINE=InnoDB;
@ -219,5 +257,4 @@ select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' A
drop database dbt3_s001;
set default_storage_engine=@save_default_storage_engine;
--echo End of 11.1 tests
--echo # End of 11.1 tests

View File

@ -231,3 +231,16 @@ Error 1327 Undeclared variable: foo
Error 1305 PROCEDURE P1 does not exist
drop procedure P1;
# End of 10.4 tests
#
# MDEV-35828: Assertion fails in alloc_root() when memory causes it to call itself
#
CREATE TEMPORARY TABLE t1 (a INT,b INT);
INSERT INTO t1 VALUES (1,1),(2,2);
SET
@tmp=@@max_session_mem_used,
max_session_mem_used=8192;
SELECT * FROM (t1 AS t2 LEFT JOIN t1 AS t3 USING (a)),t1;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
DROP TABLE t1;
SET max_session_mem_used=@tmp;
# End of 10.6 tests

View File

@ -284,3 +284,23 @@ show warnings;
drop procedure P1;
-- echo # End of 10.4 tests
--echo #
--echo # MDEV-35828: Assertion fails in alloc_root() when memory causes it to call itself
--echo #
CREATE TEMPORARY TABLE t1 (a INT,b INT);
INSERT INTO t1 VALUES (1,1),(2,2);
SET
@tmp=@@max_session_mem_used,
max_session_mem_used=8192;
--error ER_OPTION_PREVENTS_STATEMENT
SELECT * FROM (t1 AS t2 LEFT JOIN t1 AS t3 USING (a)),t1;
DROP TABLE t1;
SET max_session_mem_used=@tmp;
--echo # End of 10.6 tests

View File

@ -238,3 +238,30 @@ select variable_value into @threads_cached from information_schema.global_status
set debug_sync='now SIGNAL go3';
drop table t1;
set debug_sync='reset';
#
# MDEV-33285 - Assertion `m_table' failed in ha_perfschema::rnd_end on
# CHECKSUM TABLE
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES(1);
SET debug_sync='mysql_checksum_table_after_calculate_checksum SIGNAL parked WAIT_FOR go';
CHECKSUM TABLE t1;
connect con1, localhost, root;
connection con1;
SET debug_sync='now WAIT_FOR parked';
KILL QUERY id;
SET debug_sync='now SIGNAL go';
connection default;
ERROR 70100: Query execution was interrupted
SET debug_sync='RESET';
SET debug_sync='mysql_checksum_table_before_calculate_checksum SIGNAL parked WAIT_FOR go';
CHECKSUM TABLE t1;
connection con1;
SET debug_sync='now WAIT_FOR parked';
KILL QUERY id;
SET debug_sync='now SIGNAL go';
connection default;
ERROR 70100: Query execution was interrupted
DROP TABLE t1;
disconnect con1;
SET debug_sync='RESET';

View File

@ -324,3 +324,40 @@ if (`select @@thread_handling != 'pool-of-threads'`) {
}
drop table t1;
set debug_sync='reset';
--echo #
--echo # MDEV-33285 - Assertion `m_table' failed in ha_perfschema::rnd_end on
--echo # CHECKSUM TABLE
--echo #
let $id= `select connection_id()`;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES(1);
SET debug_sync='mysql_checksum_table_after_calculate_checksum SIGNAL parked WAIT_FOR go';
send CHECKSUM TABLE t1;
connect con1, localhost, root;
connection con1;
SET debug_sync='now WAIT_FOR parked';
replace_result $id id;
eval KILL QUERY $id;
SET debug_sync='now SIGNAL go';
connection default;
error ER_QUERY_INTERRUPTED;
reap;
SET debug_sync='RESET';
SET debug_sync='mysql_checksum_table_before_calculate_checksum SIGNAL parked WAIT_FOR go';
send CHECKSUM TABLE t1;
connection con1;
SET debug_sync='now WAIT_FOR parked';
replace_result $id id;
eval KILL QUERY $id;
SET debug_sync='now SIGNAL go';
connection default;
error ER_QUERY_INTERRUPTED;
reap;
DROP TABLE t1;
disconnect con1;
SET debug_sync='RESET';

View File

@ -22,7 +22,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
USE `mysqltest1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -32,7 +32,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
@ -41,27 +41,27 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER
USE `mysqltest3`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3i` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3is` AS SELECT
1 AS `schema_name` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3nt` AS SELECT
1 AS `1` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3ps` AS SELECT
1 AS `user` */;
SET character_set_client = @saved_cs_client;
@ -237,7 +237,7 @@ disconnect con1;
connection default;
/*M!999999\- enable the sandbox mode */
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `id` */;
SET character_set_client = @saved_cs_client;

View File

@ -731,4 +731,43 @@ alter table t1 enable keys;
insert into t1 values (2);
ERROR 23000: Duplicate entry '2' for key 'i'
drop table t1;
#
# MDEV-25654 Unexpected ER_CRASHED_ON_USAGE and Assertion `limit >= trx_id' failed in purge_node_t::skip
#
create table t1 (a int, unique using hash (a)) engine=innodb
partition by range(a) (
partition p1 values less than (2),
partition p2 values less than (101)
);
insert into t1 select seq from seq_1_to_100;
alter table t1 add partition (partition p3 values less than (maxvalue));
alter table t1 force;
drop table t1;
#
# MDEV-33658 cannot add a foreign key on a table with a long UNIQUE
# multi-column index, that contains a foreign key as a prefix.
#
create table a (id int primary key) engine = innodb;
create table b (id int,
long_text varchar(1000),
constraint unique_b unique key (id, long_text)
) engine=innodb default charset utf8mb4;
alter table b add constraint b_fk_id foreign key (id) references a (id);
show create table b;
Table Create Table
b CREATE TABLE `b` (
`id` int(11) DEFAULT NULL,
`long_text` varchar(1000) DEFAULT NULL,
UNIQUE KEY `unique_b` (`id`,`long_text`) USING HASH,
KEY `b_fk_id` (`id`),
CONSTRAINT `b_fk_id` FOREIGN KEY (`id`) REFERENCES `a` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
drop table b;
drop table a;
# veirfy that duplicate has unique is detected
create table t1 (a blob unique);
alter table t1 add constraint constraint_1 unique (a);
Warnings:
Note 1831 Duplicate index `constraint_1`. This is deprecated and will be disallowed in a future release
drop table t1;
# End of 10.5 tests

View File

@ -710,4 +710,39 @@ alter table t1 enable keys;
insert into t1 values (2);
drop table t1;
--echo #
--echo # MDEV-25654 Unexpected ER_CRASHED_ON_USAGE and Assertion `limit >= trx_id' failed in purge_node_t::skip
--echo #
create table t1 (a int, unique using hash (a)) engine=innodb
partition by range(a) (
partition p1 values less than (2),
partition p2 values less than (101)
);
insert into t1 select seq from seq_1_to_100;
alter table t1 add partition (partition p3 values less than (maxvalue));
alter table t1 force;
drop table t1;
--echo #
--echo # MDEV-33658 cannot add a foreign key on a table with a long UNIQUE
--echo # multi-column index, that contains a foreign key as a prefix.
--echo #
create table a (id int primary key) engine = innodb;
create table b (id int,
long_text varchar(1000),
constraint unique_b unique key (id, long_text)
) engine=innodb default charset utf8mb4;
alter table b add constraint b_fk_id foreign key (id) references a (id);
show create table b;
drop table b;
drop table a;
--echo # veirfy that duplicate has unique is detected
create table t1 (a blob unique);
alter table t1 add constraint constraint_1 unique (a);
drop table t1;
--echo # End of 10.5 tests

View File

@ -562,7 +562,7 @@ a1\`b1 CREATE TABLE `a1\``b1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `a1\``b1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -594,7 +594,7 @@ a1\"b1 CREATE TABLE "a1\""b1" (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "a1\""b1" (
"a" int(11) DEFAULT NULL
);

View File

@ -95,7 +95,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -112,7 +112,7 @@ INSERT DELAYED IGNORE INTO `t1` VALUES
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -129,7 +129,7 @@ INSERT DELAYED IGNORE INTO `t2` VALUES
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -146,7 +146,7 @@ INSERT DELAYED IGNORE INTO `t3` VALUES
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -163,7 +163,7 @@ INSERT DELAYED IGNORE INTO `t4` VALUES
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -180,7 +180,7 @@ INSERT DELAYED IGNORE INTO `t5` VALUES
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -223,7 +223,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -240,7 +240,7 @@ INSERT DELAYED INTO `t1` VALUES
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -257,7 +257,7 @@ INSERT DELAYED INTO `t2` VALUES
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -274,7 +274,7 @@ INSERT DELAYED INTO `t3` VALUES
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -291,7 +291,7 @@ INSERT DELAYED INTO `t4` VALUES
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
@ -308,7 +308,7 @@ INSERT DELAYED INTO `t5` VALUES
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL

View File

@ -34,7 +34,7 @@ USE `mysqltest1
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1
1t` (
`foobar
@ -53,7 +53,7 @@ raboof` int(11) DEFAULT NULL
--
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1
1v` AS SELECT
1 AS `foobar

View File

@ -23,25 +23,25 @@ test.t4 analyze Warning Engine-independent statistics are not collected for colu
test.t4 analyze status OK
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t4` (
`a` mediumblob DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`a` mediumblob DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` mediumblob DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` mediumblob DEFAULT NULL
);

View File

@ -21,7 +21,7 @@ timeout without t1 contents expected
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -45,7 +45,7 @@ This would be a race condition otherwise, but default max_statement_time=0 makes
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

View File

@ -46,7 +46,7 @@ Testing text format output
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`point` varchar(10) NOT NULL,
`data` varchar(10) DEFAULT NULL,

View File

@ -33,7 +33,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` decimal(64,20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -51,7 +51,7 @@ Warnings:
Warning 1264 Out of range value for column 'a' at row 1
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -74,7 +74,7 @@ ERROR 42S22: Unknown column '1.2345' in 'VALUES'
SET SQL_MODE=@OLD_SQL_MODE;
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
@ -88,7 +88,7 @@ INSERT INTO `t1` VALUES
(1.23450,2.3456);
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
@ -114,7 +114,7 @@ INSERT INTO `t1` VALUES
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
@ -149,7 +149,7 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` decimal(10,5) DEFAULT NULL,
`b` float DEFAULT NULL
@ -237,7 +237,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=koi8r COLLATE=koi8r_general_ci;
@ -324,7 +324,7 @@ DROP TABLE t1;
create table ```a` (i int);
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE ```a` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -348,7 +348,7 @@ create table t1(a int);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -377,7 +377,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL
);
@ -409,7 +409,7 @@ set global sql_mode='ANSI_QUOTES';
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -438,7 +438,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL
);
@ -474,7 +474,7 @@ insert into t1 values (1),(2),(3);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -571,7 +571,7 @@ INSERT INTO t1 VALUES (_latin1 '
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -697,7 +697,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -742,7 +742,7 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`b` blob DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -784,7 +784,7 @@ INSERT INTO t1 VALUES (4),(5),(6);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -825,7 +825,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -1201,7 +1201,7 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`F_c4ca4238a0b923820dcc509a6f75849b` int(11) DEFAULT NULL,
`F_c81e728d9d4c2f636f067f89cc14862c` int(11) DEFAULT NULL,
@ -1577,7 +1577,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -1625,14 +1625,14 @@ INSERT INTO t2 VALUES (1), (2);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -1661,14 +1661,14 @@ CREATE TABLE `t2` (
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -1863,7 +1863,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -1879,7 +1879,7 @@ INSERT INTO `t1` VALUES
UNLOCK TABLES;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`a` int(10) DEFAULT NULL,
@ -1989,21 +1989,21 @@ mariadb-dump: Couldn't find table: "non_existing"
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2039,7 +2039,7 @@ mariadb-dump: Got error: 1064: "You have an error in your SQL syntax; check the
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2076,7 +2076,7 @@ insert into t1 values (0815, 4711, 2006);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "t1" (
"a b" int(11) NOT NULL,
"c""d" int(11) NOT NULL,
@ -2112,7 +2112,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL,
`c"d` int(11) NOT NULL,
@ -2168,7 +2168,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` varchar(30) DEFAULT NULL,
KEY `a` (`a`(5))
@ -2188,7 +2188,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
@ -2268,7 +2268,7 @@ create view v1 as select * from t1;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2281,7 +2281,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
@ -2339,7 +2339,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` varchar(30) DEFAULT NULL,
KEY `a` (`a`(5))
@ -2359,7 +2359,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
@ -2410,7 +2410,7 @@ INSERT INTO t1 VALUES ('\'');
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2458,7 +2458,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
@ -2477,7 +2477,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `a`,
1 AS `b`,
@ -2486,14 +2486,14 @@ SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `a` */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v3` AS SELECT
1 AS `a`,
1 AS `b`,
@ -2615,7 +2615,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` bigint(20) DEFAULT NULL
@ -2691,7 +2691,7 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2749,7 +2749,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` bigint(20) DEFAULT NULL
@ -2767,7 +2767,7 @@ INSERT INTO `t1` VALUES
UNLOCK TABLES;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -2899,7 +2899,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -3056,7 +3056,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
UNIQUE KEY `d` (`d`)
@ -3096,7 +3096,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
UNIQUE KEY `d` (`d`)
@ -3152,7 +3152,7 @@ a2
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1 test";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "t1 test" (
"a1" int(11) DEFAULT NULL
);
@ -3184,7 +3184,7 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
DROP TABLE IF EXISTS "t2 test";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE "t2 test" (
"a2" int(11) DEFAULT NULL
);
@ -3242,7 +3242,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(32) DEFAULT NULL,
@ -3261,7 +3261,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v0`;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v0` AS SELECT
1 AS `a`,
1 AS `b`,
@ -3270,7 +3270,7 @@ SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `a`,
1 AS `b`,
@ -3279,7 +3279,7 @@ SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `a`,
1 AS `b`,
@ -3371,7 +3371,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -3431,7 +3431,7 @@ insert into t1 values ('','');
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` binary(1) DEFAULT NULL,
`b` blob DEFAULT NULL
@ -3467,7 +3467,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` binary(1) DEFAULT NULL,
`b` blob DEFAULT NULL
@ -3653,7 +3653,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
USE `mysqldump_test_db`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -3671,7 +3671,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `id` */;
SET character_set_client = @saved_cs_client;
@ -3718,7 +3718,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHA
USE `mysqldump_tables`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `basetable` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`tag` varchar(64) DEFAULT NULL,
@ -3730,7 +3730,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR
USE `mysqldump_views`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `nasishnasifu` AS SELECT
1 AS `id` */;
SET character_set_client = @saved_cs_client;
@ -3867,7 +3867,7 @@ use test;
/*M!999999\- enable the sandbox mode */
DROP TABLE IF EXISTS `TABLES`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TEMPORARY TABLE `TABLES` (
`TABLE_CATALOG` varchar(512) NOT NULL,
`TABLE_SCHEMA` varchar(64) NOT NULL,
@ -3943,14 +3943,14 @@ CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t2`,`t3`);
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -3962,7 +3962,7 @@ LOCK TABLES `t2` WRITE;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -4057,7 +4057,7 @@ CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL,
`c2` longblob DEFAULT NULL
@ -4152,7 +4152,7 @@ create view db42635.v2 (c) as select * from db42635.t1;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -4165,7 +4165,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v2` AS SELECT
1 AS `c` */;
SET character_set_client = @saved_cs_client;
@ -4302,7 +4302,7 @@ INSERT INTO t1 VALUES (3,4), (4,5);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
@ -4583,7 +4583,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
USE `mysqldump_test_db`;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -4601,7 +4601,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `v1` AS SELECT
1 AS `id` */;
SET character_set_client = @saved_cs_client;
@ -4699,7 +4699,7 @@ create table test (a int);
/*M!999999\- enable the sandbox mode */
DROP TABLE IF EXISTS `test`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `test` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -4921,7 +4921,7 @@ ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `test` (
`c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
@ -5413,7 +5413,7 @@ CREATE TABLE t1 (a INT);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
@ -5695,7 +5695,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET ut
USE `db1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `basetable` (
`id` smallint(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
@ -5704,13 +5704,13 @@ INSERT INTO `basetable` VALUES
(5),
(6);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_name` (
`i3` smallint(6) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci INSERT_METHOD=LAST UNION=(`basetable`);
/*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
1 AS `1` */;
SET character_set_client = @saved_cs_client;
@ -5719,7 +5719,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET ut
USE `db2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_name` (
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
UNIQUE KEY `i1` (`i1`)
@ -5729,7 +5729,7 @@ INSERT INTO `nonunique_table_name` VALUES
(1),
(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
@ -5760,7 +5760,7 @@ USE `db2`;
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_name` (
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
UNIQUE KEY `i1` (`i1`)
@ -5770,7 +5770,7 @@ INSERT INTO `nonunique_table_name` VALUES
(1),
(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
@ -5787,7 +5787,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET ut
USE `db2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_name` (
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
UNIQUE KEY `i1` (`i1`)
@ -5797,7 +5797,7 @@ INSERT DELAYED INTO `nonunique_table_name` VALUES
(1),
(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
@ -5810,7 +5810,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET ut
USE `db1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `basetable` (
`id` smallint(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
@ -5819,7 +5819,7 @@ INSERT DELAYED INTO `basetable` VALUES
(5),
(6);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `nonunique_table_name` (
`i3` smallint(6) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci INSERT_METHOD=LAST UNION=(`basetable`);
@ -5828,7 +5828,7 @@ INSERT INTO `nonunique_table_name` VALUES
(5),
(6);
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
SET character_set_client = utf8mb4;
/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
1 AS `1` */;
SET character_set_client = @saved_cs_client;
@ -5978,7 +5978,7 @@ DROP TABLE t1;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -5989,7 +5989,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -6008,7 +6008,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `innodb_index_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_index_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6023,7 +6023,7 @@ CREATE TABLE `innodb_index_stats` (
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `innodb_table_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_table_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6035,7 +6035,7 @@ CREATE TABLE `innodb_table_stats` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `transaction_registry` (
`transaction_id` bigint(20) unsigned NOT NULL,
`commit_id` bigint(20) unsigned NOT NULL,
@ -6074,7 +6074,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -6085,7 +6085,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -6104,7 +6104,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `innodb_index_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_index_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6124,7 +6124,7 @@ LOCK TABLES `innodb_index_stats` WRITE;
UNLOCK TABLES;
DROP TABLE IF EXISTS `innodb_table_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_table_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6141,7 +6141,7 @@ LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `transaction_registry` (
`transaction_id` bigint(20) unsigned NOT NULL,
`commit_id` bigint(20) unsigned NOT NULL,
@ -6180,7 +6180,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -6191,7 +6191,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
@ -6210,7 +6210,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `innodb_index_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_index_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6230,7 +6230,7 @@ LOCK TABLES `innodb_index_stats` WRITE;
UNLOCK TABLES;
DROP TABLE IF EXISTS `innodb_table_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `innodb_table_stats` (
`database_name` varchar(64) NOT NULL,
`table_name` varchar(199) NOT NULL,
@ -6247,7 +6247,7 @@ LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE IF NOT EXISTS `transaction_registry` (
`transaction_id` bigint(20) unsigned NOT NULL,
`commit_id` bigint(20) unsigned NOT NULL,
@ -6294,7 +6294,7 @@ CREATE TABLE t4(ËÏÌÏÎËÁ1 INT);
insert into t4 values(1);
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) INVISIBLE DEFAULT NULL
@ -6303,7 +6303,7 @@ CREATE TABLE `t1` (
INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),
(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
@ -6313,7 +6313,7 @@ INSERT INTO `t2` VALUES
(1,2),
(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`invisible` int(11) DEFAULT NULL,
`a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4,
@ -6325,7 +6325,7 @@ INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( )
(2,4,5),
(1,2,3);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t4` (
`ËÏÌÏÎËÁ1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -6335,7 +6335,7 @@ INSERT INTO `t4` VALUES
#Check side effect on --complete insert
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) INVISIBLE DEFAULT NULL
@ -6344,7 +6344,7 @@ CREATE TABLE `t1` (
INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),
(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
@ -6353,7 +6353,7 @@ CREATE TABLE `t2` (
INSERT INTO `t2` (`a`, `b`) VALUES (1,2),
(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t3` (
`invisible` int(11) DEFAULT NULL,
`a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4,
@ -6365,7 +6365,7 @@ INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( )
(2,4,5),
(1,2,3);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t4` (
`ËÏÌÏÎËÁ1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -6696,7 +6696,7 @@ update mysql.event set body ='select not_a_value' where db='test' and name='e1';
create table t1 (i int);
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -6750,7 +6750,7 @@ create table t1 (a int);
/*M!999999\- enable the sandbox mode */
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

View File

@ -91,7 +91,7 @@ INSERT INTO t1 VALUES (1), (2);
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
@ -128,7 +128,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);
@ -165,7 +165,7 @@ UNLOCK TABLES;
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
);

View File

@ -1250,6 +1250,46 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
#
# MDEV-34033 Exchange partition with virtual columns fails
#
create or replace table t1(
id int primary key,
col1 int,
col2 boolean as (col1 is null))
partition by list (id) ( partition p1 values in (1)
);
create or replace table t1_working like t1;
alter table t1_working remove partitioning;
alter table t1 exchange partition p1 with table t1_working;
create or replace table t2(
id int primary key,
col1 int,
col2 boolean as (true))
partition by list (id) ( partition p1 values in (1)
);
create or replace table t2_working like t2;
alter table t2_working remove partitioning;
alter table t2 exchange partition p1 with table t2_working;
drop tables t1, t1_working, t2, t2_working;
#
# MDEV-35612 EXCHANGE PARTITION does not work for tables with unique blobs
#
create table t (a int, b text, unique (b), unique(a, b)) partition by list (a) (partition p0 values in (1,2), partition pdef default);
create table tp (a int, b text, c int invisible, unique (b), unique(a, b));
alter table t exchange partition p0 with table tp;
ERROR HY000: Tables have different definitions
create or replace table tp (a int, b text, unique (b), unique(a, b));
alter table t exchange partition p0 with table tp;
drop table t, tp;
create table t (a int, b int) with system versioning partition by list (a) (partition p0 values in (1,2));
create table tp (a int, b int);
alter table t exchange partition p0 with table tp;
ERROR HY000: Tables have different definitions
create or replace table tp (a int, b int) with system versioning;
alter table t exchange partition p0 with table tp;
drop table t, tp;
# End of 10.5 tests
#
# MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
#
CREATE TABLE t1 (a INT, KEY(a DESC)) PARTITION BY KEY(a) PARTITIONS 4;
@ -1257,6 +1297,4 @@ CREATE TABLE t2 (a INT, KEY(a));
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Tables have different definitions
DROP TABLE t1, t2;
#
# End of 10.8 tests
#

View File

@ -531,6 +531,7 @@ ALTER TABLE t2 REMOVE PARTITIONING;
# The following works as table spaces are not checked anymore
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
--disable_prepare_warnings
--echo #
--echo # MDEV-14642 Assertion `table->s->db_create_options == part_table->s->db_create_options' failed in compare_table_with_partition
@ -551,6 +552,60 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
# Cleanup
DROP TABLE t1, t2;
--echo #
--echo # MDEV-34033 Exchange partition with virtual columns fails
--echo #
# this fails when the virtual persistent column
# references another column
create or replace table t1(
id int primary key,
col1 int,
col2 boolean as (col1 is null))
partition by list (id) ( partition p1 values in (1)
);
create or replace table t1_working like t1;
alter table t1_working remove partitioning;
alter table t1 exchange partition p1 with table t1_working;
# this works when the virtual persistent column
# does not reference another column
create or replace table t2(
id int primary key,
col1 int,
col2 boolean as (true))
partition by list (id) ( partition p1 values in (1)
);
create or replace table t2_working like t2;
alter table t2_working remove partitioning;
alter table t2 exchange partition p1 with table t2_working;
# Cleanup
drop tables t1, t1_working, t2, t2_working;
--echo #
--echo # MDEV-35612 EXCHANGE PARTITION does not work for tables with unique blobs
--echo #
create table t (a int, b text, unique (b), unique(a, b)) partition by list (a) (partition p0 values in (1,2), partition pdef default);
create table tp (a int, b text, c int invisible, unique (b), unique(a, b));
--error ER_TABLES_DIFFERENT_METADATA
alter table t exchange partition p0 with table tp;
create or replace table tp (a int, b text, unique (b), unique(a, b));
alter table t exchange partition p0 with table tp;
drop table t, tp;
# same for system versioning:
create table t (a int, b int) with system versioning partition by list (a) (partition p0 values in (1,2));
create table tp (a int, b int); # without system versioning
--error ER_TABLES_DIFFERENT_METADATA
alter table t exchange partition p0 with table tp;
create or replace table tp (a int, b int) with system versioning;
alter table t exchange partition p0 with table tp;
drop table t, tp;
--echo # End of 10.5 tests
--echo #
--echo # MDEV-27683 EXCHANGE PARTITION allows different index direction, but causes further errors
--echo #
@ -560,6 +615,4 @@ CREATE TABLE t2 (a INT, KEY(a));
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
DROP TABLE t1, t2;
--echo #
--echo # End of 10.8 tests
--echo #

View File

@ -245,4 +245,39 @@ NULL
DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
#
# MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
#
CREATE TABLE t (c TIMESTAMP);
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
INSERT INTO t (c) VALUES (now());
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING IGNORE;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t;
# End of 10.5 tests

View File

@ -254,4 +254,38 @@ DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
--echo #
--echo # MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
--echo #
CREATE TABLE t (c TIMESTAMP);
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
INSERT INTO t (c) VALUES (now());
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE s USING DEFAULT;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE s USING IGNORE;
DROP TABLE t;
--echo # End of 10.5 tests

View File

@ -43,3 +43,10 @@ ERROR HY000: Can't read record in system table
drop table mysql.servers;
rename table mysql.servers_save to mysql.servers;
drop server s1;
#
# MDEV-35641 foreign server "disappears" after ALTERing the servers system table to use innodb and FLUSH PRIVILEGES
#
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (HOST '127.0.0.1');
ALTER TABLE mysql.servers ENGINE=innodb;
FLUSH PRIVILEGES;
drop server s1;

View File

@ -41,3 +41,12 @@ create server s2 foreign data wrapper foo options(user 'a');
drop table mysql.servers;
rename table mysql.servers_save to mysql.servers;
drop server s1;
--echo #
--echo # MDEV-35641 foreign server "disappears" after ALTERing the servers system table to use innodb and FLUSH PRIVILEGES
--echo #
--source include/have_innodb.inc
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (HOST '127.0.0.1');
ALTER TABLE mysql.servers ENGINE=innodb;
FLUSH PRIVILEGES;
drop server s1;

View File

@ -220,3 +220,15 @@ INDEXES Indexes
TRANSACTIONS Transactions
TRIGGERS Triggers
DROP TABLE ft2;
#
# MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE
# (duplicate) MDEV-35404 Assertion failed in Field::ptr_in_record
#
CREATE TABLE t (s geometry, t text);
INSERT INTO t () VALUES ();
UPDATE t SET t = '', s = 0;
ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t`.`s`
UPDATE t SET t = '', s = 0;
ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t`.`s`
ALTER TABLE t force;
DROP TABLE t;

View File

@ -205,3 +205,19 @@ UPDATE ft2 SET copy = UPPER(copy),
copy2= copy;
SELECT * FROM ft2;
DROP TABLE ft2;
--echo #
--echo # MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE
--echo # (duplicate) MDEV-35404 Assertion failed in Field::ptr_in_record
--echo #
CREATE TABLE t (s geometry, t text);
INSERT INTO t () VALUES ();
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
UPDATE t SET t = '', s = 0;
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
UPDATE t SET t = '', s = 0;
ALTER TABLE t force;
DROP TABLE t;

View File

@ -0,0 +1,108 @@
#
# MDEV-20281 "[ERROR] Failed to write to mysql.slow_log:" without
# error reason
#
call mtr.add_suppression("Failed to write to mysql.slow_log:");
SET @old_slow_query_log= @@global.slow_query_log;
SET @old_log_output= @@global.log_output;
SET @old_long_query_time= @@long_query_time;
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
1
1
show create table mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` bigint(20) unsigned NOT NULL,
`rows_examined` bigint(20) unsigned NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`rows_affected` bigint(20) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Slow log'
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
# one field missing
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` bigint(20) unsigned NOT NULL,
`rows_examined` bigint(20) unsigned NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
1
1
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
# crazy types
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` ENUM('apple','orange','pear') NOT NULL,
`query_time` ENUM('apple','orange','pear') NOT NULL,
`lock_time` ENUM('apple','orange','pear') NOT NULL,
`rows_sent` ENUM('apple','orange','pear') NOT NULL,
`rows_examined` ENUM('apple','orange','pear') NOT NULL,
`db` ENUM('apple','orange','pear') NOT NULL,
`last_insert_id` ENUM('apple','orange','pear') NOT NULL,
`insert_id` ENUM('apple','orange','pear') NOT NULL,
`server_id` ENUM('apple','orange','pear') NOT NULL,
`sql_text` ENUM('apple','orange','pear') NOT NULL,
`thread_id` ENUM('apple','orange','pear') NOT NULL,
`rows_affected` ENUM('apple','orange','pear') NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
1
1
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
# restore normal slow log table
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` bigint(20) unsigned NOT NULL,
`rows_examined` bigint(20) unsigned NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`rows_affected` bigint(20) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
FOUND 2 /incorrect number of fields in the log table/ in mysqld.1.err
FOUND 2 /Can't write data \(possible incorrect log table structure\)/ in mysqld.1.err
# End of 10.5 tests

View File

@ -0,0 +1,113 @@
source include/not_embedded.inc;
--echo #
--echo # MDEV-20281 "[ERROR] Failed to write to mysql.slow_log:" without
--echo # error reason
--echo #
call mtr.add_suppression("Failed to write to mysql.slow_log:");
--disable_ps_protocol
SET @old_slow_query_log= @@global.slow_query_log;
SET @old_log_output= @@global.log_output;
SET @old_long_query_time= @@long_query_time;
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
show create table mysql.slow_log;
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
--echo # one field missing
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` bigint(20) unsigned NOT NULL,
`rows_examined` bigint(20) unsigned NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
--echo # crazy types
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` ENUM('apple','orange','pear') NOT NULL,
`query_time` ENUM('apple','orange','pear') NOT NULL,
`lock_time` ENUM('apple','orange','pear') NOT NULL,
`rows_sent` ENUM('apple','orange','pear') NOT NULL,
`rows_examined` ENUM('apple','orange','pear') NOT NULL,
`db` ENUM('apple','orange','pear') NOT NULL,
`last_insert_id` ENUM('apple','orange','pear') NOT NULL,
`insert_id` ENUM('apple','orange','pear') NOT NULL,
`server_id` ENUM('apple','orange','pear') NOT NULL,
`sql_text` ENUM('apple','orange','pear') NOT NULL,
`thread_id` ENUM('apple','orange','pear') NOT NULL,
`rows_affected` ENUM('apple','orange','pear') NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
select 1 from dual;
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= "FILE";
SET GLOBAL slow_query_log= OFF;
drop table mysql.slow_log;
--echo # restore normal slow log table
CREATE TABLE mysql.slow_log (
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` bigint(20) unsigned NOT NULL,
`rows_examined` bigint(20) unsigned NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`rows_affected` bigint(20) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log';
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
--enable_ps_protocol
--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN=incorrect number of fields in the log table
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Can't write data \(possible incorrect log table structure\)
--source include/search_pattern_in_file.inc
--echo # End of 10.5 tests

View File

@ -363,3 +363,30 @@ ERROR HY000: Unknown thread id: 0
#
# End of 10.4 tests
#
#
# MDEV-24935: Server crashes in Field_iterator_natural_join::next or Field_iterator_table_ref::set_field_iterator upon 2nd execution of SP
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT, c INT);
CREATE TABLE t3 (d INT);
CREATE PROCEDURE sp() SELECT * FROM t1 JOIN t2 JOIN t3 USING (x);
CALL sp;
ERROR 42S22: Unknown column 'x' in 'FROM'
CALL sp;
ERROR 42S22: Unknown column 'x' in 'FROM'
# Clean up
DROP PROCEDURE sp;
DROP TABLE t1, t2, t3;
CREATE TABLE t1 (c1 INT,c2 INT);
CREATE TABLE t2 (c INT,c2 INT);
CREATE PROCEDURE p2 (OUT i INT,OUT o INT) READS SQL DATA DELETE a2,a3 FROM t1 AS a1 JOIN t2 AS a2 NATURAL JOIN t2 AS a3;
CALL p2 (@c,@a);
ERROR 23000: Column 'c2' in FROM is ambiguous
CALL p2 (@a,@c);
ERROR 23000: Column 'c2' in FROM is ambiguous
# Clean up
DROP PROCEDURE p2;
DROP TABLE t1, t2;
#
# End of 10.5 tests
#

View File

@ -386,3 +386,34 @@ KILL (('x' IN ( SELECT 1)) MOD 44);
--echo #
--echo # End of 10.4 tests
--echo #
--echo #
--echo # MDEV-24935: Server crashes in Field_iterator_natural_join::next or Field_iterator_table_ref::set_field_iterator upon 2nd execution of SP
--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT, c INT);
CREATE TABLE t3 (d INT);
CREATE PROCEDURE sp() SELECT * FROM t1 JOIN t2 JOIN t3 USING (x);
--error ER_BAD_FIELD_ERROR
CALL sp;
--error ER_BAD_FIELD_ERROR
CALL sp;
--echo # Clean up
DROP PROCEDURE sp;
DROP TABLE t1, t2, t3;
CREATE TABLE t1 (c1 INT,c2 INT);
CREATE TABLE t2 (c INT,c2 INT);
CREATE PROCEDURE p2 (OUT i INT,OUT o INT) READS SQL DATA DELETE a2,a3 FROM t1 AS a1 JOIN t2 AS a2 NATURAL JOIN t2 AS a3;
--error ER_NON_UNIQ_ERROR
CALL p2 (@c,@a);
--error ER_NON_UNIQ_ERROR
CALL p2 (@a,@c);
--echo # Clean up
DROP PROCEDURE p2;
DROP TABLE t1, t2;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -8964,6 +8964,223 @@ DROP PROCEDURE p1;
DROP PROCEDURE p2;
# End of 10.4 tests
#
# MDEV-35910: Pushdown of conditions with local SP variables
# into materialized derived table
# Pushdown of conditions with local variables from HAVING
# into WHERE
#
CREATE TABLE t1(
pk INT PRIMARY KEY AUTO_INCREMENT,
a INT,
b INT
);
INSERT INTO t1(a,b) VALUES (1, 2), (3, 2), (4, 5);
INSERT INTO t1(a,b) VALUES (3, 7), (4, 1), (3, 4);
CREATE PROCEDURE pushdownDerivedSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
SELECT dt.a
FROM (
SELECT t1.a, MIN(t1.b) as minB
FROM t1
GROUP BY t1.a
) AS dt
WHERE dt.minB = localB AND dt.a = localA + localB;
END$$
CREATE PROCEDURE explainPushdownDerivedSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
EXPLAIN format=json SELECT dt.a
FROM (
SELECT t1.a, MIN(t1.b) as minB
FROM t1
GROUP BY t1.a
) AS dt
WHERE dt.minB = localB AND dt.a = localA + localB;
END$$
CREATE PROCEDURE pushdownFromHavingSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
SELECT t1.a, SUM(b)
FROM t1
GROUP BY t1.a
HAVING t1.a > localA AND SUM(b) > 10 OR t1.a <= localB AND SUM(b) <= 2;
END$$
CREATE PROCEDURE explainPushdownFromHavingSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
EXPLAIN format=json
SELECT t1.a, SUM(b)
FROM t1
GROUP BY t1.a
HAVING t1.a > localA AND SUM(b) > 10 OR t1.a <= localB AND SUM(b) <= 2;
END$$
CALL pushdownDerivedSp();
a
3
set statement optimizer_switch='condition_pushdown_for_derived=off'
for CALL pushdownDerivedSp();
a
3
CALL explainPushdownDerivedSp();
EXPLAIN
{
"query_block": {
"select_id": 1,
"cost": 0.012588104,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.012588104,
"filtered": 100,
"attached_condition": "dt.minB = <cache>(localB@1) and dt.a = <cache>(localA@0 + localB@1)",
"materialized": {
"query_block": {
"select_id": 2,
"cost": 0.014784479,
"having_condition": "minB = <cache>(localB@1)",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.01097403,
"filtered": 100,
"attached_condition": "t1.a = <cache>(localA@0 + localB@1)"
}
}
]
}
}
}
}
]
}
}
set statement optimizer_switch='condition_pushdown_for_derived=off' for
CALL explainPushdownDerivedSp();
EXPLAIN
{
"query_block": {
"select_id": 1,
"cost": 0.012588104,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.012588104,
"filtered": 100,
"attached_condition": "dt.minB = <cache>(localB@1) and dt.a = <cache>(localA@0 + localB@1)",
"materialized": {
"query_block": {
"select_id": 2,
"cost": 0.014784479,
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.01097403,
"filtered": 100
}
}
]
}
}
}
}
}
}
]
}
}
CALL pushdownFromHavingSp();
a SUM(b)
1 2
3 13
set statement optimizer_switch='condition_pushdown_from_having=off' for
CALL pushdownFromHavingSp();
a SUM(b)
1 2
3 13
CALL explainPushdownFromHavingSp();
EXPLAIN
{
"query_block": {
"select_id": 1,
"cost": 0.014784479,
"having_condition": "t1.a > <cache>(localA@0) and sum(t1.b) > 10 or t1.a <= <cache>(localB@1) and sum(t1.b) <= 2",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.01097403,
"filtered": 100,
"attached_condition": "t1.a > <cache>(localA@0) or t1.a <= <cache>(localB@1)"
}
}
]
}
}
}
}
set statement optimizer_switch='condition_pushdown_from_having=off' for
CALL explainPushdownFromHavingSp();
EXPLAIN
{
"query_block": {
"select_id": 1,
"cost": 0.014784479,
"having_condition": "t1.a > <cache>(localA@0) and sum(t1.b) > 10 or t1.a <= <cache>(localB@1) and sum(t1.b) <= 2",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"rows": 6,
"cost": 0.01097403,
"filtered": 100
}
}
]
}
}
}
}
DROP PROCEDURE pushdownDerivedSp;
DROP PROCEDURE explainPushdownDerivedSp;
DROP PROCEDURE pushdownFromHavingSp;
DROP PROCEDURE explainPushdownFromHavingSp;
DROP TABLE t1;
# End of 10.5 tests
#
# MDEV-29129: Performance regression starting in 10.6: unlimited "select order by limit"
#
@ -9089,6 +9306,7 @@ database()
test
DROP FUNCTION database;
DROP TABLE t1;
# End of 10.6 tests
#
# MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
#
@ -9098,6 +9316,4 @@ CREATE PROCEDURE sp() SET @=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 '=1' at line 1
CREATE PROCEDURE sp() SELECT @;
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
#
# End of 10.7 tests
#

View File

@ -10590,7 +10590,95 @@ DROP PROCEDURE p1;
DROP PROCEDURE p2;
--echo # End of 10.4 tests
--echo #
--echo # MDEV-35910: Pushdown of conditions with local SP variables
--echo # into materialized derived table
--echo # Pushdown of conditions with local variables from HAVING
--echo # into WHERE
--echo #
CREATE TABLE t1(
pk INT PRIMARY KEY AUTO_INCREMENT,
a INT,
b INT
);
INSERT INTO t1(a,b) VALUES (1, 2), (3, 2), (4, 5);
INSERT INTO t1(a,b) VALUES (3, 7), (4, 1), (3, 4);
DELIMITER $$;
CREATE PROCEDURE pushdownDerivedSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
SELECT dt.a
FROM (
SELECT t1.a, MIN(t1.b) as minB
FROM t1
GROUP BY t1.a
) AS dt
WHERE dt.minB = localB AND dt.a = localA + localB;
END$$
CREATE PROCEDURE explainPushdownDerivedSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
EXPLAIN format=json SELECT dt.a
FROM (
SELECT t1.a, MIN(t1.b) as minB
FROM t1
GROUP BY t1.a
) AS dt
WHERE dt.minB = localB AND dt.a = localA + localB;
END$$
CREATE PROCEDURE pushdownFromHavingSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
SELECT t1.a, SUM(b)
FROM t1
GROUP BY t1.a
HAVING t1.a > localA AND SUM(b) > 10 OR t1.a <= localB AND SUM(b) <= 2;
END$$
CREATE PROCEDURE explainPushdownFromHavingSp()
BEGIN
DECLARE localA INT DEFAULT 1;
DECLARE localB INT DEFAULT 2;
EXPLAIN format=json
SELECT t1.a, SUM(b)
FROM t1
GROUP BY t1.a
HAVING t1.a > localA AND SUM(b) > 10 OR t1.a <= localB AND SUM(b) <= 2;
END$$
DELIMITER ;$$
CALL pushdownDerivedSp();
set statement optimizer_switch='condition_pushdown_for_derived=off'
for CALL pushdownDerivedSp();
CALL explainPushdownDerivedSp();
set statement optimizer_switch='condition_pushdown_for_derived=off' for
CALL explainPushdownDerivedSp();
CALL pushdownFromHavingSp();
set statement optimizer_switch='condition_pushdown_from_having=off' for
CALL pushdownFromHavingSp();
CALL explainPushdownFromHavingSp();
set statement optimizer_switch='condition_pushdown_from_having=off' for
CALL explainPushdownFromHavingSp();
DROP PROCEDURE pushdownDerivedSp;
DROP PROCEDURE explainPushdownDerivedSp;
DROP PROCEDURE pushdownFromHavingSp;
DROP PROCEDURE explainPushdownFromHavingSp;
DROP TABLE t1;
--echo # End of 10.5 tests
--echo #
--echo # MDEV-29129: Performance regression starting in 10.6: unlimited "select order by limit"
@ -10678,10 +10766,9 @@ CREATE OR REPLACE FUNCTION database() RETURNS int RETURN 333;
SELECT database();
DROP FUNCTION database;
# Cleanup
DROP TABLE t1;
--echo # End of 10.6 tests
--echo #
--echo # MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
@ -10696,6 +10783,4 @@ CREATE PROCEDURE sp() SET @=1;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp() SELECT @;
--echo #
--echo # End of 10.7 tests
--echo #

View File

@ -37,6 +37,7 @@ $$
call recursion(0,2,@s1);
call recursion(0,3,@s2);
call recursion(0,4,@s3);
$$
select @s1 > 0 && @s2 > 0 && @s3 > 0;
@s1 > 0 && @s2 > 0 && @s3 > 0
1

View File

@ -30,6 +30,7 @@ DROP table t1;
--echo #
set @@max_sp_recursion_depth=20;
--disable_ps_protocol
delimiter $$;
create or replace procedure recursion(x int, max int, OUT res int)
begin
@ -40,11 +41,13 @@ begin
end;
$$
delimiter ;$$
call recursion(0,2,@s1);
call recursion(0,3,@s2);
call recursion(0,4,@s3);
$$
delimiter ;$$
--enable_ps_protocol
select @s1 > 0 && @s2 > 0 && @s3 > 0;
if (`select @s2-@s1 <> @s3 - @s2`)

View File

@ -15,10 +15,10 @@ insert t1 (b) values (10);
insert t1 (b) values (20);
ERROR HY000: Field 'a' doesn't have a default value
insert t1 (b) values (30);
ERROR 23000: Column 'a' cannot be null
select * from t1;
a b
10 10
0 30
drop table t1;
set sql_mode=default;
set sql_mode='';

View File

@ -19,7 +19,7 @@ delimiter ;|
insert t1 (b) values (10);
--error ER_NO_DEFAULT_FOR_FIELD
insert t1 (b) values (20);
# arguably the statement below should fail too
--error ER_BAD_NULL_ERROR
insert t1 (b) values (30);
select * from t1;
drop table t1;

View File

@ -364,3 +364,39 @@ create trigger tr before update on t1 for each row set @a = 1;
insert into t1 (pk, i) values (null, null);
ERROR 23000: Column 'pk' cannot be null
drop table t1;
#
# MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
#
create table t1( id int, rate int not null);
create trigger test_trigger before insert on t1 for each row
set new.rate=if(new.rate is null,10,new.rate);
insert into t1 (id) values (1);
insert into t1 values (2,3);
select * from t1;
id rate
1 10
2 3
create or replace trigger test_trigger before insert on t1 for each row
if new.rate is null then set new.rate = 15; end if;
$$
insert into t1 (id) values (3);
insert into t1 values (4,5);
select * from t1;
id rate
1 10
2 3
3 15
4 5
drop table t1;
#
# MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)
#
set sql_mode='';
create table t1 (c fixed,c2 binary (1),c5 fixed not null);
create trigger tr1 before update on t1 for each row set @a=0;
insert into t1 (c) values (1);
Warnings:
Warning 1364 Field 'c5' doesn't have a default value
drop table t1;
set sql_mode=default;
# End of 10.5 tests

View File

@ -391,3 +391,38 @@ create trigger tr before update on t1 for each row set @a = 1;
--error ER_BAD_NULL_ERROR
insert into t1 (pk, i) values (null, null);
drop table t1;
--echo #
--echo # MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
--echo #
create table t1( id int, rate int not null);
create trigger test_trigger before insert on t1 for each row
set new.rate=if(new.rate is null,10,new.rate);
insert into t1 (id) values (1);
insert into t1 values (2,3);
select * from t1;
delimiter $$;
create or replace trigger test_trigger before insert on t1 for each row
if new.rate is null then set new.rate = 15; end if;
$$
delimiter ;$$
insert into t1 (id) values (3);
insert into t1 values (4,5);
select * from t1;
drop table t1;
--echo #
--echo # MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)
--echo #
set sql_mode='';
create table t1 (c fixed,c2 binary (1),c5 fixed not null);
create trigger tr1 before update on t1 for each row set @a=0;
insert into t1 (c) values (1);
drop table t1;
set sql_mode=default;
--echo # End of 10.5 tests

View File

@ -312,7 +312,7 @@ CREATE TRIGGER tr2_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a:=2;
CREATE TRIGGER tr1_bu BEFORE UPDATE ON t1 FOR EACH ROW SET @a:=3;
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
@ -375,7 +375,7 @@ CREATE TRIGGER tr1_1_bi BEFORE INSERT ON t1 FOR EACH ROW FOLLOWS tr1_bi SET @a:=
# Expected order of triggers in the dump is: tr0_bi, tr1_bi, tr1_1_bi, tr2_i.
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

View File

@ -656,6 +656,19 @@ DROP TABLE t2;
DROP TABLE t1;
SET note_verbosity=DEFAULT;
#
# MDEV-35864 UBSAN: "applying zero offset to null pointer" when using a Field_set with empty values
#
SET sql_mode='';
CREATE OR REPLACE TABLE t (c SET('','','') KEY,c2 DECIMAL UNSIGNED ZEROFILL,c3 CHAR(1) BINARY) ENGINE=MyISAM;
Warnings:
Note 1291 Column 'c' has duplicated value '' in SET
Note 1291 Column 'c' has duplicated value '' in SET
INSERT INTO t VALUES ('',CURRENT_TIME,'');
UPDATE t SET c2=c2+5 WHERE c BETWEEN '' AND '';
DROP TABLE t;
SET sql_mode=DEFAULT;
# End of 10.6 tests
#
# MDEV-29062 Wrong result set metadata for a mix of INT+ENUM
#
CREATE TABLE t1
@ -686,3 +699,4 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def COALESCE(c_int, c_set) 253 33 0 Y 0 39 33
COALESCE(c_int, c_set)
DROP TABLE t1;
# End of 10.11 tests

View File

@ -292,6 +292,19 @@ DELIMITER ;$$
DROP TABLE t1;
SET note_verbosity=DEFAULT;
--echo #
--echo # MDEV-35864 UBSAN: "applying zero offset to null pointer" when using a Field_set with empty values
--echo #
SET sql_mode='';
CREATE OR REPLACE TABLE t (c SET('','','') KEY,c2 DECIMAL UNSIGNED ZEROFILL,c3 CHAR(1) BINARY) ENGINE=MyISAM;
INSERT INTO t VALUES ('',CURRENT_TIME,'');
UPDATE t SET c2=c2+5 WHERE c BETWEEN '' AND '';
DROP TABLE t;
SET sql_mode=DEFAULT;
--echo # End of 10.6 tests
--echo #
--echo # MDEV-29062 Wrong result set metadata for a mix of INT+ENUM
--echo #
@ -320,3 +333,5 @@ SELECT COALESCE(c_int, c_set) FROM t1;
--enable_view_protocol
DROP TABLE t1;
--echo # End of 10.11 tests

View File

@ -7009,6 +7009,17 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from `t1` union (select 1 AS `1` from DUAL where 1 group by 1 having 1 for update) latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-35090: (Item_func_current_user) Assertion
# `typeid(*copy) == typeid(*this)' failed in
# Item_func_or_sum::do_build_clone
#
CREATE VIEW v AS SELECT 1;
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '<user>N/A</user>'
DROP VIEW v;
# End of 10.5 tests
#
# MDEV-13115: SELECT .. SKIP LOCKED - ensure SHOW CREATE VIEW is correct

View File

@ -6778,6 +6778,19 @@ SHOW CREATE VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-35090: (Item_func_current_user) Assertion
--echo # `typeid(*copy) == typeid(*this)' failed in
--echo # Item_func_or_sum::do_build_clone
--echo #
CREATE VIEW v AS SELECT 1;
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
# Cleanup
DROP VIEW v;
--echo # End of 10.5 tests
--echo #

View File

@ -4723,6 +4723,29 @@ w2_total w1_total u
200 200 2
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-35869: degenerated subquery with window function
#
CREATE TABLE t1 (a int DEFAULT 10);
INSERT INTO t1 VALUES (7), (2), (3);
SELECT * FROM t1 WHERE (SELECT AVG(3)) > 2;
a
7
2
3
SELECT * FROM t1 WHERE (SELECT AVG(3) OVER ()) > 2;
a
7
2
3
INSERT INTO t1 VALUES((SELECT avg(4) OVER ()));
SELECT * FROM t1;
a
7
2
3
4
DROP TABLE t1;
# End of 10.5 tests
#
# MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER

View File

@ -3013,6 +3013,18 @@ eval $q3;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-35869: degenerated subquery with window function
--echo #
CREATE TABLE t1 (a int DEFAULT 10);
INSERT INTO t1 VALUES (7), (2), (3);
SELECT * FROM t1 WHERE (SELECT AVG(3)) > 2;
SELECT * FROM t1 WHERE (SELECT AVG(3) OVER ()) > 2;
INSERT INTO t1 VALUES((SELECT avg(4) OVER ()));
SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.5 tests
--echo #

View File

@ -1,23 +1,115 @@
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
set timestamp=1000000000;
CREATE TABLE t1(word VARCHAR(20));
set timestamp=1000000010;
INSERT INTO t1 VALUES ("abirvalg");
set timestamp=1000000020;
INSERT INTO t1 SELECT * FROM t1;
flush logs;
Case: Default, must not see warning.
# MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime before EOF, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime between records, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime at EOF, must not see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
Case: Stop datetime after EOF, must see warning.
# MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
WARNING: Did not reach stop datetime '2035-01-19 03:14:05' before end of input
DROP TABLE t1;
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-01 10:20:30.123456');
#
# Clear the existing binary log state, and start fresh using
# the timestamp variable set above
#
RESET MASTER;
create table t1 (a int);
insert into t1 values (1);
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-02 10:20:30.123456');
insert into t1 values (2);
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-03 10:20:30.123456');
flush binary logs;
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-04 10:20:30.123456');
insert into t1 values (3);
insert into t1 values (4);
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-05 10:20:30.123456');
insert into t1 values (5);
insert into t1 values (6);
insert into t1 values (7);
SET TIMESTAMP=UNIX_TIMESTAMP('2024-12-06 10:20:30.123456');
flush binary logs;
drop table t1;
# Ensuring binary log order is correct
#
#
# Test using --read-from-remote-server
#
connection default;
#
# --stop-datetime tests
# Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
# 2.a, 2.b, and 2.c.
#
# Case 1.a) With one binlog file, a --stop-datetime before the end of
# the file should not result in a warning
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
#
# Case 1.b) With one binlog file, a --stop-datetime at the end of the
# file should not result in a warning
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
#
# Case 1.c) With one binlog file, a --stop-datetime beyond the end of
# the file should(!) result in a warning
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
#
# Case 2.a) With two binlog files, a --stop-datetime within the
# timespan of binlog 2 should:
# 1) not provide any warnings
# 2) not prevent binlog 1 or 2 from outputting the desired events
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
include/assert_grep.inc [Ensure all intended GTIDs are present]
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
#
# Case 2.b) With two binlog files, a --stop-datetime at the end of
# binlog 2 should:
# 1) not provide any warnings
# 2) not prevent binlog 1 or 2 from outputting all events
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
include/assert_grep.inc [Ensure a GTID exists for each transaction]
#
# Case 2.c) With two binlog files, a --stop-datetime beyond the end of
# binlog 2 should:
# 1) provide a warning that the stop datetime was not reached
# 2) not prevent binlog 1 or 2 from outputting all events
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
include/assert_grep.inc [Ensure a GTID exists for each transaction]
#
#
# Test using local binlog files
#
connection default;
#
# --stop-datetime tests
# Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
# 2.a, 2.b, and 2.c.
#
# Case 1.a) With one binlog file, a --stop-datetime before the end of
# the file should not result in a warning
# MYSQL_BINLOG --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
#
# Case 1.b) With one binlog file, a --stop-datetime at the end of the
# file should not result in a warning
# MYSQL_BINLOG --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
#
# Case 1.c) With one binlog file, a --stop-datetime beyond the end of
# the file should(!) result in a warning
# MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
#
# Case 2.a) With two binlog files, a --stop-datetime within the
# timespan of binlog 2 should:
# 1) not provide any warnings
# 2) not prevent binlog 1 or 2 from outputting the desired events
# MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
include/assert_grep.inc [Ensure all intended GTIDs are present]
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
#
# Case 2.b) With two binlog files, a --stop-datetime at the end of
# binlog 2 should:
# 1) not provide any warnings
# 2) not prevent binlog 1 or 2 from outputting all events
# MYSQL_BINLOG --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
include/assert_grep.inc [Ensure a GTID exists for each transaction]
#
# Case 2.c) With two binlog files, a --stop-datetime beyond the end of
# binlog 2 should:
# 1) provide a warning that the stop datetime was not reached
# 2) not prevent binlog 1 or 2 from outputting all events
# MYSQL_BINLOG --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
include/assert_grep.inc [Ensure a GTID exists for each transaction]
#
# End of binlog_mysqlbinlog_warn_stop_datetime.test

View File

@ -0,0 +1,65 @@
#
# Clear the existing binary log state.
#
RESET MASTER;
create table t1 (a int);
insert into t1 values (1);
insert into t1 values (2);
flush binary logs;
insert into t1 values (3);
# Tag binlog_f2_mid
insert into t1 values (4);
insert into t1 values (5);
insert into t1 values (6);
insert into t1 values (7);
flush binary logs;
drop table t1;
# Ensuring binary log order is correct
# Ensuring file offset of binlog_f2_mid < binlog_f1_end
#
#
# Test using local binlog files
#
connection default;
#
# --stop-position tests
#
# Case 1.a) With one binlog file, a --stop-position before the end of
# the file should not result in a warning
# MYSQL_BINLOG --stop-position=binlog_f1_pre_rotate binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
#
# Case 1.b) With one binlog file, a --stop-position at the exact end of
# the file should not result in a warning
# MYSQL_BINLOG --stop-position=binlog_f1_end binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
#
# Case 1.c) With one binlog file, a --stop-position past the end of the
# file should(!) result in a warning
# MYSQL_BINLOG --short-form --stop-position=binlog_f1_over_eof binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
WARNING: Did not reach stop position <BINLOG_F1_OVER_EOF> before end of input
#
# Case 2.a) With two binlog files, a --stop-position targeting b2 which
# exists in the size of b1 should:
# 1) not provide any warnings
# 2) not prevent b2 from outputting its desired events before the
# stop position
# MYSQL_BINLOG --stop-position=binlog_f2_mid binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
include/assert_grep.inc [Ensure all intended GTIDs are present]
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
#
# Case 2.b) With two binlog files, a --stop-position targeting the end
# of binlog 2 should:
# 1) not provide any warnings
# 2) not prevent b2 from outputting its entire binary log
# MYSQL_BINLOG --stop-position=binlog_f2_end binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
include/assert_grep.inc [Ensure a GTID exists for each transaction]
include/assert_grep.inc [Ensure the last GTID binlogged is present]
#
# Case 2.c) With two binlog files, a --stop-position targeting beyond
# the eof of binlog 2 should:
# 1) provide a warning that the stop position was not reached
# 2) not prevent b2 from outputting its entire binary log
# MYSQL_BINLOG --stop-position=binlog_f2_over_eof binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
WARNING: Did not reach stop position <BINLOG_F2_OVER_EOF> before end of input
include/assert_grep.inc [Ensure a GTID exists for each transaction]
#
# End of binlog_mysqlbinlog_warn_stop_position.test

View File

@ -38,7 +38,7 @@ CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
ALTER TABLE t_stmt ADD COLUMN b INT;
CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1);
CREATE INDEX i ON t_stmt(a);
ERROR 42000: Too many key parts specified; max 0 parts allowed
ERROR 42000: Specified key was too long; max key length is 0 bytes
CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt;
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging
DROP TABLE t_stmt;

View File

@ -0,0 +1,106 @@
#
# Helper file that ensures mysqlbinlog --stop-datetime behavior for local
# files or a remote server
#
# Parameters:
# read_from_remote_server (bool): A boolean that changes which source to use
# for mysqlbinlog. When true, reads remotely; when false, uses local files.
#
--connection default
--let $MYSQLD_DATADIR= `select @@datadir`
# PARAM_READ_FROM_REMOTE is used as a parameter to mysqlbinlog (_OUT suffix is
# output in echo commands). If using local files, they are blank; if reading
# from remote server, it is overridden to the correct values.
--let $PARAM_READ_FROM_REMOTE=
# Used in echo statements to remove potentially changing values
--let $PARAM_READ_FROM_REMOTE_OUT=
if ($read_from_remote_server)
{
--let $PARAM_READ_FROM_REMOTE= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT
--let $PARAM_READ_FROM_REMOTE_OUT= --read-from-remote-server
# binlog files in --read-from-remote-server don't use file system path
--let $binlog_f1_full= $binlog_f1
--let $binlog_f2_full= $binlog_f2
}
if (!$read_from_remote_server)
{
# If using local files, file system path to the binlog files is needed
--let $binlog_f1_full= $MYSQLD_DATADIR/$binlog_f1
--let $binlog_f2_full= $MYSQLD_DATADIR/$binlog_f2
}
--echo #
--echo # --stop-datetime tests
--echo # Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
--echo # 2.a, 2.b, and 2.c.
--echo #
--echo # Case 1.a) With one binlog file, a --stop-datetime before the end of
--echo # the file should not result in a warning
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b1_timestamp2' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b1_timestamp2' $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 1.b) With one binlog file, a --stop-datetime at the end of the
--echo # file should not result in a warning
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b1_timestamp3' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b1_timestamp3' $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 1.c) With one binlog file, a --stop-datetime beyond the end of
--echo # the file should(!) result in a warning
--let $future_timestamp= 2035-12-06 10:20:30.123456
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp1' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp1' $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 2.a) With two binlog files, a --stop-datetime within the
--echo # timespan of binlog 2 should:
--echo # 1) not provide any warnings
--echo # 2) not prevent binlog 1 or 2 from outputting the desired events
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp1' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp1' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $server_id= `SELECT @@GLOBAL.server_id`
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
--let $assert_file= $binlog_out
--let $assert_text= Ensure all intended GTIDs are present
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 3
--source include/assert_grep.inc
--let $assert_text= Ensure the next GTID binlogged is _not_ present
--let $assert_select= GTID $binlog_f2_gtid_after_midpoint
--let $assert_count= 0
--source include/assert_grep.inc
--echo #
--echo # Case 2.b) With two binlog files, a --stop-datetime at the end of
--echo # binlog 2 should:
--echo # 1) not provide any warnings
--echo # 2) not prevent binlog 1 or 2 from outputting all events
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp3' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp3' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $assert_text= Ensure a GTID exists for each transaction
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 8
--source include/assert_grep.inc
--echo #
--echo # Case 2.c) With two binlog files, a --stop-datetime beyond the end of
--echo # binlog 2 should:
--echo # 1) provide a warning that the stop datetime was not reached
--echo # 2) not prevent binlog 1 or 2 from outputting all events
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp_not_reached' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp_not_reached' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $assert_text= Ensure a GTID exists for each transaction
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 8
--source include/assert_grep.inc

View File

@ -1,42 +1,86 @@
--echo
--echo # MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
--echo
#
# Test ensures that --stop-datetime work correctly for mysqlbinlog. This high
# level test sets up the binary log (and tags certain locations for comparison),
# and the helper file binlog_mysqlbinlog_warn_stop_datetime.inc performs the
# actual tests.
#
# References:
# MDEV-27037: mysqlbinlog emits a warning when reaching EOF before
# stop-condition
# MDEV-35528: mariadb-binlog cannot process more than 1 logfiles when
# --stop-datetime is specified
#
--source include/have_log_bin.inc
--source include/have_binlog_format_statement.inc
--let $binlog_out_relpath= tmp/warn_datetime_test_file.out
--let $binlog_out= $MYSQLTEST_VARDIR/$binlog_out_relpath
--let ignored_output_file= $MYSQLTEST_VARDIR/tmp/warn_pos_test_file.out
--let $b1_timestamp1= 2024-12-01 10:20:30.123456
--let $b1_timestamp2= 2024-12-02 10:20:30.123456
--let $b1_timestamp3= 2024-12-03 10:20:30.123456
--let $b2_timestamp1= 2024-12-04 10:20:30.123456
--let $b2_timestamp2= 2024-12-05 10:20:30.123456
--let $b2_timestamp3= 2024-12-06 10:20:30.123456
--let $b2_timestamp_not_reached= 2024-12-07 10:20:30.123456
set timestamp=1000000000;
CREATE TABLE t1(word VARCHAR(20));
set timestamp=1000000010;
INSERT INTO t1 VALUES ("abirvalg");
set timestamp=1000000020;
INSERT INTO t1 SELECT * FROM t1;
--let MYSQLD_DATADIR= `select @@datadir;`
flush logs;
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp1')
--echo Case: Default, must not see warning.
--echo # MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
--echo #
--echo # Clear the existing binary log state, and start fresh using
--echo # the timestamp variable set above
--echo #
RESET MASTER;
--echo Case: Stop datetime before EOF, must not see warning.
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
--let $binlog_f1= query_get_value(SHOW MASTER STATUS, File, 1)
create table t1 (a int);
insert into t1 values (1);
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp2')
insert into t1 values (2);
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp3')
flush binary logs;
--let $binlog_f2= query_get_value(SHOW MASTER STATUS, File, 1)
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b2_timestamp1')
insert into t1 values (3);
insert into t1 values (4);
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b2_timestamp2')
--let $binlog_f2_gtid_after_midpoint= `SELECT @@GLOBAL.gtid_binlog_pos`
insert into t1 values (5);
insert into t1 values (6);
insert into t1 values (7);
--let $binlog_f2_last_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
--eval SET TIMESTAMP=UNIX_TIMESTAMP('$b2_timestamp3')
flush binary logs;
drop table t1;
--echo Case: Stop datetime between records, must not see warning.
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
--echo # Ensuring binary log order is correct
--let $binlog_f1_show= query_get_value(SHOW BINARY LOGS, Log_name, 1)
if (`SELECT strcmp('$binlog_f1','$binlog_f1_show') != 0`)
{
--echo # Real binlog_f1: $binlog_f1
--echo # First binlog in SHOW BINLOG FILES: $binlog_f1_show
--die Wrong order of binary log files in SHOW BINARY LOGS
}
--let $binlog_f2_show= query_get_value(SHOW BINARY LOGS, Log_name, 2)
if (`SELECT strcmp('$binlog_f2','$binlog_f2_show') != 0`)
{
--echo # Real binlog_f2: $binlog_f2
--echo # First binlog in SHOW BINLOG FILES: $binlog_f2_show
--die Wrong order of binary log files in SHOW BINARY LOGS
}
--echo Case: Stop datetime at EOF, must not see warning.
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
--echo #
--echo #
--echo # Test using --read-from-remote-server
--echo #
--let $read_from_remote_server= 1
--source binlog_mysqlbinlog_warn_stop_datetime.inc
--echo Case: Stop datetime after EOF, must see warning.
--echo # MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
--exec $MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
DROP TABLE t1;
--remove_file $ignored_output_file
--echo #
--echo #
--echo # Test using local binlog files
--echo #
--let $read_from_remote_server= 0
--source binlog_mysqlbinlog_warn_stop_datetime.inc
--echo #
--echo # End of binlog_mysqlbinlog_warn_stop_datetime.test

View File

@ -0,0 +1,115 @@
#
# Helper file that ensures mysqlbinlog --stop-position behavior for local
# files or a remote server
#
# Parameters:
# read_from_remote_server (bool): A boolean that changes which source to use
# for mysqlbinlog. When true, reads remotely; when false, uses local files.
#
--connection default
--let $MYSQLD_DATADIR= `select @@datadir`
# PARAM_READ_FROM_REMOTE is used as a parameter to mysqlbinlog (_OUT suffix is
# output in echo commands). If using local files, they are blank; if reading
# from remote server, it is overridden to the correct values.
--let $PARAM_READ_FROM_REMOTE=
# Used in echo statements to remove potentially changing values
--let $PARAM_READ_FROM_REMOTE_OUT=
if ($read_from_remote_server)
{
--let $PARAM_READ_FROM_REMOTE= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT
--let $PARAM_READ_FROM_REMOTE_OUT= --read-from-remote-server
# binlog files in --read-from-remote-server don't use file system path
--let $binlog_f1_full= $binlog_f1
--let $binlog_f2_full= $binlog_f2
}
if (!$read_from_remote_server)
{
# If using local files, file system path to the binlog files is needed
--let $binlog_f1_full= $MYSQLD_DATADIR/$binlog_f1
--let $binlog_f2_full= $MYSQLD_DATADIR/$binlog_f2
}
--echo #
--echo # --stop-position tests
--echo #
--echo # Case 1.a) With one binlog file, a --stop-position before the end of
--echo # the file should not result in a warning
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f1_pre_rotate binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f1_pre_rotate $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 1.b) With one binlog file, a --stop-position at the exact end of
--echo # the file should not result in a warning
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f1_end binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f1_end $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 1.c) With one binlog file, a --stop-position past the end of the
--echo # file should(!) result in a warning
--let $binlog_f1_over_eof= `SELECT $binlog_f1_end + 1`
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --short-form --stop-position=binlog_f1_over_eof binlog_f1_full --result-file=$binlog_out_relpath 2>&1
--replace_result $binlog_f1_over_eof <BINLOG_F1_OVER_EOF>
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --short-form --stop-position=$binlog_f1_over_eof $binlog_f1_full --result-file=$binlog_out 2>&1
--echo #
--echo # Case 2.a) With two binlog files, a --stop-position targeting b2 which
--echo # exists in the size of b1 should:
--echo # 1) not provide any warnings
--echo # 2) not prevent b2 from outputting its desired events before the
--echo # stop position
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_mid binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_mid $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $server_id= `SELECT @@GLOBAL.server_id`
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
--let $assert_file= $binlog_out
--let $assert_text= Ensure all intended GTIDs are present
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 4
--source include/assert_grep.inc
--let $assert_text= Ensure the next GTID binlogged is _not_ present
--let $assert_select= GTID $binlog_f2_gtid_after_midpoint
--let $assert_count= 0
--source include/assert_grep.inc
--echo #
--echo # Case 2.b) With two binlog files, a --stop-position targeting the end
--echo # of binlog 2 should:
--echo # 1) not provide any warnings
--echo # 2) not prevent b2 from outputting its entire binary log
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_end binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_end $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $server_id= `SELECT @@GLOBAL.server_id`
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
--let $assert_text= Ensure a GTID exists for each transaction
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 8
--source include/assert_grep.inc
--let $assert_text= Ensure the last GTID binlogged is present
--let $assert_select= GTID $binlog_f2_last_gtid
--let $assert_count= 1
--source include/assert_grep.inc
--echo #
--echo # Case 2.c) With two binlog files, a --stop-position targeting beyond
--echo # the eof of binlog 2 should:
--echo # 1) provide a warning that the stop position was not reached
--echo # 2) not prevent b2 from outputting its entire binary log
--let $binlog_f2_over_eof= `SELECT $binlog_f2_end + 1`
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_over_eof binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
--replace_result $binlog_f2_over_eof <BINLOG_F2_OVER_EOF>
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_over_eof $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
--let $server_id= `SELECT @@GLOBAL.server_id`
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
--let $assert_text= Ensure a GTID exists for each transaction
--let $assert_select= GTID $domain_id-$server_id-
--let $assert_count= 8
--source include/assert_grep.inc

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