Merge branch '10.3' into 10.4
This commit is contained in:
commit
93ac7ae70f
@ -251,8 +251,14 @@ ENDIF()
|
||||
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG)
|
||||
|
||||
OPTION(ENABLED_LOCAL_INFILE
|
||||
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
|
||||
SET(ENABLED_LOCAL_INFILE "AUTO" CACHE STRING "If we should should enable LOAD DATA LOCAL by default (OFF/ON/AUTO)")
|
||||
IF (ENABLED_LOCAL_INFILE MATCHES "^(0|FALSE)$")
|
||||
SET(ENABLED_LOCAL_INFILE OFF)
|
||||
ELSEIF(ENABLED_LOCAL_INFILE MATCHES "^(1|TRUE)$")
|
||||
SET(ENABLED_LOCAL_INFILE ON)
|
||||
ELSEIF (NOT ENABLED_LOCAL_INFILE MATCHES "^(ON|OFF|AUTO)$")
|
||||
MESSAGE(FATAL_ERROR "ENABLED_LOCAL_INFILE must be one of OFF, ON, AUTO")
|
||||
ENDIF()
|
||||
|
||||
# Set DBUG_OFF and other optional release-only flags for non-debug project types
|
||||
FOREACH(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
|
||||
@ -506,5 +512,5 @@ ENDIF()
|
||||
|
||||
IF(NON_DISTRIBUTABLE_WARNING)
|
||||
MESSAGE(WARNING "
|
||||
You have linked MariaDB with GPLv3 libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with Free Software Foundation.")
|
||||
You have linked MariaDB with ${NON_DISTRIBUTABLE_WARNING} libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with the Free Software Foundation.")
|
||||
ENDIF()
|
||||
|
@ -83,6 +83,7 @@ ulong mysqld_net_retry_count = 10L;
|
||||
ulong open_files_limit;
|
||||
ulong opt_binlog_rows_event_max_size;
|
||||
ulonglong test_flags = 0;
|
||||
ulong opt_binlog_rows_event_max_encoded_size= MAX_MAX_ALLOWED_PACKET;
|
||||
static uint opt_protocol= 0;
|
||||
static FILE *result_file;
|
||||
static char *result_file_name= 0;
|
||||
@ -849,8 +850,14 @@ write_event_header_and_base64(Log_event *ev, FILE *result_file,
|
||||
DBUG_ENTER("write_event_header_and_base64");
|
||||
|
||||
/* Write header and base64 output to cache */
|
||||
if (ev->print_header(head, print_event_info, FALSE) ||
|
||||
ev->print_base64(body, print_event_info, FALSE))
|
||||
if (ev->print_header(head, print_event_info, FALSE))
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
|
||||
DBUG_ASSERT(print_event_info->base64_output_mode == BASE64_OUTPUT_ALWAYS);
|
||||
|
||||
if (ev->print_base64(body, print_event_info,
|
||||
print_event_info->base64_output_mode !=
|
||||
BASE64_OUTPUT_DECODE_ROWS))
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
|
||||
/* Read data from cache and write to result file */
|
||||
@ -886,12 +893,13 @@ static bool print_base64(PRINT_EVENT_INFO *print_event_info, Log_event *ev)
|
||||
type_str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return ev->print(result_file, print_event_info);
|
||||
}
|
||||
|
||||
|
||||
static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
ulong table_id, bool is_stmt_end)
|
||||
ulonglong table_id, bool is_stmt_end)
|
||||
{
|
||||
Table_map_log_event *ignored_map=
|
||||
print_event_info->m_table_map_ignored.get_table(table_id);
|
||||
@ -1760,6 +1768,15 @@ that may lead to an endless loop.",
|
||||
"This value must be a multiple of 256.",
|
||||
&opt_binlog_rows_event_max_size, &opt_binlog_rows_event_max_size, 0,
|
||||
GET_ULONG, REQUIRED_ARG, UINT_MAX, 256, ULONG_MAX, 0, 256, 0},
|
||||
#ifndef DBUG_OFF
|
||||
{"debug-binlog-row-event-max-encoded-size", 0,
|
||||
"The maximum size of base64-encoded rows-event in one BINLOG pseudo-query "
|
||||
"instance. When the computed actual size exceeds the limit "
|
||||
"the BINLOG's argument string is fragmented in two.",
|
||||
&opt_binlog_rows_event_max_encoded_size,
|
||||
&opt_binlog_rows_event_max_encoded_size, 0,
|
||||
GET_ULONG, REQUIRED_ARG, UINT_MAX/4, 256, ULONG_MAX, 0, 256, 0},
|
||||
#endif
|
||||
{"verify-binlog-checksum", 'c', "Verify checksum binlog events.",
|
||||
(uchar**) &opt_verify_binlog_checksum, (uchar**) &opt_verify_binlog_checksum,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
@ -4018,63 +4018,6 @@ void do_mkdir(struct st_command *command)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Remove directory recursively.
|
||||
*/
|
||||
static int rmtree(const char *dir)
|
||||
{
|
||||
char path[FN_REFLEN];
|
||||
char sep[]={ FN_LIBCHAR, 0 };
|
||||
int err=0;
|
||||
|
||||
MY_DIR *dir_info= my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT));
|
||||
if (!dir_info)
|
||||
return 1;
|
||||
|
||||
for (uint i= 0; i < dir_info->number_of_files; i++)
|
||||
{
|
||||
FILEINFO *file= dir_info->dir_entry + i;
|
||||
/* Skip "." and ".." */
|
||||
if (!strcmp(file->name, ".") || !strcmp(file->name, ".."))
|
||||
continue;
|
||||
|
||||
strxnmov(path, sizeof(path), dir, sep, file->name, NULL);
|
||||
|
||||
if (!MY_S_ISDIR(file->mystat->st_mode))
|
||||
{
|
||||
err= my_delete(path, 0);
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
On Windows, check and possible reset readonly attribute.
|
||||
my_delete(), or DeleteFile does not remove theses files.
|
||||
*/
|
||||
if (err)
|
||||
{
|
||||
DWORD attr= GetFileAttributes(path);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES &&
|
||||
(attr & FILE_ATTRIBUTE_READONLY))
|
||||
{
|
||||
SetFileAttributes(path, attr &~ FILE_ATTRIBUTE_READONLY);
|
||||
err= my_delete(path, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
err= rmtree(path);
|
||||
|
||||
if(err)
|
||||
break;
|
||||
}
|
||||
|
||||
my_dirend(dir_info);
|
||||
|
||||
if (!err)
|
||||
err= rmdir(dir);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SYNOPSIS
|
||||
@ -4102,7 +4045,7 @@ void do_rmdir(struct st_command *command)
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
DBUG_PRINT("info", ("removing directory: %s", ds_dirname.str));
|
||||
if (rmtree(ds_dirname.str))
|
||||
if (my_rmtree(ds_dirname.str, MYF(0)))
|
||||
handle_command_error(command, 1, errno);
|
||||
|
||||
dynstr_free(&ds_dirname);
|
||||
@ -6106,7 +6049,6 @@ void do_connect(struct st_command *command)
|
||||
#endif
|
||||
if (opt_compress || con_compress)
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
csname?csname: charset_info->csname);
|
||||
if (opt_charsets_dir)
|
||||
@ -6190,6 +6132,11 @@ void do_connect(struct st_command *command)
|
||||
if (con_slot == next_con)
|
||||
next_con++; /* if we used the next_con slot, advance the pointer */
|
||||
}
|
||||
else // Failed to connect. Free the memory.
|
||||
{
|
||||
mysql_close(con_slot->mysql);
|
||||
con_slot->mysql= NULL;
|
||||
}
|
||||
|
||||
dynstr_free(&ds_connection_name);
|
||||
dynstr_free(&ds_host);
|
||||
@ -9291,7 +9238,6 @@ int main(int argc, char **argv)
|
||||
(void *) &opt_connect_timeout);
|
||||
if (opt_compress)
|
||||
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
charset_info->csname);
|
||||
if (opt_charsets_dir)
|
||||
|
@ -9,6 +9,9 @@ FUNCTION (CHECK_AWS_SDK RETVAL REASON)
|
||||
IF(NOT AWS_SDK_EXTERNAL_PROJECT)
|
||||
SKIP_AWS_SDK("AWS_SDK_EXTERNAL_PROJECT is not ON")
|
||||
ENDIF()
|
||||
IF(NOT NOT_FOR_DISTRIBUTION)
|
||||
SKIP_AWS_SDK("AWS SDK has Apache 2.0 License which is not complatible with GPLv2. Set -DNOT_FOR_DISTRIBUTION=ON if you need it")
|
||||
ENDIF()
|
||||
# Check compiler support
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||
@ -73,6 +76,7 @@ FUNCTION(USE_AWS_SDK_LIBS)
|
||||
IF(NOT TARGET ${target})
|
||||
MESSAGE(FATAL_ERROR "${target} is not a valid target")
|
||||
ENDIF()
|
||||
SET(NON_DISTRIBUTABLE_WARNING "Apache 2.0" CACHE INTERNAL "")
|
||||
LIST(REMOVE_AT SDK_COMPONENTS 0)
|
||||
FOREACH(comp ${SDK_COMPONENTS})
|
||||
SET_PROPERTY(GLOBAL PROPERTY AWS_SDK_LIBS ${comp} APPEND)
|
||||
|
@ -86,7 +86,6 @@ IF(FEATURE_SET)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
OPTION(ENABLED_LOCAL_INFILE "" ON)
|
||||
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
|
||||
IF(WIN32)
|
||||
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
|
||||
|
@ -134,7 +134,7 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
|
||||
SET(USE_NEW_READLINE_INTERFACE 1)
|
||||
ELSE()
|
||||
IF(NOT_FOR_DISTRIBUTION)
|
||||
SET(NON_DISTRIBUTABLE_WARNING 1)
|
||||
SET(NON_DISTRIBUTABLE_WARNING "GPLv3" CACHE INTERNAL "")
|
||||
SET(USE_NEW_READLINE_INTERFACE 1)
|
||||
ELSE()
|
||||
SET(USE_NEW_READLINE_INTERFACE 0)
|
||||
|
@ -10,7 +10,12 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE cmake_update_submodules
|
||||
RESULT_VARIABLE git_config_get_result)
|
||||
IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no)
|
||||
IF(cmake_update_submodules MATCHES no)
|
||||
SET(update_result 0)
|
||||
SET(SUBMODULE_UPDATE_CONFIG_MESSAGE
|
||||
"\n\nTo update submodules automatically, set cmake.update-submodules to 'yes', or 'force' to update automatically:
|
||||
${GIT_EXECUTABLE} config cmake.update-submodules yes")
|
||||
ELSEIF(git_config_get_result EQUAL 128)
|
||||
SET(update_result 0)
|
||||
ELSEIF (cmake_update_submodules MATCHES force)
|
||||
MESSAGE(STATUS "Updating submodules (forced)")
|
||||
@ -31,7 +36,6 @@ ENDIF()
|
||||
|
||||
IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
|
||||
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
|
||||
git submodule update --init --recursive
|
||||
Then restart the build.
|
||||
")
|
||||
${GIT_EXECUTABLE} submodule update --init --recursive
|
||||
Then restart the build.${SUBMODULE_UPDATE_CONFIG_MESSAGE}")
|
||||
ENDIF()
|
||||
|
@ -445,7 +445,11 @@
|
||||
/*
|
||||
MySQL features
|
||||
*/
|
||||
#cmakedefine ENABLED_LOCAL_INFILE 1
|
||||
#define LOCAL_INFILE_MODE_OFF 0
|
||||
#define LOCAL_INFILE_MODE_ON 1
|
||||
#define LOCAL_INFILE_MODE_AUTO 2
|
||||
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_@ENABLED_LOCAL_INFILE@
|
||||
|
||||
#cmakedefine ENABLED_PROFILING 1
|
||||
#cmakedefine EXTRA_DEBUG 1
|
||||
#cmakedefine USE_SYMDIR 1
|
||||
|
@ -260,7 +260,7 @@ SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DPACKAGE=test) # b
|
||||
CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS)
|
||||
IF(BFD_H_EXISTS)
|
||||
IF(NOT_FOR_DISTRIBUTION)
|
||||
SET(NON_DISTRIBUTABLE_WARNING 1)
|
||||
SET(NON_DISTRIBUTABLE_WARNING "GPLv3" CACHE INTERNAL "")
|
||||
SET(HAVE_BFD_H 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
27
debian/autobake-deb.sh
vendored
27
debian/autobake-deb.sh
vendored
@ -97,33 +97,6 @@ then
|
||||
sed '/Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control
|
||||
fi
|
||||
|
||||
# AWS SDK requires c++11 -capable compiler.
|
||||
# Minimal supported versions are g++ 4.8 and clang 3.3.
|
||||
# AWS SDK also requires the build machine to have network access and git, so
|
||||
# it cannot be part of the base version included in Linux distros, but a pure
|
||||
# custom built plugin.
|
||||
if [[ $GCCVERSION -gt 40800 ]] && [[ ! $TRAVIS ]] && [[ -x "$(command -v git)" ]] && timeout 3s bash -c 'sed -n q </dev/tcp/github.com/22'
|
||||
then
|
||||
cat <<EOF >> debian/control
|
||||
|
||||
Package: mariadb-plugin-aws-key-management
|
||||
Architecture: any
|
||||
Breaks: mariadb-aws-key-management-10.1,
|
||||
mariadb-aws-key-management-10.2
|
||||
Replaces: mariadb-aws-key-management-10.1,
|
||||
mariadb-aws-key-management-10.2
|
||||
Depends: mariadb-server-10.4,
|
||||
\${misc:Depends},
|
||||
\${shlibs:Depends}
|
||||
Description: Amazon Web Service Key Management Service Plugin for MariaDB
|
||||
This encryption key management plugin gives an interface to the Amazon Web
|
||||
Services Key Management Service for managing encryption keys used for MariaDB
|
||||
data-at-rest encryption.
|
||||
EOF
|
||||
|
||||
sed -i -e "/-DPLUGIN_AWS_KEY_MANAGEMENT=NO/d" debian/rules
|
||||
fi
|
||||
|
||||
# Don't build cassandra package if thrift is not installed
|
||||
if [[ ! -f /usr/local/include/thrift/Thrift.h && ! -f /usr/include/thrift/Thrift.h ]]
|
||||
then
|
||||
|
@ -1629,8 +1629,21 @@ ibx_copy_incremental_over_full()
|
||||
}
|
||||
}
|
||||
|
||||
if (directory_exists(ROCKSDB_BACKUP_DIR, false)) {
|
||||
if (my_rmtree(ROCKSDB_BACKUP_DIR, MYF(0))) {
|
||||
die("Can't remove " ROCKSDB_BACKUP_DIR);
|
||||
}
|
||||
}
|
||||
snprintf(path, sizeof(path), "%s/" ROCKSDB_BACKUP_DIR, xtrabackup_incremental_dir);
|
||||
if (directory_exists(path, false)) {
|
||||
if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) {
|
||||
die("my_mkdir failed for " ROCKSDB_BACKUP_DIR);
|
||||
}
|
||||
copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cleanup:
|
||||
if (it != NULL) {
|
||||
datadir_iter_free(it);
|
||||
|
@ -234,8 +234,6 @@ long innobase_write_io_threads = 4;
|
||||
longlong innobase_page_size = (1LL << 14); /* 16KB */
|
||||
char* innobase_buffer_pool_filename = NULL;
|
||||
|
||||
longlong innobase_buffer_pool_size = 8*1024*1024L;
|
||||
|
||||
/* The default values for the following char* start-up parameters
|
||||
are determined in innobase_init below: */
|
||||
|
||||
@ -800,7 +798,6 @@ enum options_xtrabackup
|
||||
OPT_INNODB_LOG_CHECKSUMS,
|
||||
OPT_XTRA_INCREMENTAL_FORCE_SCAN,
|
||||
OPT_DEFAULTS_GROUP,
|
||||
OPT_INNODB_ENCRYPT_LOG,
|
||||
OPT_CLOSE_FILES,
|
||||
OPT_CORE_FILE,
|
||||
|
||||
@ -1257,11 +1254,6 @@ struct my_option xb_server_options[] =
|
||||
(G_PTR*) &sys_tablespace_auto_extend_increment,
|
||||
(G_PTR*) &sys_tablespace_auto_extend_increment,
|
||||
0, GET_ULONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0},
|
||||
{"innodb_buffer_pool_size", OPT_INNODB_BUFFER_POOL_SIZE,
|
||||
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
|
||||
(G_PTR*) &innobase_buffer_pool_size, (G_PTR*) &innobase_buffer_pool_size, 0,
|
||||
GET_LL, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
|
||||
1024*1024L, 0},
|
||||
{"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH,
|
||||
"Path to individual files and their sizes.", &innobase_data_file_path,
|
||||
&innobase_data_file_path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -1375,10 +1367,6 @@ struct my_option xb_server_options[] =
|
||||
&xb_plugin_dir, &xb_plugin_dir,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
|
||||
|
||||
{ "innodb-encrypt-log", OPT_INNODB_ENCRYPT_LOG, "Whether to encrypt innodb log",
|
||||
&srv_encrypt_log, &srv_encrypt_log,
|
||||
0, GET_BOOL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
|
||||
|
||||
{"innodb-log-checksums", OPT_INNODB_LOG_CHECKSUMS,
|
||||
"Whether to require checksums for InnoDB redo log blocks",
|
||||
&innodb_log_checksums, &innodb_log_checksums,
|
||||
@ -1575,11 +1563,23 @@ end:
|
||||
}
|
||||
|
||||
|
||||
static const char *xb_client_default_groups[]=
|
||||
{ "xtrabackup", "mariabackup", "client", 0, 0, 0 };
|
||||
static const char *xb_client_default_groups[]={
|
||||
"xtrabackup", "mariabackup",
|
||||
"client", "client-server",
|
||||
"client-mariadb",
|
||||
0, 0, 0
|
||||
};
|
||||
|
||||
static const char *xb_server_default_groups[]=
|
||||
{ "xtrabackup", "mariabackup", "mysqld", 0, 0, 0 };
|
||||
static const char *xb_server_default_groups[]={
|
||||
"xtrabackup", "mariabackup",
|
||||
"mysqld", "server", MYSQL_BASE_VERSION,
|
||||
"mariadb", MARIADB_BASE_VERSION,
|
||||
"client-server",
|
||||
#ifdef WITH_WSREP
|
||||
"galera",
|
||||
#endif
|
||||
0, 0, 0
|
||||
};
|
||||
|
||||
static void print_version(void)
|
||||
{
|
||||
@ -1821,13 +1821,6 @@ static bool innodb_init_param()
|
||||
msg("mariabackup: use-memory can't be over 4GB"
|
||||
" on 32-bit systems");
|
||||
}
|
||||
|
||||
if (innobase_buffer_pool_size > UINT_MAX32) {
|
||||
msg("mariabackup: innobase_buffer_pool_size can't be "
|
||||
"over 4GB on 32-bit systems");
|
||||
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
static char default_path[2] = { FN_CURLIB, 0 };
|
||||
@ -2763,7 +2756,10 @@ static bool xtrabackup_copy_logfile(bool last = false)
|
||||
log_mutex_exit();
|
||||
|
||||
if (!start_lsn) {
|
||||
die("xtrabackup_copy_logfile() failed.");
|
||||
msg(recv_sys->found_corrupt_log
|
||||
? "xtrabackup_copy_logfile() failed: corrupt log."
|
||||
: "xtrabackup_copy_logfile() failed.");
|
||||
return true;
|
||||
}
|
||||
} while (start_lsn == end_lsn);
|
||||
|
||||
|
@ -613,7 +613,9 @@ static inline size_t my_b_bytes_in_cache(const IO_CACHE *info)
|
||||
return (size_t) (info->read_end - info->read_pos);
|
||||
}
|
||||
|
||||
int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
|
||||
int my_b_copy_to_file (IO_CACHE *cache, FILE *file, size_t count);
|
||||
int my_b_copy_all_to_file(IO_CACHE *cache, FILE *file);
|
||||
|
||||
my_off_t my_b_append_tell(IO_CACHE* info);
|
||||
my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
|
||||
int my_b_pread(IO_CACHE *info, uchar *Buffer, size_t Count, my_off_t pos);
|
||||
@ -627,6 +629,7 @@ extern int (*mysys_test_invalid_symlink)(const char *filename);
|
||||
|
||||
extern int my_copy(const char *from,const char *to,myf MyFlags);
|
||||
extern int my_delete(const char *name,myf MyFlags);
|
||||
extern int my_rmtree(const char *name, myf Myflags);
|
||||
extern int my_getwd(char * buf,size_t size,myf MyFlags);
|
||||
extern int my_setwd(const char *dir,myf MyFlags);
|
||||
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
|
||||
|
@ -42,7 +42,7 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
||||
#else
|
||||
# define MEM_UNDEFINED(a,len) ((void) 0)
|
||||
# define MEM_UNDEFINED(a,len) ((void) (a), (void) (len))
|
||||
# define MEM_NOACCESS(a,len) ((void) 0)
|
||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
||||
@ -51,7 +51,7 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
||||
#if !defined(DBUG_OFF) || defined(TRASH_FREED_MEMORY)
|
||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
|
||||
#else
|
||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
|
||||
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
|
||||
#endif
|
||||
|
||||
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
|
||||
|
@ -293,7 +293,7 @@ typedef struct st_mysql
|
||||
|
||||
/* session-wide random string */
|
||||
char scramble[SCRAMBLE_LENGTH+1];
|
||||
my_bool unused1;
|
||||
my_bool auto_local_infile;
|
||||
void *unused2, *unused3, *unused4, *unused5;
|
||||
|
||||
LIST *stmts; /* list of all statements */
|
||||
|
@ -382,7 +382,7 @@ typedef struct st_mysql
|
||||
my_bool free_me;
|
||||
my_bool reconnect;
|
||||
char scramble[20 +1];
|
||||
my_bool unused1;
|
||||
my_bool auto_local_infile;
|
||||
void *unused2, *unused3, *unused4, *unused5;
|
||||
LIST *stmts;
|
||||
const struct st_mysql_methods *methods;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit beb9d5ea8994bb90361c4b9f3d926eee24055178
|
||||
Subproject commit 2c5aebb3bc724c1663c481ba2fedde00ab494fa4
|
@ -98,7 +98,6 @@ call mtr.check_testcase();
|
||||
let $datadir=`select @@datadir`;
|
||||
list_files $datadir mysql_upgrade_info;
|
||||
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
|
||||
--replace_regex /#sql-ib[0-9a-f]+-[0-9a-f]+\.ibd\n//
|
||||
cat_file $datadir.tempfiles.txt;
|
||||
remove_file $datadir.tempfiles.txt;
|
||||
list_files $datadir/mysql #sql*;
|
||||
|
@ -35,7 +35,6 @@ BEGIN
|
||||
AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
|
||||
AND variable_name not like 'GTID%POS'
|
||||
AND variable_name != 'GTID_BINLOG_STATE'
|
||||
AND variable_name != 'AUTO_INCREMENT_INCREMENT'
|
||||
ORDER BY variable_name;
|
||||
|
||||
-- Dump all databases, there should be none
|
||||
|
@ -2468,6 +2468,55 @@ ERROR 23000: Duplicate entry '1' for key 'i'
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-17599 ALTER TABLE DROP CONSTRAINT does not work for foreign keys.
|
||||
#
|
||||
CREATE TABLE t1(id INT PRIMARY KEY, c1 INT) ENGINE= INNODB;
|
||||
CREATE TABLE t2(id INT PRIMARY KEY, c1 INT, c2 INT NOT NULL,
|
||||
CONSTRAINT sid FOREIGN KEY (`c1`) REFERENCES t1 (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||
CONSTRAINT UNIQUE `ui`(c2)) ENGINE= INNODB;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`id` int(11) NOT NULL,
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ui` (`c2`),
|
||||
KEY `sid` (`c1`),
|
||||
CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `t1` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t2 DROP CONSTRAINT sid;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`id` int(11) NOT NULL,
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ui` (`c2`),
|
||||
KEY `sid` (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t2 DROP CONSTRAINT ui;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`id` int(11) NOT NULL,
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `sid` (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t2 DROP CONSTRAINT PRIMARY KEY;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`id` int(11) NOT NULL,
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
KEY `sid` (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t2, t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -2018,6 +2018,23 @@ UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17599 ALTER TABLE DROP CONSTRAINT does not work for foreign keys.
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(id INT PRIMARY KEY, c1 INT) ENGINE= INNODB;
|
||||
CREATE TABLE t2(id INT PRIMARY KEY, c1 INT, c2 INT NOT NULL,
|
||||
CONSTRAINT sid FOREIGN KEY (`c1`) REFERENCES t1 (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||
CONSTRAINT UNIQUE `ui`(c2)) ENGINE= INNODB;
|
||||
SHOW CREATE TABLE t2;
|
||||
ALTER TABLE t2 DROP CONSTRAINT sid;
|
||||
SHOW CREATE TABLE t2;
|
||||
ALTER TABLE t2 DROP CONSTRAINT ui;
|
||||
SHOW CREATE TABLE t2;
|
||||
ALTER TABLE t2 DROP CONSTRAINT PRIMARY KEY;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -27,3 +27,9 @@ t2 CREATE TEMPORARY TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`v` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop temporary table t1, t2;
|
||||
create temporary table t1 (a int);
|
||||
alter table t1 add column f text;
|
||||
insert into t1 values ('x','foo');
|
||||
ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`a` at row 1
|
||||
drop temporary table t1;
|
||||
|
@ -19,3 +19,13 @@ lock table t2 write;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
alter table t2 change column a b int, algorithm=inplace;
|
||||
show create table t2;
|
||||
drop temporary table t1, t2;
|
||||
|
||||
#
|
||||
# MDEV-18083 ASAN heap-use-after-free in Field::set_warning_truncated_wrong_value upon inserting into temporary table
|
||||
#
|
||||
create temporary table t1 (a int);
|
||||
alter table t1 add column f text;
|
||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
||||
insert into t1 values ('x','foo');
|
||||
drop temporary table t1;
|
||||
|
@ -95,3 +95,10 @@ Warnings:
|
||||
Warning 4025 CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
|
||||
alter table t1;
|
||||
drop table t1;
|
||||
create temporary table t1 (a int default 0, check (a > 0));
|
||||
alter table t1 drop constraint if exists non_existing_constraint;
|
||||
Warnings:
|
||||
Note 1091 Can't DROP CONSTRAINT `non_existing_constraint`; check that it exists
|
||||
insert into t1 () values ();
|
||||
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
|
||||
drop table t1;
|
||||
|
@ -115,3 +115,12 @@ insert into t1 () values ();
|
||||
alter ignore table t1 add constraint check (f > 0);
|
||||
alter table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# MDEV-16905 ASAN heap-use-after-free in __interceptor_strnlen / ... / TABLE::verify_constraints upon INSERT into temporary table with CHECK constraint
|
||||
#
|
||||
create temporary table t1 (a int default 0, check (a > 0));
|
||||
alter table t1 drop constraint if exists non_existing_constraint;
|
||||
--error ER_CONSTRAINT_FAILED
|
||||
insert into t1 () values ();
|
||||
drop table t1;
|
||||
|
@ -44,7 +44,7 @@ a b
|
||||
103 103
|
||||
set check_constraint_checks=@save_check_constraint;
|
||||
alter table t1 add c int default 0 check (c < 10);
|
||||
ERROR 23000: CONSTRAINT `max` failed for table
|
||||
ERROR 23000: CONSTRAINT `max` failed for `test`.`t1`
|
||||
set check_constraint_checks=0;
|
||||
alter table t1 add c int default 0 check (c < 10);
|
||||
alter table t1 add check (a+b+c < 500);
|
||||
|
@ -27,7 +27,6 @@ insert into t1 values (101,101),(102,102),(600,600),(103,103);
|
||||
select * from t1;
|
||||
set check_constraint_checks=@save_check_constraint;
|
||||
|
||||
--replace_regex /failed for.*/failed for table/
|
||||
--error ER_CONSTRAINT_FAILED
|
||||
alter table t1 add c int default 0 check (c < 10);
|
||||
|
||||
|
9
mysql-test/main/check_constraint_innodb.result
Normal file
9
mysql-test/main/check_constraint_innodb.result
Normal file
@ -0,0 +1,9 @@
|
||||
create table t1 (a int, b smallint) engine=innodb;
|
||||
connect con1,localhost,root,,test;
|
||||
alter table t1 add constraint check (b < 8);
|
||||
alter table t1 modify column b int, algorithm=inplace;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
|
||||
connection default;
|
||||
alter table t1 add primary key (a);
|
||||
drop table t1;
|
||||
disconnect con1;
|
14
mysql-test/main/check_constraint_innodb.test
Normal file
14
mysql-test/main/check_constraint_innodb.test
Normal file
@ -0,0 +1,14 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# MDEV-18239 ASAN use-after-poison in process_str_arg / ... / mark_unsupported_func or unexpected ER_BAD_FIELD_ERROR upon ALTER TABLE
|
||||
#
|
||||
create table t1 (a int, b smallint) engine=innodb;
|
||||
connect con1,localhost,root,,test;
|
||||
alter table t1 add constraint check (b < 8);
|
||||
error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON;
|
||||
alter table t1 modify column b int, algorithm=inplace;
|
||||
connection default;
|
||||
alter table t1 add primary key (a);
|
||||
drop table t1;
|
||||
disconnect con1;
|
@ -18,6 +18,7 @@ innodb-wl5522-debug-zip : broken upstream
|
||||
innodb_bug12902967 : broken upstream
|
||||
file_contents : MDEV-6526 these files are not installed anymore
|
||||
max_statement_time : cannot possibly work, depends on timing
|
||||
partition_open_files_limit : open_files_limit check broken by MDEV-18360
|
||||
mysqlcheck : special tables like proxy , host specific to a system are shown
|
||||
flush_read_lock : special tables like proxy , host specific to a system are shown
|
||||
join_cache : enable after MDEV-17752 is fixed
|
||||
|
@ -1,6 +1,3 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.t1'
|
||||
CREATE TABLE t1 (
|
||||
a varchar(32) character set utf8 collate utf8_bin NOT NULL,
|
||||
b varchar(32) character set utf8 collate utf8_bin NOT NULL )
|
||||
@ -15,7 +12,7 @@ INSERT INTO t1 VALUES
|
||||
set tmp_table_size=1024;
|
||||
set session debug_dbug="+d,raise_error";
|
||||
SELECT MAX(a) FROM t1 GROUP BY a,b;
|
||||
ERROR 23000: Can't write; duplicate key in table 'tmp_table'
|
||||
ERROR 23000: Can't write; duplicate key in table '(temporary)'
|
||||
set tmp_table_size=default;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
|
@ -1,12 +1,9 @@
|
||||
-- source include/have_debug.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# Bug #28499: crash for grouping query when tmp_table_size is too small
|
||||
#
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a varchar(32) character set utf8 collate utf8_bin NOT NULL,
|
||||
b varchar(32) character set utf8 collate utf8_bin NOT NULL )
|
||||
@ -26,14 +23,12 @@ set tmp_table_size=1024;
|
||||
# tmp table in query is converted from heap to myisam
|
||||
set session debug_dbug="+d,raise_error";
|
||||
|
||||
--replace_regex /in table '[^']+'/in table 'tmp_table'/
|
||||
--error ER_DUP_KEY
|
||||
SELECT MAX(a) FROM t1 GROUP BY a,b;
|
||||
|
||||
set tmp_table_size=default;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #50946: fast index creation still seems to copy the table
|
||||
--echo #
|
||||
|
@ -1483,6 +1483,14 @@ ip_full_addr
|
||||
2000::
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# MDEV-18195 ASAN use-after-poison in my_strcasecmp_utf8 / Item::eq upon prepared statement with ORDER BY NAME_CONST
|
||||
#
|
||||
PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
|
||||
EXECUTE stmt;
|
||||
x
|
||||
x
|
||||
DEALLOCATE PREPARE stmt;
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -1130,6 +1130,14 @@ DELIMITER ;$$
|
||||
CALL p1();
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18195 ASAN use-after-poison in my_strcasecmp_utf8 / Item::eq upon prepared statement with ORDER BY NAME_CONST
|
||||
--echo #
|
||||
|
||||
PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.2 tests
|
||||
|
@ -762,7 +762,6 @@ drop table t1;
|
||||
--echo # on char > 31 bytes".
|
||||
--echo #
|
||||
create table t1(a char(32) not null) engine=myisam;
|
||||
--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
create spatial index i on t1 (a);
|
||||
drop table t1;
|
||||
|
@ -33,6 +33,6 @@ SET timestamp=default;
|
||||
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1))));
|
||||
set timestamp=10;
|
||||
alter table t1 add column i int;
|
||||
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1
|
||||
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
|
||||
drop table t1;
|
||||
SET timestamp=default;
|
||||
|
@ -600,3 +600,29 @@ a
|
||||
2
|
||||
drop table "a1\""b1";
|
||||
set sql_mode=default;
|
||||
create table t1 (a text);
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
41
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
41
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
41
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
truncate table t1;
|
||||
drop table t1;
|
||||
|
@ -680,3 +680,25 @@ show create table "a1\""b1";
|
||||
select * from "a1\""b1";
|
||||
drop table "a1\""b1";
|
||||
set sql_mode=default;
|
||||
|
||||
#
|
||||
# mysql --local-infile
|
||||
#
|
||||
--let $ldli = load data local infile '$MYSQLTEST_VARDIR/tmp/bug.sql' into table test.t1;
|
||||
create table t1 (a text);
|
||||
--exec $MYSQL -e "$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
--exec $MYSQL --enable-local-infile -e "$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
--error 1
|
||||
--exec $MYSQL --disable-local-infile -e "$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
--error 1
|
||||
--exec $MYSQL -e "/*q*/$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
--exec $MYSQL --enable-local-infile -e "/*q*/$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
--error 1
|
||||
--exec $MYSQL --disable-local-infile -e "/*q*/$ldli"
|
||||
select count(*) from t1; truncate table t1;
|
||||
drop table t1;
|
||||
|
@ -237,43 +237,40 @@ BEGIN
|
||||
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
|
||||
#<date> server id 1 end_log_pos 2591 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 2591
|
||||
#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2657 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
|
||||
### UPDATE `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
### @5=4 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### UPDATE `test`.`t2`
|
||||
### WHERE
|
||||
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
|
||||
### @5=4 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### SET
|
||||
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
|
||||
### UPDATE `test`.`t2`
|
||||
### WHERE
|
||||
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
|
||||
### @5=NULL /* INT meta=0 nullable=1 is_null=1 */
|
||||
### SET
|
||||
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
|
||||
# Number of rows: 3
|
||||
# at 2665
|
||||
#<date> server id 1 end_log_pos 2738 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
# at 2657
|
||||
#<date> server id 1 end_log_pos 2730 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
SET TIMESTAMP=X/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at 2738
|
||||
#<date> server id 1 end_log_pos 2780 CRC32 XXX GTID 0-1-9
|
||||
# at 2730
|
||||
#<date> server id 1 end_log_pos 2772 CRC32 XXX GTID 0-1-9
|
||||
/*!100001 SET @@session.gtid_seq_no=9*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at 2780
|
||||
# at 2817
|
||||
#<date> server id 1 end_log_pos 2817 CRC32 XXX Annotate_rows:
|
||||
# at 2772
|
||||
# at 2809
|
||||
#<date> server id 1 end_log_pos 2809 CRC32 XXX Annotate_rows:
|
||||
#Q> DELETE FROM t1
|
||||
#<date> server id 1 end_log_pos 2873 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 2873
|
||||
#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 2865 CRC32 XXX Table_map: `test`.`t1` mapped to number num
|
||||
# at 2865
|
||||
#<date> server id 1 end_log_pos 2919 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t1`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
@ -287,23 +284,23 @@ BEGIN
|
||||
### WHERE
|
||||
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
|
||||
# Number of rows: 4
|
||||
# at 2927
|
||||
#<date> server id 1 end_log_pos 3000 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
# at 2919
|
||||
#<date> server id 1 end_log_pos 2992 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
SET TIMESTAMP=X/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at 3000
|
||||
#<date> server id 1 end_log_pos 3042 CRC32 XXX GTID 0-1-10
|
||||
# at 2992
|
||||
#<date> server id 1 end_log_pos 3034 CRC32 XXX GTID 0-1-10
|
||||
/*!100001 SET @@session.gtid_seq_no=10*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at 3042
|
||||
# at 3079
|
||||
#<date> server id 1 end_log_pos 3079 CRC32 XXX Annotate_rows:
|
||||
# at 3034
|
||||
# at 3071
|
||||
#<date> server id 1 end_log_pos 3071 CRC32 XXX Annotate_rows:
|
||||
#Q> DELETE FROM t2
|
||||
#<date> server id 1 end_log_pos 3135 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 3135
|
||||
#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
|
||||
#<date> server id 1 end_log_pos 3127 CRC32 XXX Table_map: `test`.`t2` mapped to number num
|
||||
# at 3127
|
||||
#<date> server id 1 end_log_pos 3181 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
|
||||
### DELETE FROM `test`.`t2`
|
||||
### WHERE
|
||||
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
|
||||
@ -317,13 +314,82 @@ BEGIN
|
||||
### WHERE
|
||||
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
|
||||
# Number of rows: 4
|
||||
# at 3189
|
||||
#<date> server id 1 end_log_pos 3262 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
# at 3181
|
||||
#<date> server id 1 end_log_pos 3254 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
SET TIMESTAMP=X/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at 3262
|
||||
#<date> server id 1 end_log_pos 3310 CRC32 XXX Rotate to master-bin.000002 pos: 4
|
||||
# at 3254
|
||||
#<date> server id 1 end_log_pos 3302 CRC32 XXX Rotate to master-bin.000002 pos: 4
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE `t1` (
|
||||
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`is_deleted` BIT(1) DEFAULT b'0',
|
||||
`last_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`ref_id` BIGINT(20) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `last_updated_KEY` (`last_updated`)
|
||||
);
|
||||
CREATE TABLE `t2` (
|
||||
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`short_desc` VARCHAR(50) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
INSERT INTO t2 (id, short_desc) VALUES (1, 'test');
|
||||
INSERT INTO t1 (id, is_deleted, ref_id) VALUES (1, b'0', 1);
|
||||
FLUSH BINARY LOGS;
|
||||
UPDATE t1 t1 INNER JOIN t2 t2 ON t1.ref_id = t2.id
|
||||
SET t1.is_deleted = TRUE
|
||||
WHERE t1.id = 1;
|
||||
FLUSH BINARY LOGS;
|
||||
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
# at 387
|
||||
#<date> server id 1 end_log_pos 429 CRC32 XXX GTID 0-1-16
|
||||
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
|
||||
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
|
||||
/*!100001 SET @@session.server_id=1*//*!*/;
|
||||
/*!100001 SET @@session.gtid_seq_no=16*//*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
# at 429
|
||||
# at 543
|
||||
#<date> server id 1 end_log_pos 543 CRC32 XXX Annotate_rows:
|
||||
#Q> UPDATE t1 t1 INNER JOIN t2 t2 ON t1.ref_id = t2.id
|
||||
#Q> SET t1.is_deleted = TRUE
|
||||
#Q> WHERE t1.id =
|
||||
#<date> server id 1 end_log_pos 594 CRC32 XXX Table_map: `test`.`t1` mapped to number 35
|
||||
# at 594
|
||||
#<date> server id 1 end_log_pos 643 CRC32 XXX Update_rows: table id 35 flags: STMT_END_F
|
||||
### UPDATE `test`.`t1`
|
||||
### WHERE
|
||||
### @1=1 /* LONGINT meta=0 nullable=0 is_null=0 */
|
||||
### SET
|
||||
### @2=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
|
||||
### @3=X /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
|
||||
# Number of rows: 1
|
||||
# at 643
|
||||
#<date> server id 1 end_log_pos 725 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
|
||||
SET TIMESTAMP=X/*!*/;
|
||||
SET @@session.pseudo_thread_id=5/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
|
||||
SET @@session.sql_mode=1411383296/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
# at 725
|
||||
#<date> server id 1 end_log_pos 773 CRC32 XXX Rotate to master-bin.000004 pos: 4
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -26,8 +26,49 @@ DELETE FROM t2;
|
||||
--let $datadir = `SELECT @@datadir`
|
||||
|
||||
FLUSH BINARY LOGS;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/
|
||||
--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# MDEV-14605 ON UPDATE CURRENT_TIMESTAMP fields by multi-table UPDATE are not logged with binlog_row_image=MINIMAL
|
||||
#
|
||||
|
||||
CREATE TABLE `t1` (
|
||||
|
||||
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`is_deleted` BIT(1) DEFAULT b'0',
|
||||
`last_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`ref_id` BIGINT(20) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `last_updated_KEY` (`last_updated`)
|
||||
);
|
||||
|
||||
CREATE TABLE `t2` (
|
||||
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`short_desc` VARCHAR(50) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO t2 (id, short_desc) VALUES (1, 'test');
|
||||
INSERT INTO t1 (id, is_deleted, ref_id) VALUES (1, b'0', 1);
|
||||
FLUSH BINARY LOGS;
|
||||
--let $binlog_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
|
||||
UPDATE t1 t1 INNER JOIN t2 t2 ON t1.ref_id = t2.id
|
||||
SET t1.is_deleted = TRUE
|
||||
WHERE t1.id = 1;
|
||||
|
||||
--let $binlog = query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
|
||||
FLUSH BINARY LOGS;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /@3=\d*/@3=X/ /CRC32 0x[0-9a-f]+/CRC32 XXX/
|
||||
--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog --start-position=$binlog_pos
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
@ -83,3 +83,19 @@ checksum table t1 extended;
|
||||
Table Checksum
|
||||
test.t1 452555338
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||
#
|
||||
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||
# Important is that checksum is different from following
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 2514025256
|
||||
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||
# Important is that checksum is different from above
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 2326430205
|
||||
drop table t1;
|
||||
# End of 5.5 tests
|
||||
|
@ -83,3 +83,19 @@ checksum table t1 extended;
|
||||
Table Checksum
|
||||
test.t1 229851577
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||
#
|
||||
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||
# Important is that checksum is different from following
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 2514025256
|
||||
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||
# Important is that checksum is different from above
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 2326430205
|
||||
drop table t1;
|
||||
# End of 5.5 tests
|
||||
|
@ -60,3 +60,20 @@ checksum table t1;
|
||||
checksum table t1 quick;
|
||||
checksum table t1 extended;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||
|
||||
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||
--echo # Important is that checksum is different from following
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||
--echo # Important is that checksum is different from above
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 5.5 tests
|
||||
|
@ -394,3 +394,25 @@ select null in (select a from t1 where a < out3.a union select a from t2 where
|
||||
(select a from t3) +1 < out3.a+1) from t3 out3;
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
drop table t1, t2, t3;
|
||||
CREATE TABLE t1(
|
||||
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
|
||||
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
|
||||
f1 int
|
||||
);
|
||||
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
|
||||
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
|
||||
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
|
||||
SELECT f1,
|
||||
(SELECT t.f21 from t2 t where max(
|
||||
q11+q12+q13+q14+q15+q16+q17+q18+q19+
|
||||
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
|
||||
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
|
||||
SELECT 1 LIMIT 1) AS test
|
||||
FROM t1 GROUP BY f1;
|
||||
f1 test
|
||||
1 1
|
||||
2 1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '1'
|
||||
Warning 1292 Truncated incorrect datetime value: '2'
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -411,3 +411,23 @@ insert into t3 select a from t1;
|
||||
select null in (select a from t1 where a < out3.a union select a from t2 where
|
||||
(select a from t3) +1 < out3.a+1) from t3 out3;
|
||||
drop table t1, t2, t3;
|
||||
|
||||
#
|
||||
# Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
|
||||
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
|
||||
f1 int
|
||||
);
|
||||
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
|
||||
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
|
||||
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
|
||||
SELECT f1,
|
||||
(SELECT t.f21 from t2 t where max(
|
||||
q11+q12+q13+q14+q15+q16+q17+q18+q19+
|
||||
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
|
||||
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
|
||||
SELECT 1 LIMIT 1) AS test
|
||||
FROM t1 GROUP BY f1;
|
||||
DROP TABLE t1,t2;
|
||||
|
@ -2898,6 +2898,22 @@ SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||
f
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-18255: Server crashes in Bitmap<64u>::intersect
|
||||
#
|
||||
create table t1 (v1 varchar(1)) engine=myisam ;
|
||||
create table t2 (v1 varchar(1)) engine=myisam ;
|
||||
explain
|
||||
select 1 from t1 where exists
|
||||
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||
3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||
select 1 from t1 where exists
|
||||
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||
1
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||
# UNION ALL
|
||||
#
|
||||
|
@ -268,6 +268,19 @@ SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18255: Server crashes in Bitmap<64u>::intersect
|
||||
--echo #
|
||||
create table t1 (v1 varchar(1)) engine=myisam ;
|
||||
create table t2 (v1 varchar(1)) engine=myisam ;
|
||||
|
||||
explain
|
||||
select 1 from t1 where exists
|
||||
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||
select 1 from t1 where exists
|
||||
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||
--echo # UNION ALL
|
||||
|
@ -1734,6 +1734,10 @@ insert into t1(`id`,`local_name`) values
|
||||
(11,'Rollover - Internet Payday'),
|
||||
(12,'AL Monthly Installment'),
|
||||
(13,'AL Semi-Monthly Installment');
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
explain
|
||||
SELECT SQL_NO_CACHE t.id
|
||||
FROM t1 t
|
||||
|
@ -335,6 +335,8 @@ insert into t1(`id`,`local_name`) values
|
||||
(12,'AL Monthly Installment'),
|
||||
(13,'AL Semi-Monthly Installment');
|
||||
|
||||
ANALYZE TABLE t1;
|
||||
|
||||
explain
|
||||
SELECT SQL_NO_CACHE t.id
|
||||
FROM t1 t
|
||||
|
@ -30,7 +30,7 @@ partition by list (a)
|
||||
(partition p0 values in (1), partition p1 values in (2));
|
||||
insert into t1 values (1), (2);
|
||||
create index inx on t1 (a);
|
||||
ERROR HY000: Can't create table `db99`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
ERROR HY000: Can't create table `db99`.`t1` (errno: 140 "Wrong create options")
|
||||
alter table t1 add partition (partition p2 values in (3));
|
||||
alter table t1 drop partition p2;
|
||||
use test;
|
||||
@ -141,7 +141,7 @@ t1 CREATE TABLE `t1` (
|
||||
PARTITION BY HASH (`fld1`)
|
||||
PARTITIONS 5
|
||||
ALTER TABLE t1 ENGINE= ARCHIVE;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
#After the patch, the ENGINE is correctly displayed as MyISAM
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
|
@ -47,7 +47,7 @@ engine=archive
|
||||
partition by list (a)
|
||||
(partition p0 values in (1), partition p1 values in (2));
|
||||
insert into t1 values (1), (2);
|
||||
--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ /Not owner/Operation not permitted/
|
||||
--replace_regex /Not owner/Operation not permitted/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create index inx on t1 (a);
|
||||
alter table t1 add partition (partition p2 values in (3));
|
||||
@ -138,7 +138,6 @@ CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= MYISAM PARTITION BY HASH(fld1)
|
||||
PARTITIONS 5;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t1 ENGINE= ARCHIVE;
|
||||
|
||||
|
@ -28,6 +28,25 @@ a
|
||||
1
|
||||
1
|
||||
3
|
||||
DELETE FROM t1 WHERE a=3;
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
SET @binlog_fragment_0='
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
SET @binlog_fragment_1='';
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_1;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
3
|
||||
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
|
||||
@binlog_fragment_0 NULL NULL
|
||||
NULL NULL NULL
|
||||
==== Test --base64-output=never on a binlog with row events ====
|
||||
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
|
24
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_frag.result
Normal file
24
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_frag.result
Normal file
@ -0,0 +1,24 @@
|
||||
CREATE TABLE t (a TEXT);
|
||||
RESET MASTER;
|
||||
INSERT INTO t SET a=repeat('a', 1024);
|
||||
SELECT a into @a from t;
|
||||
FLUSH LOGS;
|
||||
DELETE FROM t;
|
||||
FOUND 1 /BINLOG @binlog_fragment_0, @binlog_fragment_1/ in mysqlbinlog.sql
|
||||
SELECT a LIKE @a as 'true' FROM t;
|
||||
true
|
||||
1
|
||||
BINLOG number-of-fragments must be exactly two
|
||||
BINLOG @binlog_fragment;
|
||||
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
|
||||
BINLOG @binlog_fragment, @binlog_fragment, @binlog_fragment;
|
||||
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 ' @binlog_fragment' at line 1
|
||||
SET @binlog_fragment_0='012345';
|
||||
SET @binlog_fragment_1='012345';
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_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
|
||||
SET @binlog_fragment_0='012345';
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
|
||||
ERROR 42000: Incorrect argument type to variable 'binlog_fragment_not_exist'
|
||||
# Cleanup
|
||||
DROP TABLE t;
|
@ -67,6 +67,28 @@ TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
# The above line should succeed and 3 should be in the table
|
||||
select * from t1;
|
||||
|
||||
# The same as above with one-fragment BINLOG to prove
|
||||
# equivalency with the fragmented BINLOG @frag_0, @frag_1.
|
||||
DELETE FROM t1 WHERE a=3;
|
||||
# This is a binlog statement containing a Format_description_log_event
|
||||
# from the same version as the Table_map and Write_rows_log_event.
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
|
||||
# This is a Table_map_log_event+Write_rows_log_event corresponding to:
|
||||
# INSERT INTO TABLE test.t1 VALUES (3)
|
||||
SET @binlog_fragment_0='
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
SET @binlog_fragment_1='';
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_1;
|
||||
# The above line should succeed and 3 should be in the table:
|
||||
select * from t1;
|
||||
# show "one-shot" feature of binlog_fragment variables
|
||||
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
|
||||
|
||||
# New mysqlbinlog supports --base64-output=never
|
||||
--echo ==== Test --base64-output=never on a binlog with row events ====
|
||||
|
46
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_frag.test
Normal file
46
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_frag.test
Normal file
@ -0,0 +1,46 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
|
||||
CREATE TABLE t (a TEXT);
|
||||
# events of interest are guaranteed to stay in 000001 log
|
||||
RESET MASTER;
|
||||
--eval INSERT INTO t SET a=repeat('a', 1024)
|
||||
SELECT a into @a from t;
|
||||
FLUSH LOGS;
|
||||
DELETE FROM t;
|
||||
|
||||
# Todo: MDEV-10362 to test multi-row Rows_log_event:s in verbose mode
|
||||
--exec $MYSQL_BINLOG -vv --debug-binlog-row-event-max-encoded-size=256 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
|
||||
|
||||
--let SEARCH_PATTERN= BINLOG @binlog_fragment_0, @binlog_fragment_1
|
||||
--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
|
||||
|
||||
SELECT a LIKE @a as 'true' FROM t;
|
||||
|
||||
# improper syntax error
|
||||
--echo BINLOG number-of-fragments must be exactly two
|
||||
--error ER_PARSE_ERROR
|
||||
BINLOG @binlog_fragment;
|
||||
--error ER_PARSE_ERROR
|
||||
BINLOG @binlog_fragment, @binlog_fragment, @binlog_fragment;
|
||||
|
||||
# corrupted fragments error check (to the expected error code notice,
|
||||
# the same error code occurs in a similar unfragmented case)
|
||||
SET @binlog_fragment_0='012345';
|
||||
SET @binlog_fragment_1='012345';
|
||||
--error ER_SYNTAX_ERROR
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_1;
|
||||
|
||||
# Not existing fragment is not allowed
|
||||
SET @binlog_fragment_0='012345';
|
||||
--error ER_WRONG_TYPE_FOR_VAR
|
||||
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
|
||||
|
||||
--echo # Cleanup
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
|
||||
DROP TABLE t;
|
@ -65,11 +65,11 @@ t1 CREATE TABLE `t1` (
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (a int not null primary key) engine=innodb;
|
||||
ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options")
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options")
|
||||
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
|
@ -92,10 +92,8 @@ SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t2 (a int not null primary key) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
SHOW WARNINGS;
|
||||
SHOW CREATE TABLE t2;
|
||||
|
||||
|
@ -20,7 +20,6 @@ if ($checksum_algorithm == "strict_full_crc32")
|
||||
let $error_code = 0;
|
||||
}
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error $error_code
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
|
||||
c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB
|
||||
@ -49,7 +48,6 @@ CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
|
||||
c VARCHAR(256), coordinate POINT NOT NULL) ENCRYPTED=YES ENGINE=INNODB;
|
||||
# FIXME: MDEV-13851 Encrypted table refuses some form of ALGORITHM=COPY,
|
||||
# but allows rebuild by FORCE
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error $error_code
|
||||
ALTER TABLE t1 ADD SPATIAL INDEX b1(coordinate), ALGORITHM=COPY;
|
||||
--error $error_code
|
||||
|
@ -197,7 +197,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
connect testuser2, localhost, testuser2, , db_datadict;
|
||||
SELECT * FROM information_schema.routines;
|
||||
@ -209,7 +209,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
connect testuser3, localhost, testuser3, , test;
|
||||
SELECT * FROM information_schema.routines;
|
||||
@ -221,7 +221,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
|
@ -2,7 +2,7 @@ connection node_2;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) `expect 48` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
|
||||
expect 48
|
||||
48
|
||||
49
|
||||
SELECT VARIABLE_NAME, VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
@ -21,6 +21,7 @@ ORDER BY VARIABLE_NAME;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_AUTO_INCREMENT_CONTROL ON
|
||||
WSREP_CAUSAL_READS ON
|
||||
WSREP_CERTIFICATION_RULES strict
|
||||
WSREP_CERTIFY_NONPK ON
|
||||
WSREP_CLUSTER_ADDRESS gcomm://
|
||||
WSREP_CLUSTER_NAME my_wsrep_cluster
|
||||
|
@ -9,6 +9,7 @@ innodb-autoinc-lock-mode=2
|
||||
default-storage-engine=innodb
|
||||
wsrep_gtid_mode=1
|
||||
gtid_ignore_duplicates
|
||||
auto_increment_increment=3
|
||||
|
||||
wsrep-provider=@ENV.WSREP_PROVIDER
|
||||
wsrep_node_address=127.0.0.1
|
||||
|
@ -5,6 +5,7 @@
|
||||
binlog-format=row
|
||||
innodb-autoinc-lock-mode=2
|
||||
default-storage-engine=innodb
|
||||
auto_increment_increment=3
|
||||
|
||||
wsrep-provider=@ENV.WSREP_PROVIDER
|
||||
wsrep_node_address=127.0.0.1
|
||||
|
@ -1,4 +0,0 @@
|
||||
#
|
||||
# suite.pm will make sure that all tests including this file
|
||||
# will be skipped as needed
|
||||
#
|
@ -2,9 +2,11 @@ connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_3;
|
||||
Killing node #3 to free ports for garbd ...
|
||||
connection node_3;
|
||||
connection node_1;
|
||||
Starting garbd ...
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
|
@ -1,5 +1,9 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_3;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
|
@ -50,9 +50,12 @@ push @::global_suppressions,
|
||||
qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.),
|
||||
qr(WSREP: evs::proto.*),
|
||||
qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|,
|
||||
qr(WSREP: no nodes coming from prim view, prim not possible),
|
||||
qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable),
|
||||
qr(WSREP: user message in state LEAVING),
|
||||
qr(WSREP: .* sending install message failed: Transport endpoint is not connected),
|
||||
qr(WSREP: .* sending install message failed: Resource temporarily unavailable),
|
||||
qr(WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.),
|
||||
qr(WSREP: Could not find peer:),
|
||||
qr|WSREP: gcs_caused\(\) returned .*|,
|
||||
qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|,
|
||||
@ -78,11 +81,11 @@ sub skip_combinations {
|
||||
my %skip = ();
|
||||
$skip{'include/have_filekeymanagement.inc'} = 'needs file_key_management plugin'
|
||||
unless $ENV{FILE_KEY_MANAGEMENT_SO};
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need mariabackup'
|
||||
$skip{'suite/galera/include/have_mariabackup.inc'} = 'Need mariabackup'
|
||||
unless which(mariabackup);
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need ss'
|
||||
$skip{'suite/galera/include/have_mariabackup.inc'} = 'Need ss'
|
||||
unless which(ss);
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need socat or nc'
|
||||
$skip{'suite/galera/include/have_mariabackup.inc'} = 'Need socat or nc'
|
||||
unless $ENV{MTR_GALERA_TFMT};
|
||||
%skip;
|
||||
}
|
||||
|
@ -16,12 +16,22 @@
|
||||
--source suite/galera/include/galera_base_port.inc
|
||||
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--let $galera_connection_name = node_3
|
||||
--let $galera_server_number = 3
|
||||
--source include/galera_connect.inc
|
||||
--source suite/galera/include/galera_base_port.inc
|
||||
--let $NODE_GALERAPORT_3 = $_NODE_GALERAPORT
|
||||
|
||||
--connection node_3
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--let $node_3=node_3
|
||||
--source ../galera/include/auto_increment_offset_save.inc
|
||||
|
||||
--echo Killing node #3 to free ports for garbd ...
|
||||
--connection node_3
|
||||
--let $gp3 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
|
||||
--let $galera_port_3 = `SELECT SUBSTR('$gp3', 1, LOCATE(';', '$gp3') - 1)`
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--connection node_1
|
||||
@ -91,6 +101,8 @@ DROP TABLE t1;
|
||||
--connection node_3
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--source ../galera/include/auto_increment_offset_restore.inc
|
||||
|
||||
# Workaround for galera#101
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/check_ipv6.inc
|
||||
--source include/have_mariabackup.inc
|
||||
--source suite/galera/include/have_mariabackup.inc
|
||||
|
||||
# Confirm that initial handshake happened over ipv6
|
||||
|
||||
|
@ -5,6 +5,17 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--let $galera_connection_name = node_3
|
||||
--let $galera_server_number = 3
|
||||
--source include/galera_connect.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--let $node_3=node_3
|
||||
--source ../galera/include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
@ -111,3 +122,6 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
|
||||
--source include/galera_wait_ready.inc
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--source ../galera/include/auto_increment_offset_restore.inc
|
||||
|
@ -150,7 +150,6 @@ create table t2 (a int);
|
||||
alter table t1 add constraint foreign key fk(d) references t2(a);
|
||||
if ($support_virtual_foreign)
|
||||
{
|
||||
--replace_regex /`#sql-.*`/`#sql-temporary`/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t1 add constraint foreign key fk(b) references t2(a);
|
||||
}
|
||||
|
@ -156,7 +156,6 @@ create table t1 (a int, b int generated always as (a+1) virtual,
|
||||
foreign key (b) references t2(a));
|
||||
|
||||
create table t1 (a int, b int generated always as (a+1) virtual);
|
||||
--replace_regex /`#sql-.*`/`#sql-temporary`/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t1 add foreign key (b) references t2(a);
|
||||
drop table t1;
|
||||
|
@ -153,7 +153,7 @@ foreign key (b) references t2(a));
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
create table t1 (a int, b int generated always as (a+1) virtual);
|
||||
alter table t1 add foreign key (b) references t2(a);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
drop table t1;
|
||||
# Allowed FK options.
|
||||
create table t2 (a int primary key, b char(5));
|
||||
|
@ -702,7 +702,7 @@ v3 TIME AS (c3) VIRTUAL,
|
||||
v4 CHAR(10) AS (c4) VIRTUAL
|
||||
) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
SET foreign_key_checks=0;
|
||||
ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
ERROR HY000: Failed to add the foreign key constaint. Missing index for constraint 'fk' in the foreign table 't1'
|
||||
@ -725,7 +725,7 @@ t1 CREATE TABLE `t1` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t1 DROP FOREIGN KEY fk;
|
||||
ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -590,7 +590,6 @@ CREATE TABLE t1 (
|
||||
v3 TIME AS (c3) VIRTUAL,
|
||||
v4 CHAR(10) AS (c4) VIRTUAL
|
||||
) ENGINE=InnoDB;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
SET foreign_key_checks=0;
|
||||
@ -601,7 +600,6 @@ ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
SET foreign_key_checks=1;
|
||||
SHOW CREATE TABLE t1;
|
||||
ALTER TABLE t1 DROP FOREIGN KEY fk;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
|
||||
SHOW CREATE TABLE t1;
|
||||
|
@ -6,7 +6,7 @@ create table t2(a int, b int, key(a),key(b))engine=innodb;
|
||||
alter table t2 add constraint b foreign key (b) references t1(a);
|
||||
alter table t1 add constraint b1 foreign key (b) references t2(a);
|
||||
alter table t2 add constraint b1 foreign key (b) references t1(a);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
|
||||
alter table t2 drop foreign key b;
|
||||
alter table t1 drop foreign key b1;
|
||||
drop table t2;
|
||||
|
@ -21,6 +21,6 @@ Tables_in_bug
|
||||
parent
|
||||
alter table parent row_format=dynamic;
|
||||
Warnings:
|
||||
Warning 1088 InnoDB: Could not add foreign key constraints.
|
||||
Warning 1088 failed to load FOREIGN KEY constraints
|
||||
drop table parent;
|
||||
drop database bug;
|
||||
|
@ -491,3 +491,12 @@ t1 CREATE TABLE `t1` (
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE get_index_id;
|
||||
DROP PROCEDURE get_table_id;
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
name pos mtype prtype len
|
||||
a 0 1 524303 100
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
name pos mtype prtype len
|
||||
a 0 1 524303 110
|
||||
drop table t;
|
||||
|
@ -10,7 +10,7 @@ ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint
|
||||
create table t2 (f1 int primary key,
|
||||
constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
|
||||
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
|
||||
set foreign_key_checks = 0;
|
||||
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
|
||||
ERROR HY000: Duplicate FOREIGN KEY constraint name 'test/c1'
|
||||
@ -206,6 +206,61 @@ connection default;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
disconnect fk;
|
||||
DROP TABLE t3,t1;
|
||||
#
|
||||
# MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
# or ASAN heap-use-after-free in dict_foreign_remove_from_cache upon CHANGE COLUMN
|
||||
#
|
||||
CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL;
|
||||
ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
|
||||
ALTER TABLE t1 CHANGE COLUMN a b TIME;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-18256 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
# upon DROP FOREIGN KEY
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY fk1 (b) REFERENCES t1 (a))
|
||||
ENGINE=InnoDB;
|
||||
ALTER TABLE t2 DROP FOREIGN KEY fk1, DROP FOREIGN KEY fk1;
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
Warnings:
|
||||
Warning 1088 failed to load FOREIGN KEY constraints
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
Warnings:
|
||||
Warning 1088 failed to load FOREIGN KEY constraints
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f VARCHAR(256), FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY)
|
||||
ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
Warnings:
|
||||
Warning 1088 failed to load FOREIGN KEY constraints
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-18630 Conditional jump or move depends on uninitialised value
|
||||
# in ib_push_warning / dict_create_foreign_constraints_low
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
ALTER IGNORE TABLE t1 ADD FOREIGN KEY (a) REFERENCES t2 (b);
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 150 Alter table test/#sql-temporary with foreign key constraint failed. Referenced table `test`.`t2` not found in the data dictionary near 'FOREIGN KEY (a) REFERENCES t2 (b)'.
|
||||
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t1`
|
||||
DROP TABLE t1;
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
|
||||
|
@ -39,21 +39,21 @@ Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is
|
||||
Warning 1215 Cannot add foreign key constraint for `t2`
|
||||
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
|
||||
alter table t2 add constraint b foreign key (b) references t2(b);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near ' foreign key (b) references t2(b)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t2`
|
||||
drop table t2, t1;
|
||||
create table t1 (f1 integer primary key) engine=innodb;
|
||||
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t11` not found in the data dictionary near ' foreign key (f1) references t11(f1)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t1`
|
||||
drop table t1;
|
||||
create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
|
||||
@ -78,12 +78,12 @@ Warning 150 Create table `mysqld.1`.`t2` with foreign key constraint failed. Re
|
||||
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t2`
|
||||
alter table t1 add foreign key(b) references t1(a);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary near 'foreign key(b) references t1(a)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t1`
|
||||
drop table t1;
|
||||
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
alter table t1 add foreign key(a,b) references t1(a);
|
||||
@ -101,12 +101,12 @@ Error 1239 Incorrect foreign key definition for 'foreign key without name': Key
|
||||
drop table t1;
|
||||
create table t1 (f1 integer not null primary key) engine=innodb;
|
||||
alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. You have defined a SET NULL condition but column 'f1' is defined as NOT NULL in ' foreign key (f1) references t1(f1) on update set null' near ' on update set null'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t1`
|
||||
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
|
@ -62,12 +62,12 @@ PRIMARY KEY (`id`),
|
||||
CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary near ' FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `t2`
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
CREATE DATABASE kg_test1;
|
||||
|
@ -518,7 +518,7 @@ SET DEBUG_SYNC = 'RESET';
|
||||
disconnect con1;
|
||||
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
DROP TABLE t2,t1;
|
||||
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
|
||||
SET GLOBAL innodb_monitor_enable = default;
|
||||
|
@ -508,7 +508,7 @@ t4 CREATE TABLE `t4` (
|
||||
CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
alter table t3 add constraint dc foreign key (a) references t1(a);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update")
|
||||
ERROR HY000: Can't create table `test`.`t3` (errno: 121 "Duplicate key on write or update")
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
alter table t3 add constraint dc foreign key (a) references t1(a);
|
||||
ERROR HY000: Failed to add the foreign key constraint 'test/dc' to system tables
|
||||
@ -955,13 +955,13 @@ PRIMARY KEY (c1)
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1), ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
|
||||
ERROR HY000: Failed to add the foreign key constaint. Missing index for constraint 'fk_t2_ca' in the referenced table 't1'
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2), ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
|
||||
ERROR HY000: Failed to add the foreign key constaint. Missing index for constraint 'fk_t2_ca' in the referenced table 't1'
|
||||
@ -970,13 +970,13 @@ FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1), ALGORITHM=INPLACE;
|
||||
ERROR HY000: Failed to add the foreign key constraint on table 't2'. Incorrect options in FOREIGN KEY constraint 'test/fk_t2_ca'
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1), ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2), ALGORITHM=COPY;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
|
||||
ERROR HY000: Failed to add the foreign key constaint. Missing index for constraint 'fk_t2_ca' in the referenced table 't1'
|
||||
|
@ -10,11 +10,11 @@ f1 f2
|
||||
insert into t1 values(2, 3);
|
||||
ERROR HY000: Running in read-only mode
|
||||
alter table t1 add f3 int not null, algorithm=copy;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
|
||||
alter table t1 add f3 int not null, algorithm=inplace;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
|
||||
drop index idx on t1;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
|
||||
alter table t1 drop index idx, algorithm=inplace;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
|
||||
update t1 set f1=3 where f2=2;
|
||||
@ -38,11 +38,11 @@ f1 f2
|
||||
insert into t2 values(2, 3);
|
||||
ERROR HY000: Running in read-only mode
|
||||
alter table t2 add f3 int not null, algorithm=copy;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 165 "Table is read only")
|
||||
alter table t2 add f3 int not null, algorithm=inplace;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
|
||||
drop index idx on t2;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
|
||||
ERROR HY000: Can't create table `test`.`t2` (errno: 165 "Table is read only")
|
||||
update t2 set f1=3 where f2=2;
|
||||
ERROR HY000: Running in read-only mode
|
||||
create table t1(f1 int not null)engine=innodb;
|
||||
|
@ -1,9 +0,0 @@
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
name pos mtype prtype len
|
||||
a 0 1 524303 100
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
name pos mtype prtype len
|
||||
a 0 1 524303 110
|
||||
drop table t;
|
@ -9,6 +9,7 @@ update t1 set c = 'MariaDB';
|
||||
update t1 set c = 'InnoDB';
|
||||
set global debug_dbug = '+d,ib_undo_trunc';
|
||||
commit;
|
||||
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
FOUND 1 /ib_undo_trunc/ in mysqld.1.err
|
||||
drop table t1;
|
||||
|
@ -10,7 +10,6 @@ create table t2(a int, b int, key(a),key(b))engine=innodb;
|
||||
alter table t2 add constraint b foreign key (b) references t1(a);
|
||||
alter table t1 add constraint b1 foreign key (b) references t2(a);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add constraint b1 foreign key (b) references t1(a);
|
||||
|
||||
|
@ -358,3 +358,10 @@ DROP TABLE t1;
|
||||
|
||||
DROP PROCEDURE get_index_id;
|
||||
DROP PROCEDURE get_table_id;
|
||||
|
||||
# LEN must increase here
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
drop table t;
|
||||
|
@ -14,7 +14,6 @@ constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
|
||||
create table t2 (f1 int primary key,
|
||||
constraint c1 foreign key (f1) references t1(f1)) engine=innodb;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
|
||||
|
||||
@ -191,6 +190,57 @@ disconnect fk;
|
||||
|
||||
DROP TABLE t3,t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
--echo # or ASAN heap-use-after-free in dict_foreign_remove_from_cache upon CHANGE COLUMN
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL;
|
||||
ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
|
||||
ALTER TABLE t1 CHANGE COLUMN a b TIME;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18256 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||
--echo # upon DROP FOREIGN KEY
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY fk1 (b) REFERENCES t1 (a))
|
||||
ENGINE=InnoDB;
|
||||
ALTER TABLE t2 DROP FOREIGN KEY fk1, DROP FOREIGN KEY fk1;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (f VARCHAR(256), FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY)
|
||||
ENGINE=InnoDB;
|
||||
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18630 Conditional jump or move depends on uninitialised value
|
||||
--echo # in ib_push_warning / dict_create_foreign_constraints_low
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER IGNORE TABLE t1 ADD FOREIGN KEY (a) REFERENCES t2 (b);
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
SHOW WARNINGS;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Start of 10.2 tests
|
||||
|
||||
--echo #
|
||||
|
@ -48,10 +48,8 @@ create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
|
||||
constraint a foreign key a (a) references t1(b)) engine=innodb;
|
||||
show warnings;
|
||||
create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t2 add constraint b foreign key (b) references t2(b);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t2, t1;
|
||||
|
||||
@ -60,10 +58,8 @@ drop table t2, t1;
|
||||
#
|
||||
|
||||
create table t1 (f1 integer primary key) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add constraint c1 foreign key (f1) references t11(f1);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@ -87,15 +83,11 @@ create temporary table t1(a int not null primary key, b int, key(b)) engine=inno
|
||||
--echo Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(b) references t1(a).
|
||||
--echo Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
--echo Warning 1215 Cannot add foreign key constraint
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add foreign key(b) references t1(a);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@ -103,17 +95,13 @@ drop table t1;
|
||||
# Column numbers do not match
|
||||
#
|
||||
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1239
|
||||
alter table t1 add foreign key(a,b) references t1(a);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1239
|
||||
alter table t1 add foreign key(a) references t1(a,b);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@ -121,15 +109,11 @@ drop table t1;
|
||||
# ON UPDATE/DELETE SET NULL on NOT NULL column
|
||||
#
|
||||
create table t1 (f1 integer not null primary key) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
@ -137,9 +121,7 @@ drop table t1;
|
||||
# Incorrect types
|
||||
#
|
||||
create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
@ -115,11 +115,9 @@ CREATE TABLE t2 (
|
||||
CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
--error 1005
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE;
|
||||
|
||||
--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/
|
||||
show warnings;
|
||||
|
||||
drop table t2;
|
||||
|
@ -492,7 +492,6 @@ reap;
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
disconnect con1;
|
||||
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
|
||||
DROP TABLE t2,t1;
|
||||
|
@ -218,7 +218,6 @@ alter table t4 add constraint dc foreign key (a) references t1(a);
|
||||
--disable_info
|
||||
show create table t4;
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
# a foreign key 'test/dc' already exists
|
||||
@ -416,7 +415,6 @@ SET FOREIGN_KEY_CHECKS=0;
|
||||
--enable_info
|
||||
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@ -426,7 +424,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@ -441,7 +438,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1), ALGORITHM=INPLACE;
|
||||
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
@ -450,7 +446,6 @@ ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
|
||||
|
||||
ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLD_DATADIR ./ master-data/ ''
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
|
@ -9,20 +9,16 @@ set global innodb_compression_algorithm = 1;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
show create table innodb_compact;
|
||||
show create table innodb_dynamic;
|
||||
|
||||
# MDEV-7133: InnoDB: Assertion failure in thread 140737091569408 in file dict0mem.cc line 74
|
||||
# InnoDB: Failing assertion: dict_tf_is_valid(flags)
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error 1005
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
|
||||
show create table innodb_redundant;
|
||||
|
@ -26,14 +26,12 @@ select * from t1;
|
||||
--error ER_READ_ONLY_MODE
|
||||
insert into t1 values(2, 3);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t1 add f3 int not null, algorithm=copy;
|
||||
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t1 add f3 int not null, algorithm=inplace;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
drop index idx on t1;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
@ -66,14 +64,12 @@ select * from t2;
|
||||
--error ER_READ_ONLY_MODE
|
||||
insert into t2 values(2, 3);
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
alter table t2 add f3 int not null, algorithm=copy;
|
||||
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
alter table t2 add f3 int not null, algorithm=inplace;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
drop index idx on t2;
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# LEN must increase here
|
||||
create table t (a varchar(100)) engine=innodb;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
alter table t modify a varchar(110), algorithm=inplace;
|
||||
select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a';
|
||||
drop table t;
|
@ -39,17 +39,19 @@ update t1 set c = 'MariaDB';
|
||||
update t1 set c = 'InnoDB';
|
||||
eval set global debug_dbug = '+d,$SEARCH_PATTERN';
|
||||
commit;
|
||||
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
--source include/search_pattern_in_file.inc
|
||||
--let $restart_parameters= --innodb-undo-tablespaces=1
|
||||
if ($checksum_algorithm == "strict_full_crc32")
|
||||
{
|
||||
let $restart_parameters= --innodb_checksum_algorithm=strict_crc32;
|
||||
let $restart_parameters= $restart_parameters --innodb_checksum_algorithm=strict_crc32;
|
||||
}
|
||||
|
||||
if ($checksum_algorithm == "strict_crc32")
|
||||
{
|
||||
let $restart_parameters= --innodb_checksum_algorithm=strict_full_crc32;
|
||||
let $restart_parameters= $restart_parameters --innodb_checksum_algorithm=strict_full_crc32;
|
||||
}
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
|
@ -800,7 +800,7 @@ SET timestamp=default;
|
||||
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
|
||||
set timestamp=10;
|
||||
alter table t1 add column i int;
|
||||
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1
|
||||
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
|
||||
drop table t1;
|
||||
SET timestamp=default;
|
||||
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
|
@ -1521,28 +1521,28 @@ child CREATE TABLE `child` (
|
||||
SPATIAL KEY `idx2` (`p`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
ERROR HY000: Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table '`test`.`child`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `child`
|
||||
ALTER TABLE parent DROP INDEX idx1;
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
Got one of the listed errors
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table '`test`.`child`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `child`
|
||||
ALTER TABLE child DROP INDEX idx2;
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
Got one of the listed errors
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 150 Alter table '`test`.`child`' with foreign key constraint failed. There is only prefix index in the referenced table where the referenced columns appear as the first columns near 'FOREIGN KEY(p) REFERENCES parent(p)'.
|
||||
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `#sql-temporary`
|
||||
Error 1005 Can't create table `test`.`child` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
Warning 1215 Cannot add foreign key constraint for `child`
|
||||
DROP TABLE child, parent;
|
||||
#
|
||||
# Bug#28763: Selecting geometry fields in UNION caused server crash.
|
||||
|
@ -772,24 +772,18 @@ ALTER TABLE child ADD SPATIAL INDEX idx2(p ASC);
|
||||
SHOW CREATE TABLE parent;
|
||||
SHOW CREATE TABLE child;
|
||||
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
|
||||
ALTER TABLE parent DROP INDEX idx1;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error ER_CANNOT_ADD_FOREIGN,ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
|
||||
ALTER TABLE child DROP INDEX idx2;
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
--error ER_CANNOT_ADD_FOREIGN,ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE child ADD FOREIGN KEY(p) REFERENCES parent(p);
|
||||
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
|
||||
show warnings;
|
||||
|
||||
DROP TABLE child, parent;
|
||||
|
@ -36,7 +36,7 @@ echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
--error 1
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backuplog;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog;
|
||||
--enable_result_log
|
||||
|
||||
--let SEARCH_PATTERN=Database page corruption detected.*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user