1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '10.6' into 10.11

This commit is contained in:
Sergei Golubchik
2025-01-30 11:55:13 +01:00
344 changed files with 8502 additions and 2511 deletions

View File

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

@ -160,6 +160,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;
@ -1034,6 +1036,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
@ -1608,6 +1611,7 @@ err:
end:
rec_count++;
end_skip_count:
last_processed_datetime= ev_when;
DBUG_PRINT("info", ("end event processing"));
/*
@ -3220,6 +3224,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(3)))
@ -3320,7 +3325,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 */
{
@ -3353,7 +3359,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 */
@ -3393,7 +3400,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)
{
@ -3467,8 +3473,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)
{
@ -3477,15 +3485,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
@ -3499,21 +3507,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;
@ -3692,6 +3687,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

@ -3259,7 +3259,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);
@ -3327,7 +3327,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

@ -176,13 +176,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
@ -196,10 +204,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()
@ -210,11 +220,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)
@ -229,10 +241,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()
@ -240,13 +260,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
@ -259,27 +287,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

@ -37,16 +37,19 @@
#define mysql_free_result MARIADB_ADD_PREFIX(mysql_free_result)
#define mysql_get_socket MARIADB_ADD_PREFIX(mysql_get_socket)
#define mysql_set_character_set MARIADB_ADD_PREFIX(mysql_set_character_set)
#define mysql_real_escape_string MARIADB_ADD_PREFIX(mysql_real_escape_string)
#define mysql_get_server_version MARIADB_ADD_PREFIX(mysql_get_server_version)
#define mysql_error MARIADB_ADD_PREFIX(mysql_error)
#define mysql_errno MARIADB_ADD_PREFIX(mysql_errno)
#define mysql_num_fields MARIADB_ADD_PREFIX(mysql_num_fields)
#define mysql_num_rows MARIADB_ADD_PREFIX(mysql_num_rows)
#define mysql_options4 MARIADB_ADD_PREFIX(mysql_options4)
#define mysql_fetch_fields MARIADB_ADD_PREFIX(mysql_fetch_fields)
#define mysql_fetch_lengths MARIADB_ADD_PREFIX(mysql_fetch_lengths)
#define mysql_fetch_row MARIADB_ADD_PREFIX(mysql_fetch_row)
#define mysql_affected_rows MARIADB_ADD_PREFIX(mysql_affected_rows)
#define mysql_store_result MARIADB_ADD_PREFIX(mysql_store_result)
#define mysql_use_result MARIADB_ADD_PREFIX(mysql_use_result)
#define mysql_select_db MARIADB_ADD_PREFIX(mysql_select_db)
#define mysql_get_ssl_cipher MARIADB_ADD_PREFIX(mysql_get_ssl_cipher)
#define mysql_ssl_set MARIADB_ADD_PREFIX(mysql_ssl_set)

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

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

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

View File

@ -487,9 +487,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
}

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

@ -68,9 +68,12 @@ extern struct sql_service_st {
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
MYSQL_RES *(STDCALL *mysql_use_result_func)(MYSQL *mysql);
MYSQL_FIELD *(STDCALL *mysql_fetch_fields_func)(MYSQL_RES *res);
unsigned long (STDCALL *mysql_real_escape_string_func)(MYSQL *mysql, char *to,
const char *from, unsigned long length);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
const char *cert, const char *ca, const char *capath, const char *cipher);
} *sql_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
@ -92,7 +95,10 @@ extern struct sql_service_st {
#define mysql_set_character_set(M,C) sql_service->mysql_set_character_set_func(M,C)
#define mysql_num_fields(R) sql_service->mysql_num_fields_func(R)
#define mysql_select_db(M,D) sql_service->mysql_select_db_func(M,D)
#define mysql_ssl_set(M,K,C,A,P,H) sql_service->mysql_ssl_set_func(M,K,C,A,P,H)
#define mysql_use_result(M) sql_service->mysql_use_result_func(M)
#define mysql_fetch_fields(R) sql_service->mysql_fetch_fields_func(R)
#define mysql_real_escape_string(M,T,F,L) sql_service->mysql_real_escape_string_func(M,T,F,L)
#define mysql_ssl_set(M,K,C1,C2,C3,C4) sql_service->mysql_ssl_set_func(M,K,C1,C2,C3,C4)
#else

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 0x0101
#define VERSION_provider_bzip2 0x0100
#define VERSION_provider_lz4 0x0100

View File

@ -1065,11 +1065,6 @@ MYSQL_FIELD * STDCALL mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
return &(res)->fields[fieldnr];
}
MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res)
{
return (res)->fields;
}
MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res)
{
return res->data_cursor;
@ -1215,18 +1210,6 @@ mysql_escape_string(char *to,const char *from,ulong length)
length, &overflow);
}
ulong STDCALL
mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
ulong length)
{
my_bool overflow;
if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
return (ulong) escape_quotes_for_mysql(mysql->charset, to, 0, from, length,
&overflow);
return (ulong) escape_string_for_mysql(mysql->charset, to, 0, from, length,
&overflow);
}
void STDCALL
myodbc_remove_escape(MYSQL *mysql,char *name)
{
@ -4955,11 +4938,6 @@ int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt)
}
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql)
{
return (*mysql->methods->use_result)(mysql);
}
my_bool STDCALL mysql_read_query_result(MYSQL *mysql)
{
return (*mysql->methods->read_query_result)(mysql);

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(*) = 50 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 50 + $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

@ -3107,8 +3107,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

@ -6791,5 +6791,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

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

@ -3031,12 +3031,66 @@ 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;
# End of 10.5 tests
#
#
# Start of 10.11 tests
#
#
# MDEV-10865 COLLATE keyword doesn't work in PREPARE query
#
#
@ -3115,6 +3169,4 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET NAMES utf8mb4;
#
# End of 10.11 tests
#

View File

@ -1168,12 +1168,15 @@ 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 #
--echo #
--echo # Start of 10.11 tests
--echo #
SET NAMES utf8mb4;
--let $table_charset=CHARACTER SET utf32
--source include/ctype_supplementary_chars.inc
DROP TABLE t1, t2, t3, t4, t5;
--echo # End of 10.5 tests
--echo #
--echo # MDEV-10865 COLLATE keyword doesn't work in PREPARE query
@ -1243,8 +1246,6 @@ DROP TABLE t1;
SET NAMES utf8mb4;
--echo #
--echo # End of 10.11 tests
--echo #
--enable_service_connection

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

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

@ -24,3 +24,30 @@ SELECT * FROM t1;
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

View File

@ -20,3 +20,42 @@ 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

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
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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';
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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 '
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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` (
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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"
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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 ('\'');
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
@ -2901,7 +2901,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;
@ -3058,7 +3058,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`)
@ -3098,7 +3098,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`)
@ -3154,7 +3154,7 @@ a2
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
);
@ -3186,7 +3186,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
);
@ -3244,7 +3244,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,
@ -3263,7 +3263,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`,
@ -3272,7 +3272,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`,
@ -3281,7 +3281,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`,
@ -3373,7 +3373,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;
@ -3433,7 +3433,7 @@ insert into t1 values ('','');
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
@ -3469,7 +3469,7 @@ UNLOCK TABLES;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
@ -3655,7 +3655,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;
@ -3673,7 +3673,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;
@ -3720,7 +3720,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,
@ -3732,7 +3732,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;
@ -3869,7 +3869,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,
@ -3945,14 +3945,14 @@ CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
@ -3964,7 +3964,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
@ -4146,7 +4146,7 @@ create view db42635.v2 (c) as select * from db42635.t1;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
@ -4159,7 +4159,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;
@ -4296,7 +4296,7 @@ INSERT INTO t1 VALUES (3,4), (4,5);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
@ -4577,7 +4577,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;
@ -4595,7 +4595,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;
@ -4693,7 +4693,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;
@ -4915,7 +4915,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;
@ -5406,7 +5406,7 @@ CREATE TABLE t1 (a INT);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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
);
@ -5685,7 +5685,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;
@ -5694,13 +5694,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;
@ -5709,7 +5709,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`)
@ -5719,7 +5719,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;
@ -5750,7 +5750,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`)
@ -5760,7 +5760,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;
@ -5777,7 +5777,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`)
@ -5787,7 +5787,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;
@ -5800,7 +5800,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;
@ -5809,7 +5809,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`);
@ -5818,7 +5818,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;
@ -5968,7 +5968,7 @@ DROP TABLE t1;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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,
@ -5979,7 +5979,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,
@ -5998,7 +5998,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,
@ -6013,7 +6013,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,
@ -6025,7 +6025,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,
@ -6064,7 +6064,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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,
@ -6075,7 +6075,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,
@ -6094,7 +6094,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,
@ -6114,7 +6114,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,
@ -6131,7 +6131,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,
@ -6170,7 +6170,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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,
@ -6181,7 +6181,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,
@ -6200,7 +6200,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,
@ -6220,7 +6220,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,
@ -6237,7 +6237,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,
@ -6284,7 +6284,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
@ -6293,7 +6293,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
@ -6303,7 +6303,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,
@ -6315,7 +6315,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;
@ -6325,7 +6325,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
@ -6334,7 +6334,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
@ -6343,7 +6343,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,
@ -6355,7 +6355,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;
@ -6686,7 +6686,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;
@ -6740,7 +6740,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);
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=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

@ -8971,6 +8971,205 @@ 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,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 6,
"filtered": 100,
"attached_condition": "dt.minB = <cache>(localB@1) and dt.a = <cache>(localA@0 + localB@1)",
"materialized": {
"query_block": {
"select_id": 2,
"having_condition": "minB = <cache>(localB@1)",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"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,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 6,
"filtered": 100,
"attached_condition": "dt.minB = <cache>(localB@1) and dt.a = <cache>(localA@0 + localB@1)",
"materialized": {
"query_block": {
"select_id": 2,
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 6,
"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,
"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",
"rows": 6,
"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,
"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",
"rows": 6,
"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"
#
@ -9096,6 +9295,7 @@ database()
test
DROP FUNCTION database;
DROP TABLE t1;
# End of 10.6 tests
#
# MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
#
@ -9105,6 +9305,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

@ -10591,7 +10591,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"
@ -10679,10 +10767,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*)
@ -10697,6 +10784,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

@ -661,6 +661,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
@ -691,3 +704,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

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