mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 16:54:15 +01:00
Merge branch '10.2' into 10.3
This commit is contained in:
commit
57e0da50bb
436 changed files with 9699 additions and 196654 deletions
CREDITS
cmake
config.h.cmakeextra/mariabackup
include
mysql-test
collections
main
constraints.resultconstraints.testcontributors.resultcreate_or_replace.resultcreate_or_replace.testcte_nonrecursive.resultcte_nonrecursive.testcte_recursive.resultcte_recursive.testflush.resultflush.testfunc_json.resultfunc_json.testfunc_time.resultfunc_time.testgis-precise.resultgis-precise.testgis.resultgis.testgrant.resultgrant.testgroup_min_max.resultgroup_min_max.testjoin.resultjoin.testquery_cache_innodb.resultselectivity.resultselectivity.testselectivity_innodb.resultsp-security.resultsp-security.testsp.resultsp.teststat_tables.resultstat_tables.teststat_tables_innodb.resulttype_float.resulttype_float.test
mysql-test-run.plsuite
binlog/include
galera
disabled.def
include
r
MW-286.resultMW-336.resultMW-44.resultgalera#505.resultgalera_binlog_stmt_autoinc.resultgalera_defaults.resultgalera_ist_innodb_flush_logs,debug.rdiffgalera_ist_innodb_flush_logs.resultgalera_ist_mysqldump,debug.rdiffgalera_ist_mysqldump.resultgalera_ist_rsync,debug.rdiffgalera_ist_rsync.resultgalera_ist_xtrabackup-v2,debug.rdiffgalera_ist_xtrabackup-v2.resultgalera_kill_ddl.resultgalera_kill_largechanges.resultgalera_kill_smallchanges.resultgalera_sst_rsync2,debug.rdiffgalera_sst_rsync2.resultgalera_sst_rsync_data_dir,debug.rdiffgalera_sst_xtrabackup-v2_data_dir.resultgalera_suspend_slave.resultgalera_toi_truncate.resultgalera_unicode_identifiers.resultgalera_var_node_address.resultgalera_var_slave_threads.resultgalera_wan.resultmysql-wsrep#332.resultquery_cache.result
suite.pmt
4
CREDITS
4
CREDITS
|
@ -10,9 +10,11 @@ Microsoft https://microsoft.com/ (2017)
|
|||
Tencent Cloud https://cloud.tencent.com (2017)
|
||||
Development Bank of Singapore https://dbs.com (2016)
|
||||
IBM https://www.ibm.com (2017)
|
||||
Tencent Games http://game.qq.com/ (2018)
|
||||
Visma https://visma.com (2015)
|
||||
Acronis http://acronis.com (2016)
|
||||
Acronis https://acronis.com (2016)
|
||||
Nexedi https://www.nexedi.com (2016)
|
||||
Percona https://www.percona.com (2018)
|
||||
Tencent Game DBA http://tencentdba.com/about (2016)
|
||||
Tencent TDSQL http://tdsql.org (2016)
|
||||
Verkkokauppa.com https://www.verkkokauppa.com (2015)
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
# Wrapper for CPackRPM.cmake
|
||||
#
|
||||
|
||||
#
|
||||
# Support for per-component LICENSE and VENDOR
|
||||
#
|
||||
# per component values, if present, are copied into global CPACK_RPM_PACKAGE_xxx
|
||||
#
|
||||
macro(set_from_component WHAT)
|
||||
set(orig_CPACK_RPM_PACKAGE_${WHAT} ${CPACK_RPM_PACKAGE_${WHAT}})
|
||||
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
|
||||
|
@ -15,6 +20,33 @@ endmacro()
|
|||
set_from_component(LICENSE)
|
||||
set_from_component(VENDOR)
|
||||
|
||||
#
|
||||
# Support for the %posttrans scriptlet
|
||||
#
|
||||
# the scriptlet, if present, is appended (together with the %posttrans tag)
|
||||
# to the pre-uninstall scriptlet
|
||||
#
|
||||
set(base_time "PRE")
|
||||
set(base_type "UNINSTALL")
|
||||
set(base_var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}_SCRIPT_FILE)
|
||||
set(acc)
|
||||
|
||||
macro(read_one_file time_ type_ tag_)
|
||||
set(var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${time_}_${type_}_SCRIPT_FILE)
|
||||
if (${var})
|
||||
file(READ ${${var}} content)
|
||||
set(acc "${tag_}\n${content}\n\n${acc}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
read_one_file("POST" "TRANS" "%posttrans")
|
||||
if (acc)
|
||||
set(orig_${base_var} ${${base_var}})
|
||||
read_one_file(${base_time} ${base_type} "")
|
||||
set(${base_var} ${CPACK_TOPLEVEL_DIRECTORY}/SPECS/${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}.scriptlet)
|
||||
file(WRITE ${${base_var}} "${acc}")
|
||||
endif()
|
||||
|
||||
# load the original CPackRPM.cmake
|
||||
set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
unset(CMAKE_MODULE_PATH)
|
||||
|
@ -23,10 +55,10 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
|
|||
|
||||
restore(LICENSE)
|
||||
restore(VENDOR)
|
||||
set(${base_var} ${orig_${base_var}})
|
||||
|
||||
# per-component cleanup
|
||||
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
|
||||
unset(TMP_RPM_${_RPM_SPEC_HEADER})
|
||||
unset(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
||||
endforeach()
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
|
|||
%define _bindir ${INSTALL_BINDIRABS}
|
||||
%define _sbindir ${INSTALL_SBINDIRABS}
|
||||
%define _sysconfdir ${INSTALL_SYSCONFDIR}
|
||||
%define restart_flag_dir %{_localstatedir}/lib/rpm-state/mariadb
|
||||
%define restart_flag %{restart_flag_dir}/need-restart
|
||||
")
|
||||
|
||||
# this creative hack is described here: http://www.cmake.org/pipermail/cmake/2012-January/048416.html
|
||||
|
@ -174,6 +176,7 @@ SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/r
|
|||
SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-preun.sh)
|
||||
SET(CPACK_RPM_server_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postin.sh)
|
||||
SET(CPACK_RPM_server_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postun.sh)
|
||||
SET(CPACK_RPM_server_POST_TRANS_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-posttrans.sh)
|
||||
SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
|
||||
SET(CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
|
||||
SET(CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
|
||||
|
|
|
@ -33,26 +33,17 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
|
|||
SET(targets ${ARG_UNPARSED_ARGUMENTS})
|
||||
FOREACH(target ${targets})
|
||||
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||
|
||||
IF(target_type MATCHES "STATIC")
|
||||
RETURN()
|
||||
ENDIF()
|
||||
set(comp "")
|
||||
|
||||
IF(target MATCHES "mysqld" OR type MATCHES "MODULE")
|
||||
#MESSAGE("PDB: ${targets}")
|
||||
|
||||
IF((target STREQUAL "mysqld"))
|
||||
SET(comp Server)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT comp MATCHES Server)
|
||||
IF(ARG_COMPONENT MATCHES Development
|
||||
OR ARG_COMPONENT MATCHES SharedLibraries
|
||||
OR ARG_COMPONENT MATCHES Embedded)
|
||||
SET(comp Debuginfo)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT comp)
|
||||
SET(comp Debuginfo_archive_only) # not in MSI
|
||||
ENDIF()
|
||||
IF(NOT target_type MATCHES "STATIC")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${target}> DESTINATION symbols COMPONENT Debuginfo)
|
||||
IF(comp)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
|
|
@ -238,11 +238,13 @@ MACRO(MYSQL_ADD_PLUGIN)
|
|||
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE)
|
||||
IF(NOT ARG_CLIENT AND UNIX)
|
||||
IF (NOT ARG_CONFIG)
|
||||
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf")
|
||||
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.cnf")
|
||||
FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n")
|
||||
ENDIF()
|
||||
INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR})
|
||||
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE)
|
||||
SET(CPACK_RPM_${ARG_COMPONENT}_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/plugin-postin.sh PARENT_SCOPE)
|
||||
SET(CPACK_RPM_${ARG_COMPONENT}_POST_TRANS_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-posttrans.sh PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
|
|
|
@ -559,12 +559,8 @@
|
|||
#cmakedefine WSREP_PROC_INFO 1
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
/*
|
||||
AIX includes inttypes.h from sys/types.h
|
||||
Explicitly request format macros before the first inclusion of inttypes.h
|
||||
*/
|
||||
#if !defined(__STDC_FORMAT_MACROS)
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
#endif // !defined(__STDC_FORMAT_MACROS)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -123,7 +123,7 @@ struct datadir_thread_ctxt_t {
|
|||
datadir_iter_t *it;
|
||||
uint n_thread;
|
||||
uint *count;
|
||||
pthread_mutex_t count_mutex;
|
||||
pthread_mutex_t* count_mutex;
|
||||
os_thread_id_t id;
|
||||
bool ret;
|
||||
};
|
||||
|
@ -961,7 +961,7 @@ run_data_threads(datadir_iter_t *it, os_thread_func_t func, uint n)
|
|||
data_threads[i].it = it;
|
||||
data_threads[i].n_thread = i + 1;
|
||||
data_threads[i].count = &count;
|
||||
data_threads[i].count_mutex = count_mutex;
|
||||
data_threads[i].count_mutex = &count_mutex;
|
||||
os_thread_create(func, data_threads + i, &data_threads[i].id);
|
||||
}
|
||||
|
||||
|
@ -1347,7 +1347,8 @@ backup_files(const char *from, bool prep_mode)
|
|||
if (rsync_tmpfile == NULL) {
|
||||
msg("Error: can't open file %s\n",
|
||||
rsync_tmpfile_name);
|
||||
return(false);
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (fgets(path, sizeof(path), rsync_tmpfile)) {
|
||||
|
@ -1386,24 +1387,22 @@ out:
|
|||
|
||||
void backup_fix_ddl(void);
|
||||
|
||||
#define LSN_PREFIX_IN_SHOW_STATUS "\nLog sequence number "
|
||||
static lsn_t get_current_lsn(MYSQL *connection) {
|
||||
MYSQL_RES *res = xb_mysql_query(connection, "SHOW ENGINE INNODB STATUS", true, false);
|
||||
if (!res)
|
||||
return 0;
|
||||
MYSQL_ROW row = mysql_fetch_row(res);
|
||||
DBUG_ASSERT(row);
|
||||
if (row) {
|
||||
const char *p = strstr(row[2],LSN_PREFIX_IN_SHOW_STATUS);
|
||||
DBUG_ASSERT(p);
|
||||
if (p)
|
||||
{
|
||||
p += sizeof(LSN_PREFIX_IN_SHOW_STATUS) - 1;
|
||||
return (lsn_t)strtoll(p, NULL, 10);
|
||||
static lsn_t get_current_lsn(MYSQL *connection)
|
||||
{
|
||||
static const char lsn_prefix[] = "\nLog sequence number ";
|
||||
lsn_t lsn = 0;
|
||||
if (MYSQL_RES *res = xb_mysql_query(connection,
|
||||
"SHOW ENGINE INNODB STATUS",
|
||||
true, false)) {
|
||||
if (MYSQL_ROW row = mysql_fetch_row(res)) {
|
||||
if (const char *p = strstr(row[2], lsn_prefix)) {
|
||||
p += sizeof lsn_prefix - 1;
|
||||
lsn = lsn_t(strtoll(p, NULL, 10));
|
||||
}
|
||||
}
|
||||
mysql_free_result(res);
|
||||
}
|
||||
mysql_free_result(res);
|
||||
return 0;
|
||||
return lsn;
|
||||
}
|
||||
|
||||
lsn_t server_lsn_after_lock;
|
||||
|
@ -2038,9 +2037,9 @@ cleanup:
|
|||
|
||||
datadir_node_free(&node);
|
||||
|
||||
pthread_mutex_lock(&ctxt->count_mutex);
|
||||
pthread_mutex_lock(ctxt->count_mutex);
|
||||
--(*ctxt->count);
|
||||
pthread_mutex_unlock(&ctxt->count_mutex);
|
||||
pthread_mutex_unlock(ctxt->count_mutex);
|
||||
|
||||
ctxt->ret = ret;
|
||||
|
||||
|
|
|
@ -917,6 +917,7 @@ DECLARE_THREAD(kill_mdl_waiters_thread(void *))
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
||||
mysql_close(mysql);
|
||||
|
|
|
@ -343,39 +343,39 @@ read_retry:
|
|||
page += page_size, i++) {
|
||||
ulint page_no = cursor->buf_page_no + i;
|
||||
|
||||
if (cursor->space_id == TRX_SYS_SPACE &&
|
||||
page_no >= FSP_EXTENT_SIZE &&
|
||||
page_no < FSP_EXTENT_SIZE * 3) {
|
||||
/* We ignore the doublewrite buffer pages */
|
||||
} else if (!fil_space_verify_crypt_checksum(
|
||||
page, cursor->page_size, space->id, page_no)
|
||||
&& buf_page_is_corrupted(true, page,
|
||||
cursor->page_size,
|
||||
space)) {
|
||||
retry_count--;
|
||||
if (retry_count == 0) {
|
||||
msg("[%02u] mariabackup: "
|
||||
"Error: failed to read page after "
|
||||
"10 retries. File %s seems to be "
|
||||
"corrupted.\n", cursor->thread_n,
|
||||
cursor->abs_path);
|
||||
ret = XB_FIL_CUR_ERROR;
|
||||
break;
|
||||
}
|
||||
if (cursor->space_id == TRX_SYS_SPACE &&
|
||||
page_no >= FSP_EXTENT_SIZE &&
|
||||
page_no < FSP_EXTENT_SIZE * 3) {
|
||||
/* We ignore the doublewrite buffer pages */
|
||||
} else if (!fil_space_verify_crypt_checksum(
|
||||
page, cursor->page_size, space->id, page_no)
|
||||
&& buf_page_is_corrupted(true, page,
|
||||
cursor->page_size,
|
||||
space)) {
|
||||
retry_count--;
|
||||
if (retry_count == 0) {
|
||||
msg("[%02u] mariabackup: "
|
||||
"Error: failed to read page after "
|
||||
"10 retries. File %s seems to be "
|
||||
"corrupted.\n", cursor->thread_n,
|
||||
cursor->abs_path);
|
||||
ret = XB_FIL_CUR_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (retry_count == 9) {
|
||||
msg("[%02u] mariabackup: "
|
||||
"Database page corruption detected at page "
|
||||
ULINTPF ", retrying...\n",
|
||||
cursor->thread_n, page_no);
|
||||
}
|
||||
if (retry_count == 9) {
|
||||
msg("[%02u] mariabackup: "
|
||||
"Database page corruption detected at page "
|
||||
ULINTPF ", retrying...\n",
|
||||
cursor->thread_n, page_no);
|
||||
}
|
||||
|
||||
os_thread_sleep(100000);
|
||||
os_thread_sleep(100000);
|
||||
|
||||
goto read_retry;
|
||||
}
|
||||
cursor->buf_read += page_size;
|
||||
cursor->buf_npages++;
|
||||
goto read_retry;
|
||||
}
|
||||
cursor->buf_read += page_size;
|
||||
cursor->buf_npages++;
|
||||
}
|
||||
|
||||
posix_fadvise(cursor->file, offset, to_read, POSIX_FADV_DONTNEED);
|
||||
|
|
|
@ -522,7 +522,9 @@ static os_event_t dbug_start_query_thread(
|
|||
mysql_thread_id(par->con), wait_state);
|
||||
for (;;) {
|
||||
MYSQL_RES *result = xb_mysql_query(mysql_connection,q, true, true);
|
||||
if (mysql_fetch_row(result)) {
|
||||
bool exists = mysql_fetch_row(result) != NULL;
|
||||
mysql_free_result(result);
|
||||
if (exists) {
|
||||
goto end;
|
||||
}
|
||||
msg_ts("Waiting for query '%s' on connection %lu to "
|
||||
|
@ -577,7 +579,9 @@ std::string filename_to_spacename(const byte *filename, size_t len)
|
|||
char *db = strrchr(f, '/');
|
||||
ut_a(db);
|
||||
*table = '/';
|
||||
return std::string(db+1);
|
||||
std::string s(db+1);
|
||||
free(f);
|
||||
return s;
|
||||
}
|
||||
|
||||
/** Report an operation to create, delete, or rename a file during backup.
|
||||
|
@ -587,7 +591,7 @@ std::string filename_to_spacename(const byte *filename, size_t len)
|
|||
@param[in] len length of name, in bytes
|
||||
@param[in] new_name new file name (NULL if not rename)
|
||||
@param[in] new_len length of new_name, in bytes (0 if NULL) */
|
||||
void backup_file_op(ulint space_id, const byte* flags,
|
||||
static void backup_file_op(ulint space_id, const byte* flags,
|
||||
const byte* name, ulint len,
|
||||
const byte* new_name, ulint new_len)
|
||||
{
|
||||
|
@ -615,19 +619,72 @@ void backup_file_op(ulint space_id, const byte* flags,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
This callback is called if DDL operation is detected,
|
||||
at the end of backup
|
||||
|
||||
Normally, DDL operations are blocked due to FTWRL,
|
||||
but in rare cases of --no-lock, they are not.
|
||||
|
||||
We will abort backup in this case.
|
||||
*/
|
||||
static void backup_file_op_fail(ulint space_id, const byte* flags,
|
||||
const byte* name, ulint len,
|
||||
const byte* new_name, ulint new_len)
|
||||
{
|
||||
ut_a(opt_no_lock);
|
||||
bool fail;
|
||||
if (flags) {
|
||||
msg("DDL tracking : create %zu \"%.*s\": %x\n",
|
||||
space_id, int(len), name, mach_read_from_4(flags));
|
||||
std::string spacename = filename_to_spacename(name, len);
|
||||
fail = !check_if_skip_table(spacename.c_str());
|
||||
}
|
||||
else if (new_name) {
|
||||
msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"\n",
|
||||
space_id, int(len), name, int(new_len), new_name);
|
||||
std::string spacename = filename_to_spacename(name, len);
|
||||
std::string new_spacename = filename_to_spacename(new_name, new_len);
|
||||
fail = !check_if_skip_table(spacename.c_str()) || !check_if_skip_table(new_spacename.c_str());
|
||||
}
|
||||
else {
|
||||
std::string spacename = filename_to_spacename(name, len);
|
||||
fail = !check_if_skip_table(spacename.c_str());
|
||||
msg("DDL tracking : delete %zu \"%.*s\"\n", space_id, int(len), name);
|
||||
}
|
||||
if (fail) {
|
||||
msg("ERROR : DDL operation detected in the late phase of backup."
|
||||
"Backup is inconsistent. Remove --no-lock option to fix.\n");
|
||||
log_mutex_exit();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Callback whenever MLOG_INDEX_LOAD happens.
|
||||
@param[in] space_id space id to check */
|
||||
static void backup_optimized_ddl_op(ulint space_id)
|
||||
{
|
||||
// TODO : handle incremental
|
||||
if (xtrabackup_incremental)
|
||||
return;
|
||||
|
||||
pthread_mutex_lock(&backup_mutex);
|
||||
ddl_tracker.optimized_ddl.insert(space_id);
|
||||
pthread_mutex_unlock(&backup_mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
Optimized DDL callback at the end of backup that
|
||||
run with --no-lock. Usually aborts the backup.
|
||||
*/
|
||||
static void backup_optimized_ddl_op_fail(ulint space_id) {
|
||||
ut_a(opt_no_lock);
|
||||
msg("DDL tracking : optimized DDL on space %zu\n", space_id);
|
||||
if (ddl_tracker.tables_in_backup.find(space_id) != ddl_tracker.tables_in_backup.end()) {
|
||||
msg("ERROR : Optimized DDL operation detected in the late phase of backup."
|
||||
"Backup is inconsistent. Remove --no-lock option to fix.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Callback whenever MLOG_TRUNCATE happens. */
|
||||
static void backup_truncate_fail()
|
||||
{
|
||||
|
@ -637,13 +694,45 @@ static void backup_truncate_fail()
|
|||
: " Use --lock-ddl-per-table to lock all tables before backup.");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Retrieve default data directory, to be used with --copy-back.
|
||||
|
||||
On Windows, default datadir is ..\data, relative to the
|
||||
directory where mariabackup.exe is located(usually "bin")
|
||||
|
||||
Elsewhere, the compiled-in constant MYSQL_DATADIR is used.
|
||||
*/
|
||||
static char *get_default_datadir() {
|
||||
static char ddir[] = MYSQL_DATADIR;
|
||||
#ifdef _WIN32
|
||||
static char buf[MAX_PATH];
|
||||
DWORD size = (DWORD)sizeof(buf) - 1;
|
||||
if (GetModuleFileName(NULL, buf, size) <= size)
|
||||
{
|
||||
char *p;
|
||||
if ((p = strrchr(buf, '\\')))
|
||||
{
|
||||
*p = 0;
|
||||
if ((p = strrchr(buf, '\\')))
|
||||
{
|
||||
strncpy(p + 1, "data", buf + MAX_PATH - p);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return ddir;
|
||||
}
|
||||
|
||||
|
||||
/* ======== Date copying thread context ======== */
|
||||
|
||||
typedef struct {
|
||||
datafiles_iter_t *it;
|
||||
uint num;
|
||||
uint *count;
|
||||
pthread_mutex_t count_mutex;
|
||||
pthread_mutex_t* count_mutex;
|
||||
os_thread_id_t id;
|
||||
} data_thread_ctxt_t;
|
||||
|
||||
|
@ -2815,9 +2904,9 @@ DECLARE_THREAD(data_copy_thread_func)(
|
|||
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&ctxt->count_mutex);
|
||||
pthread_mutex_lock(ctxt->count_mutex);
|
||||
(*ctxt->count)--;
|
||||
pthread_mutex_unlock(&ctxt->count_mutex);
|
||||
pthread_mutex_unlock(ctxt->count_mutex);
|
||||
|
||||
my_thread_end();
|
||||
os_thread_exit();
|
||||
|
@ -3173,35 +3262,24 @@ the first slot rollback segments of TRX_SYS_PAGE_NO.
|
|||
@retval DB_SUCCESS if srv_undo_space_id assigned successfully. */
|
||||
static dberr_t xb_assign_undo_space_start()
|
||||
{
|
||||
ulint dirnamelen;
|
||||
char name[1000];
|
||||
|
||||
pfs_os_file_t file;
|
||||
byte* buf;
|
||||
byte* page;
|
||||
bool ret;
|
||||
dberr_t error = DB_SUCCESS;
|
||||
ulint space, page_no __attribute__((unused));
|
||||
int n_retries = 5;
|
||||
|
||||
if (srv_undo_tablespaces == 0) {
|
||||
return error;
|
||||
}
|
||||
|
||||
os_normalize_path(srv_data_home);
|
||||
dirnamelen = strlen(srv_data_home);
|
||||
memcpy(name, srv_data_home, dirnamelen);
|
||||
|
||||
if (dirnamelen && name[dirnamelen - 1] != OS_PATH_SEPARATOR) {
|
||||
name[dirnamelen++] = OS_PATH_SEPARATOR;
|
||||
}
|
||||
|
||||
snprintf(name + dirnamelen, (sizeof name) - dirnamelen,
|
||||
"%s", "ibdata1");
|
||||
|
||||
file = os_file_create(0, name, OS_FILE_OPEN,
|
||||
OS_FILE_NORMAL, OS_DATA_FILE, true, &ret);
|
||||
file = os_file_create(0, srv_sys_space.first_datafile()->filepath(),
|
||||
OS_FILE_OPEN, OS_FILE_NORMAL, OS_DATA_FILE, true, &ret);
|
||||
|
||||
if (!ret) {
|
||||
msg("mariabackup: Error in opening %s\n", name);
|
||||
msg("mariabackup: Error in opening %s\n", srv_sys_space.first_datafile()->filepath());
|
||||
return DB_ERROR;
|
||||
}
|
||||
|
||||
|
@ -3219,7 +3297,14 @@ retry:
|
|||
|
||||
/* TRX_SYS page can't be compressed or encrypted. */
|
||||
if (buf_page_is_corrupted(false, page, univ_page_size)) {
|
||||
goto retry;
|
||||
if (n_retries--) {
|
||||
os_thread_sleep(1000);
|
||||
goto retry;
|
||||
} else {
|
||||
msg("mariabackup: TRX_SYS page corrupted.\n");
|
||||
error = DB_ERROR;
|
||||
goto func_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* 0th slot always points to system tablespace.
|
||||
|
@ -4058,7 +4143,6 @@ fail:
|
|||
|
||||
/* start back ground thread to copy newer log */
|
||||
os_thread_id_t log_copying_thread_id;
|
||||
datafiles_iter_t *it;
|
||||
|
||||
/* get current checkpoint_lsn */
|
||||
/* Look for the latest checkpoint from any of the log groups */
|
||||
|
@ -4194,19 +4278,6 @@ fail_before_log_copying_thread_start:
|
|||
}
|
||||
debug_sync_point("xtrabackup_suspend_at_start");
|
||||
|
||||
if (xtrabackup_incremental) {
|
||||
if (!xtrabackup_incremental_force_scan) {
|
||||
changed_page_bitmap = xb_page_bitmap_init();
|
||||
}
|
||||
if (!changed_page_bitmap) {
|
||||
msg("mariabackup: using the full scan for incremental "
|
||||
"backup\n");
|
||||
} else if (incremental_lsn != checkpoint_lsn_start) {
|
||||
/* Do not print that bitmaps are used when dummy bitmap
|
||||
is build for an empty LSN range. */
|
||||
msg("mariabackup: using the changed page bitmap\n");
|
||||
}
|
||||
}
|
||||
|
||||
ut_a(xtrabackup_parallel > 0);
|
||||
|
||||
|
@ -4224,7 +4295,7 @@ fail_before_log_copying_thread_start:
|
|||
"Waiting for table metadata lock", 1, ER_QUERY_INTERRUPTED););
|
||||
}
|
||||
|
||||
it = datafiles_iter_new();
|
||||
datafiles_iter_t *it = datafiles_iter_new();
|
||||
if (it == NULL) {
|
||||
msg("mariabackup: Error: datafiles_iter_new() failed.\n");
|
||||
goto fail;
|
||||
|
@ -4240,7 +4311,7 @@ fail_before_log_copying_thread_start:
|
|||
data_threads[i].it = it;
|
||||
data_threads[i].num = i+1;
|
||||
data_threads[i].count = &count;
|
||||
data_threads[i].count_mutex = count_mutex;
|
||||
data_threads[i].count_mutex = &count_mutex;
|
||||
os_thread_create(data_copy_thread_func, data_threads + i,
|
||||
&data_threads[i].id);
|
||||
}
|
||||
|
@ -4333,6 +4404,14 @@ void backup_fix_ddl(void)
|
|||
std::set<std::string> dropped_tables;
|
||||
std::map<std::string, std::string> renamed_tables;
|
||||
|
||||
/* Disable further DDL on backed up tables (only needed for --no-lock).*/
|
||||
pthread_mutex_lock(&backup_mutex);
|
||||
log_file_op = backup_file_op_fail;
|
||||
log_optimized_ddl_op = backup_optimized_ddl_op_fail;
|
||||
pthread_mutex_unlock(&backup_mutex);
|
||||
|
||||
DBUG_MARIABACKUP_EVENT("backup_fix_ddl",0);
|
||||
|
||||
for (space_id_to_name_t::iterator iter = ddl_tracker.tables_in_backup.begin();
|
||||
iter != ddl_tracker.tables_in_backup.end();
|
||||
iter++) {
|
||||
|
@ -4429,7 +4508,7 @@ void backup_fix_ddl(void)
|
|||
}
|
||||
fil_space_free(n->space->id, false);
|
||||
}
|
||||
|
||||
datafiles_iter_free(it);
|
||||
|
||||
for (std::set<std::string>::iterator iter = new_tables.begin();
|
||||
iter != new_tables.end(); iter++) {
|
||||
|
@ -4476,6 +4555,8 @@ void backup_fix_ddl(void)
|
|||
#endif
|
||||
xtrabackup_copy_datafile(node, 0, dest_name.c_str()/*, do_full_copy ? ULONGLONG_MAX:UNIV_PAGE_SIZE */);
|
||||
}
|
||||
|
||||
datafiles_iter_free(it);
|
||||
}
|
||||
|
||||
/* ================= prepare ================= */
|
||||
|
@ -6195,8 +6276,7 @@ static int main_low(char** argv)
|
|||
|
||||
if (xtrabackup_copy_back || xtrabackup_move_back) {
|
||||
if (!check_if_param_set("datadir")) {
|
||||
msg("Error: datadir must be specified.\n");
|
||||
return(EXIT_FAILURE);
|
||||
mysql_data_home = get_default_datadir();
|
||||
}
|
||||
if (!copy_back())
|
||||
return(EXIT_FAILURE);
|
||||
|
|
|
@ -319,6 +319,12 @@ int json_skip_to_level(json_engine_t *j, int level);
|
|||
json_skip_to_level((json_engine), (json_engine)->stack_p)
|
||||
|
||||
|
||||
/*
|
||||
works as json_skip_level() but also counts items on the current
|
||||
level skipped.
|
||||
*/
|
||||
int json_skip_level_and_count(json_engine_t *j, int *n_items_skipped);
|
||||
|
||||
#define json_skip_array_item json_skip_key
|
||||
|
||||
/*
|
||||
|
|
|
@ -246,7 +246,9 @@
|
|||
AIX includes inttypes.h from sys/types.h
|
||||
Explicitly request format macros before the first inclusion of inttypes.h
|
||||
*/
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#if !defined(__STDC_FORMAT_MACROS)
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif // !defined(__STDC_FORMAT_MACROS)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
sd-daemon.h may include inttypes.h. Explicitly request format macros before
|
||||
the first inclusion of inttypes.h.
|
||||
*/
|
||||
#if !defined(__STDC_FORMAT_MACROS)
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif // !defined(__STDC_FORMAT_MACROS)
|
||||
#include <systemd/sd-daemon.h>
|
||||
/** INTERVAL in seconds followed by printf style status */
|
||||
#define service_manager_extend_timeout(INTERVAL, FMTSTR, ...) \
|
||||
|
|
|
@ -112,6 +112,7 @@ extern struct wsrep_service_st {
|
|||
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
|
||||
int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD);
|
||||
void (*wsrep_unlock_rollback_func)();
|
||||
void (*wsrep_set_data_home_dir_func)(const char *data_dir);
|
||||
} *wsrep_service;
|
||||
|
||||
#ifdef MYSQL_DYNAMIC_PLUGIN
|
||||
|
@ -155,6 +156,7 @@ extern struct wsrep_service_st {
|
|||
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
|
||||
#define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2)
|
||||
#define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func()
|
||||
#define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A)
|
||||
|
||||
#define wsrep_debug get_wsrep_debug()
|
||||
#define wsrep_log_conflicts get_wsrep_log_conflicts()
|
||||
|
@ -214,6 +216,7 @@ void wsrep_thd_awake(THD *thd, my_bool signal);
|
|||
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
|
||||
bool wsrep_thd_ignore_table(THD *thd);
|
||||
void wsrep_unlock_rollback();
|
||||
void wsrep_set_data_home_dir(const char *data_dir);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,4 +41,4 @@
|
|||
#define VERSION_thd_specifics 0x0100
|
||||
#define VERSION_thd_timezone 0x0100
|
||||
#define VERSION_thd_wait 0x0100
|
||||
#define VERSION_wsrep 0x0201
|
||||
#define VERSION_wsrep 0x0202
|
||||
|
|
|
@ -27,6 +27,11 @@
|
|||
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
|
||||
goto error;
|
||||
|
||||
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) \
|
||||
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, \
|
||||
table_list_, alter_info_)) \
|
||||
goto error;
|
||||
|
||||
#define WSREP_TO_ISOLATION_END \
|
||||
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
|
||||
wsrep_to_isolation_end(thd);
|
||||
|
@ -57,6 +62,7 @@
|
|||
#define WSREP_WARN(...)
|
||||
#define WSREP_ERROR(...)
|
||||
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
|
||||
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_)
|
||||
#define WSREP_TO_ISOLATION_END
|
||||
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
|
||||
#define WSREP_SYNC_WAIT(thd_, before_)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# All lines which have a hash sign *anywhere* will be ignored
|
||||
|
||||
main.1st
|
||||
main.adddate_454
|
||||
main.almost_full
|
||||
|
@ -500,7 +502,8 @@ main.subselect-crash_15755
|
|||
main.subselect_exists2in
|
||||
main.subselect_exists2in_costmat
|
||||
main.subselect_extra
|
||||
main.subselect_extra_no_semijoin
|
||||
# Disabled due to connect log output
|
||||
# main.subselect_extra_no_semijoin
|
||||
main.subselect_gis
|
||||
main.subselect_innodb
|
||||
main.subselect_mat
|
||||
|
@ -579,7 +582,8 @@ main.win_empty_over
|
|||
main.win_first_last_value
|
||||
main.win_insert_select
|
||||
main.win_i_s
|
||||
main.win_lead_lag
|
||||
# Disabled due to unknown SQL error name
|
||||
# main.win_lead_lag
|
||||
main.win_min_max
|
||||
main.win_nth_value
|
||||
main.win_orderby
|
||||
|
|
|
@ -74,3 +74,40 @@ CREATE TABLE t_illegal (col_1 INT CHECK something (whatever));
|
|||
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 'something (whatever))' at line 1
|
||||
CREATE TABLE t_illegal (col_1 INT CHECK something);
|
||||
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 'something)' at line 1
|
||||
CREATE TABLE long_enough_name (
|
||||
pk int(11) NOT NULL,
|
||||
f1 int(11) DEFAULT NULL,
|
||||
f2 int(11) NOT NULL,
|
||||
f3 int(11) DEFAULT NULL,
|
||||
f4 timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
f5 varchar(32) COLLATE utf8_bin NOT NULL DEFAULT 'foo',
|
||||
f6 smallint(6) NOT NULL DEFAULT 1,
|
||||
f7 int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY idx1 (f7),
|
||||
KEY idx2 (f1),
|
||||
KEY idx3 (f2),
|
||||
KEY idx4 (f3),
|
||||
CONSTRAINT constr CHECK (f6 >= 0)
|
||||
);
|
||||
SELECT * FROM long_enough_name AS tbl;
|
||||
pk f1 f2 f3 f4 f5 f6 f7
|
||||
SHOW CREATE TABLE long_enough_name;
|
||||
Table Create Table
|
||||
long_enough_name CREATE TABLE `long_enough_name` (
|
||||
`pk` int(11) NOT NULL,
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
`f3` int(11) DEFAULT NULL,
|
||||
`f4` timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
`f5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT 'foo',
|
||||
`f6` smallint(6) NOT NULL DEFAULT 1,
|
||||
`f7` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`pk`),
|
||||
KEY `idx1` (`f7`),
|
||||
KEY `idx2` (`f1`),
|
||||
KEY `idx3` (`f2`),
|
||||
KEY `idx4` (`f3`),
|
||||
CONSTRAINT `constr` CHECK (`f6` >= 0)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE long_enough_name;
|
||||
|
|
|
@ -77,3 +77,28 @@ CREATE TABLE t_illegal (col_1 INT CHECK something (whatever));
|
|||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t_illegal (col_1 INT CHECK something);
|
||||
|
||||
#
|
||||
# MDEV-17065 Crash on SHOW CREATE TABLE with CHECK CONSTRAINT
|
||||
#
|
||||
|
||||
CREATE TABLE long_enough_name (
|
||||
pk int(11) NOT NULL,
|
||||
f1 int(11) DEFAULT NULL,
|
||||
f2 int(11) NOT NULL,
|
||||
f3 int(11) DEFAULT NULL,
|
||||
f4 timestamp NOT NULL DEFAULT current_timestamp(),
|
||||
f5 varchar(32) COLLATE utf8_bin NOT NULL DEFAULT 'foo',
|
||||
f6 smallint(6) NOT NULL DEFAULT 1,
|
||||
f7 int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY idx1 (f7),
|
||||
KEY idx2 (f1),
|
||||
KEY idx3 (f2),
|
||||
KEY idx4 (f3),
|
||||
CONSTRAINT constr CHECK (f6 >= 0)
|
||||
);
|
||||
|
||||
SELECT * FROM long_enough_name AS tbl;
|
||||
SHOW CREATE TABLE long_enough_name;
|
||||
|
||||
DROP TABLE long_enough_name;
|
||||
|
|
|
@ -8,12 +8,14 @@ MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the
|
|||
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
|
||||
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
|
||||
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
|
||||
Tencent Games http://game.qq.com/ Gold Sponsor of the MariaDB Foundation
|
||||
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
|
||||
Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
|
||||
Acronis https://www.acronis.com Silver Sponsor of the MariaDB Foundation
|
||||
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
|
||||
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
|
||||
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation
|
||||
Tencent TDSQL http://tdsql.org Bronze Sponsor of the MariaDB Foundation
|
||||
Percona https://www.percona.com/ Bronze Sponsor of the MariaDB Foundation
|
||||
Google USA Sponsoring encryption, parallel replication and GTID
|
||||
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
|
||||
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
|
||||
|
|
|
@ -479,6 +479,21 @@ UNLOCK TABLES;
|
|||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-14410 - Assertion `table->pos_in_locked_tables == __null ||
|
||||
# table->pos_in_locked_tables->table == table' failed in
|
||||
# mark_used_tables_as_free_for_reuse
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (b INT);
|
||||
CREATE TABLE t3 (c INT);
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t3 FOR EACH ROW INSERT INTO t1 VALUES ();
|
||||
CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t3 SELECT * FROM t1;
|
||||
LOCK TABLE t1 WRITE, t2 WRITE;
|
||||
CREATE OR REPLACE TABLE t1 (i INT);
|
||||
UNLOCK TABLES;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
DROP TABLE t1, t2, t3;
|
||||
#
|
||||
# MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
|
||||
# Locked_tables_list::unlock_locked_tables
|
||||
#
|
||||
|
|
|
@ -422,6 +422,27 @@ UNLOCK TABLES;
|
|||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14410 - Assertion `table->pos_in_locked_tables == __null ||
|
||||
--echo # table->pos_in_locked_tables->table == table' failed in
|
||||
--echo # mark_used_tables_as_free_for_reuse
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (b INT);
|
||||
CREATE TABLE t3 (c INT);
|
||||
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t3 FOR EACH ROW INSERT INTO t1 VALUES ();
|
||||
CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW INSERT INTO t3 SELECT * FROM t1;
|
||||
|
||||
LOCK TABLE t1 WRITE, t2 WRITE;
|
||||
CREATE OR REPLACE TABLE t1 (i INT);
|
||||
UNLOCK TABLES;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
|
||||
--echo # Locked_tables_list::unlock_locked_tables
|
||||
|
|
|
@ -1512,3 +1512,132 @@ a a
|
|||
1 1
|
||||
drop database db_mdev_16473;
|
||||
use test;
|
||||
#
|
||||
# MDEV-17154: using parameter markers for PS within CTEs more than once
|
||||
# using local variables in SP within CTEs more than once
|
||||
#
|
||||
prepare stmt from "
|
||||
with cte(c) as (select ? ) select r.c, s.c+10 from cte as r, cte as s;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
c s.c+10
|
||||
2 12
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
c s.c+10
|
||||
5 15
|
||||
deallocate prepare stmt;
|
||||
prepare stmt from "
|
||||
with cte(c) as (select ? ) select c from cte union select c+10 from cte;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
c
|
||||
2
|
||||
12
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
c
|
||||
5
|
||||
15
|
||||
deallocate prepare stmt;
|
||||
prepare stmt from "
|
||||
with cte_e(a,b) as
|
||||
(
|
||||
with cte_o(c) as (select ?)
|
||||
select r.c+10, s.c+20 from cte_o as r, cte_o as s
|
||||
)
|
||||
select * from cte_e as cte_e1 where a > 12
|
||||
union all
|
||||
select * from cte_e as cte_e2;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
a b
|
||||
12 22
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
a b
|
||||
15 25
|
||||
15 25
|
||||
deallocate prepare stmt;
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 values
|
||||
(3,33), (1,17), (7,72), (4,45), (2,27), (3,35), (4,47), (3,38), (2,22);
|
||||
prepare stmt from "
|
||||
with cte as (select * from t1 where a < ? and b > ?)
|
||||
select r.a, r.b+10, s.a, s.b+20 from cte as r, cte as s where r.a=s.a+1;
|
||||
";
|
||||
set @a=4, @b=20;
|
||||
execute stmt using @a,@b;
|
||||
a r.b+10 a s.b+20
|
||||
3 43 2 47
|
||||
3 45 2 47
|
||||
3 48 2 47
|
||||
3 43 2 42
|
||||
3 45 2 42
|
||||
3 48 2 42
|
||||
set @a=5, @b=20;
|
||||
execute stmt using @a,@b;
|
||||
a r.b+10 a s.b+20
|
||||
4 55 3 53
|
||||
4 57 3 53
|
||||
3 43 2 47
|
||||
3 45 2 47
|
||||
3 48 2 47
|
||||
4 55 3 55
|
||||
4 57 3 55
|
||||
4 55 3 58
|
||||
4 57 3 58
|
||||
3 43 2 42
|
||||
3 45 2 42
|
||||
3 48 2 42
|
||||
deallocate prepare stmt;
|
||||
create procedure p1()
|
||||
begin
|
||||
declare i int;
|
||||
set i = 0;
|
||||
while i < 4 do
|
||||
insert into t1
|
||||
with cte(a) as (select i) select r.a-1, s.a+1 from cte as r, cte as s;
|
||||
set i = i+1;
|
||||
end while;
|
||||
end|
|
||||
create procedure p2(in i int)
|
||||
begin
|
||||
insert into t1
|
||||
with cte(a) as (select i) select r.a-1, s.a+1 from cte as r, cte as s;
|
||||
end|
|
||||
delete from t1;
|
||||
call p1();
|
||||
select * from t1;
|
||||
a b
|
||||
-1 1
|
||||
0 2
|
||||
1 3
|
||||
2 4
|
||||
call p1();
|
||||
select * from t1;
|
||||
a b
|
||||
-1 1
|
||||
0 2
|
||||
1 3
|
||||
2 4
|
||||
-1 1
|
||||
0 2
|
||||
1 3
|
||||
2 4
|
||||
delete from t1;
|
||||
call p2(3);
|
||||
select * from t1;
|
||||
a b
|
||||
2 4
|
||||
call p2(7);
|
||||
select * from t1;
|
||||
a b
|
||||
2 4
|
||||
6 8
|
||||
drop procedure p1;
|
||||
drop procedure p2;
|
||||
drop table t1;
|
||||
|
|
|
@ -1057,3 +1057,93 @@ select * from cte, db_mdev_16473.t1 as t where cte.a=t.a;
|
|||
drop database db_mdev_16473;
|
||||
|
||||
use test;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17154: using parameter markers for PS within CTEs more than once
|
||||
--echo # using local variables in SP within CTEs more than once
|
||||
--echo #
|
||||
|
||||
prepare stmt from "
|
||||
with cte(c) as (select ? ) select r.c, s.c+10 from cte as r, cte as s;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
with cte(c) as (select ? ) select c from cte union select c+10 from cte;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
with cte_e(a,b) as
|
||||
(
|
||||
with cte_o(c) as (select ?)
|
||||
select r.c+10, s.c+20 from cte_o as r, cte_o as s
|
||||
)
|
||||
select * from cte_e as cte_e1 where a > 12
|
||||
union all
|
||||
select * from cte_e as cte_e2;
|
||||
";
|
||||
set @a=2;
|
||||
execute stmt using @a;
|
||||
set @a=5;
|
||||
execute stmt using @a;
|
||||
deallocate prepare stmt;
|
||||
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 values
|
||||
(3,33), (1,17), (7,72), (4,45), (2,27), (3,35), (4,47), (3,38), (2,22);
|
||||
|
||||
prepare stmt from "
|
||||
with cte as (select * from t1 where a < ? and b > ?)
|
||||
select r.a, r.b+10, s.a, s.b+20 from cte as r, cte as s where r.a=s.a+1;
|
||||
";
|
||||
set @a=4, @b=20;
|
||||
execute stmt using @a,@b;
|
||||
set @a=5, @b=20;
|
||||
execute stmt using @a,@b;
|
||||
deallocate prepare stmt;
|
||||
|
||||
delimiter |;
|
||||
|
||||
create procedure p1()
|
||||
begin
|
||||
declare i int;
|
||||
set i = 0;
|
||||
while i < 4 do
|
||||
insert into t1
|
||||
with cte(a) as (select i) select r.a-1, s.a+1 from cte as r, cte as s;
|
||||
set i = i+1;
|
||||
end while;
|
||||
end|
|
||||
|
||||
create procedure p2(in i int)
|
||||
begin
|
||||
insert into t1
|
||||
with cte(a) as (select i) select r.a-1, s.a+1 from cte as r, cte as s;
|
||||
end|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
delete from t1;
|
||||
call p1();
|
||||
select * from t1;
|
||||
call p1();
|
||||
select * from t1;
|
||||
|
||||
delete from t1;
|
||||
call p2(3);
|
||||
select * from t1;
|
||||
call p2(7);
|
||||
select * from t1;
|
||||
|
||||
drop procedure p1;
|
||||
drop procedure p2;
|
||||
drop table t1;
|
||||
|
|
|
@ -3306,7 +3306,148 @@ SELECT func();
|
|||
func()
|
||||
1
|
||||
DROP FUNCTION func;
|
||||
# Start of 10.3 tests
|
||||
#
|
||||
# MDEV-17024: two materialized CTEs using the same recursive CTE
|
||||
#
|
||||
create table t1 (id int);
|
||||
insert into t1 values (1), (2), (3);
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2;
|
||||
c1 c2
|
||||
2 1
|
||||
explain extended with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 6 100.00
|
||||
1 PRIMARY <derived5> ALL NULL NULL NULL NULL 6 100.00 Using join buffer (flat, BNL join)
|
||||
4 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
4 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
||||
5 DERIVED <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
5 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
||||
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
3 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 with recursive rcte as (/* select#2 */ select 1 AS `a` union /* select#3 */ select cast(`rcte`.`a` + 1 as unsigned) AS `cast(a+1 as unsigned)` from `rcte` where `rcte`.`a` < 10), cte1 as (/* select#4 */ select count(0) AS `c1` from `rcte` join `test`.`t1` where `rcte`.`a` between 3 and 5 and `test`.`t1`.`id` = `rcte`.`a` - 3), cte2 as (/* select#5 */ select count(0) AS `c2` from `rcte` join `test`.`t1` where `rcte`.`a` between 7 and 8 and `test`.`t1`.`id` = `rcte`.`a` - 7)/* select#1 */ select `cte1`.`c1` AS `c1`,`cte2`.`c2` AS `c2` from `cte1` join `cte2`
|
||||
prepare stmt from "with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2";
|
||||
execute stmt;
|
||||
c1 c2
|
||||
2 1
|
||||
execute stmt;
|
||||
c1 c2
|
||||
2 1
|
||||
create table t2 (c1 int, c2 int);
|
||||
create procedure p() insert into t2 with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2;
|
||||
call p();
|
||||
select * from t2;
|
||||
c1 c2
|
||||
2 1
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1;
|
||||
c1
|
||||
2
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from t1),
|
||||
cte2 as
|
||||
(select count(*) as c2 from t2)
|
||||
select * from cte1,cte2;
|
||||
c1 c2
|
||||
3 1
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2 where cte1.c1 = 3;
|
||||
c1 c2
|
||||
drop procedure p;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-17201: recursive part with LIMIT
|
||||
#
|
||||
CREATE TABLE purchases (
|
||||
id int unsigned NOT NULL AUTO_INCREMENT,
|
||||
pdate date NOT NULL,
|
||||
quantity int unsigned NOT NULL,
|
||||
p_id int unsigned NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
INSERT INTO purchases(pdate, quantity, p_id) VALUES
|
||||
('2014-11-01',5 ,1),('2014-11-03', 3 ,1),
|
||||
('2014-11-01',2 ,2),('2014-11-03', 4 ,2);
|
||||
CREATE TABLE expired (
|
||||
edate date NOT NULL,
|
||||
quantity int unsigned NOT NULL,
|
||||
p_id int unsigned NOT NULL,
|
||||
PRIMARY KEY (edate,p_id)
|
||||
);
|
||||
INSERT INTO expired VALUES ('2014-11-12', 5 ,1),('2014-11-08', 1 ,2);
|
||||
WITH RECURSIVE expired_map AS (
|
||||
SELECT edate AS expired_date,
|
||||
CAST(NULL AS date) AS purchase_date,
|
||||
0 AS quantity,
|
||||
e.p_id,
|
||||
(SELECT MAX(id)+1 FROM purchases p
|
||||
WHERE pdate <= edate AND p.p_id =p_id) AS purchase_processed,
|
||||
quantity AS unresolved
|
||||
FROM expired e
|
||||
UNION
|
||||
( SELECT expired_date,
|
||||
pdate,
|
||||
IF(p.quantity < m.unresolved, p.quantity, m.unresolved),
|
||||
p.p_id,
|
||||
p.id,
|
||||
IF(p.quantity < m.unresolved, m.unresolved - p.quantity, 0)
|
||||
FROM purchases p JOIN expired_map m ON p.p_id = m.p_id
|
||||
WHERE p.id < m.purchase_processed AND m.unresolved > 0
|
||||
ORDER BY p.id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
)
|
||||
SELECT * FROM expired_map;
|
||||
expired_date purchase_date quantity p_id purchase_processed unresolved
|
||||
2014-11-12 NULL 0 1 5 5
|
||||
2014-11-08 NULL 0 2 5 1
|
||||
2014-11-08 2014-11-03 1 2 4 0
|
||||
DROP TABLE purchases, expired;
|
||||
# End of 10.2 tests
|
||||
#
|
||||
# MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
|
||||
#
|
||||
|
@ -3595,3 +3736,4 @@ a
|
|||
0
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
# End of 10.3 tests
|
||||
|
|
|
@ -2324,7 +2324,124 @@ SELECT func();
|
|||
|
||||
DROP FUNCTION func;
|
||||
|
||||
--echo # Start of 10.3 tests
|
||||
--echo #
|
||||
--echo # MDEV-17024: two materialized CTEs using the same recursive CTE
|
||||
--echo #
|
||||
|
||||
create table t1 (id int);
|
||||
insert into t1 values (1), (2), (3);
|
||||
|
||||
let $q=
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2;
|
||||
|
||||
eval $q;
|
||||
eval explain extended $q;
|
||||
eval prepare stmt from "$q";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
|
||||
create table t2 (c1 int, c2 int);
|
||||
eval create procedure p() insert into t2 $q;
|
||||
call p();
|
||||
select * from t2;
|
||||
|
||||
let $q1=
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1;
|
||||
|
||||
eval $q1;
|
||||
|
||||
let $q2=
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from t1),
|
||||
cte2 as
|
||||
(select count(*) as c2 from t2)
|
||||
select * from cte1,cte2;
|
||||
|
||||
eval $q2;
|
||||
|
||||
let $q3=
|
||||
with recursive
|
||||
rcte(a) as
|
||||
(select 1 union select cast(a+1 as unsigned) from rcte where a < 10),
|
||||
cte1 as
|
||||
(select count(*) as c1 from rcte,t1 where a between 3 and 5 and id=a-3),
|
||||
cte2 as
|
||||
(select count(*) as c2 from rcte,t1 where a between 7 and 8 and id=a-7)
|
||||
select * from cte1, cte2 where cte1.c1 = 3;
|
||||
|
||||
eval $q3;
|
||||
|
||||
drop procedure p;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17201: recursive part with LIMIT
|
||||
--echo #
|
||||
|
||||
CREATE TABLE purchases (
|
||||
id int unsigned NOT NULL AUTO_INCREMENT,
|
||||
pdate date NOT NULL,
|
||||
quantity int unsigned NOT NULL,
|
||||
p_id int unsigned NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
INSERT INTO purchases(pdate, quantity, p_id) VALUES
|
||||
('2014-11-01',5 ,1),('2014-11-03', 3 ,1),
|
||||
('2014-11-01',2 ,2),('2014-11-03', 4 ,2);
|
||||
|
||||
CREATE TABLE expired (
|
||||
edate date NOT NULL,
|
||||
quantity int unsigned NOT NULL,
|
||||
p_id int unsigned NOT NULL,
|
||||
PRIMARY KEY (edate,p_id)
|
||||
);
|
||||
|
||||
INSERT INTO expired VALUES ('2014-11-12', 5 ,1),('2014-11-08', 1 ,2);
|
||||
|
||||
WITH RECURSIVE expired_map AS (
|
||||
SELECT edate AS expired_date,
|
||||
CAST(NULL AS date) AS purchase_date,
|
||||
0 AS quantity,
|
||||
e.p_id,
|
||||
(SELECT MAX(id)+1 FROM purchases p
|
||||
WHERE pdate <= edate AND p.p_id =p_id) AS purchase_processed,
|
||||
quantity AS unresolved
|
||||
FROM expired e
|
||||
UNION
|
||||
( SELECT expired_date,
|
||||
pdate,
|
||||
IF(p.quantity < m.unresolved, p.quantity, m.unresolved),
|
||||
p.p_id,
|
||||
p.id,
|
||||
IF(p.quantity < m.unresolved, m.unresolved - p.quantity, 0)
|
||||
FROM purchases p JOIN expired_map m ON p.p_id = m.p_id
|
||||
WHERE p.id < m.purchase_processed AND m.unresolved > 0
|
||||
ORDER BY p.id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
)
|
||||
SELECT * FROM expired_map;
|
||||
|
||||
DROP TABLE purchases, expired;
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
|
||||
|
@ -2553,3 +2670,5 @@ WITH RECURSIVE cte AS
|
|||
SELECT * FROM cte;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.3 tests
|
||||
|
|
|
@ -542,3 +542,27 @@ flush relay logs,relay logs;
|
|||
ERROR HY000: Incorrect usage of FLUSH and RELAY LOGS
|
||||
flush slave,slave;
|
||||
ERROR HY000: Incorrect usage of FLUSH and SLAVE
|
||||
#
|
||||
# MDEV-15890 Strange error message if you try to
|
||||
# FLUSH TABLES <view> after LOCK TABLES <view>.
|
||||
#
|
||||
CREATE TABLE t1 (qty INT, price INT);
|
||||
CREATE VIEW v1 AS SELECT qty, price, qty*price AS value FROM t1;
|
||||
LOCK TABLES v1 READ;
|
||||
FLUSH TABLES v1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES v1 WRITE;
|
||||
FLUSH TABLES v1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES v1 READ;
|
||||
FLUSH TABLES t1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
FLUSH TABLES v1;
|
||||
ERROR HY000: Table 'v1' was not locked with LOCK TABLES
|
||||
UNLOCK TABLES;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -673,3 +673,35 @@ DROP TABLE t1;
|
|||
flush relay logs,relay logs;
|
||||
--error ER_WRONG_USAGE
|
||||
flush slave,slave;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-15890 Strange error message if you try to
|
||||
--echo # FLUSH TABLES <view> after LOCK TABLES <view>.
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (qty INT, price INT);
|
||||
CREATE VIEW v1 AS SELECT qty, price, qty*price AS value FROM t1;
|
||||
|
||||
LOCK TABLES v1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
FLUSH TABLES v1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES v1 WRITE;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
FLUSH TABLES v1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES v1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
FLUSH TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES t1 READ;
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
FLUSH TABLES v1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
|
|
@ -791,6 +791,26 @@ SELECT JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6');
|
|||
JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6')
|
||||
{"a": "ö", "x": 1, "b": "ö"}
|
||||
#
|
||||
# MDEV-17121 JSON_ARRAY_APPEND
|
||||
#
|
||||
select json_array_append('[ ]', '$', 'aue');
|
||||
json_array_append('[ ]', '$', 'aue')
|
||||
["aue"]
|
||||
#
|
||||
# MDEV-17018 JSON_SEARCH and User-Defined Variables.
|
||||
#
|
||||
SET @`json` := '["A", [{"B": "1"}], {"C": "AB"}, {"D": "BC"}]', @`value` := 'AB';
|
||||
SELECT JSON_SEARCH(@`json`, 'one', @`value`);
|
||||
JSON_SEARCH(@`json`, 'one', @`value`)
|
||||
"$[2].C"
|
||||
SET @`json` := NULL, @`value` := NULL;
|
||||
#
|
||||
# MDEV-17001 JSON_MERGE returns nullwhen merging empty array.
|
||||
#
|
||||
SELECT JSON_MERGE('[1]', '[]');
|
||||
JSON_MERGE('[1]', '[]')
|
||||
[1]
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -446,6 +446,26 @@ SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6);
|
|||
SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6, '$.b', _utf8 0xC3B6);
|
||||
SELECT JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6');
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17121 JSON_ARRAY_APPEND
|
||||
--echo #
|
||||
|
||||
select json_array_append('[ ]', '$', 'aue');
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17018 JSON_SEARCH and User-Defined Variables.
|
||||
--echo #
|
||||
|
||||
SET @`json` := '["A", [{"B": "1"}], {"C": "AB"}, {"D": "BC"}]', @`value` := 'AB';
|
||||
SELECT JSON_SEARCH(@`json`, 'one', @`value`);
|
||||
SET @`json` := NULL, @`value` := NULL;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17001 JSON_MERGE returns nullwhen merging empty array.
|
||||
--echo #
|
||||
|
||||
SELECT JSON_MERGE('[1]', '[]');
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
|
|
@ -2803,6 +2803,164 @@ PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'))
|
|||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '-3S\xFA\xDE?\x00\x00\xCA\xB3\xEEE\xA4\xD1\xC1\xA8'
|
||||
#
|
||||
# MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
|
||||
#
|
||||
SELECT
|
||||
MAKETIME(1e10,0,0),
|
||||
MAKETIME(-1e10,0,0),
|
||||
MAKETIME(1e50,0,0),
|
||||
MAKETIME(-1e50,0,0),
|
||||
MAKETIME(COALESCE(1e50),0,0),
|
||||
MAKETIME(COALESCE(-1e50),0,0);
|
||||
MAKETIME(1e10,0,0) 838:59:59
|
||||
MAKETIME(-1e10,0,0) -838:59:59
|
||||
MAKETIME(1e50,0,0) 838:59:59
|
||||
MAKETIME(-1e50,0,0) -838:59:59
|
||||
MAKETIME(COALESCE(1e50),0,0) 838:59:59
|
||||
MAKETIME(COALESCE(-1e50),0,0) -838:59:59
|
||||
Warnings:
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '10000000000:00:00'
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '-10000000000:00:00'
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '9223372036854775807:00:00'
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '-9223372036854775808:00:00'
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '9223372036854775807:00:00'
|
||||
Level Warning
|
||||
Code 1292
|
||||
Message Truncated incorrect time value: '-9223372036854775808:00:00'
|
||||
CREATE TABLE t1 (a FLOAT);
|
||||
INSERT INTO t1 VALUES (1e30),(-1e30);
|
||||
SELECT MAKETIME(a,0,0) FROM t1;
|
||||
MAKETIME(a,0,0)
|
||||
838:59:59
|
||||
-838:59:59
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '9223372036854775807:00:00'
|
||||
Warning 1292 Truncated incorrect time value: '-9223372036854775808:00:00'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result
|
||||
#
|
||||
SELECT MAKETIME(900,0,0);
|
||||
MAKETIME(900,0,0)
|
||||
838:59:59
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.1);
|
||||
MAKETIME(900,0,0.1)
|
||||
838:59:59.9
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.11);
|
||||
MAKETIME(900,0,0.11)
|
||||
838:59:59.99
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.111);
|
||||
MAKETIME(900,0,0.111)
|
||||
838:59:59.999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.1111);
|
||||
MAKETIME(900,0,0.1111)
|
||||
838:59:59.9999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.11111);
|
||||
MAKETIME(900,0,0.11111)
|
||||
838:59:59.99999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.111111);
|
||||
MAKETIME(900,0,0.111111)
|
||||
838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.1111111);
|
||||
MAKETIME(900,0,0.1111111)
|
||||
838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.11111111);
|
||||
MAKETIME(900,0,0.11111111)
|
||||
838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,0.111111111);
|
||||
MAKETIME(900,0,0.111111111)
|
||||
838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:00'
|
||||
SELECT MAKETIME(900,0,EXP(1));
|
||||
MAKETIME(900,0,EXP(1))
|
||||
838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '900:00:02'
|
||||
SELECT MAKETIME(-900,0,0);
|
||||
MAKETIME(-900,0,0)
|
||||
-838:59:59
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.1);
|
||||
MAKETIME(-900,0,0.1)
|
||||
-838:59:59.9
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.11);
|
||||
MAKETIME(-900,0,0.11)
|
||||
-838:59:59.99
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.111);
|
||||
MAKETIME(-900,0,0.111)
|
||||
-838:59:59.999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.1111);
|
||||
MAKETIME(-900,0,0.1111)
|
||||
-838:59:59.9999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.11111);
|
||||
MAKETIME(-900,0,0.11111)
|
||||
-838:59:59.99999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.111111);
|
||||
MAKETIME(-900,0,0.111111)
|
||||
-838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.1111111);
|
||||
MAKETIME(-900,0,0.1111111)
|
||||
-838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.11111111);
|
||||
MAKETIME(-900,0,0.11111111)
|
||||
-838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,0.111111111);
|
||||
MAKETIME(-900,0,0.111111111)
|
||||
-838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:00'
|
||||
SELECT MAKETIME(-900,0,EXP(1));
|
||||
MAKETIME(-900,0,EXP(1))
|
||||
-838:59:59.999999
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: '-900:00:02'
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -1707,6 +1707,55 @@ SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
|
|||
#
|
||||
SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'));
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
|
||||
--echo #
|
||||
|
||||
--vertical_results
|
||||
SELECT
|
||||
MAKETIME(1e10,0,0),
|
||||
MAKETIME(-1e10,0,0),
|
||||
MAKETIME(1e50,0,0),
|
||||
MAKETIME(-1e50,0,0),
|
||||
MAKETIME(COALESCE(1e50),0,0),
|
||||
MAKETIME(COALESCE(-1e50),0,0);
|
||||
--horizontal_results
|
||||
|
||||
CREATE TABLE t1 (a FLOAT);
|
||||
INSERT INTO t1 VALUES (1e30),(-1e30);
|
||||
SELECT MAKETIME(a,0,0) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result
|
||||
--echo #
|
||||
|
||||
SELECT MAKETIME(900,0,0);
|
||||
SELECT MAKETIME(900,0,0.1);
|
||||
SELECT MAKETIME(900,0,0.11);
|
||||
SELECT MAKETIME(900,0,0.111);
|
||||
SELECT MAKETIME(900,0,0.1111);
|
||||
SELECT MAKETIME(900,0,0.11111);
|
||||
SELECT MAKETIME(900,0,0.111111);
|
||||
SELECT MAKETIME(900,0,0.1111111);
|
||||
SELECT MAKETIME(900,0,0.11111111);
|
||||
SELECT MAKETIME(900,0,0.111111111);
|
||||
SELECT MAKETIME(900,0,EXP(1));
|
||||
|
||||
SELECT MAKETIME(-900,0,0);
|
||||
SELECT MAKETIME(-900,0,0.1);
|
||||
SELECT MAKETIME(-900,0,0.11);
|
||||
SELECT MAKETIME(-900,0,0.111);
|
||||
SELECT MAKETIME(-900,0,0.1111);
|
||||
SELECT MAKETIME(-900,0,0.11111);
|
||||
SELECT MAKETIME(-900,0,0.111111);
|
||||
SELECT MAKETIME(-900,0,0.1111111);
|
||||
SELECT MAKETIME(-900,0,0.11111111);
|
||||
SELECT MAKETIME(-900,0,0.111111111);
|
||||
SELECT MAKETIME(-900,0,EXP(1));
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
|
|
@ -504,6 +504,9 @@ GEOMETRYFROMTEXT('POINT(4599 60359)'),
|
|||
) as relate_res;
|
||||
relate_res
|
||||
0
|
||||
with cte1 as( select (st_symdifference(point(1,1),point(1,1))) as a1 ), cte2 as(select 1 as a2) select 1 from cte1 where cte1.a1 < '1';
|
||||
1
|
||||
1
|
||||
DROP TABLE IF EXISTS p1;
|
||||
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
|
||||
BEGIN
|
||||
|
|
|
@ -382,5 +382,9 @@ SELECT ST_RELATE(
|
|||
'F*FFFF**F'
|
||||
) as relate_res;
|
||||
|
||||
# MDEV- 16050 cte + geometry functions lead to crash.
|
||||
|
||||
with cte1 as( select (st_symdifference(point(1,1),point(1,1))) as a1 ), cte2 as(select 1 as a2) select 1 from cte1 where cte1.a1 < '1';
|
||||
|
||||
--source include/gis_debug.inc
|
||||
|
||||
|
|
|
@ -1721,6 +1721,22 @@ c2
|
|||
DROP TABLE t1;
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
#
|
||||
# MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
|
||||
# optimizer_use_condition_selectivity>=3
|
||||
#
|
||||
CREATE TABLE t1 (a POINT);
|
||||
INSERT INTO t1 VALUES (POINT(1,1)),(POINT(1,2)),(POINT(1,3));
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||
set @@use_stat_tables= PREFERABLY;
|
||||
set @@optimizer_use_condition_selectivity=3;
|
||||
SELECT COUNT(*) FROM t1 WHERE a IN ('test','test1');
|
||||
COUNT(*)
|
||||
0
|
||||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
#
|
||||
# End 10.0 tests
|
||||
#
|
||||
SHOW CREATE TABLE information_schema.geometry_columns;
|
||||
|
|
|
@ -1481,6 +1481,21 @@ SELECT LENGTH(CONCAT(t2,'--',t2)) c2 FROM (SELECT ST_BUFFER(POINT(x,y), 0) t2 FR
|
|||
DROP TABLE t1;
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
|
||||
--echo # optimizer_use_condition_selectivity>=3
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a POINT);
|
||||
INSERT INTO t1 VALUES (POINT(1,1)),(POINT(1,2)),(POINT(1,3));
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||
set @@use_stat_tables= PREFERABLY;
|
||||
set @@optimizer_use_condition_selectivity=3;
|
||||
SELECT COUNT(*) FROM t1 WHERE a IN ('test','test1');
|
||||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End 10.0 tests
|
||||
|
|
|
@ -2670,6 +2670,38 @@ disconnect conn2;
|
|||
disconnect conn3;
|
||||
DROP USER foo@'127.0.0.1';
|
||||
# End of Bug#12766319
|
||||
create user foo@localhost;
|
||||
create database foodb;
|
||||
grant create routine on foodb.* to foo@localhost;
|
||||
connect con1,localhost,foo;
|
||||
create procedure fooproc() select 'i am fooproc';
|
||||
show grants;
|
||||
Grants for foo@localhost
|
||||
GRANT USAGE ON *.* TO 'foo'@'localhost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
|
||||
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
|
||||
disconnect con1;
|
||||
connection default;
|
||||
rename table mysql.procs_priv to mysql.procs_priv1;
|
||||
flush privileges;
|
||||
show grants for foo@localhost;
|
||||
Grants for foo@localhost
|
||||
GRANT USAGE ON *.* TO 'foo'@'localhost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
|
||||
rename table mysql.procs_priv1 to mysql.procs_priv;
|
||||
show grants for foo@localhost;
|
||||
Grants for foo@localhost
|
||||
GRANT USAGE ON *.* TO 'foo'@'localhost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
|
||||
flush privileges;
|
||||
show grants for foo@localhost;
|
||||
Grants for foo@localhost
|
||||
GRANT USAGE ON *.* TO 'foo'@'localhost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'localhost'
|
||||
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'localhost'
|
||||
drop user foo@localhost;
|
||||
drop procedure fooproc;
|
||||
drop database foodb;
|
||||
#
|
||||
# Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS
|
||||
# DATABASE SECURITY
|
||||
|
|
|
@ -2175,6 +2175,28 @@ DROP USER foo@'127.0.0.1';
|
|||
|
||||
--echo # End of Bug#12766319
|
||||
|
||||
#
|
||||
# Bug#27230925: HANDLE_FATAL_SIGNAL (SIG=11) IN SHOW_ROUTINE_GRANTS
|
||||
#
|
||||
create user foo@localhost;
|
||||
create database foodb;
|
||||
grant create routine on foodb.* to foo@localhost;
|
||||
connect con1,localhost,foo;
|
||||
create procedure fooproc() select 'i am fooproc';
|
||||
show grants;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
rename table mysql.procs_priv to mysql.procs_priv1;
|
||||
flush privileges;
|
||||
show grants for foo@localhost;
|
||||
rename table mysql.procs_priv1 to mysql.procs_priv;
|
||||
show grants for foo@localhost;
|
||||
flush privileges;
|
||||
show grants for foo@localhost;
|
||||
drop user foo@localhost;
|
||||
drop procedure fooproc;
|
||||
drop database foodb;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS
|
||||
|
|
|
@ -3733,6 +3733,34 @@ id MIN(a) MAX(a)
|
|||
4 2001-01-04 2001-01-04
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-17039: Query plan changes when we use GROUP BY optimization with optimizer_use_condition_selectivity=4
|
||||
# and use_stat_tables= PREFERABLY
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT,c INT DEFAULT 0, INDEX (a,b));
|
||||
INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
|
||||
(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
|
||||
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables=PREFERABLY;
|
||||
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
|
||||
1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
|
||||
2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from <materialize> (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set @@use_stat_tables=@save_use_stat_tables;
|
||||
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
|
||||
1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
|
||||
2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from <materialize> (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -1519,6 +1519,23 @@ ALTER TABLE t1 ADD KEY(id,a);
|
|||
SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=DATE'2001-01-04' GROUP BY id;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17039: Query plan changes when we use GROUP BY optimization with optimizer_use_condition_selectivity=4
|
||||
--echo # and use_stat_tables= PREFERABLY
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT,c INT DEFAULT 0, INDEX (a,b));
|
||||
INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
|
||||
(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
|
||||
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables=PREFERABLY;
|
||||
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set @@use_stat_tables=@save_use_stat_tables;
|
||||
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.0 tests
|
||||
|
|
|
@ -1522,11 +1522,13 @@ ERROR 42S22: Unknown column 'f' in 'from clause'
|
|||
DROP TABLE t;
|
||||
CREATE TABLE t (f INT);
|
||||
CALL p;
|
||||
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||
f
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (i INT);
|
||||
CALL p;
|
||||
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||
ERROR 42S22: Unknown column 't1.f' in 'field list'
|
||||
CALL p;
|
||||
ERROR 42S22: Unknown column 't1.f' in 'field list'
|
||||
DROP PROCEDURE p;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
|
|
|
@ -1185,12 +1185,13 @@ CREATE TABLE t (f INT);
|
|||
#
|
||||
# The following shouldn't fail as the table is now matching the using
|
||||
#
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL p;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (i INT);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL p;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL p;
|
||||
DROP PROCEDURE p;
|
||||
DROP TABLE t;
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ t2id id
|
|||
use test;
|
||||
drop database `#mysql50#-`;
|
||||
SET NAMES default;
|
||||
FOUND 12 /\[ERROR\] Invalid \(old\?\) table or database name/ in mysqld.1.err
|
||||
FOUND 8 /\[ERROR\] Invalid \(old\?\) table or database name/ in mysqld.1.err
|
||||
set global query_cache_type=DEFAULT;
|
||||
set global query_cache_size=DEFAULT;
|
||||
End of 10.2 tests
|
||||
|
|
|
@ -782,9 +782,9 @@ set optimizer_use_condition_selectivity=3;
|
|||
explain extended
|
||||
select * from t1 where a < 1 and a > 7;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select 7 AS `a` from `test`.`t1` where 0
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7
|
||||
select * from t1 where a < 1 and a > 7;
|
||||
a
|
||||
drop table t1;
|
||||
|
@ -1506,9 +1506,9 @@ col1
|
|||
explain extended
|
||||
select * from t2 where col1 < 'b' and col1 > 'd';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select 'd' AS `col1` from `test`.`t2` where 0
|
||||
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` < 'b' and `test`.`t2`.`col1` > 'd'
|
||||
drop table t1,t2;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
@ -1595,3 +1595,43 @@ drop table t1,t0;
|
|||
set histogram_size=@save_histogram_size;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-15306: Wrong/Unexpected result with the value
|
||||
# optimizer_use_condition_selectivity set to 4
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
SET @cnt := @cnt + 1;
|
||||
RETURN 1;
|
||||
END;|
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@use_stat_tables='complementary';
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SET @cnt= 0;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
a
|
||||
1
|
||||
SELECT @cnt;
|
||||
@cnt
|
||||
1
|
||||
set @@use_stat_tables='preferably';
|
||||
analyze table t1 persistent for all;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SET @cnt := 0;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
a
|
||||
1
|
||||
SELECT @cnt;
|
||||
@cnt
|
||||
2
|
||||
alter table t1 force;
|
||||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
|
|
|
@ -1066,3 +1066,39 @@ drop table t1,t0;
|
|||
set histogram_size=@save_histogram_size;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-15306: Wrong/Unexpected result with the value
|
||||
--echo # optimizer_use_condition_selectivity set to 4
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
|
||||
delimiter |;
|
||||
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
SET @cnt := @cnt + 1;
|
||||
RETURN 1;
|
||||
END;|
|
||||
delimiter ;|
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@use_stat_tables='complementary';
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SET @cnt= 0;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
SELECT @cnt;
|
||||
|
||||
set @@use_stat_tables='preferably';
|
||||
analyze table t1 persistent for all;
|
||||
SET @cnt := 0;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
SELECT @cnt;
|
||||
alter table t1 force;
|
||||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
|
||||
|
|
|
@ -789,9 +789,9 @@ set optimizer_use_condition_selectivity=3;
|
|||
explain extended
|
||||
select * from t1 where a < 1 and a > 7;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select 7 AS `a` from `test`.`t1` where 0
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7
|
||||
select * from t1 where a < 1 and a > 7;
|
||||
a
|
||||
drop table t1;
|
||||
|
@ -1517,9 +1517,9 @@ col1
|
|||
explain extended
|
||||
select * from t2 where col1 < 'b' and col1 > 'd';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select 'd' AS `col1` from `test`.`t2` where 0
|
||||
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` < 'b' and `test`.`t2`.`col1` > 'd'
|
||||
drop table t1,t2;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
@ -1606,6 +1606,46 @@ drop table t1,t0;
|
|||
set histogram_size=@save_histogram_size;
|
||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-15306: Wrong/Unexpected result with the value
|
||||
# optimizer_use_condition_selectivity set to 4
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
|
||||
BEGIN
|
||||
SET @cnt := @cnt + 1;
|
||||
RETURN 1;
|
||||
END;|
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@use_stat_tables='complementary';
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SET @cnt= 0;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
a
|
||||
1
|
||||
SELECT @cnt;
|
||||
@cnt
|
||||
1
|
||||
set @@use_stat_tables='preferably';
|
||||
analyze table t1 persistent for all;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SET @cnt := 0;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
a
|
||||
1
|
||||
SELECT @cnt;
|
||||
@cnt
|
||||
2
|
||||
alter table t1 force;
|
||||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
drop function f1;
|
||||
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
|
||||
set @tmp_ust= @@use_stat_tables;
|
||||
set @tmp_oucs= @@optimizer_use_condition_selectivity;
|
||||
|
|
|
@ -710,6 +710,32 @@ connection default;
|
|||
disconnect con2;
|
||||
DROP USER user2@localhost;
|
||||
DROP DATABASE db1;
|
||||
create user foo@local_ost;
|
||||
create user foo@`local\_ost`;
|
||||
update mysql.user set plugin='foobar' where host='local\\_ost';
|
||||
flush privileges;
|
||||
create database foodb;
|
||||
grant create routine on foodb.* to foo@local_ost;
|
||||
connect con1,localhost,foo;
|
||||
select user(), current_user();
|
||||
user() current_user()
|
||||
foo@localhost foo@local_ost
|
||||
show grants;
|
||||
Grants for foo@local_ost
|
||||
GRANT USAGE ON *.* TO 'foo'@'local_ost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
|
||||
create procedure fooproc() select 'i am fooproc';
|
||||
show grants;
|
||||
Grants for foo@local_ost
|
||||
GRANT USAGE ON *.* TO 'foo'@'local_ost'
|
||||
GRANT CREATE ROUTINE ON `foodb`.* TO 'foo'@'local_ost'
|
||||
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`fooproc` TO 'foo'@'local_ost'
|
||||
disconnect con1;
|
||||
connection default;
|
||||
drop user foo@local_ost;
|
||||
drop user foo@`local\_ost`;
|
||||
drop procedure fooproc;
|
||||
drop database foodb;
|
||||
#
|
||||
# Test for bug#12602983 - User without privilege on routine can discover
|
||||
# its existence by executing "select non_existing_func();" or by
|
||||
|
|
|
@ -973,6 +973,34 @@ disconnect con2;
|
|||
DROP USER user2@localhost;
|
||||
DROP DATABASE db1;
|
||||
|
||||
#
|
||||
# Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
|
||||
#
|
||||
create user foo@local_ost;
|
||||
#
|
||||
# Create a user with an authentification plugin 'foobar'.
|
||||
# Instead of using a normal "CREATE USER <user> IDENTIFIED VIA <plugin>"
|
||||
# we do CREATE (without VIA) followed by UPDATE and FLUSH.
|
||||
# This is to avoid installing a real plugin and thus avoid the test dependency.
|
||||
# We won't login under this user in the below test, so this is fine.
|
||||
#
|
||||
create user foo@`local\_ost`;
|
||||
update mysql.user set plugin='foobar' where host='local\\_ost';
|
||||
flush privileges;
|
||||
create database foodb;
|
||||
grant create routine on foodb.* to foo@local_ost;
|
||||
connect con1,localhost,foo;
|
||||
select user(), current_user();
|
||||
show grants;
|
||||
create procedure fooproc() select 'i am fooproc';
|
||||
show grants;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
drop user foo@local_ost;
|
||||
drop user foo@`local\_ost`;
|
||||
drop procedure fooproc;
|
||||
drop database foodb;
|
||||
|
||||
--echo #
|
||||
--echo # Test for bug#12602983 - User without privilege on routine can discover
|
||||
--echo # its existence by executing "select non_existing_func();" or by
|
||||
|
|
|
@ -7910,6 +7910,23 @@ SET S.CLOSE_YN = ''
|
|||
where 1=1;
|
||||
drop function if exists f1;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-16957: Server crashes in Field_iterator_natural_join::next
|
||||
# upon 2nd execution of SP
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b VARCHAR(32));
|
||||
CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c);
|
||||
CALL sp;
|
||||
ERROR 42S22: Unknown column 'c' in 'from clause'
|
||||
CALL sp;
|
||||
ERROR 42S22: Unknown column 'c' in 'from clause'
|
||||
CALL sp;
|
||||
ERROR 42S22: Unknown column 'c' in 'from clause'
|
||||
alter table t1 add column c int;
|
||||
CALL sp;
|
||||
c a b a b
|
||||
DROP PROCEDURE sp;
|
||||
DROP TABLE t1;
|
||||
# End of 5.5 test
|
||||
#
|
||||
# MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2
|
||||
|
|
|
@ -9344,6 +9344,27 @@ where 1=1;
|
|||
drop function if exists f1;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16957: Server crashes in Field_iterator_natural_join::next
|
||||
--echo # upon 2nd execution of SP
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, b VARCHAR(32));
|
||||
CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL sp;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL sp;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
CALL sp;
|
||||
alter table t1 add column c int;
|
||||
CALL sp;
|
||||
|
||||
# Cleanup
|
||||
DROP PROCEDURE sp;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # End of 5.5 test
|
||||
|
||||
--echo #
|
||||
|
|
|
@ -578,57 +578,17 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr
|
|||
DROP TABLE t1;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16757: manual addition of min/max statistics for BLOB
|
||||
# MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
|
||||
#
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze Warning Engine-independent statistics are not collected for column 't'
|
||||
test.t1 analyze status OK
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
DELETE FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='t';
|
||||
INSERT INTO mysql.column_stats VALUES
|
||||
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
test t1 t bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||
SELECT pk FROM t1;
|
||||
pk
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||
#
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SELECT * FROM t1;
|
||||
pk c
|
||||
1 foo
|
||||
2 bar
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
test t1 c bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||
SELECT * FROM t1;
|
||||
pk a
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
DROP TABLE t1;
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables= PREFERABLY;
|
||||
explain
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
|
||||
1 SIMPLE user ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16711:CREATE OR REPLACE TABLE introducing BLOB column
|
||||
|
|
|
@ -358,50 +358,17 @@ DROP TABLE t1;
|
|||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16757: manual addition of min/max statistics for BLOB
|
||||
--echo # MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
|
||||
--echo #
|
||||
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
--sorted_result
|
||||
SELECT * FROM mysql.column_stats;
|
||||
DELETE FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='t';
|
||||
INSERT INTO mysql.column_stats VALUES
|
||||
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
|
||||
--sorted_result
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
SELECT pk FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables= PREFERABLY;
|
||||
explain
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||
--echo #
|
||||
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16711:CREATE OR REPLACE TABLE introducing BLOB column
|
||||
--echo #
|
||||
|
|
|
@ -605,57 +605,17 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr
|
|||
DROP TABLE t1;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16757: manual addition of min/max statistics for BLOB
|
||||
# MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
|
||||
#
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze Warning Engine-independent statistics are not collected for column 't'
|
||||
test.t1 analyze status OK
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
DELETE FROM mysql.column_stats
|
||||
WHERE db_name='test' AND table_name='t1' AND column_name='t';
|
||||
INSERT INTO mysql.column_stats VALUES
|
||||
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
test t1 t bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||
SELECT pk FROM t1;
|
||||
pk
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||
#
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SELECT * FROM t1;
|
||||
pk c
|
||||
1 foo
|
||||
2 bar
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||
test t1 c bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||
SELECT * FROM t1;
|
||||
pk a
|
||||
SELECT * FROM mysql.column_stats;
|
||||
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||
DROP TABLE t1;
|
||||
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
|
||||
set @@optimizer_use_condition_selectivity=4;
|
||||
set @@use_stat_tables= PREFERABLY;
|
||||
explain
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
|
||||
1 SIMPLE user ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
|
||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
#
|
||||
# MDEV-16711:CREATE OR REPLACE TABLE introducing BLOB column
|
||||
|
|
|
@ -448,6 +448,46 @@ select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
|
|||
foo
|
||||
0
|
||||
#
|
||||
# MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
|
||||
#
|
||||
SELECT LEFT('a',EXP(50));
|
||||
LEFT('a',EXP(50))
|
||||
a
|
||||
SELECT LEFT('a', COALESCE(1e30));
|
||||
LEFT('a', COALESCE(1e30))
|
||||
a
|
||||
CREATE TABLE t1 (a FLOAT);
|
||||
INSERT INTO t1 VALUES (1e30);
|
||||
SELECT LEFT('a',a), LEFT('a',1e30) FROM t1;
|
||||
LEFT('a',a) LEFT('a',1e30)
|
||||
a a
|
||||
DROP TABLE t1;
|
||||
PREPARE stmt FROM 'SELECT LEFT(111,?)';
|
||||
SET @a=1e30;
|
||||
EXECUTE stmt USING @a;
|
||||
LEFT(111,?)
|
||||
111
|
||||
DEALLOCATE PREPARE stmt;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT LEFT('a',(SELECT 1e30 FROM t1 LIMIT 1));
|
||||
LEFT('a',(SELECT 1e30 FROM t1 LIMIT 1))
|
||||
a
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a DOUBLE);
|
||||
INSERT INTO t1 VALUES (1e30),(0);
|
||||
SELECT LEFT('a', SUM(a)) FROM t1;
|
||||
LEFT('a', SUM(a))
|
||||
a
|
||||
Warnings:
|
||||
Warning 1916 Got overflow when converting '1e30' to INT. Value truncated
|
||||
SELECT LEFT('a', AVG(a)) FROM t1;
|
||||
LEFT('a', AVG(a))
|
||||
a
|
||||
Warnings:
|
||||
Warning 1916 Got overflow when converting '5e29' to INT. Value truncated
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
|
||||
# (WARN_DATA_TRUNCATED)
|
||||
#
|
||||
|
|
|
@ -332,6 +332,36 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
|
|||
|
||||
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
|
||||
--echo #
|
||||
|
||||
SELECT LEFT('a',EXP(50));
|
||||
SELECT LEFT('a', COALESCE(1e30));
|
||||
|
||||
CREATE TABLE t1 (a FLOAT);
|
||||
INSERT INTO t1 VALUES (1e30);
|
||||
SELECT LEFT('a',a), LEFT('a',1e30) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
PREPARE stmt FROM 'SELECT LEFT(111,?)';
|
||||
SET @a=1e30;
|
||||
EXECUTE stmt USING @a;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT LEFT('a',(SELECT 1e30 FROM t1 LIMIT 1));
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a DOUBLE);
|
||||
INSERT INTO t1 VALUES (1e30),(0);
|
||||
SELECT LEFT('a', SUM(a)) FROM t1;
|
||||
SELECT LEFT('a', AVG(a)) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
|
||||
--echo # (WARN_DATA_TRUNCATED)
|
||||
|
|
|
@ -1456,7 +1456,7 @@ sub command_line_setup {
|
|||
|
||||
foreach my $fs (@tmpfs_locations)
|
||||
{
|
||||
if ( -d $fs && ! -l $fs )
|
||||
if ( -d $fs && ! -l $fs && -w $fs )
|
||||
{
|
||||
my $template= "var_${opt_build_thread}_XXXX";
|
||||
$opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
|
||||
|
@ -3992,14 +3992,14 @@ sub run_testcase ($$) {
|
|||
}
|
||||
|
||||
my $test= $tinfo->{suite}->start_test($tinfo);
|
||||
# Set only when we have to keep waiting after expectedly died server
|
||||
my $keep_waiting_proc = 0;
|
||||
# Set to a list of processes we have to keep waiting (expectedly died servers)
|
||||
my %keep_waiting_proc = ();
|
||||
my $print_timeout= start_timer($print_freq * 60);
|
||||
|
||||
while (1)
|
||||
{
|
||||
my $proc;
|
||||
if ($keep_waiting_proc)
|
||||
if (%keep_waiting_proc)
|
||||
{
|
||||
# Any other process exited?
|
||||
$proc = My::SafeProcess->check_any();
|
||||
|
@ -4009,48 +4009,34 @@ sub run_testcase ($$) {
|
|||
}
|
||||
else
|
||||
{
|
||||
$proc = $keep_waiting_proc;
|
||||
# Also check if timer has expired, if so cancel waiting
|
||||
if ( has_expired($test_timeout) )
|
||||
{
|
||||
$keep_waiting_proc = 0;
|
||||
%keep_waiting_proc = ();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! $keep_waiting_proc)
|
||||
if (!%keep_waiting_proc && !$proc)
|
||||
{
|
||||
if($test_timeout > $print_timeout)
|
||||
if ($test_timeout > $print_timeout)
|
||||
{
|
||||
$proc= My::SafeProcess->wait_any_timeout($print_timeout);
|
||||
if ( $proc->{timeout} )
|
||||
{
|
||||
#print out that the test is still on
|
||||
mtr_print("Test still running: $tinfo->{name}");
|
||||
#reset the timer
|
||||
$print_timeout= start_timer($print_freq * 60);
|
||||
next;
|
||||
}
|
||||
$proc= My::SafeProcess->wait_any_timeout($print_timeout);
|
||||
if ($proc->{timeout})
|
||||
{
|
||||
#print out that the test is still on
|
||||
mtr_print("Test still running: $tinfo->{name}");
|
||||
#reset the timer
|
||||
$print_timeout= start_timer($print_freq * 60);
|
||||
next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$proc= My::SafeProcess->wait_any_timeout($test_timeout);
|
||||
$proc= My::SafeProcess->wait_any_timeout($test_timeout);
|
||||
}
|
||||
}
|
||||
|
||||
# Will be restored if we need to keep waiting
|
||||
$keep_waiting_proc = 0;
|
||||
|
||||
unless ( defined $proc )
|
||||
{
|
||||
mtr_error("wait_any failed");
|
||||
}
|
||||
mtr_verbose("Got $proc");
|
||||
|
||||
mark_time_used('test');
|
||||
# ----------------------------------------------------
|
||||
# Was it the test program that exited
|
||||
# ----------------------------------------------------
|
||||
if ($proc eq $test)
|
||||
if ($proc and $proc eq $test) # mysqltest itself exited
|
||||
{
|
||||
my $res= $test->exit_status();
|
||||
|
||||
|
@ -4065,12 +4051,12 @@ sub run_testcase ($$) {
|
|||
|
||||
if ( $res == 0 )
|
||||
{
|
||||
my $check_res;
|
||||
if ( $opt_check_testcases and
|
||||
$check_res= check_testcase($tinfo, "after"))
|
||||
{
|
||||
if ($check_res == 1) {
|
||||
# Test case had sideeffects, not fatal error, just continue
|
||||
my $check_res;
|
||||
if ( $opt_check_testcases and
|
||||
$check_res= check_testcase($tinfo, "after"))
|
||||
{
|
||||
if ($check_res == 1) {
|
||||
# Test case had sideeffects, not fatal error, just continue
|
||||
if ($opt_warnings) {
|
||||
# Checking error logs for warnings, so need to stop server
|
||||
# gracefully so that memory leaks etc. can be properly detected.
|
||||
|
@ -4081,93 +4067,110 @@ sub run_testcase ($$) {
|
|||
# test.
|
||||
} else {
|
||||
# Not checking warnings, so can do a hard shutdown.
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
mtr_report("Resuming tests...\n");
|
||||
resfile_output($tinfo->{'check'}) if $opt_resfile;
|
||||
}
|
||||
else {
|
||||
# Test case check failed fatally, probably a server crashed
|
||||
report_failure_and_restart($tinfo);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
mtr_report_test_passed($tinfo);
|
||||
mtr_report("Resuming tests...\n");
|
||||
resfile_output($tinfo->{'check'}) if $opt_resfile;
|
||||
}
|
||||
else {
|
||||
# Test case check failed fatally, probably a server crashed
|
||||
report_failure_and_restart($tinfo);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
mtr_report_test_passed($tinfo);
|
||||
}
|
||||
elsif ( $res == 62 )
|
||||
{
|
||||
# Testcase itself tell us to skip this one
|
||||
$tinfo->{skip_detected_by_test}= 1;
|
||||
# Try to get reason from test log file
|
||||
find_testcase_skipped_reason($tinfo);
|
||||
mtr_report_test_skipped($tinfo);
|
||||
# Restart if skipped due to missing perl, it may have had side effects
|
||||
if ( $tinfo->{'comment'} =~ /^perl not found/ )
|
||||
{
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
# Testcase itself tell us to skip this one
|
||||
$tinfo->{skip_detected_by_test}= 1;
|
||||
# Try to get reason from test log file
|
||||
find_testcase_skipped_reason($tinfo);
|
||||
mtr_report_test_skipped($tinfo);
|
||||
# Restart if skipped due to missing perl, it may have had side effects
|
||||
if ( $tinfo->{'comment'} =~ /^perl not found/ )
|
||||
{
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
}
|
||||
elsif ( $res == 65 )
|
||||
{
|
||||
# Testprogram killed by signal
|
||||
$tinfo->{comment}=
|
||||
"testprogram crashed(returned code $res)";
|
||||
report_failure_and_restart($tinfo);
|
||||
# Testprogram killed by signal
|
||||
$tinfo->{comment}=
|
||||
"testprogram crashed(returned code $res)";
|
||||
report_failure_and_restart($tinfo);
|
||||
}
|
||||
elsif ( $res == 1 )
|
||||
{
|
||||
# Check if the test tool requests that
|
||||
# an analyze script should be run
|
||||
my $analyze= find_analyze_request();
|
||||
if ($analyze){
|
||||
run_on_all($tinfo, "analyze-$analyze");
|
||||
}
|
||||
# Check if the test tool requests that
|
||||
# an analyze script should be run
|
||||
my $analyze= find_analyze_request();
|
||||
if ($analyze){
|
||||
run_on_all($tinfo, "analyze-$analyze");
|
||||
}
|
||||
|
||||
# Wait a bit and see if a server died, if so report that instead
|
||||
mtr_milli_sleep(100);
|
||||
my $srvproc= My::SafeProcess::check_any();
|
||||
if ($srvproc && grep($srvproc eq $_, started(all_servers()))) {
|
||||
$proc= $srvproc;
|
||||
goto SRVDIED;
|
||||
}
|
||||
# Wait a bit and see if a server died, if so report that instead
|
||||
mtr_milli_sleep(100);
|
||||
my $srvproc= My::SafeProcess::check_any();
|
||||
if ($srvproc && grep($srvproc eq $_, started(all_servers()))) {
|
||||
$proc= $srvproc;
|
||||
goto SRVDIED;
|
||||
}
|
||||
|
||||
# Test case failure reported by mysqltest
|
||||
report_failure_and_restart($tinfo);
|
||||
# Test case failure reported by mysqltest
|
||||
report_failure_and_restart($tinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
# mysqltest failed, probably crashed
|
||||
$tinfo->{comment}=
|
||||
"mysqltest failed with unexpected return code $res\n";
|
||||
report_failure_and_restart($tinfo);
|
||||
# mysqltest failed, probably crashed
|
||||
$tinfo->{comment}=
|
||||
"mysqltest failed with unexpected return code $res\n";
|
||||
report_failure_and_restart($tinfo);
|
||||
}
|
||||
|
||||
# Save info from this testcase run to mysqltest.log
|
||||
if( -f $path_current_testlog)
|
||||
{
|
||||
if ($opt_resfile && $res && $res != 62) {
|
||||
resfile_output_file($path_current_testlog);
|
||||
}
|
||||
mtr_appendfile_to_file($path_current_testlog, $path_testlog);
|
||||
unlink($path_current_testlog);
|
||||
if ($opt_resfile && $res && $res != 62) {
|
||||
resfile_output_file($path_current_testlog);
|
||||
}
|
||||
mtr_appendfile_to_file($path_current_testlog, $path_testlog);
|
||||
unlink($path_current_testlog);
|
||||
}
|
||||
|
||||
return ($res == 62) ? 0 : $res;
|
||||
|
||||
}
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Check if it was an expected crash
|
||||
# ----------------------------------------------------
|
||||
my $check_crash = check_expected_crash_and_restart($proc);
|
||||
if ($check_crash)
|
||||
if ($proc)
|
||||
{
|
||||
# Keep waiting if it returned 2, if 1 don't wait or stop waiting.
|
||||
$keep_waiting_proc = 0 if $check_crash == 1;
|
||||
$keep_waiting_proc = $proc if $check_crash == 2;
|
||||
next;
|
||||
# It was not mysqltest that exited, add to a wait-to-be-started-again list.
|
||||
$keep_waiting_proc{$proc} = 1;
|
||||
}
|
||||
|
||||
mtr_verbose("Got " . join(",", keys(%keep_waiting_proc)));
|
||||
|
||||
mark_time_used('test');
|
||||
foreach my $wait_for_proc (keys(%keep_waiting_proc)) {
|
||||
# ----------------------------------------------------
|
||||
# Check if it was an expected crash
|
||||
# ----------------------------------------------------
|
||||
my $check_crash = check_expected_crash_and_restart($wait_for_proc);
|
||||
if ($check_crash == 0) # unexpected exit/crash of $wait_for_proc
|
||||
{
|
||||
goto SRVDIED;
|
||||
}
|
||||
elsif ($check_crash == 1) # $wait_for_proc was started again by check_expected_crash_and_restart()
|
||||
{
|
||||
delete $keep_waiting_proc{$wait_for_proc};
|
||||
}
|
||||
elsif ($check_crash == 2) # we must keep waiting
|
||||
{
|
||||
# do nothing
|
||||
}
|
||||
}
|
||||
|
||||
next;
|
||||
|
||||
SRVDIED:
|
||||
# ----------------------------------------------------
|
||||
# Stop the test case timer
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
-- source include/have_log_bin.inc
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_debug.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
|
|
|
@ -24,14 +24,11 @@ galera_gcache_recover : MDEV-13549 Galera test failures
|
|||
galera_gcache_recover_full_gcache : MDEV-13549 Galera test failures
|
||||
galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
|
||||
galera_ssl_upgrade : MDEV-13549 Galera test failures
|
||||
galera.MW-329 : wsrep_local_replays not stable
|
||||
galera.MW-328A : have_deadlocks test not stable
|
||||
query_cache : MDEV-15805 Test failure on galera.query_cache
|
||||
MW-329 : wsrep_local_replays not stable
|
||||
MW-416 : MDEV-13549 Galera test failures
|
||||
galera_wan : MDEV-13549 Galera test failures
|
||||
MW-388 : MDEV-13549 Galera test failures
|
||||
galera.MW-44 : MDEV-15809 Test failure on galera.MW-44
|
||||
galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
|
||||
MW-44 : MDEV-15809 Test failure on galera.MW-44
|
||||
galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
|
||||
galera_kill_applier : race condition at the start of the test
|
||||
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
|
||||
pxc-421: Lock timeout exceeded
|
||||
|
@ -41,5 +38,12 @@ MW-328C : Timeouts
|
|||
galera_gcs_fc_limit : Timeouts
|
||||
pool_of_threads: WSREP has not yet prepared node for application use
|
||||
galera_var_innodb_disallow_writes : Timeout
|
||||
galera.galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl
|
||||
MW-336 : nondeterministic wsrep_thread_count
|
||||
galera_binlog_stmt_autoinc : MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc
|
||||
galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl
|
||||
galera_var_node_address : MDEV-17151 Galera test failure on galera.galera_var_node_address
|
||||
galera_binlog_stmt_autoinc: MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc
|
||||
galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit
|
||||
partition : MDEV-13881 galera.partition failed in buildbot with wrong result
|
||||
galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion
|
||||
galera_wan : MDEV-17259: Test failure on galera.galera_wan
|
||||
|
|
11
mysql-test/suite/galera/include/reset_query_cache.inc
Normal file
11
mysql-test/suite/galera/include/reset_query_cache.inc
Normal file
|
@ -0,0 +1,11 @@
|
|||
--disable_query_log
|
||||
--disable_result_log
|
||||
--connection node_1
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
|
||||
--connection node_2
|
||||
flush query cache;
|
||||
reset query cache;
|
||||
--enable_result_log
|
||||
--enable_query_log
|
|
@ -1,13 +1,15 @@
|
|||
CREATE TABLE ten (f1 INTEGER);
|
||||
connection node_1;
|
||||
CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
|
||||
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
|
||||
INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
|
||||
connection node_2;
|
||||
SET GLOBAL wsrep_desync = TRUE;
|
||||
SET wsrep_on = FALSE;
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (f1);
|
||||
ERROR 70100: Query execution was interrupted
|
||||
SET wsrep_on = TRUE;
|
||||
SET GLOBAL wsrep_desync = FALSE;
|
||||
connection node_1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE ten;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
INSERT INTO t1 values(0);
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
<<<<<<< HEAD
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
COUNT(*)
|
||||
11
|
||||
|
@ -20,11 +22,23 @@ INSERT INTO t1 VALUES (1);
|
|||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
=======
|
||||
# Wait 10 slave threads to start 1
|
||||
connection node_2;
|
||||
# Generate 12 replication events
|
||||
>>>>>>> 10.2
|
||||
connection node_1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
13
|
||||
# Wait 9 slave threads to exit 1
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
# Wait 10 slave threads to start 2
|
||||
SET GLOBAL wsrep_slave_threads = 20;
|
||||
# Wait 20 slave threads to start 3
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_2;
|
||||
<<<<<<< HEAD
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
@ -46,11 +60,21 @@ INSERT INTO t1 VALUES (1);
|
|||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
=======
|
||||
# Generate 40 replication events
|
||||
connection node_1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
53
|
||||
# Wait 10 slave threads to exit 3
|
||||
>>>>>>> 10.2
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
|
||||
# Wait 10 slave threads to start 3
|
||||
connection node_2;
|
||||
<<<<<<< HEAD
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
@ -97,4 +121,13 @@ INSERT INTO t1 VALUES (1);
|
|||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_1;
|
||||
=======
|
||||
# Generate 12 replication events
|
||||
connection node_1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
65
|
||||
# Wait 10 slave threads to exit 4
|
||||
connection node_1;
|
||||
>>>>>>> 10.2
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
SET GLOBAL general_log='OFF';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
SET GLOBAL general_log='OFF';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
SELECT Argument FROM mysql.general_log;
|
||||
Argument
|
||||
SET GLOBAL general_log='ON';
|
||||
SELECT argument from mysql.general_log WHERE argument NOT LIKE 'SELECT%';
|
||||
argument
|
||||
SET SESSION wsrep_osu_method=TOI;
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
SET SESSION wsrep_osu_method=RSU;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET SESSION wsrep_osu_method=TOI;
|
||||
SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SET GLOBAL general_log='ON';
|
||||
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
|
||||
COUNT(*) = 0
|
||||
1
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
|
||||
argument
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
SELECT Argument FROM mysql.general_log;
|
||||
Argument
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL general_log='OFF';
|
||||
SET GLOBAL general_log='OFF';
|
||||
|
|
8
mysql-test/suite/galera/r/galera#505.result
Normal file
8
mysql-test/suite/galera/r/galera#505.result
Normal file
|
@ -0,0 +1,8 @@
|
|||
connection node_1;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SET SESSION wsrep_sync_wait=DEFAULT;
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
|
||||
SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
|
||||
Variable_name Value
|
||||
wsrep_provider_options pc.weight = 3
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
|
147
mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result
Normal file
147
mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result
Normal file
|
@ -0,0 +1,147 @@
|
|||
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
|
||||
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
insert into t1(i) values(null);
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
5 dummy_text
|
||||
7 dummy_text
|
||||
9 dummy_text
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
5 dummy_text
|
||||
7 dummy_text
|
||||
9 dummy_text
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
drop table t1;
|
||||
SET SESSION binlog_format='STATEMENT';
|
||||
show variables like 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format STATEMENT
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
SET SESSION auto_increment_increment = 3;
|
||||
SET SESSION auto_increment_offset = 1;
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
insert into t1(i) values(null);
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
7 dummy_text
|
||||
10 dummy_text
|
||||
13 dummy_text
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
7 dummy_text
|
||||
10 dummy_text
|
||||
13 dummy_text
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
SET SESSION binlog_format='ROW';
|
||||
show variables like 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
show variables like '%auto_increment%';
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 1
|
||||
wsrep_auto_increment_control ON
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
show variables like '%auto_increment%';
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 1
|
||||
wsrep_auto_increment_control OFF
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
drop table t1;
|
||||
SET GLOBAL wsrep_forced_binlog_format='ROW';
|
||||
SET GLOBAL wsrep_forced_binlog_format='ROW';
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
insert into t1(i) values(null);
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
5 dummy_text
|
||||
7 dummy_text
|
||||
9 dummy_text
|
||||
select * from t1;
|
||||
i c
|
||||
3 dummy_text
|
||||
5 dummy_text
|
||||
7 dummy_text
|
||||
9 dummy_text
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
drop table t1;
|
||||
SET SESSION binlog_format='ROW';
|
||||
show variables like 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
SET SESSION auto_increment_increment = 3;
|
||||
SET SESSION auto_increment_offset = 1;
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
insert into t1(i) values(null);
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
7 dummy_text
|
||||
10 dummy_text
|
||||
13 dummy_text
|
||||
select * from t1;
|
||||
i c
|
||||
4 dummy_text
|
||||
7 dummy_text
|
||||
10 dummy_text
|
||||
13 dummy_text
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
show variables like 'binlog_format';
|
||||
Variable_name Value
|
||||
binlog_format ROW
|
||||
show variables like '%auto_increment%';
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 1
|
||||
wsrep_auto_increment_control ON
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
show variables like '%auto_increment%';
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 1
|
||||
wsrep_auto_increment_control OFF
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
drop table t1;
|
|
@ -53,71 +53,3 @@ WSREP_SST_DONOR_REJECTS_QUERIES OFF
|
|||
WSREP_SST_METHOD rsync
|
||||
WSREP_SYNC_WAIT 15
|
||||
<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; <REPL_PROTO_MAX>;socket.checksum = 2; socket.recv_buf_size = 212992;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
|
||||
COUNT(*)
|
||||
58
|
||||
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
|
||||
ORDER BY VARIABLE_NAME;
|
||||
VARIABLE_NAME
|
||||
WSREP_APPLY_OOOE
|
||||
WSREP_APPLY_OOOL
|
||||
WSREP_APPLY_WINDOW
|
||||
WSREP_CAUSAL_READS
|
||||
WSREP_CERT_DEPS_DISTANCE
|
||||
WSREP_CERT_INDEX_SIZE
|
||||
WSREP_CERT_INTERVAL
|
||||
WSREP_CLUSTER_CONF_ID
|
||||
WSREP_CLUSTER_SIZE
|
||||
WSREP_CLUSTER_STATE_UUID
|
||||
WSREP_CLUSTER_STATUS
|
||||
WSREP_COMMIT_OOOE
|
||||
WSREP_COMMIT_OOOL
|
||||
WSREP_COMMIT_WINDOW
|
||||
WSREP_CONNECTED
|
||||
WSREP_DESYNC_COUNT
|
||||
WSREP_EVS_DELAYED
|
||||
WSREP_EVS_EVICT_LIST
|
||||
WSREP_EVS_REPL_LATENCY
|
||||
WSREP_EVS_STATE
|
||||
WSREP_FLOW_CONTROL_PAUSED
|
||||
WSREP_FLOW_CONTROL_PAUSED_NS
|
||||
WSREP_FLOW_CONTROL_RECV
|
||||
WSREP_FLOW_CONTROL_SENT
|
||||
WSREP_GCOMM_UUID
|
||||
WSREP_INCOMING_ADDRESSES
|
||||
WSREP_LAST_COMMITTED
|
||||
WSREP_LOCAL_BF_ABORTS
|
||||
WSREP_LOCAL_CACHED_DOWNTO
|
||||
WSREP_LOCAL_CERT_FAILURES
|
||||
WSREP_LOCAL_COMMITS
|
||||
WSREP_LOCAL_INDEX
|
||||
WSREP_LOCAL_RECV_QUEUE
|
||||
WSREP_LOCAL_RECV_QUEUE_AVG
|
||||
WSREP_LOCAL_RECV_QUEUE_MAX
|
||||
WSREP_LOCAL_RECV_QUEUE_MIN
|
||||
WSREP_LOCAL_REPLAYS
|
||||
WSREP_LOCAL_SEND_QUEUE
|
||||
WSREP_LOCAL_SEND_QUEUE_AVG
|
||||
WSREP_LOCAL_SEND_QUEUE_MAX
|
||||
WSREP_LOCAL_SEND_QUEUE_MIN
|
||||
WSREP_LOCAL_STATE
|
||||
WSREP_LOCAL_STATE_COMMENT
|
||||
WSREP_LOCAL_STATE_UUID
|
||||
WSREP_PROTOCOL_VERSION
|
||||
WSREP_PROVIDER_NAME
|
||||
WSREP_PROVIDER_VENDOR
|
||||
WSREP_PROVIDER_VERSION
|
||||
WSREP_READY
|
||||
WSREP_RECEIVED
|
||||
WSREP_RECEIVED_BYTES
|
||||
WSREP_REPLICATED
|
||||
WSREP_REPLICATED_BYTES
|
||||
WSREP_REPL_DATA_BYTES
|
||||
WSREP_REPL_KEYS
|
||||
WSREP_REPL_KEYS_BYTES
|
||||
WSREP_REPL_OTHER_BYTES
|
||||
WSREP_THREAD_COUNT
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
--- r/galera_ist_innodb_flush_logs.result 2018-09-05 10:34:36.192439933 +0300
|
||||
+++ r/galera_ist_innodb_flush_logs.reject 2018-09-17 10:20:06.039150838 +0300
|
||||
@@ -86,3 +86,100 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+Performing --wsrep-recover ...
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
|
@ -86,99 +86,3 @@ COUNT(*) = 0
|
|||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug = 'd,sync.alter_opened_table';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
|
|
106
mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff
Normal file
106
mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff
Normal file
|
@ -0,0 +1,106 @@
|
|||
--- r/galera_ist_mysqldump.result 2018-09-11 12:38:42.027479411 +0300
|
||||
+++ r/galera_ist_mysqldump.reject 2018-09-17 10:28:44.483441364 +0300
|
||||
@@ -180,6 +180,103 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+Performing --wsrep-recover ...
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
||||
DROP USER sst;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
|
@ -7,6 +7,7 @@ GRANT ALL PRIVILEGES ON *.* TO 'sst';
|
|||
SET GLOBAL wsrep_sst_auth = 'sst:';
|
||||
connection node_2;
|
||||
SET GLOBAL wsrep_sst_method = 'mysqldump';
|
||||
call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*");
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
|
@ -199,114 +200,6 @@ COUNT(*) = 0
|
|||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
connection node_2;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
connection node_1;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
connection node_2;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave_ddl;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SET GLOBAL debug_dbug = $debug_orig;
|
||||
connection node_1;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
||||
DROP USER sst;
|
||||
|
|
103
mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff
Normal file
103
mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff
Normal file
|
@ -0,0 +1,103 @@
|
|||
--- r/galera_ist_rsync.result 2018-09-11 12:38:42.027479411 +0300
|
||||
+++ r/galera_ist_rsync.reject 2018-09-17 10:50:16.527307668 +0300
|
||||
@@ -259,3 +259,100 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+Performing --wsrep-recover ...
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
|
@ -285,111 +285,3 @@ COUNT(*) = 0
|
|||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
connection node_2;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
connection node_1;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
connection node_2;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave_ddl;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SET GLOBAL debug_dbug = $debug_orig;
|
||||
|
|
103
mysql-test/suite/galera/r/galera_ist_xtrabackup-v2,debug.rdiff
Normal file
103
mysql-test/suite/galera/r/galera_ist_xtrabackup-v2,debug.rdiff
Normal file
|
@ -0,0 +1,103 @@
|
|||
--- r/galera_ist_xtrabackup-v2.result 2018-09-05 10:34:36.192439933 +0300
|
||||
+++ r/galera_ist_xtrabackup-v2.reject 2018-09-17 11:13:33.395264800 +0300
|
||||
@@ -259,3 +259,100 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+Performing --wsrep-recover ...
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
|
@ -259,99 +259,3 @@ COUNT(*) = 0
|
|||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug = 'd,sync.alter_opened_table';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
|
||||
CREATE TABLE ten (f1 INTEGER);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
|
114
mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
Normal file
114
mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
Normal file
|
@ -0,0 +1,114 @@
|
|||
--- suite/galera/r/galera_sst_rsync2.result 2018-09-12 13:09:35.352229478 +0200
|
||||
+++ suite/galera/r/galera_sst_rsync2,debug.reject 2018-09-12 17:00:51.601974979 +0200
|
||||
@@ -286,3 +286,111 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
288
mysql-test/suite/galera/r/galera_sst_rsync2.result
Normal file
288
mysql-test/suite/galera/r/galera_sst_rsync2.result
Normal file
|
@ -0,0 +1,288 @@
|
|||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_shutdown_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that starts from a clean var directory
|
||||
This is accomplished by shutting down node #2 and removing its var directory before restarting it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_clean_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
114
mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff
Normal file
114
mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff
Normal file
|
@ -0,0 +1,114 @@
|
|||
--- suite/galera/r/galera_sst_rsync_data_dir.result 2018-09-13 14:52:50.848220719 +0200
|
||||
+++ suite/galera/r/galera_sst_rsync_data_dir.reject 2018-09-13 15:03:32.339135247 +0200
|
||||
@@ -286,3 +286,111 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
|
@ -0,0 +1,262 @@
|
|||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that starts from a clean var directory
|
||||
This is accomplished by shutting down node #2 and removing its var directory before restarting it
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
Cleaning var directory ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Killing server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
|
@ -7,9 +7,11 @@ disconnect node_2;
|
|||
connection node_1;
|
||||
Suspending node_2 ...
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET SESSION wsrep_sync_wait = 15;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
Got one of the listed errors
|
||||
Resuming node_2 ...
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2a;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
|
|
|
@ -4,6 +4,8 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
connection node_2;
|
||||
SET SESSION wsrep_retry_autocommit = 0;
|
||||
INSERT INTO t1(f1) SELECT 1 FROM ten as a1, ten AS a2;
|
||||
set debug_sync='ha_commit_trans_after_prepare WAIT_FOR go';
|
||||
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
|
||||
connection node_1;
|
||||
TRUNCATE TABLE t1;;
|
||||
|
|
|
@ -8,7 +8,7 @@ CREATE TABLE `table with space` (
|
|||
`column with space` INTEGER AUTO_INCREMENT PRIMARY KEY,
|
||||
`second column with space` INTEGER,
|
||||
UNIQUE `index name with space` (`second column with space`)
|
||||
);
|
||||
) engine=innodb;
|
||||
INSERT INTO `table with space` VALUES (1, 1);
|
||||
CREATE DATABASE `база`;
|
||||
USE `база`;
|
||||
|
@ -16,7 +16,7 @@ CREATE TABLE `таблица` (
|
|||
`първа_колона` INTEGER PRIMARY KEY,
|
||||
`втора_колона` INTEGER,
|
||||
UNIQUE `индекс` (`втора_колона`)
|
||||
);
|
||||
) engine=innodb;
|
||||
INSERT INTO `таблица` VALUES (1, 1);
|
||||
CREATE DATABASE `втора база`;
|
||||
USE `втора база`;
|
||||
|
@ -24,7 +24,7 @@ CREATE TABLE `втора таблица` (
|
|||
`първа колона` INTEGER,
|
||||
`втора колона` INTEGER,
|
||||
KEY `първи индекс` (`първа колона`)
|
||||
);
|
||||
) engine=innodb;
|
||||
INSERT INTO `втора таблица` VALUES (1, 1);
|
||||
connection node_2;
|
||||
USE `database with space`;
|
||||
|
|
|
@ -5,7 +5,7 @@ SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
|
|||
VARIABLE_VALUE = 4
|
||||
1
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
|
|
|
@ -20,72 +20,11 @@ SET GLOBAL wsrep_slave_threads = 64;
|
|||
connection node_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 1 FROM t1;
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_1;
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
CALL mtr.add_suppression("WSREP: Stray state UUID msg:.*");
|
||||
CALL mtr.add_suppression("WSREP: Sending JOIN failed:.*");
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 4
|
||||
1
|
||||
|
@ -6,7 +10,6 @@ CREATE TABLE t1 (f1 INTEGER);
|
|||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connection node_3;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection node_4;
|
||||
SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_provider_options';
|
||||
|
@ -16,4 +19,3 @@ SELECT COUNT(*) = 1 FROM t1;
|
|||
COUNT(*) = 1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
|
||||
|
|
111
mysql-test/suite/galera/r/mysql-wsrep#332.result
Normal file
111
mysql-test/suite/galera/r/mysql-wsrep#332.result
Normal file
|
@ -0,0 +1,111 @@
|
|||
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
|
||||
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
|
||||
INSERT INTO p VALUES (1, 0);
|
||||
INSERT INTO p VALUES (2, 0);
|
||||
INSERT INTO c VALUES (1, 1);
|
||||
INSERT INTO c VALUES (2, 2);
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
UPDATE p SET f1 = f1 + 100;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1);
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
|
||||
COMMIT;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
SELECT * FROM p;
|
||||
f1 f2
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM c;
|
||||
f1 p_id
|
||||
1 1
|
||||
2 2
|
||||
DROP TABLE c;
|
||||
DROP TABLE p;
|
||||
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
|
||||
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
|
||||
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
|
||||
INSERT INTO p1 VALUES (1, 0), (2, 0);
|
||||
INSERT INTO p2 VALUES (1, 0), (2, 0);
|
||||
INSERT INTO c VALUES (1, 1, 1);
|
||||
INSERT INTO c VALUES (2, 2, 2);
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
UPDATE p1 SET f1 = f1 + 100;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
|
||||
COMMIT;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
SELECT * FROM p1;
|
||||
f1 f2
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM p2;
|
||||
f1 f2
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM c;
|
||||
f1 p_id1 p_id2
|
||||
1 1 1
|
||||
2 2 2
|
||||
DROP TABLE c;
|
||||
DROP TABLE p1;
|
||||
DROP TABLE p2;
|
||||
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
|
||||
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
|
||||
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
|
||||
INSERT INTO p1 VALUES (1, 0), (2, 0);
|
||||
INSERT INTO p2 VALUES (1, 0), (2, 0);
|
||||
INSERT INTO c VALUES (1, 1, 1);
|
||||
INSERT INTO c VALUES (2, 2, 2);
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
UPDATE p2 SET f1 = f1 + 100;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
|
||||
COMMIT;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
SELECT * FROM p1;
|
||||
f1 f2
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM p2;
|
||||
f1 f2
|
||||
1 0
|
||||
2 0
|
||||
SELECT * FROM c;
|
||||
f1 p_id1 p_id2
|
||||
1 1 1
|
||||
2 2 2
|
||||
DROP TABLE c;
|
||||
DROP TABLE p1;
|
||||
DROP TABLE p2;
|
|
@ -421,24 +421,6 @@ Qcache_queries_in_cache 1
|
|||
set query_cache_type=on;
|
||||
# On node-1
|
||||
connection node_1;
|
||||
reset query cache;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 4
|
||||
# On node-2
|
||||
connection node_2;
|
||||
reset query cache;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 3
|
||||
# On node-1
|
||||
connection node_1;
|
||||
select sql_no_cache * from t1;
|
||||
a
|
||||
1
|
||||
|
@ -1318,9 +1300,6 @@ Qcache_queries_in_cache 0
|
|||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 12
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
70
|
||||
# On node-2
|
||||
connection node_2;
|
||||
select count(*) from t1;
|
||||
|
@ -1328,7 +1307,7 @@ count(*)
|
|||
70
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
Qcache_queries_in_cache 2
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 11
|
||||
|
@ -1515,7 +1494,7 @@ Variable_name Value
|
|||
Qcache_hits 11
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 34
|
||||
Qcache_inserts 35
|
||||
unlock table;
|
||||
drop view v1;
|
||||
set query_cache_wlock_invalidate=default;
|
||||
|
@ -1626,7 +1605,7 @@ Variable_name Value
|
|||
Qcache_hits 11
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 36
|
||||
Qcache_inserts 37
|
||||
set character_set_client=cp1251;
|
||||
SELECT a,'Â','â'='Â' FROM t1;
|
||||
a ?? '??'='?‚'
|
||||
|
@ -1640,7 +1619,7 @@ Variable_name Value
|
|||
Qcache_hits 11
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 37
|
||||
Qcache_inserts 38
|
||||
set character_set_results=cp1251;
|
||||
SELECT a,'Â','â'='Â' FROM t1;
|
||||
a � 'â'='Â'
|
||||
|
@ -1654,7 +1633,7 @@ Variable_name Value
|
|||
Qcache_hits 11
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 38
|
||||
Qcache_inserts 39
|
||||
drop table t1;
|
||||
#
|
||||
# Comments before command
|
||||
|
@ -1665,9 +1644,6 @@ create table t1 (a int) engine=innodb;
|
|||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 46
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 12
|
||||
|
@ -1678,9 +1654,6 @@ a
|
|||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 47
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 13
|
||||
|
@ -1689,9 +1662,6 @@ connection node_2;
|
|||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 38
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 11
|
||||
|
@ -1702,9 +1672,6 @@ a
|
|||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
show status like "Qcache_inserts";
|
||||
Variable_name Value
|
||||
Qcache_inserts 39
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 12
|
||||
|
|
|
@ -81,6 +81,8 @@ push @::global_suppressions,
|
|||
qr|WSREP: .*core_handle_uuid_msg.*|,
|
||||
qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
|
||||
qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|,
|
||||
qr(WSREP: Failed to remove page file .*),
|
||||
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
|
||||
);
|
||||
|
||||
$ENV{PATH}="$epath:$ENV{PATH}";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
--source include/big_test.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE ten (f1 INTEGER);
|
||||
CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
|
||||
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
|
@ -22,11 +22,13 @@ INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3
|
|||
SET GLOBAL wsrep_desync = TRUE;
|
||||
SET wsrep_on = FALSE;
|
||||
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
--error 0,ER_QUERY_INTERRUPTED
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (f1);
|
||||
|
||||
SET wsrep_on = TRUE;
|
||||
SET GLOBAL wsrep_desync = FALSE;
|
||||
|
||||
--connection node_1
|
||||
reap;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE ten;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# a success was reported.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# gets the deadlock error
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# masks all deadlock errors
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
--log-output=TABLE
|
||||
--general-log=OFF
|
||||
|
|
|
@ -6,33 +6,37 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL general_log='OFF';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sleep 1
|
||||
--connection node_2
|
||||
SET GLOBAL general_log='OFF';
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log;
|
||||
--source include/wait_condition.inc
|
||||
TRUNCATE TABLE mysql.general_log;
|
||||
|
||||
--sleep 1
|
||||
--connection node_1
|
||||
SET GLOBAL general_log='ON';
|
||||
SELECT argument from mysql.general_log WHERE argument NOT LIKE 'SELECT%';
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log;
|
||||
--source include/wait_condition.inc
|
||||
SELECT Argument FROM mysql.general_log;
|
||||
|
||||
SET GLOBAL general_log='ON';
|
||||
SET SESSION wsrep_osu_method=TOI;
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
SET SESSION wsrep_osu_method=RSU;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET SESSION wsrep_osu_method=TOI;
|
||||
|
||||
SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
|
||||
--let $wait_condition = SELECT COUNT(argument) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
|
||||
|
||||
--connection node_2
|
||||
SET GLOBAL general_log='ON';
|
||||
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
|
||||
SELECT Argument FROM mysql.general_log;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL general_log='OFF';
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL general_log='OFF';
|
||||
|
||||
|
|
26
mysql-test/suite/galera/t/galera#505.test
Normal file
26
mysql-test/suite/galera/t/galera#505.test
Normal file
|
@ -0,0 +1,26 @@
|
|||
# galera#505 - Change of pc.weight wsrep param will be correctly stored in wsrep_provider_options variable
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
--connection node_1
|
||||
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
--disable_result_log
|
||||
--disable_query_log
|
||||
--let $galera_version=25.3.24
|
||||
source ../../wsrep/include/check_galera_version.inc;
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
SET SESSION wsrep_sync_wait=DEFAULT;
|
||||
|
||||
# Convert "... pc.weight = N; ..." to "N; ..."
|
||||
--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('pc.weight =', @@wsrep_provider_options) + LENGTH('pc.weight = '))`
|
||||
# Convert "N; ..." to "N"
|
||||
--let $pc_weight_value = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)`
|
||||
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
|
||||
|
||||
-- replace_regex /.*(pc\.weight = [0-9]+);.*/\1/
|
||||
SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
|
||||
|
||||
--eval SET GLOBAL wsrep_provider_options = 'pc.weight=$pc_weight_value'
|
230
mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test
Normal file
230
mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test
Normal file
|
@ -0,0 +1,230 @@
|
|||
##
|
||||
## Tests the auto-increment with binlog in STATEMENT mode.
|
||||
##
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
##
|
||||
## Verify the correct operation of the auto-increment when the binlog
|
||||
## format artificially set to the 'STATEMENT' (although this mode is
|
||||
## not recommended in the current version):
|
||||
##
|
||||
|
||||
--connection node_2
|
||||
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
insert into t1(i) values(null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
select * from t1;
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
|
||||
--connection node_1
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
|
||||
drop table t1;
|
||||
|
||||
##
|
||||
## Check the operation when the automatic control over the auto-increment
|
||||
## settings is switched off, that is, when we use the increment step and
|
||||
## the offset specified by the user. In the current session, the binlog
|
||||
## format is set to 'STATEMENT'. It is important that the values of the
|
||||
## auto-increment options does not changed on other node - it allows us
|
||||
## to check the correct transmission of the auto-increment options to
|
||||
## other nodes:
|
||||
##
|
||||
|
||||
--disable_warnings
|
||||
SET SESSION binlog_format='STATEMENT';
|
||||
--enable_warnings
|
||||
|
||||
show variables like 'binlog_format';
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
|
||||
SET SESSION auto_increment_increment = 3;
|
||||
SET SESSION auto_increment_offset = 1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
insert into t1(i) values(null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_1
|
||||
|
||||
##
|
||||
## Verify the return to automatic calculation of the step
|
||||
## and offset of the auto-increment:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
|
||||
SET SESSION binlog_format='ROW';
|
||||
|
||||
show variables like 'binlog_format';
|
||||
show variables like '%auto_increment%';
|
||||
|
||||
##
|
||||
## Verify the recovery of original user-defined values after
|
||||
## stopping the automatic control over auto-increment:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
|
||||
show variables like '%auto_increment%';
|
||||
|
||||
##
|
||||
## Restore original options and drop test table:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
|
||||
drop table t1;
|
||||
|
||||
##
|
||||
## Verify the correct operation of the auto-increment when the binlog
|
||||
## format set to the 'ROW':
|
||||
##
|
||||
|
||||
--connection node_2
|
||||
SET GLOBAL wsrep_forced_binlog_format='ROW';
|
||||
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_forced_binlog_format='ROW';
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
insert into t1(i) values(null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
select * from t1;
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
|
||||
--connection node_1
|
||||
|
||||
SET GLOBAL wsrep_forced_binlog_format='none';
|
||||
|
||||
drop table t1;
|
||||
|
||||
##
|
||||
## Check the operation when the automatic control over the auto-increment
|
||||
## settings is switched off, that is, when we use the increment step and
|
||||
## the offset specified by the user. In the current session, the binlog
|
||||
## format is set to 'ROW'. It is important that the values of the
|
||||
## auto-increment options does not changed on other node - it allows us
|
||||
## to check the correct transmission of the auto-increment options to
|
||||
## other nodes:
|
||||
##
|
||||
|
||||
SET SESSION binlog_format='ROW';
|
||||
|
||||
show variables like 'binlog_format';
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
|
||||
SET SESSION auto_increment_increment = 3;
|
||||
SET SESSION auto_increment_offset = 1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
i int(11) NOT NULL AUTO_INCREMENT,
|
||||
c char(32) DEFAULT 'dummy_text',
|
||||
PRIMARY KEY (i)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
insert into t1(i) values(null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
insert into t1(i) values(null), (null), (null);
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
select * from t1;
|
||||
|
||||
--connection node_1
|
||||
|
||||
##
|
||||
## Verify the return to automatic calculation of the step
|
||||
## and offset of the auto-increment:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
|
||||
show variables like 'binlog_format';
|
||||
show variables like '%auto_increment%';
|
||||
|
||||
##
|
||||
## Verify the recovery of original user-defined values after
|
||||
## stopping the automatic control over auto-increment:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='OFF';
|
||||
|
||||
show variables like '%auto_increment%';
|
||||
|
||||
##
|
||||
## Restore original options and drop test table:
|
||||
##
|
||||
|
||||
SET GLOBAL wsrep_auto_increment_control='ON';
|
||||
|
||||
drop table t1;
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
# Make sure that the test is operating on the right version of galera library.
|
||||
--disable_query_log
|
||||
--let $galera_version=3.20
|
||||
--let $galera_version=25.3.20
|
||||
source ../wsrep/include/check_galera_version.inc;
|
||||
--enable_query_log
|
||||
|
||||
|
@ -59,14 +59,3 @@ ORDER BY VARIABLE_NAME;
|
|||
$wsrep_provider_options =~ s/repl.proto_max = .*?;\s*/<REPL_PROTO_MAX>;/sgio;
|
||||
print $wsrep_provider_options."\n";
|
||||
EOF
|
||||
|
||||
# Global Status
|
||||
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
|
||||
|
||||
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
|
||||
ORDER BY VARIABLE_NAME;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
--source suite/galera/include/galera_sst_set_mysqldump.inc
|
||||
|
||||
call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*");
|
||||
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_xtrabackup.inc
|
||||
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--source suite/galera/include/galera_st_disconnect_slave.inc
|
||||
--source suite/galera/include/galera_st_shutdown_slave.inc
|
||||
|
||||
--source suite/galera/include/galera_st_kill_slave.inc
|
||||
--source suite/galera/include/galera_st_kill_slave_ddl.inc
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue