mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@@ -503,7 +503,9 @@ IF(UNIX)
|
||||
ADD_SUBDIRECTORY(man)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(cmake/abi_check.cmake)
|
||||
IF (NOT WITHOUT_ABI_CHECK)
|
||||
INCLUDE(cmake/abi_check.cmake)
|
||||
ENDIF()
|
||||
INCLUDE(cmake/tags.cmake)
|
||||
INCLUDE(for_clients)
|
||||
ADD_SUBDIRECTORY(scripts)
|
||||
|
||||
@@ -148,6 +148,8 @@ static const longlong stop_position_default= (longlong)(~(my_off_t)0);
|
||||
|
||||
static char *start_datetime_str, *stop_datetime_str;
|
||||
static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX;
|
||||
static my_time_t last_processed_datetime= MY_TIME_T_MAX;
|
||||
|
||||
static ulonglong rec_count= 0;
|
||||
static MYSQL* mysql = NULL;
|
||||
static const char* dirname_for_local_load= 0;
|
||||
@@ -1010,6 +1012,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
DBUG_ENTER("process_event");
|
||||
Exit_status retval= OK_CONTINUE;
|
||||
IO_CACHE *const head= &print_event_info->head_cache;
|
||||
my_time_t ev_when= ev->when;
|
||||
|
||||
/* Bypass flashback settings to event */
|
||||
ev->is_flashback= opt_flashback;
|
||||
@@ -1457,6 +1460,7 @@ err:
|
||||
retval= ERROR_STOP;
|
||||
end:
|
||||
rec_count++;
|
||||
last_processed_datetime= ev_when;
|
||||
|
||||
DBUG_PRINT("info", ("end event processing"));
|
||||
/*
|
||||
@@ -2871,7 +2875,6 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
IO_CACHE cache,*file= &cache;
|
||||
uchar tmp_buff[BIN_LOG_HEADER_SIZE];
|
||||
Exit_status retval= OK_CONTINUE;
|
||||
my_time_t last_ev_when= MY_TIME_T_MAX;
|
||||
|
||||
if (logname && strcmp(logname, "-") != 0)
|
||||
{
|
||||
@@ -2977,21 +2980,8 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
"end of input", stop_position);
|
||||
}
|
||||
|
||||
/*
|
||||
Emit a warning in the event that we finished processing input
|
||||
before reaching the boundary indicated by --stop-datetime.
|
||||
*/
|
||||
if (stop_datetime != MY_TIME_T_MAX &&
|
||||
stop_datetime > last_ev_when)
|
||||
{
|
||||
retval = OK_STOP;
|
||||
warning("Did not reach stop datetime '%s' "
|
||||
"before end of input", stop_datetime_str);
|
||||
}
|
||||
|
||||
goto end;
|
||||
}
|
||||
last_ev_when= ev->when;
|
||||
if ((retval= process_event(print_event_info, ev, old_off, logname)) !=
|
||||
OK_CONTINUE)
|
||||
goto end;
|
||||
@@ -3170,6 +3160,11 @@ int main(int argc, char** argv)
|
||||
start_position= BIN_LOG_HEADER_SIZE;
|
||||
}
|
||||
|
||||
if (stop_datetime != MY_TIME_T_MAX &&
|
||||
stop_datetime > last_processed_datetime)
|
||||
warning("Did not reach stop datetime '%s' before end of input",
|
||||
stop_datetime_str);
|
||||
|
||||
/*
|
||||
If enable flashback, need to print the events from the end to the
|
||||
beginning
|
||||
|
||||
@@ -3208,7 +3208,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
|
||||
|
||||
fprintf(sql_file,
|
||||
"SET @saved_cs_client = @@character_set_client;\n"
|
||||
"SET character_set_client = utf8;\n"
|
||||
"SET character_set_client = utf8mb4;\n"
|
||||
"/*!50001 CREATE VIEW %s AS SELECT\n",
|
||||
result_table);
|
||||
|
||||
@@ -3276,7 +3276,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
|
||||
{
|
||||
fprintf(sql_file,
|
||||
"/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
|
||||
"/*!40101 SET character_set_client = utf8 */;\n"
|
||||
"/*!40101 SET character_set_client = utf8mb4 */;\n"
|
||||
"%s%s;\n"
|
||||
"/*!40101 SET character_set_client = @saved_cs_client */;\n",
|
||||
is_log_table ? "CREATE TABLE IF NOT EXISTS " : "",
|
||||
|
||||
@@ -94,13 +94,8 @@ static inline void MY_RELAX_CPU(void)
|
||||
__asm__ __volatile__ ("pause");
|
||||
#endif
|
||||
#elif defined(_ARCH_PWR8)
|
||||
#ifdef __FreeBSD__
|
||||
uint64_t __tb;
|
||||
__asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
|
||||
#else
|
||||
/* Changed from __ppc_get_timebase for musl compatibility */
|
||||
/* Changed from __ppc_get_timebase for musl and clang compatibility */
|
||||
__builtin_ppc_get_timebase();
|
||||
#endif
|
||||
#elif defined __GNUC__ && defined __riscv
|
||||
__builtin_riscv_pause();
|
||||
#elif defined __GNUC__
|
||||
|
||||
@@ -640,6 +640,13 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
|
||||
#endif
|
||||
|
||||
typedef uint64 my_thread_id;
|
||||
/**
|
||||
Long-standing formats (such as the client-server protocol and the binary log)
|
||||
hard-coded `my_thread_id` to 32 bits in practice. (Though not all
|
||||
`thread_id`s are typed as such, @ref my_thread_id itself among those.)
|
||||
@see MDEV-35706
|
||||
*/
|
||||
#define MY_THREAD_ID_MAX UINT32_MAX
|
||||
|
||||
extern void my_threadattr_global_init(void);
|
||||
extern my_bool my_thread_global_init(void);
|
||||
|
||||
@@ -44,7 +44,8 @@ class THD;
|
||||
class Item;
|
||||
#define MYSQL_THD THD*
|
||||
#else
|
||||
#define MYSQL_THD void*
|
||||
struct THD;
|
||||
typedef struct THD* MYSQL_THD;
|
||||
#endif
|
||||
|
||||
typedef char my_bool;
|
||||
|
||||
@@ -351,7 +351,11 @@ extern void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t);
|
||||
#endif /* defined(ENABLED_DEBUG_SYNC) */
|
||||
|
||||
/* compatibility macro */
|
||||
#ifdef __cplusplus
|
||||
#define DEBUG_SYNC_C(name) DEBUG_SYNC(nullptr, name)
|
||||
#else
|
||||
#define DEBUG_SYNC_C(name) DEBUG_SYNC(NULL, name)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
104
include/scope.h
104
include/scope.h
@@ -32,6 +32,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
scope_exit(F &&f, bool engaged) : function_(std::forward<F>(f)), engaged_(engaged)
|
||||
{
|
||||
}
|
||||
|
||||
scope_exit(scope_exit &&rhs)
|
||||
: function_(std::move(rhs.function_)), engaged_(rhs.engaged_)
|
||||
{
|
||||
@@ -43,6 +48,7 @@ public:
|
||||
scope_exit &operator=(const scope_exit &)= delete;
|
||||
|
||||
void release() { engaged_= false; }
|
||||
void engage() { DBUG_ASSERT(!engaged_); engaged_= true; }
|
||||
|
||||
~scope_exit()
|
||||
{
|
||||
@@ -58,17 +64,103 @@ private:
|
||||
} // end namespace detail
|
||||
|
||||
template <typename Callable>
|
||||
detail::scope_exit<typename std::decay<Callable>::type>
|
||||
make_scope_exit(Callable &&f)
|
||||
inline
|
||||
::detail::scope_exit<typename std::decay<Callable>::type>
|
||||
make_scope_exit(Callable &&f, bool engaged= true)
|
||||
{
|
||||
return detail::scope_exit<typename std::decay<Callable>::type>(
|
||||
std::forward<Callable>(f));
|
||||
return ::detail::scope_exit<typename std::decay<Callable>::type>(
|
||||
std::forward<Callable>(f), engaged);
|
||||
}
|
||||
|
||||
#define CONCAT_IMPL(x, y) x##y
|
||||
|
||||
#define CONCAT(x, y) CONCAT_IMPL(x, y)
|
||||
|
||||
#define ANONYMOUS_VARIABLE CONCAT(_anonymous_variable, __LINE__)
|
||||
|
||||
#define SCOPE_EXIT auto ANONYMOUS_VARIABLE= make_scope_exit
|
||||
|
||||
#define IF_CLASS(C) typename std::enable_if<std::is_class<C>::value>::type
|
||||
#define IF_NOT_CLASS(C) typename std::enable_if<!std::is_class<C>::value>::type
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
class Scope_value
|
||||
{
|
||||
public:
|
||||
// Use SFINAE for passing structs by reference and plain types by value.
|
||||
// This ctor is defined only if T is a class or struct:
|
||||
template <typename U = T, typename = IF_CLASS(U)>
|
||||
Scope_value(T &variable, const T &scope_value)
|
||||
: variable_(&variable), saved_value_(variable)
|
||||
{
|
||||
variable= scope_value;
|
||||
}
|
||||
|
||||
// This ctor is defined only if T is NOT a class or struct:
|
||||
template <typename U = T, typename = IF_NOT_CLASS(U)>
|
||||
Scope_value(T &variable, const T scope_value)
|
||||
: variable_(&variable), saved_value_(variable)
|
||||
{
|
||||
variable= scope_value;
|
||||
}
|
||||
|
||||
Scope_value(Scope_value &&rhs)
|
||||
: variable_(rhs.variable_), saved_value_(rhs.saved_value_)
|
||||
{
|
||||
rhs.variable_= NULL;
|
||||
}
|
||||
|
||||
Scope_value(const Scope_value &)= delete;
|
||||
Scope_value &operator=(const Scope_value &)= delete;
|
||||
Scope_value &operator=(Scope_value &&)= delete;
|
||||
|
||||
~Scope_value()
|
||||
{
|
||||
if (variable_)
|
||||
*variable_= saved_value_;
|
||||
}
|
||||
|
||||
private:
|
||||
T *variable_;
|
||||
T saved_value_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// Use like this:
|
||||
// auto _= make_scope_value(var, tmp_value);
|
||||
|
||||
template <typename T, typename = IF_CLASS(T)>
|
||||
inline
|
||||
::detail::Scope_value<T> make_scope_value(T &variable, const T &scope_value)
|
||||
{
|
||||
return ::detail::Scope_value<T>(variable, scope_value);
|
||||
}
|
||||
|
||||
template <typename T, typename = IF_NOT_CLASS(T)>
|
||||
inline
|
||||
::detail::Scope_value<T> make_scope_value(T &variable, T scope_value)
|
||||
{
|
||||
return ::detail::Scope_value<T>(variable, scope_value);
|
||||
}
|
||||
|
||||
/*
|
||||
Note: perfect forwarding version can not pass const:
|
||||
|
||||
template <typename T, typename U>
|
||||
inline
|
||||
detail::Scope_value<T> make_scope_value(T &variable, U &&scope_value)
|
||||
{
|
||||
return detail::Scope_value<T>(variable, std::forward<U>(scope_value));
|
||||
}
|
||||
|
||||
as `const U &&` fails with error `expects an rvalue for 2nd argument`. That
|
||||
happens because const U && is treated as rvalue only (this is the exact syntax
|
||||
for declaring rvalues).
|
||||
*/
|
||||
|
||||
|
||||
#define SCOPE_VALUE auto ANONYMOUS_VARIABLE= make_scope_value
|
||||
#define SCOPE_SET(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR | MASK)
|
||||
#define SCOPE_CLEAR(VAR, MASK) auto ANONYMOUS_VARIABLE= make_scope_value(VAR, VAR & ~MASK)
|
||||
|
||||
26
mysql-test/include/ctype_supplementary_chars.inc
Normal file
26
mysql-test/include/ctype_supplementary_chars.inc
Normal file
@@ -0,0 +1,26 @@
|
||||
--eval CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) $table_charset
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT * FROM t1;
|
||||
|
||||
--eval CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) $table_charset
|
||||
SHOW CREATE TABLE t2;
|
||||
INSERT INTO t2 VALUES ();
|
||||
SELECT * FROM t2;
|
||||
|
||||
--eval CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) $table_charset
|
||||
SHOW CREATE TABLE t3;
|
||||
INSERT INTO t3 VALUES ();
|
||||
SELECT * FROM t3;
|
||||
|
||||
--eval CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) $table_charset
|
||||
SHOW CREATE TABLE t4;
|
||||
INSERT INTO t4 (a) VALUES ('');
|
||||
SELECT * FROM t4;
|
||||
|
||||
--eval CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) $table_charset
|
||||
SHOW CREATE TABLE t5;
|
||||
--error ER_CONSTRAINT_FAILED
|
||||
INSERT INTO t5 VALUES ('','😎😀');
|
||||
INSERT INTO t5 VALUES ('','😀😎');
|
||||
SELECT * FROM t5;
|
||||
@@ -3031,5 +3031,62 @@ SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
|
||||
c1
|
||||
-9223372036854775808
|
||||
#
|
||||
# End of 10.5 tests
|
||||
# MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(8) DEFAULT reverse('aha')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
aha
|
||||
CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` char(8) DEFAULT reverse('åäá')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t2 VALUES ();
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
áäå
|
||||
CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` char(8) DEFAULT reverse('😎😀')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t3 VALUES ();
|
||||
SELECT * FROM t3;
|
||||
a
|
||||
😀😎
|
||||
CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t4 (a) VALUES ('');
|
||||
SELECT * FROM t4;
|
||||
a b
|
||||
😀😎
|
||||
CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t5;
|
||||
Table Create Table
|
||||
t5 CREATE TABLE `t5` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t5 VALUES ('','😎😀');
|
||||
ERROR 23000: CONSTRAINT `t5.b` failed for `test`.`t5`
|
||||
INSERT INTO t5 VALUES ('','😀😎');
|
||||
SELECT * FROM t5;
|
||||
a b
|
||||
😀😎
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
# End of 10.5 tests
|
||||
|
||||
@@ -1171,5 +1171,12 @@ SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
|
||||
SELECT CAST(CONVERT('-9223372036854775808' USING utf32) AS SIGNED) AS c1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo # MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
--let $table_charset=CHARACTER SET utf32
|
||||
--source include/ctype_supplementary_chars.inc
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
106
mysql-test/main/ctype_utf32_not_embedded.result
Normal file
106
mysql-test/main/ctype_utf32_not_embedded.result
Normal file
@@ -0,0 +1,106 @@
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
# MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
CREATE TABLE t1 (a CHAR(8) DEFAULT REVERSE('aha')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(8) DEFAULT reverse('aha')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
aha
|
||||
CREATE TABLE t2 (a CHAR(8) DEFAULT REVERSE('åäá')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` char(8) DEFAULT reverse('åäá')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t2 VALUES ();
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
áäå
|
||||
CREATE TABLE t3 (a CHAR(8) DEFAULT REVERSE('😎😀')) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` char(8) DEFAULT reverse('😎😀')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t3 VALUES ();
|
||||
SELECT * FROM t3;
|
||||
a
|
||||
😀😎
|
||||
CREATE TABLE t4 (a CHAR(8), b CHAR(8) AS (REVERSE('😎😀'))) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t4 (a) VALUES ('');
|
||||
SELECT * FROM t4;
|
||||
a b
|
||||
😀😎
|
||||
CREATE TABLE t5 (a CHAR(8), b CHAR(8) CHECK (b=BINARY REVERSE('😎😀'))) CHARACTER SET utf32;
|
||||
SHOW CREATE TABLE t5;
|
||||
Table Create Table
|
||||
t5 CREATE TABLE `t5` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
INSERT INTO t5 VALUES ('','😎😀');
|
||||
ERROR 23000: CONSTRAINT `t5.b` failed for `test`.`t5`
|
||||
INSERT INTO t5 VALUES ('','😀😎');
|
||||
SELECT * FROM t5;
|
||||
a b
|
||||
😀😎
|
||||
# Running dump
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
# Running restore
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(8) DEFAULT reverse('aha')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
aha
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` char(8) DEFAULT reverse('åäá')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
áäå
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` char(8) DEFAULT reverse('😎😀')
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
SELECT * FROM t3;
|
||||
a
|
||||
😀😎
|
||||
SHOW CREATE TABLE t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) GENERATED ALWAYS AS (reverse('😎😀')) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
SELECT * FROM t4;
|
||||
a b
|
||||
😀😎
|
||||
SHOW CREATE TABLE t5;
|
||||
Table Create Table
|
||||
t5 CREATE TABLE `t5` (
|
||||
`a` char(8) DEFAULT NULL,
|
||||
`b` char(8) DEFAULT NULL CHECK (`b` = cast(reverse('😎😀') as char charset binary))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci
|
||||
SELECT * FROM t5;
|
||||
a b
|
||||
😀😎
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
# End of 10.5 tests
|
||||
38
mysql-test/main/ctype_utf32_not_embedded.test
Normal file
38
mysql-test/main/ctype_utf32_not_embedded.test
Normal file
@@ -0,0 +1,38 @@
|
||||
# Embedded server doesn't support external clients
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo # Start of 10.5 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
--let $table_charset=CHARACTER SET utf32
|
||||
--source include/ctype_supplementary_chars.inc
|
||||
|
||||
--echo # Running dump
|
||||
--let $mysqldumpfile = $MYSQLTEST_VARDIR/tmp/ctype_utf32_not_embedded_dump.sql
|
||||
--exec $MYSQL_DUMP test > $mysqldumpfile
|
||||
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
|
||||
--echo # Running restore
|
||||
--exec $MYSQL test < $mysqldumpfile
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t3;
|
||||
SELECT * FROM t3;
|
||||
SHOW CREATE TABLE t4;
|
||||
SELECT * FROM t4;
|
||||
SHOW CREATE TABLE t5;
|
||||
SELECT * FROM t5;
|
||||
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
|
||||
--error 0,1
|
||||
--remove_file $mysqldumpfile
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
@@ -1731,13 +1731,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `log` (
|
||||
`msg` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`c` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
@@ -1811,13 +1811,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `log` (
|
||||
`msg` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`c` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
@@ -1731,13 +1731,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `log` (
|
||||
`msg` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`c` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
@@ -1811,13 +1811,13 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `log` (
|
||||
`msg` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`c` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
@@ -231,3 +231,16 @@ Error 1327 Undeclared variable: foo
|
||||
Error 1305 PROCEDURE P1 does not exist
|
||||
drop procedure P1;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
# MDEV-35828: Assertion fails in alloc_root() when memory causes it to call itself
|
||||
#
|
||||
CREATE TEMPORARY TABLE t1 (a INT,b INT);
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
SET
|
||||
@tmp=@@max_session_mem_used,
|
||||
max_session_mem_used=8192;
|
||||
SELECT * FROM (t1 AS t2 LEFT JOIN t1 AS t3 USING (a)),t1;
|
||||
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
|
||||
DROP TABLE t1;
|
||||
SET max_session_mem_used=@tmp;
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -284,3 +284,23 @@ show warnings;
|
||||
drop procedure P1;
|
||||
|
||||
-- echo # End of 10.4 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35828: Assertion fails in alloc_root() when memory causes it to call itself
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE t1 (a INT,b INT);
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
|
||||
SET
|
||||
@tmp=@@max_session_mem_used,
|
||||
max_session_mem_used=8192;
|
||||
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
SELECT * FROM (t1 AS t2 LEFT JOIN t1 AS t3 USING (a)),t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET max_session_mem_used=@tmp;
|
||||
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
@@ -22,7 +22,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -32,7 +32,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest2`;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -41,27 +41,27 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest3`;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3i` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3is` AS SELECT
|
||||
1 AS `schema_name` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3nt` AS SELECT
|
||||
1 AS `1` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3ps` AS SELECT
|
||||
1 AS `user` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -238,7 +238,7 @@ disconnect con1;
|
||||
connection default;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `id` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
@@ -731,4 +731,22 @@ alter table t1 enable keys;
|
||||
insert into t1 values (2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'i'
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-25654 Unexpected ER_CRASHED_ON_USAGE and Assertion `limit >= trx_id' failed in purge_node_t::skip
|
||||
#
|
||||
create table t1 (a int, unique using hash (a)) engine=innodb
|
||||
partition by range(a) (
|
||||
partition p1 values less than (2),
|
||||
partition p2 values less than (101)
|
||||
);
|
||||
insert into t1 select seq from seq_1_to_100;
|
||||
alter table t1 add partition (partition p3 values less than (maxvalue));
|
||||
alter table t1 force;
|
||||
drop table t1;
|
||||
# veirfy that duplicate has unique is detected
|
||||
create table t1 (a blob unique);
|
||||
alter table t1 add constraint constraint_1 unique (a);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index `constraint_1`. This is deprecated and will be disallowed in a future release
|
||||
drop table t1;
|
||||
# End of 10.5 tests
|
||||
|
||||
@@ -710,4 +710,24 @@ alter table t1 enable keys;
|
||||
insert into t1 values (2);
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-25654 Unexpected ER_CRASHED_ON_USAGE and Assertion `limit >= trx_id' failed in purge_node_t::skip
|
||||
--echo #
|
||||
create table t1 (a int, unique using hash (a)) engine=innodb
|
||||
partition by range(a) (
|
||||
partition p1 values less than (2),
|
||||
partition p2 values less than (101)
|
||||
);
|
||||
insert into t1 select seq from seq_1_to_100;
|
||||
|
||||
alter table t1 add partition (partition p3 values less than (maxvalue));
|
||||
alter table t1 force;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo # veirfy that duplicate has unique is detected
|
||||
create table t1 (a blob unique);
|
||||
alter table t1 add constraint constraint_1 unique (a);
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
@@ -562,7 +562,7 @@ a1\`b1 CREATE TABLE `a1\``b1` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `a1\``b1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -592,7 +592,7 @@ a1\"b1 CREATE TABLE "a1\""b1" (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "a1\""b1" (
|
||||
"a" int(11) DEFAULT NULL
|
||||
);
|
||||
|
||||
@@ -95,7 +95,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -107,7 +107,7 @@ INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'f
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -119,7 +119,7 @@ INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'f
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -131,7 +131,7 @@ INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'f
|
||||
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t4`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t4` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -143,7 +143,7 @@ INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'f
|
||||
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t5`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t5` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -155,7 +155,7 @@ INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'f
|
||||
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t6`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t6` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -193,7 +193,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -205,7 +205,7 @@ INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first va
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -217,7 +217,7 @@ INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first va
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -229,7 +229,7 @@ INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first va
|
||||
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t4`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t4` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -241,7 +241,7 @@ INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first va
|
||||
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t5`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t5` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
@@ -253,7 +253,7 @@ INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first va
|
||||
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `t6`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t6` (
|
||||
`id` int(8) DEFAULT NULL,
|
||||
`name` varchar(32) DEFAULT NULL
|
||||
|
||||
@@ -34,7 +34,7 @@ USE `mysqltest1
|
||||
--
|
||||
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1
|
||||
1t` (
|
||||
`foobar
|
||||
@@ -53,7 +53,7 @@ raboof` int(11) DEFAULT NULL
|
||||
--
|
||||
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1
|
||||
1v` AS SELECT
|
||||
1 AS `foobar
|
||||
|
||||
@@ -21,7 +21,7 @@ timeout without t1 contents expected
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -45,7 +45,7 @@ This would be a race condition otherwise, but default max_statement_time=0 makes
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
|
||||
@@ -46,7 +46,7 @@ Testing text format output
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`point` varchar(10) NOT NULL,
|
||||
`data` varchar(10) DEFAULT NULL,
|
||||
|
||||
@@ -33,7 +33,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
|
||||
("0987654321098765432109876543210987654321");
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(64,20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -49,7 +49,7 @@ Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` double DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -71,7 +71,7 @@ ERROR 42S22: Unknown column '1.2345' in 'VALUES'
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) DEFAULT NULL,
|
||||
`b` float DEFAULT NULL
|
||||
@@ -80,7 +80,7 @@ CREATE TABLE `t1` (
|
||||
INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) DEFAULT NULL,
|
||||
`b` float DEFAULT NULL
|
||||
@@ -101,7 +101,7 @@ INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) DEFAULT NULL,
|
||||
`b` float DEFAULT NULL
|
||||
@@ -131,7 +131,7 @@ UNLOCK TABLES;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) DEFAULT NULL,
|
||||
`b` float DEFAULT NULL
|
||||
@@ -214,7 +214,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=koi8r COLLATE=koi8r_general_ci;
|
||||
@@ -297,7 +297,7 @@ DROP TABLE t1;
|
||||
create table ```a` (i int);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE ```a` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -321,7 +321,7 @@ create table t1(a int);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -350,7 +350,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1";
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "t1" (
|
||||
"a" int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -382,7 +382,7 @@ set global sql_mode='ANSI_QUOTES';
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -411,7 +411,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1";
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "t1" (
|
||||
"a" int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -447,7 +447,7 @@ insert into t1 values (1),(2),(3);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -544,7 +544,7 @@ INSERT INTO t1 VALUES (_latin1 '
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -666,7 +666,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -708,7 +708,7 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`b` blob DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -750,7 +750,7 @@ INSERT INTO t1 VALUES (4),(5),(6);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -785,7 +785,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1155,7 +1155,7 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`F_c4ca4238a0b923820dcc509a6f75849b` int(11) DEFAULT NULL,
|
||||
`F_c81e728d9d4c2f636f067f89cc14862c` int(11) DEFAULT NULL,
|
||||
@@ -1531,7 +1531,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1576,14 +1576,14 @@ INSERT INTO t2 VALUES (1), (2);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1612,14 +1612,14 @@ CREATE TABLE `t2` (
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1807,7 +1807,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1820,7 +1820,7 @@ INSERT INTO `t1` VALUES (NULL),(10),(20);
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`a` int(10) DEFAULT NULL,
|
||||
@@ -1926,21 +1926,21 @@ mariadb-dump: Couldn't find table: "non_existing"
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -1976,7 +1976,7 @@ mariadb-dump: Got error: 1064: "You have an error in your SQL syntax; check the
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2013,7 +2013,7 @@ insert into t1 values (0815, 4711, 2006);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1";
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "t1" (
|
||||
"a b" int(11) NOT NULL,
|
||||
"c""d" int(11) NOT NULL,
|
||||
@@ -2048,7 +2048,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a b` int(11) NOT NULL,
|
||||
`c"d` int(11) NOT NULL,
|
||||
@@ -2103,7 +2103,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) DEFAULT NULL,
|
||||
KEY `a` (`a`(5))
|
||||
@@ -2118,7 +2118,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -2198,7 +2198,7 @@ create view v1 as select * from t1;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2211,7 +2211,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -2269,7 +2269,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) DEFAULT NULL,
|
||||
KEY `a` (`a`(5))
|
||||
@@ -2284,7 +2284,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -2335,7 +2335,7 @@ INSERT INTO t1 VALUES ('\'');
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2382,7 +2382,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
@@ -2398,7 +2398,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `a`,
|
||||
1 AS `b`,
|
||||
@@ -2407,14 +2407,14 @@ SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v3`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3` AS SELECT
|
||||
1 AS `a`,
|
||||
1 AS `b`,
|
||||
@@ -2536,7 +2536,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` bigint(20) DEFAULT NULL
|
||||
@@ -2608,7 +2608,7 @@ DELIMITER ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2666,7 +2666,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` bigint(20) DEFAULT NULL
|
||||
@@ -2680,7 +2680,7 @@ INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2814,7 +2814,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -2966,7 +2966,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
UNIQUE KEY `d` (`d`)
|
||||
@@ -3004,7 +3004,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
UNIQUE KEY `d` (`d`)
|
||||
@@ -3058,7 +3058,7 @@ a2
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1 test";
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "t1 test" (
|
||||
"a1" int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -3087,7 +3087,7 @@ DELIMITER ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
DROP TABLE IF EXISTS "t2 test";
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE "t2 test" (
|
||||
"a2" int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -3142,7 +3142,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` varchar(32) DEFAULT NULL,
|
||||
@@ -3158,7 +3158,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v0`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v0`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v0` AS SELECT
|
||||
1 AS `a`,
|
||||
1 AS `b`,
|
||||
@@ -3167,7 +3167,7 @@ SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `a`,
|
||||
1 AS `b`,
|
||||
@@ -3176,7 +3176,7 @@ SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a`,
|
||||
1 AS `b`,
|
||||
@@ -3268,7 +3268,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
USE `test`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -3328,7 +3328,7 @@ insert into t1 values ('','');
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob DEFAULT NULL
|
||||
@@ -3364,7 +3364,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob DEFAULT NULL
|
||||
@@ -3549,7 +3549,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
|
||||
USE `mysqldump_test_db`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -3563,7 +3563,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `id` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -3610,7 +3610,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHA
|
||||
|
||||
USE `mysqldump_tables`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `basetable` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`tag` varchar(64) DEFAULT NULL,
|
||||
@@ -3622,7 +3622,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR
|
||||
|
||||
USE `mysqldump_views`;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `nasishnasifu` AS SELECT
|
||||
1 AS `id` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -3758,7 +3758,7 @@ use test;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
DROP TABLE IF EXISTS `TABLES`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TEMPORARY TABLE `TABLES` (
|
||||
`TABLE_CATALOG` varchar(512) NOT NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL,
|
||||
@@ -3834,14 +3834,14 @@ CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t2`,`t3`);
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -3853,7 +3853,7 @@ LOCK TABLES `t2` WRITE;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `t3`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -3946,7 +3946,7 @@ CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
|
||||
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
`c2` longblob DEFAULT NULL
|
||||
@@ -4034,7 +4034,7 @@ create view db42635.v2 (c) as select * from db42635.t1;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -4047,7 +4047,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `c` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -4184,7 +4184,7 @@ INSERT INTO t1 VALUES (3,4), (4,5);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
@@ -4461,7 +4461,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CH
|
||||
USE `mysqldump_test_db`;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -4475,7 +4475,7 @@ UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `id` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -4573,7 +4573,7 @@ create table test (a int);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
DROP TABLE IF EXISTS `test`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `test` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -4795,7 +4795,7 @@ ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
|
||||
ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `test` (
|
||||
`c1` varchar(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
@@ -5286,7 +5286,7 @@ CREATE TABLE t1 (a INT);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -5565,20 +5565,20 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET ut
|
||||
|
||||
USE `db1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `basetable` (
|
||||
`id` smallint(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `basetable` VALUES (5),(6);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_name` (
|
||||
`i3` smallint(6) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci INSERT_METHOD=LAST UNION=(`basetable`);
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
|
||||
1 AS `1` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -5587,7 +5587,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET ut
|
||||
|
||||
USE `db2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_name` (
|
||||
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
UNIQUE KEY `i1` (`i1`)
|
||||
@@ -5595,7 +5595,7 @@ CREATE TABLE `nonunique_table_name` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `nonunique_table_name` VALUES (1),(2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_view_name` (
|
||||
`i2` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
@@ -5624,7 +5624,7 @@ USE `db2`;
|
||||
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_name` (
|
||||
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
UNIQUE KEY `i1` (`i1`)
|
||||
@@ -5632,7 +5632,7 @@ CREATE TABLE `nonunique_table_name` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `nonunique_table_name` VALUES (1),(2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_view_name` (
|
||||
`i2` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
@@ -5647,7 +5647,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET ut
|
||||
|
||||
USE `db2`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_name` (
|
||||
`i1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
UNIQUE KEY `i1` (`i1`)
|
||||
@@ -5655,7 +5655,7 @@ CREATE TABLE `nonunique_table_name` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT DELAYED INTO `nonunique_table_name` VALUES (1),(2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_view_name` (
|
||||
`i2` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
@@ -5666,21 +5666,21 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET ut
|
||||
|
||||
USE `db1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `basetable` (
|
||||
`id` smallint(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT DELAYED INTO `basetable` VALUES (5),(6);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `nonunique_table_name` (
|
||||
`i3` smallint(6) DEFAULT NULL
|
||||
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci INSERT_METHOD=LAST UNION=(`basetable`);
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `nonunique_table_name` VALUES (5),(6);
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
|
||||
1 AS `1` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
@@ -5827,7 +5827,7 @@ DROP TABLE t1;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -5838,7 +5838,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -5857,7 +5857,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `innodb_index_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_index_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -5872,7 +5872,7 @@ CREATE TABLE `innodb_index_stats` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `innodb_table_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_table_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -5884,7 +5884,7 @@ CREATE TABLE `innodb_table_stats` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin STATS_PERSISTENT=0;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `transaction_registry` (
|
||||
`transaction_id` bigint(20) unsigned NOT NULL,
|
||||
`commit_id` bigint(20) unsigned NOT NULL,
|
||||
@@ -5923,7 +5923,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -5934,7 +5934,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -5953,7 +5953,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `innodb_index_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_index_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -5973,7 +5973,7 @@ LOCK TABLES `innodb_index_stats` WRITE;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `innodb_table_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_table_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -5990,7 +5990,7 @@ LOCK TABLES `innodb_table_stats` WRITE;
|
||||
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `transaction_registry` (
|
||||
`transaction_id` bigint(20) unsigned NOT NULL,
|
||||
`commit_id` bigint(20) unsigned NOT NULL,
|
||||
@@ -6029,7 +6029,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -6040,7 +6040,7 @@ CREATE TABLE IF NOT EXISTS `general_log` (
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||
`user_host` mediumtext NOT NULL,
|
||||
@@ -6059,7 +6059,7 @@ CREATE TABLE IF NOT EXISTS `slow_log` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
DROP TABLE IF EXISTS `innodb_index_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_index_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -6079,7 +6079,7 @@ LOCK TABLES `innodb_index_stats` WRITE;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `innodb_table_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `innodb_table_stats` (
|
||||
`database_name` varchar(64) NOT NULL,
|
||||
`table_name` varchar(199) NOT NULL,
|
||||
@@ -6096,7 +6096,7 @@ LOCK TABLES `innodb_table_stats` WRITE;
|
||||
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE IF NOT EXISTS `transaction_registry` (
|
||||
`transaction_id` bigint(20) unsigned NOT NULL,
|
||||
`commit_id` bigint(20) unsigned NOT NULL,
|
||||
@@ -6143,7 +6143,7 @@ CREATE TABLE t4(ËÏÌÏÎËÁ1 INT);
|
||||
insert into t4 values(1);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) INVISIBLE DEFAULT NULL
|
||||
@@ -6151,7 +6151,7 @@ CREATE TABLE `t1` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
@@ -6159,7 +6159,7 @@ CREATE TABLE `t2` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t2` VALUES (1,2),(1,2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`invisible` int(11) DEFAULT NULL,
|
||||
`a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4,
|
||||
@@ -6168,7 +6168,7 @@ CREATE TABLE `t3` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t4` (
|
||||
`ËÏÌÏÎËÁ1` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -6177,7 +6177,7 @@ INSERT INTO `t4` VALUES (1);
|
||||
#Check side effect on --complete insert
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) INVISIBLE DEFAULT NULL
|
||||
@@ -6185,7 +6185,7 @@ CREATE TABLE `t1` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
@@ -6193,7 +6193,7 @@ CREATE TABLE `t2` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t2` (`a`, `b`) VALUES (1,2),(1,2);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t3` (
|
||||
`invisible` int(11) DEFAULT NULL,
|
||||
`a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4,
|
||||
@@ -6202,7 +6202,7 @@ CREATE TABLE `t3` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t4` (
|
||||
`ËÏÌÏÎËÁ1` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -6529,7 +6529,7 @@ update mysql.event set body ='select not_a_value' where db='test' and name='e1';
|
||||
create table t1 (i int);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -6583,7 +6583,7 @@ create table t1 (a int);
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
|
||||
@@ -91,7 +91,7 @@ INSERT INTO t1 VALUES (1), (2);
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -126,7 +126,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
);
|
||||
@@ -161,7 +161,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
);
|
||||
|
||||
@@ -1321,3 +1321,35 @@ CREATE TABLE t2 (a INT, PRIMARY KEY(a)) CHECKSUM=1, ENGINE=InnoDB;
|
||||
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
|
||||
ERROR HY000: Tables have different definitions
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-34033 Exchange partition with virtual columns fails
|
||||
#
|
||||
create or replace table t1(
|
||||
id int primary key,
|
||||
col1 int,
|
||||
col2 boolean as (col1 is null))
|
||||
partition by list (id) ( partition p1 values in (1)
|
||||
);
|
||||
create or replace table t1_working like t1;
|
||||
alter table t1_working remove partitioning;
|
||||
alter table t1 exchange partition p1 with table t1_working;
|
||||
create or replace table t2(
|
||||
id int primary key,
|
||||
col1 int,
|
||||
col2 boolean as (true))
|
||||
partition by list (id) ( partition p1 values in (1)
|
||||
);
|
||||
create or replace table t2_working like t2;
|
||||
alter table t2_working remove partitioning;
|
||||
alter table t2 exchange partition p1 with table t2_working;
|
||||
drop tables t1, t1_working, t2, t2_working;
|
||||
#
|
||||
# MDEV-35612 EXCHANGE PARTITION does not work for tables with unique blobs
|
||||
#
|
||||
create table t (a int, b text, unique (b), unique(a, b)) partition by list (a) (partition p0 values in (1,2), partition pdef default);
|
||||
create table tp (a int, b text, c int invisible, unique (b), unique(a, b));
|
||||
alter table t exchange partition p0 with table tp;
|
||||
ERROR HY000: Tables have different definitions
|
||||
create or replace table tp (a int, b text, unique (b), unique(a, b));
|
||||
alter table t exchange partition p0 with table tp;
|
||||
drop table t, tp;
|
||||
|
||||
@@ -556,4 +556,50 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
|
||||
# Cleanup
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34033 Exchange partition with virtual columns fails
|
||||
--echo #
|
||||
# this fails when the virtual persistent column
|
||||
# references another column
|
||||
create or replace table t1(
|
||||
id int primary key,
|
||||
col1 int,
|
||||
col2 boolean as (col1 is null))
|
||||
partition by list (id) ( partition p1 values in (1)
|
||||
);
|
||||
|
||||
create or replace table t1_working like t1;
|
||||
alter table t1_working remove partitioning;
|
||||
alter table t1 exchange partition p1 with table t1_working;
|
||||
|
||||
# this works when the virtual persistent column
|
||||
# does not reference another column
|
||||
create or replace table t2(
|
||||
id int primary key,
|
||||
col1 int,
|
||||
col2 boolean as (true))
|
||||
partition by list (id) ( partition p1 values in (1)
|
||||
);
|
||||
|
||||
create or replace table t2_working like t2;
|
||||
alter table t2_working remove partitioning;
|
||||
alter table t2 exchange partition p1 with table t2_working;
|
||||
|
||||
# Cleanup
|
||||
drop tables t1, t1_working, t2, t2_working;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35612 EXCHANGE PARTITION does not work for tables with unique blobs
|
||||
--echo #
|
||||
create table t (a int, b text, unique (b), unique(a, b)) partition by list (a) (partition p0 values in (1,2), partition pdef default);
|
||||
create table tp (a int, b text, c int invisible, unique (b), unique(a, b));
|
||||
--error ER_TABLES_DIFFERENT_METADATA
|
||||
alter table t exchange partition p0 with table tp;
|
||||
|
||||
create or replace table tp (a int, b text, unique (b), unique(a, b));
|
||||
alter table t exchange partition p0 with table tp;
|
||||
|
||||
# cleanup
|
||||
drop table t, tp;
|
||||
|
||||
--disable_prepare_warnings
|
||||
|
||||
@@ -245,4 +245,39 @@ NULL
|
||||
DEALLOCATE PREPARE stmt;
|
||||
SET timestamp=DEFAULT;
|
||||
SET time_zone=DEFAULT;
|
||||
#
|
||||
# MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
|
||||
#
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
INSERT INTO t (c) VALUES (now());
|
||||
EXECUTE s USING NULL;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '1'
|
||||
EXECUTE s USING NULL;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '1'
|
||||
EXECUTE s USING DEFAULT;
|
||||
ERROR HY000: Default/ignore value is not supported for such parameter usage
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '1'
|
||||
EXECUTE s USING IGNORE;
|
||||
ERROR HY000: Default/ignore value is not supported for such parameter usage
|
||||
DROP TABLE t;
|
||||
# End of 10.5 tests
|
||||
|
||||
@@ -254,4 +254,38 @@ DEALLOCATE PREPARE stmt;
|
||||
SET timestamp=DEFAULT;
|
||||
SET time_zone=DEFAULT;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
INSERT INTO t (c) VALUES (now());
|
||||
EXECUTE s USING NULL;
|
||||
DROP TABLE t;
|
||||
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
EXECUTE s USING NULL;
|
||||
DROP TABLE t;
|
||||
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
--error ER_INVALID_DEFAULT_PARAM
|
||||
EXECUTE s USING DEFAULT;
|
||||
DROP TABLE t;
|
||||
|
||||
CREATE TABLE t (c TIMESTAMP);
|
||||
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
|
||||
PREPARE s FROM 'DELETE FROM t WHERE c=?';
|
||||
EXECUTE s USING 1;
|
||||
--error ER_INVALID_DEFAULT_PARAM
|
||||
EXECUTE s USING IGNORE;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
@@ -43,3 +43,10 @@ ERROR HY000: Can't read record in system table
|
||||
drop table mysql.servers;
|
||||
rename table mysql.servers_save to mysql.servers;
|
||||
drop server s1;
|
||||
#
|
||||
# MDEV-35641 foreign server "disappears" after ALTERing the servers system table to use innodb and FLUSH PRIVILEGES
|
||||
#
|
||||
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (HOST '127.0.0.1');
|
||||
ALTER TABLE mysql.servers ENGINE=innodb;
|
||||
FLUSH PRIVILEGES;
|
||||
drop server s1;
|
||||
|
||||
@@ -41,3 +41,12 @@ create server s2 foreign data wrapper foo options(user 'a');
|
||||
drop table mysql.servers;
|
||||
rename table mysql.servers_save to mysql.servers;
|
||||
drop server s1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35641 foreign server "disappears" after ALTERing the servers system table to use innodb and FLUSH PRIVILEGES
|
||||
--echo #
|
||||
--source include/have_innodb.inc
|
||||
CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (HOST '127.0.0.1');
|
||||
ALTER TABLE mysql.servers ENGINE=innodb;
|
||||
FLUSH PRIVILEGES;
|
||||
drop server s1;
|
||||
|
||||
@@ -37,6 +37,7 @@ $$
|
||||
call recursion(0,2,@s1);
|
||||
call recursion(0,3,@s2);
|
||||
call recursion(0,4,@s3);
|
||||
$$
|
||||
select @s1 > 0 && @s2 > 0 && @s3 > 0;
|
||||
@s1 > 0 && @s2 > 0 && @s3 > 0
|
||||
1
|
||||
|
||||
@@ -30,6 +30,7 @@ DROP table t1;
|
||||
--echo #
|
||||
|
||||
set @@max_sp_recursion_depth=20;
|
||||
--disable_ps_protocol
|
||||
delimiter $$;
|
||||
create or replace procedure recursion(x int, max int, OUT res int)
|
||||
begin
|
||||
@@ -40,11 +41,13 @@ begin
|
||||
end;
|
||||
$$
|
||||
|
||||
delimiter ;$$
|
||||
|
||||
call recursion(0,2,@s1);
|
||||
call recursion(0,3,@s2);
|
||||
call recursion(0,4,@s3);
|
||||
$$
|
||||
|
||||
delimiter ;$$
|
||||
--enable_ps_protocol
|
||||
|
||||
select @s1 > 0 && @s2 > 0 && @s3 > 0;
|
||||
if (`select @s2-@s1 <> @s3 - @s2`)
|
||||
|
||||
@@ -15,10 +15,10 @@ insert t1 (b) values (10);
|
||||
insert t1 (b) values (20);
|
||||
ERROR HY000: Field 'a' doesn't have a default value
|
||||
insert t1 (b) values (30);
|
||||
ERROR 23000: Column 'a' cannot be null
|
||||
select * from t1;
|
||||
a b
|
||||
10 10
|
||||
0 30
|
||||
drop table t1;
|
||||
set sql_mode=default;
|
||||
set sql_mode='';
|
||||
|
||||
@@ -19,7 +19,7 @@ delimiter ;|
|
||||
insert t1 (b) values (10);
|
||||
--error ER_NO_DEFAULT_FOR_FIELD
|
||||
insert t1 (b) values (20);
|
||||
# arguably the statement below should fail too
|
||||
--error ER_BAD_NULL_ERROR
|
||||
insert t1 (b) values (30);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
@@ -364,3 +364,28 @@ create trigger tr before update on t1 for each row set @a = 1;
|
||||
insert into t1 (pk, i) values (null, null);
|
||||
ERROR 23000: Column 'pk' cannot be null
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
|
||||
#
|
||||
create table t1( id int, rate int not null);
|
||||
create trigger test_trigger before insert on t1 for each row
|
||||
set new.rate=if(new.rate is null,10,new.rate);
|
||||
insert into t1 (id) values (1);
|
||||
insert into t1 values (2,3);
|
||||
select * from t1;
|
||||
id rate
|
||||
1 10
|
||||
2 3
|
||||
create or replace trigger test_trigger before insert on t1 for each row
|
||||
if new.rate is null then set new.rate = 15; end if;
|
||||
$$
|
||||
insert into t1 (id) values (3);
|
||||
insert into t1 values (4,5);
|
||||
select * from t1;
|
||||
id rate
|
||||
1 10
|
||||
2 3
|
||||
3 15
|
||||
4 5
|
||||
drop table t1;
|
||||
# End of 10.5 tests
|
||||
|
||||
@@ -391,3 +391,28 @@ create trigger tr before update on t1 for each row set @a = 1;
|
||||
--error ER_BAD_NULL_ERROR
|
||||
insert into t1 (pk, i) values (null, null);
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
|
||||
--echo #
|
||||
create table t1( id int, rate int not null);
|
||||
create trigger test_trigger before insert on t1 for each row
|
||||
set new.rate=if(new.rate is null,10,new.rate);
|
||||
|
||||
insert into t1 (id) values (1);
|
||||
insert into t1 values (2,3);
|
||||
select * from t1;
|
||||
|
||||
delimiter $$;
|
||||
create or replace trigger test_trigger before insert on t1 for each row
|
||||
if new.rate is null then set new.rate = 15; end if;
|
||||
$$
|
||||
delimiter ;$$
|
||||
|
||||
insert into t1 (id) values (3);
|
||||
insert into t1 values (4,5);
|
||||
select * from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
@@ -312,7 +312,7 @@ CREATE TRIGGER tr2_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a:=2;
|
||||
CREATE TRIGGER tr1_bu BEFORE UPDATE ON t1 FOR EACH ROW SET @a:=3;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
@@ -375,7 +375,7 @@ CREATE TRIGGER tr1_1_bi BEFORE INSERT ON t1 FOR EACH ROW FOLLOWS tr1_bi SET @a:=
|
||||
# Expected order of triggers in the dump is: tr0_bi, tr1_bi, tr1_1_bi, tr2_i.
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
|
||||
@@ -1,23 +1,115 @@
|
||||
|
||||
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
|
||||
|
||||
set timestamp=1000000000;
|
||||
CREATE TABLE t1(word VARCHAR(20));
|
||||
set timestamp=1000000010;
|
||||
INSERT INTO t1 VALUES ("abirvalg");
|
||||
set timestamp=1000000020;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
flush logs;
|
||||
Case: Default, must not see warning.
|
||||
# MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
Case: Stop datetime before EOF, must not see warning.
|
||||
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
Case: Stop datetime between records, must not see warning.
|
||||
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
Case: Stop datetime at EOF, must not see warning.
|
||||
# MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
Case: Stop datetime after EOF, must see warning.
|
||||
# MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
WARNING: Did not reach stop datetime '2035-01-19 03:14:05' before end of input
|
||||
DROP TABLE t1;
|
||||
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-01 10:20:30.123456');
|
||||
#
|
||||
# Clear the existing binary log state, and start fresh using
|
||||
# the timestamp variable set above
|
||||
#
|
||||
RESET MASTER;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-02 10:20:30.123456');
|
||||
insert into t1 values (2);
|
||||
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-03 10:20:30.123456');
|
||||
flush binary logs;
|
||||
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-04 10:20:30.123456');
|
||||
insert into t1 values (3);
|
||||
insert into t1 values (4);
|
||||
SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-05 10:20:30.123456');
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (6);
|
||||
insert into t1 values (7);
|
||||
SET TIMESTAMP=UNIX_TIMESTAMP('2024-12-06 10:20:30.123456');
|
||||
flush binary logs;
|
||||
drop table t1;
|
||||
# Ensuring binary log order is correct
|
||||
#
|
||||
#
|
||||
# Test using --read-from-remote-server
|
||||
#
|
||||
connection default;
|
||||
#
|
||||
# --stop-datetime tests
|
||||
# Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
|
||||
# 2.a, 2.b, and 2.c.
|
||||
#
|
||||
# Case 1.a) With one binlog file, a --stop-datetime before the end of
|
||||
# the file should not result in a warning
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.b) With one binlog file, a --stop-datetime at the end of the
|
||||
# file should not result in a warning
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.c) With one binlog file, a --stop-datetime beyond the end of
|
||||
# the file should(!) result in a warning
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
|
||||
#
|
||||
# Case 2.a) With two binlog files, a --stop-datetime within the
|
||||
# timespan of binlog 2 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent binlog 1 or 2 from outputting the desired events
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure all intended GTIDs are present]
|
||||
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
|
||||
#
|
||||
# Case 2.b) With two binlog files, a --stop-datetime at the end of
|
||||
# binlog 2 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent binlog 1 or 2 from outputting all events
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
#
|
||||
# Case 2.c) With two binlog files, a --stop-datetime beyond the end of
|
||||
# binlog 2 should:
|
||||
# 1) provide a warning that the stop datetime was not reached
|
||||
# 2) not prevent binlog 1 or 2 from outputting all events
|
||||
# MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
#
|
||||
#
|
||||
# Test using local binlog files
|
||||
#
|
||||
connection default;
|
||||
#
|
||||
# --stop-datetime tests
|
||||
# Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
|
||||
# 2.a, 2.b, and 2.c.
|
||||
#
|
||||
# Case 1.a) With one binlog file, a --stop-datetime before the end of
|
||||
# the file should not result in a warning
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.b) With one binlog file, a --stop-datetime at the end of the
|
||||
# file should not result in a warning
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.c) With one binlog file, a --stop-datetime beyond the end of
|
||||
# the file should(!) result in a warning
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
|
||||
#
|
||||
# Case 2.a) With two binlog files, a --stop-datetime within the
|
||||
# timespan of binlog 2 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent binlog 1 or 2 from outputting the desired events
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure all intended GTIDs are present]
|
||||
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
|
||||
#
|
||||
# Case 2.b) With two binlog files, a --stop-datetime at the end of
|
||||
# binlog 2 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent binlog 1 or 2 from outputting all events
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
#
|
||||
# Case 2.c) With two binlog files, a --stop-datetime beyond the end of
|
||||
# binlog 2 should:
|
||||
# 1) provide a warning that the stop datetime was not reached
|
||||
# 2) not prevent binlog 1 or 2 from outputting all events
|
||||
# MYSQL_BINLOG --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
|
||||
WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
#
|
||||
# End of binlog_mysqlbinlog_warn_stop_datetime.test
|
||||
|
||||
@@ -1,13 +1,65 @@
|
||||
|
||||
# MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-condition
|
||||
|
||||
Case: Default stop position, WARNING must not appear
|
||||
# MYSQL_BINLOG --short-form --start-position=4 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
Case: Stop position before EOF, WARNING must not appear
|
||||
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=97 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
Case: Stop position at EOF, WARNING must not appear
|
||||
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=98 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
Case: Stop position after EOF, WARNING must appear
|
||||
# MYSQL_BINLOG --short-form --start-position=4 --stop-position=99 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
WARNING: Did not reach stop position 99 before end of input
|
||||
#
|
||||
# Clear the existing binary log state.
|
||||
#
|
||||
RESET MASTER;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
flush binary logs;
|
||||
insert into t1 values (3);
|
||||
# Tag binlog_f2_mid
|
||||
insert into t1 values (4);
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (6);
|
||||
insert into t1 values (7);
|
||||
flush binary logs;
|
||||
drop table t1;
|
||||
# Ensuring binary log order is correct
|
||||
# Ensuring file offset of binlog_f2_mid < binlog_f1_end
|
||||
#
|
||||
#
|
||||
# Test using local binlog files
|
||||
#
|
||||
connection default;
|
||||
#
|
||||
# --stop-position tests
|
||||
#
|
||||
# Case 1.a) With one binlog file, a --stop-position before the end of
|
||||
# the file should not result in a warning
|
||||
# MYSQL_BINLOG --stop-position=binlog_f1_pre_rotate binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.b) With one binlog file, a --stop-position at the exact end of
|
||||
# the file should not result in a warning
|
||||
# MYSQL_BINLOG --stop-position=binlog_f1_end binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
#
|
||||
# Case 1.c) With one binlog file, a --stop-position past the end of the
|
||||
# file should(!) result in a warning
|
||||
# MYSQL_BINLOG --short-form --stop-position=binlog_f1_over_eof binlog_f1_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
WARNING: Did not reach stop position <BINLOG_F1_OVER_EOF> before end of input
|
||||
#
|
||||
# Case 2.a) With two binlog files, a --stop-position targeting b2 which
|
||||
# exists in the size of b1 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent b2 from outputting its desired events before the
|
||||
# stop position
|
||||
# MYSQL_BINLOG --stop-position=binlog_f2_mid binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure all intended GTIDs are present]
|
||||
include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
|
||||
#
|
||||
# Case 2.b) With two binlog files, a --stop-position targeting the end
|
||||
# of binlog 2 should:
|
||||
# 1) not provide any warnings
|
||||
# 2) not prevent b2 from outputting its entire binary log
|
||||
# MYSQL_BINLOG --stop-position=binlog_f2_end binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
include/assert_grep.inc [Ensure the last GTID binlogged is present]
|
||||
#
|
||||
# Case 2.c) With two binlog files, a --stop-position targeting beyond
|
||||
# the eof of binlog 2 should:
|
||||
# 1) provide a warning that the stop position was not reached
|
||||
# 2) not prevent b2 from outputting its entire binary log
|
||||
# MYSQL_BINLOG --stop-position=binlog_f2_over_eof binlog_f1_full binlog_f2_full --result-file=tmp/warn_position_test_file.out 2>&1
|
||||
WARNING: Did not reach stop position <BINLOG_F2_OVER_EOF> before end of input
|
||||
include/assert_grep.inc [Ensure a GTID exists for each transaction]
|
||||
#
|
||||
# End of binlog_mysqlbinlog_warn_stop_position.test
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#
|
||||
# Helper file that ensures mysqlbinlog --stop-datetime behavior for local
|
||||
# files or a remote server
|
||||
#
|
||||
# Parameters:
|
||||
# read_from_remote_server (bool): A boolean that changes which source to use
|
||||
# for mysqlbinlog. When true, reads remotely; when false, uses local files.
|
||||
#
|
||||
|
||||
--connection default
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
|
||||
# PARAM_READ_FROM_REMOTE is used as a parameter to mysqlbinlog (_OUT suffix is
|
||||
# output in echo commands). If using local files, they are blank; if reading
|
||||
# from remote server, it is overridden to the correct values.
|
||||
--let $PARAM_READ_FROM_REMOTE=
|
||||
# Used in echo statements to remove potentially changing values
|
||||
--let $PARAM_READ_FROM_REMOTE_OUT=
|
||||
|
||||
if ($read_from_remote_server)
|
||||
{
|
||||
--let $PARAM_READ_FROM_REMOTE= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT
|
||||
--let $PARAM_READ_FROM_REMOTE_OUT= --read-from-remote-server
|
||||
# binlog files in --read-from-remote-server don't use file system path
|
||||
--let $binlog_f1_full= $binlog_f1
|
||||
--let $binlog_f2_full= $binlog_f2
|
||||
}
|
||||
if (!$read_from_remote_server)
|
||||
{
|
||||
# If using local files, file system path to the binlog files is needed
|
||||
--let $binlog_f1_full= $MYSQLD_DATADIR/$binlog_f1
|
||||
--let $binlog_f2_full= $MYSQLD_DATADIR/$binlog_f2
|
||||
}
|
||||
|
||||
--echo #
|
||||
--echo # --stop-datetime tests
|
||||
--echo # Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
|
||||
--echo # 2.a, 2.b, and 2.c.
|
||||
--echo #
|
||||
|
||||
--echo # Case 1.a) With one binlog file, a --stop-datetime before the end of
|
||||
--echo # the file should not result in a warning
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b1_timestamp2' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b1_timestamp2' $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 1.b) With one binlog file, a --stop-datetime at the end of the
|
||||
--echo # file should not result in a warning
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b1_timestamp3' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b1_timestamp3' $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 1.c) With one binlog file, a --stop-datetime beyond the end of
|
||||
--echo # the file should(!) result in a warning
|
||||
--let $future_timestamp= 2035-12-06 10:20:30.123456
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp1' binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp1' $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.a) With two binlog files, a --stop-datetime within the
|
||||
--echo # timespan of binlog 2 should:
|
||||
--echo # 1) not provide any warnings
|
||||
--echo # 2) not prevent binlog 1 or 2 from outputting the desired events
|
||||
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp1' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp1' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $server_id= `SELECT @@GLOBAL.server_id`
|
||||
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
|
||||
--let $assert_file= $binlog_out
|
||||
--let $assert_text= Ensure all intended GTIDs are present
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 3
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--let $assert_text= Ensure the next GTID binlogged is _not_ present
|
||||
--let $assert_select= GTID $binlog_f2_gtid_after_midpoint
|
||||
--let $assert_count= 0
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.b) With two binlog files, a --stop-datetime at the end of
|
||||
--echo # binlog 2 should:
|
||||
--echo # 1) not provide any warnings
|
||||
--echo # 2) not prevent binlog 1 or 2 from outputting all events
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp3' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp3' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $assert_text= Ensure a GTID exists for each transaction
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 8
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.c) With two binlog files, a --stop-datetime beyond the end of
|
||||
--echo # binlog 2 should:
|
||||
--echo # 1) provide a warning that the stop datetime was not reached
|
||||
--echo # 2) not prevent binlog 1 or 2 from outputting all events
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-datetime='$b2_timestamp_not_reached' binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-datetime='$b2_timestamp_not_reached' $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $assert_text= Ensure a GTID exists for each transaction
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 8
|
||||
--source include/assert_grep.inc
|
||||
|
||||
@@ -1,42 +1,86 @@
|
||||
--echo
|
||||
--echo # MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-datetime
|
||||
--echo
|
||||
#
|
||||
# Test ensures that --stop-datetime work correctly for mysqlbinlog. This high
|
||||
# level test sets up the binary log (and tags certain locations for comparison),
|
||||
# and the helper file binlog_mysqlbinlog_warn_stop_datetime.inc performs the
|
||||
# actual tests.
|
||||
#
|
||||
# References:
|
||||
# MDEV-27037: mysqlbinlog emits a warning when reaching EOF before
|
||||
# stop-condition
|
||||
# MDEV-35528: mariadb-binlog cannot process more than 1 logfiles when
|
||||
# --stop-datetime is specified
|
||||
#
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
--source include/have_binlog_format_statement.inc
|
||||
--let $binlog_out_relpath= tmp/warn_datetime_test_file.out
|
||||
--let $binlog_out= $MYSQLTEST_VARDIR/$binlog_out_relpath
|
||||
|
||||
--let ignored_output_file= $MYSQLTEST_VARDIR/tmp/warn_pos_test_file.out
|
||||
--let $b1_timestamp1= 2024-12-01 10:20:30.123456
|
||||
--let $b1_timestamp2= 2024-12-02 10:20:30.123456
|
||||
--let $b1_timestamp3= 2024-12-03 10:20:30.123456
|
||||
--let $b2_timestamp1= 2024-12-04 10:20:30.123456
|
||||
--let $b2_timestamp2= 2024-12-05 10:20:30.123456
|
||||
--let $b2_timestamp3= 2024-12-06 10:20:30.123456
|
||||
--let $b2_timestamp_not_reached= 2024-12-07 10:20:30.123456
|
||||
|
||||
set timestamp=1000000000;
|
||||
CREATE TABLE t1(word VARCHAR(20));
|
||||
set timestamp=1000000010;
|
||||
INSERT INTO t1 VALUES ("abirvalg");
|
||||
set timestamp=1000000020;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
--let MYSQLD_DATADIR= `select @@datadir;`
|
||||
flush logs;
|
||||
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp1')
|
||||
|
||||
--echo Case: Default, must not see warning.
|
||||
--echo # MYSQL_BINLOG --short-form MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
|
||||
--echo #
|
||||
--echo # Clear the existing binary log state, and start fresh using
|
||||
--echo # the timestamp variable set above
|
||||
--echo #
|
||||
RESET MASTER;
|
||||
|
||||
--echo Case: Stop datetime before EOF, must not see warning.
|
||||
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:50' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
|
||||
--let $binlog_f1= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp2')
|
||||
insert into t1 values (2);
|
||||
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b1_timestamp3')
|
||||
flush binary logs;
|
||||
--let $binlog_f2= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b2_timestamp1')
|
||||
insert into t1 values (3);
|
||||
insert into t1 values (4);
|
||||
--eval SET TIMESTAMP= UNIX_TIMESTAMP('$b2_timestamp2')
|
||||
--let $binlog_f2_gtid_after_midpoint= `SELECT @@GLOBAL.gtid_binlog_pos`
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (6);
|
||||
insert into t1 values (7);
|
||||
--let $binlog_f2_last_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
|
||||
--eval SET TIMESTAMP=UNIX_TIMESTAMP('$b2_timestamp3')
|
||||
flush binary logs;
|
||||
drop table t1;
|
||||
|
||||
--echo Case: Stop datetime between records, must not see warning.
|
||||
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
|
||||
--echo # Ensuring binary log order is correct
|
||||
--let $binlog_f1_show= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
||||
if (`SELECT strcmp('$binlog_f1','$binlog_f1_show') != 0`)
|
||||
{
|
||||
--echo # Real binlog_f1: $binlog_f1
|
||||
--echo # First binlog in SHOW BINLOG FILES: $binlog_f1_show
|
||||
--die Wrong order of binary log files in SHOW BINARY LOGS
|
||||
}
|
||||
--let $binlog_f2_show= query_get_value(SHOW BINARY LOGS, Log_name, 2)
|
||||
if (`SELECT strcmp('$binlog_f2','$binlog_f2_show') != 0`)
|
||||
{
|
||||
--echo # Real binlog_f2: $binlog_f2
|
||||
--echo # First binlog in SHOW BINLOG FILES: $binlog_f2_show
|
||||
--die Wrong order of binary log files in SHOW BINARY LOGS
|
||||
}
|
||||
|
||||
--echo Case: Stop datetime at EOF, must not see warning.
|
||||
--echo # MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
--exec $MYSQL_BINLOG --short-form --stop-datetime='2001-09-08 21:46:55' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
|
||||
--echo #
|
||||
--echo #
|
||||
--echo # Test using --read-from-remote-server
|
||||
--echo #
|
||||
--let $read_from_remote_server= 1
|
||||
--source binlog_mysqlbinlog_warn_stop_datetime.inc
|
||||
|
||||
--echo Case: Stop datetime after EOF, must see warning.
|
||||
--echo # MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' MYSQLD_DATADIR/master-bin.000001 --result-file=ignored_output_file
|
||||
--exec $MYSQL_BINLOG --short-form --stop-datetime='2035-01-19 03:14:05' $MYSQLD_DATADIR/master-bin.000001 --result-file=$ignored_output_file 2>&1
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--remove_file $ignored_output_file
|
||||
--echo #
|
||||
--echo #
|
||||
--echo # Test using local binlog files
|
||||
--echo #
|
||||
--let $read_from_remote_server= 0
|
||||
--source binlog_mysqlbinlog_warn_stop_datetime.inc
|
||||
|
||||
--echo #
|
||||
--echo # End of binlog_mysqlbinlog_warn_stop_datetime.test
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
#
|
||||
# Helper file that ensures mysqlbinlog --stop-position behavior for local
|
||||
# files or a remote server
|
||||
#
|
||||
# Parameters:
|
||||
# read_from_remote_server (bool): A boolean that changes which source to use
|
||||
# for mysqlbinlog. When true, reads remotely; when false, uses local files.
|
||||
#
|
||||
|
||||
--connection default
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
|
||||
# PARAM_READ_FROM_REMOTE is used as a parameter to mysqlbinlog (_OUT suffix is
|
||||
# output in echo commands). If using local files, they are blank; if reading
|
||||
# from remote server, it is overridden to the correct values.
|
||||
--let $PARAM_READ_FROM_REMOTE=
|
||||
# Used in echo statements to remove potentially changing values
|
||||
--let $PARAM_READ_FROM_REMOTE_OUT=
|
||||
|
||||
if ($read_from_remote_server)
|
||||
{
|
||||
--let $PARAM_READ_FROM_REMOTE= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT
|
||||
--let $PARAM_READ_FROM_REMOTE_OUT= --read-from-remote-server
|
||||
# binlog files in --read-from-remote-server don't use file system path
|
||||
--let $binlog_f1_full= $binlog_f1
|
||||
--let $binlog_f2_full= $binlog_f2
|
||||
}
|
||||
if (!$read_from_remote_server)
|
||||
{
|
||||
# If using local files, file system path to the binlog files is needed
|
||||
--let $binlog_f1_full= $MYSQLD_DATADIR/$binlog_f1
|
||||
--let $binlog_f2_full= $MYSQLD_DATADIR/$binlog_f2
|
||||
}
|
||||
|
||||
--echo #
|
||||
--echo # --stop-position tests
|
||||
--echo #
|
||||
|
||||
--echo # Case 1.a) With one binlog file, a --stop-position before the end of
|
||||
--echo # the file should not result in a warning
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f1_pre_rotate binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f1_pre_rotate $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 1.b) With one binlog file, a --stop-position at the exact end of
|
||||
--echo # the file should not result in a warning
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f1_end binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f1_end $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 1.c) With one binlog file, a --stop-position past the end of the
|
||||
--echo # file should(!) result in a warning
|
||||
--let $binlog_f1_over_eof= `SELECT $binlog_f1_end + 1`
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --short-form --stop-position=binlog_f1_over_eof binlog_f1_full --result-file=$binlog_out_relpath 2>&1
|
||||
--replace_result $binlog_f1_over_eof <BINLOG_F1_OVER_EOF>
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --short-form --stop-position=$binlog_f1_over_eof $binlog_f1_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.a) With two binlog files, a --stop-position targeting b2 which
|
||||
--echo # exists in the size of b1 should:
|
||||
--echo # 1) not provide any warnings
|
||||
--echo # 2) not prevent b2 from outputting its desired events before the
|
||||
--echo # stop position
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_mid binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_mid $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $server_id= `SELECT @@GLOBAL.server_id`
|
||||
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
|
||||
--let $assert_file= $binlog_out
|
||||
--let $assert_text= Ensure all intended GTIDs are present
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 4
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--let $assert_text= Ensure the next GTID binlogged is _not_ present
|
||||
--let $assert_select= GTID $binlog_f2_gtid_after_midpoint
|
||||
--let $assert_count= 0
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.b) With two binlog files, a --stop-position targeting the end
|
||||
--echo # of binlog 2 should:
|
||||
--echo # 1) not provide any warnings
|
||||
--echo # 2) not prevent b2 from outputting its entire binary log
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_end binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_end $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $server_id= `SELECT @@GLOBAL.server_id`
|
||||
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
|
||||
--let $assert_text= Ensure a GTID exists for each transaction
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 8
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--let $assert_text= Ensure the last GTID binlogged is present
|
||||
--let $assert_select= GTID $binlog_f2_last_gtid
|
||||
--let $assert_count= 1
|
||||
--source include/assert_grep.inc
|
||||
|
||||
--echo #
|
||||
--echo # Case 2.c) With two binlog files, a --stop-position targeting beyond
|
||||
--echo # the eof of binlog 2 should:
|
||||
--echo # 1) provide a warning that the stop position was not reached
|
||||
--echo # 2) not prevent b2 from outputting its entire binary log
|
||||
--let $binlog_f2_over_eof= `SELECT $binlog_f2_end + 1`
|
||||
--echo # MYSQL_BINLOG $PARAM_READ_FROM_REMOTE_OUT --stop-position=binlog_f2_over_eof binlog_f1_full binlog_f2_full --result-file=$binlog_out_relpath 2>&1
|
||||
--replace_result $binlog_f2_over_eof <BINLOG_F2_OVER_EOF>
|
||||
--exec $MYSQL_BINLOG $PARAM_READ_FROM_REMOTE --stop-position=$binlog_f2_over_eof $binlog_f1_full $binlog_f2_full --result-file=$binlog_out 2>&1
|
||||
|
||||
--let $server_id= `SELECT @@GLOBAL.server_id`
|
||||
--let $domain_id= `SELECT @@GLOBAL.gtid_domain_id`
|
||||
--let $assert_text= Ensure a GTID exists for each transaction
|
||||
--let $assert_select= GTID $domain_id-$server_id-
|
||||
--let $assert_count= 8
|
||||
--source include/assert_grep.inc
|
||||
@@ -1,26 +1,83 @@
|
||||
--echo
|
||||
--echo # MDEV-27037 mysqlbinlog emits a warning when reaching EOF before stop-condition
|
||||
--echo
|
||||
#
|
||||
# Test ensures that --stop-position work correctly for mysqlbinlog. This high
|
||||
# level test sets up the binary log (and tags certain locations for comparison),
|
||||
# and the helper file binlog_mysqlbinlog_warn_stop_position.inc performs the
|
||||
# actual tests.
|
||||
#
|
||||
# References:
|
||||
# MDEV-27037: mysqlbinlog emits a warning when reaching EOF before
|
||||
# stop-condition
|
||||
#
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
--let assert_file= $MYSQLTEST_VARDIR/tmp/warn_pos_test_file.out
|
||||
--let data_file= $MYSQLTEST_VARDIR/std_data/master-bin.000001
|
||||
--let $binlog_out_relpath= tmp/warn_position_test_file.out
|
||||
--let $binlog_out= $MYSQLTEST_VARDIR/$binlog_out_relpath
|
||||
|
||||
--echo Case: Default stop position, WARNING must not appear
|
||||
--echo # MYSQL_BINLOG --short-form --start-position=4 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=4 $data_file --result-file=$assert_file 2>&1
|
||||
--echo #
|
||||
--echo # Clear the existing binary log state.
|
||||
--echo #
|
||||
RESET MASTER;
|
||||
|
||||
--echo Case: Stop position before EOF, WARNING must not appear
|
||||
--echo # MYSQL_BINLOG --short-form --start-position=4 --stop-position=97 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=4 --stop-position=97 $data_file --result-file=$assert_file 2>&1
|
||||
--let $binlog_f1= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
--let $binlog_f1_pre_rotate= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
flush binary logs;
|
||||
--let $binlog_f2= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
insert into t1 values (3);
|
||||
--echo # Tag binlog_f2_mid
|
||||
--let $binlog_f2_mid= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
insert into t1 values (4);
|
||||
--let $binlog_f2_gtid_after_midpoint= `SELECT @@GLOBAL.gtid_binlog_pos`
|
||||
insert into t1 values (5);
|
||||
insert into t1 values (6);
|
||||
insert into t1 values (7);
|
||||
--let $binlog_f2_last_gtid= `SELECT @@GLOBAL.gtid_binlog_pos`
|
||||
--let $binlog_f2_pre_rot= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
flush binary logs;
|
||||
drop table t1;
|
||||
|
||||
--echo Case: Stop position at EOF, WARNING must not appear
|
||||
--echo # MYSQL_BINLOG --short-form --start-position=4 --stop-position=98 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=4 --stop-position=98 $data_file --result-file=$assert_file 2>&1
|
||||
--echo # Ensuring binary log order is correct
|
||||
--let $binlog_f1_show= query_get_value(SHOW BINARY LOGS, Log_name, 1)
|
||||
--let $binlog_f1_end= query_get_value(SHOW BINARY LOGS, File_size, 1)
|
||||
if (`SELECT strcmp('$binlog_f1','$binlog_f1_show') != 0`)
|
||||
{
|
||||
--echo # Real binlog_f1: $binlog_f1
|
||||
--echo # First binlog in SHOW BINLOG FILES: $binlog_f1_show
|
||||
--die Wrong order of binary log files in SHOW BINARY LOGS
|
||||
}
|
||||
--let $binlog_f2_show= query_get_value(SHOW BINARY LOGS, Log_name, 2)
|
||||
--let $binlog_f2_end= query_get_value(SHOW BINARY LOGS, File_size, 2)
|
||||
if (`SELECT strcmp('$binlog_f2','$binlog_f2_show') != 0`)
|
||||
{
|
||||
--echo # Real binlog_f2: $binlog_f2
|
||||
--echo # First binlog in SHOW BINLOG FILES: $binlog_f2_show
|
||||
--die Wrong order of binary log files in SHOW BINARY LOGS
|
||||
}
|
||||
|
||||
--echo Case: Stop position after EOF, WARNING must appear
|
||||
--echo # MYSQL_BINLOG --short-form --start-position=4 --stop-position=99 mysql-test/std_data/master-bin.000001 --result-file=warn_pos_test_file.out 2>&1
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=4 --stop-position=99 $data_file --result-file=$assert_file 2>&1
|
||||
--echo # Ensuring file offset of binlog_f2_mid < binlog_f1_end
|
||||
if ($binlog_f2_mid > $binlog_f1_end)
|
||||
{
|
||||
--echo # Binlog 1 end: $binlog_f1:$binlog_f1_end
|
||||
--echo # Binlog 2 stop point: $binlog_f2:$binlog_f2_mid
|
||||
--die Mid point chosen to end in binlog 2 does not exist in earlier binlog
|
||||
}
|
||||
|
||||
--remove_file $assert_file
|
||||
#--echo #
|
||||
#--echo #
|
||||
#--echo # Test using --read-from-remote-server
|
||||
#--echo #
|
||||
#--let $read_from_remote_server= 1
|
||||
#--emit warning is not supported by --read-from-remote-server now
|
||||
#--source binlog_mysqlbinlog_warn_stop_position.inc
|
||||
|
||||
--echo #
|
||||
--echo #
|
||||
--echo # Test using local binlog files
|
||||
--echo #
|
||||
--let $read_from_remote_server= 0
|
||||
--source binlog_mysqlbinlog_warn_stop_position.inc
|
||||
|
||||
--echo #
|
||||
--echo # End of binlog_mysqlbinlog_warn_stop_position.test
|
||||
|
||||
@@ -26,7 +26,7 @@ LTRIM(now()) AS a0,
|
||||
LPAD(now(),10) AS b0;
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a0` varchar(64) NOT NULL DEFAULT ltrim(current_timestamp()),
|
||||
`a1` varchar(64) GENERATED ALWAYS AS (ltrim(`a0`)) STORED,
|
||||
@@ -35,7 +35,7 @@ CREATE TABLE `t1` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a0` varchar(64) NOT NULL DEFAULT ltrim_oracle(current_timestamp()),
|
||||
`a1` varchar(64) GENERATED ALWAYS AS (ltrim_oracle(`a0`)) STORED,
|
||||
@@ -44,13 +44,13 @@ CREATE TABLE `t2` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `a0`,
|
||||
1 AS `b0` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a0`,
|
||||
1 AS `b0` */;
|
||||
|
||||
@@ -2245,7 +2245,7 @@ CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
# Dump table t1 using mysqldump tool
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`id` varchar(20) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# This .cnf file creates a setup with 2 standard MariaDB servers, followed by a 2-node Galera cluster
|
||||
#
|
||||
|
||||
# Use default setting for mysqld processes
|
||||
!include include/default_mysqld.cnf
|
||||
|
||||
[mysqld]
|
||||
loose-innodb
|
||||
log-bin=mysqld-bin
|
||||
log-slave-updates
|
||||
binlog-format=row
|
||||
innodb-autoinc-lock-mode=2
|
||||
default-storage-engine=innodb
|
||||
# enforce read-committed characteristics across the cluster
|
||||
# wsrep-causal-reads=ON
|
||||
wsrep-sync-wait=15
|
||||
|
||||
[mysqld.1]
|
||||
wsrep-on=1
|
||||
server-id=1
|
||||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep_provider=@ENV.WSREP_PROVIDER
|
||||
wsrep_cluster_address=gcomm://
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
|
||||
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
|
||||
[mysqld.2]
|
||||
wsrep-on=1
|
||||
server-id=2
|
||||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep_provider=@ENV.WSREP_PROVIDER
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
|
||||
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
|
||||
[mysqld.3]
|
||||
wsrep-on=OFF
|
||||
server-id=3
|
||||
gtid_domain_id=3
|
||||
|
||||
[mysqld.4]
|
||||
wsrep-on=OFF
|
||||
server-id=4
|
||||
gtid_domain_id=4
|
||||
|
||||
|
||||
[sst]
|
||||
sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log
|
||||
|
||||
[ENV]
|
||||
NODE_MYPORT_1= @mysqld.1.port
|
||||
NODE_MYSOCK_1= @mysqld.1.socket
|
||||
|
||||
NODE_MYPORT_2= @mysqld.2.port
|
||||
NODE_MYSOCK_2= @mysqld.2.socket
|
||||
|
||||
NODE_MYPORT_3= @mysqld.3.port
|
||||
NODE_MYSOCK_3= @mysqld.3.socket
|
||||
|
||||
NODE_MYPORT_4= @mysqld.4.port
|
||||
NODE_MYSOCK_4= @mysqld.4.socket
|
||||
95
mysql-test/suite/galera/r/galera_2primary_replica.result
Normal file
95
mysql-test/suite/galera/r/galera_2primary_replica.result
Normal file
@@ -0,0 +1,95 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connect primary1, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect primary2, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection primary1;
|
||||
# Primary1 creating user for replication
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
connection primary2;
|
||||
# Primary2 creating user for replication
|
||||
create user repl2@'%' identified by 'repl2';
|
||||
grant all on *.* to repl2@'%';
|
||||
connect replica, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
connection replica;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
# Galera replica changing master to primary1
|
||||
SET @@default_master_connection='stream2';
|
||||
# Primary node changing master to primary2
|
||||
START ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1937 SLAVE 'stream1' started
|
||||
Note 1937 SLAVE 'stream2' started
|
||||
connection primary1;
|
||||
# Primary 1: Creating table and populating it with data
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection primary2;
|
||||
# Primary 2: Creating table and populating it with data
|
||||
CREATE TABLE t2 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection replica;
|
||||
# Waiting for data to replicate to node_1
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
EXPECT_1000
|
||||
1000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
3-3-1003,4-4-1003 3-3-1003,4-4-1003 3-3-1003,4-4-1003
|
||||
connection node_2;
|
||||
# Waiting for data to replicate to node_2
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
EXPECT_1000
|
||||
1000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
3-3-1003,4-4-1003 3-3-1003,4-4-1003 3-3-1003,4-4-1003
|
||||
connection primary1;
|
||||
drop table t1;
|
||||
connection primary2;
|
||||
drop table t2;
|
||||
# Wait until drop table is replicated on Galera
|
||||
connection replica;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'stream1' stopped
|
||||
Note 1938 SLAVE 'stream2' stopped
|
||||
RESET SLAVE ALL;
|
||||
connection primary1;
|
||||
RESET MASTER;
|
||||
connection primary2;
|
||||
RESET MASTER;
|
||||
connection node_1;
|
||||
disconnect primary1;
|
||||
disconnect primary2;
|
||||
disconnect replica;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
||||
138
mysql-test/suite/galera/r/galera_circular_replication.result
Normal file
138
mysql-test/suite/galera/r/galera_circular_replication.result
Normal file
@@ -0,0 +1,138 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connect replica1, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
connect primary2, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect primary1, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connect replica2, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection primary1;
|
||||
# Primary1 node creating user for replication
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
connection replica1;
|
||||
connection node_2;
|
||||
connection primary2;
|
||||
connection replica1;
|
||||
# Galera replica changing master to primary1
|
||||
START SLAVE;
|
||||
connection primary2;
|
||||
# Primary2 creating user for replication
|
||||
create user repl2@'%' identified by 'repl2';
|
||||
grant all on *.* to repl2@'%';
|
||||
connection replica2;
|
||||
# replica2 changing master to primary2
|
||||
START SLAVE;
|
||||
connection primary1;
|
||||
# Primary1: Creating table and populating it with data
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection replica1;
|
||||
# Waiting for data to replicate to replica
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
# Writing more data to table
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
connection node_2;
|
||||
# Waiting for data to replicate to Galera node_2
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
# Writing more data to table
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_3000 FROM t1;
|
||||
EXPECT_3000
|
||||
3000
|
||||
connection primary2;
|
||||
# Waiting for data to replicate to primary2
|
||||
SELECT COUNT(*) AS EXPECT_3000 FROM t1;
|
||||
EXPECT_3000
|
||||
3000
|
||||
# Writing more data to table
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
EXPECT_4000
|
||||
4000
|
||||
connection primary1;
|
||||
# Waiting for data to replicate to primary1
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
EXPECT_4000
|
||||
4000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-4-1004,16-15-3002 0-4-1004,16-15-3002 0-4-1004,16-15-3002
|
||||
connection replica1;
|
||||
# Waiting for data to replicate to replica
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
EXPECT_4000
|
||||
4000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-4-1004,16-15-3002 0-4-1004,16-15-3002 0-4-1004,16-15-3002
|
||||
connection node_2;
|
||||
# Waiting for data to replicate to node_2
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
EXPECT_4000
|
||||
4000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-4-1004 0-4-1004,16-15-3002 0-4-1004,16-15-3002
|
||||
connection primary2;
|
||||
# Waiting for data to replicate to node_3
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
EXPECT_4000
|
||||
4000
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-4-1004 0-4-1004,16-15-3002 0-4-1004,16-15-3002
|
||||
connection primary1;
|
||||
drop table t1;
|
||||
# Wait until drop table is replicated on Galera
|
||||
connection replica1;
|
||||
connection node_2;
|
||||
connection primary2;
|
||||
connection replica1;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
connection replica2;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
RESET MASTER;
|
||||
connection node_1;
|
||||
disconnect primary1;
|
||||
disconnect replica1;
|
||||
disconnect primary2;
|
||||
disconnect replica2;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
||||
@@ -1,122 +1,169 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect replica, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
connect primary, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
connection replica;
|
||||
START SLAVE;
|
||||
connection node_3;
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
connection primary;
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection replica;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-1004 0-3-1004 0-3-1004
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
# Verify that graceful shutdown succeeds.
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-1004 0-3-1004 0-3-1004
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection replica;
|
||||
# Verify that graceful shutdown succeeds in replica.
|
||||
# Force SST
|
||||
connection node_1;
|
||||
# Waiting until node_2 is not part of cluster anymore
|
||||
connection node_2;
|
||||
# Start node_2 again
|
||||
¤ Wait until node_2 is back on cluster
|
||||
connection node_2;
|
||||
# Waiting until replica is not part of cluster anymore
|
||||
connection replica;
|
||||
# Start replica again
|
||||
# Wait until replica is back on cluster
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-1004 0-3-1004 0-3-1004
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_3;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_3;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-1004 0-3-1004 0-3-1004
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection primary;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
drop table t1;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
connection node_1;
|
||||
connection node_3;
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
connection primary;
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection replica;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-2006 0-3-2006 0-3-2006
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
EXPECT_1000
|
||||
1000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
EXPECT_10000
|
||||
10000
|
||||
connection node_2;
|
||||
# Verify that graceful shutdown succeeds.
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-2006 0-3-2006 0-3-2006
|
||||
connection replica;
|
||||
# Verify that graceful shutdown succeeds in replica.
|
||||
# Force SST
|
||||
connection node_1;
|
||||
# Waiting until node_2 is not part of cluster anymore
|
||||
connection node_3;
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
EXPECT_20000
|
||||
20000
|
||||
connection node_2;
|
||||
# Start node_2 again
|
||||
¤ Wait until node_2 is back on cluster
|
||||
connection node_2;
|
||||
# Waiting until replica is not part of cluster anymore
|
||||
# Add writes to primary
|
||||
connection primary;
|
||||
# Intentionally generate 1k GTID-events
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
connection replica;
|
||||
# Start replica again
|
||||
# Wait until replica is back on cluster
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
EXPECT_20000
|
||||
20000
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-3006 0-3-3006 0-3-3006
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
connection node_1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
EXPECT_20000
|
||||
20000
|
||||
connection node_3;
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
EXPECT_20000
|
||||
20000
|
||||
connection node_3;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
@@gtid_slave_pos @@gtid_binlog_pos @@gtid_current_pos
|
||||
0-3-3006 0-3-3006 0-3-3006
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
connection primary;
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
EXPECT_2000
|
||||
2000
|
||||
drop table t1;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection replica;
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
connection node_3;
|
||||
connection primary;
|
||||
RESET MASTER;
|
||||
connection node_1;
|
||||
disconnect node_3;
|
||||
disconnect primary;
|
||||
disconnect replica;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
# End of test
|
||||
|
||||
22
mysql-test/suite/galera/t/galera_2primary_replica.cnf
Normal file
22
mysql-test/suite/galera/t/galera_2primary_replica.cnf
Normal file
@@ -0,0 +1,22 @@
|
||||
!include ../galera_2nodes_as_replica_2primary.cnf
|
||||
|
||||
[mysqld]
|
||||
wsrep-debug=1
|
||||
|
||||
[mysqld.1]
|
||||
server_id=15
|
||||
wsrep_gtid_mode=1
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=1
|
||||
wsrep-slave-threads=4
|
||||
slave-parallel-threads=2
|
||||
|
||||
[mysqld.2]
|
||||
skip-slave-start=OFF
|
||||
server_id=15
|
||||
wsrep_gtid_mode=1
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=1
|
||||
wsrep-slave-threads=4
|
||||
170
mysql-test/suite/galera/t/galera_2primary_replica.test
Normal file
170
mysql-test/suite/galera/t/galera_2primary_replica.test
Normal file
@@ -0,0 +1,170 @@
|
||||
#
|
||||
# Test two primary nodes async replication to Galera cluster
|
||||
#
|
||||
# primary1 primary2
|
||||
# #3 #4
|
||||
# | |
|
||||
# | async replication v
|
||||
# +-------------------+ +----------------+
|
||||
# | |
|
||||
# v v
|
||||
# galera replica <------galera replication-------->galera node_2
|
||||
# #1 #2
|
||||
#
|
||||
# Test outline
|
||||
#
|
||||
# - Create user for async replication and table with rows in both primaries
|
||||
# - Verify that tables and rows are replicated to all Galera nodes
|
||||
# - Verify that gtid position is same in all Galera nodes
|
||||
#
|
||||
# The galera/galera_2nodes_as_replica_2primary.cnf describes the setup of the nodes
|
||||
#
|
||||
--source include/force_restart.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# As node #3 and #4 are not a Galera node, and galera_cluster.inc does not open connetion to it
|
||||
# we open the connections here
|
||||
--connect primary1, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connect primary2, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connection primary1
|
||||
--echo # Primary1 creating user for replication
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
|
||||
--connection primary2
|
||||
--echo # Primary2 creating user for replication
|
||||
create user repl2@'%' identified by 'repl2';
|
||||
grant all on *.* to repl2@'%';
|
||||
|
||||
--connect replica, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
|
||||
--let $node_1 = replica
|
||||
--let $node_2 = node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection replica
|
||||
--echo # Galera replica changing master to primary1
|
||||
--disable_query_log
|
||||
SET @@default_master_connection='stream1';
|
||||
--eval CHANGE MASTER 'stream1' TO master_host='127.0.0.1', master_user='repl', master_password='repl', master_port=$NODE_MYPORT_3, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
|
||||
SET @@default_master_connection='stream2';
|
||||
--echo # Primary node changing master to primary2
|
||||
--disable_query_log
|
||||
--eval CHANGE MASTER 'stream2' TO master_host='127.0.0.1', master_user='repl2', master_password='repl2', master_port=$NODE_MYPORT_4, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
|
||||
START ALL SLAVES;
|
||||
|
||||
--connection primary1
|
||||
--echo # Primary 1: Creating table and populating it with data
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
--disable_query_log
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection primary2
|
||||
--echo # Primary 2: Creating table and populating it with data
|
||||
CREATE TABLE t2 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t2 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
|
||||
--connection replica
|
||||
--echo # Waiting for data to replicate to node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--let $wait_condition_on_error_output = SHOW ALL SLAVES STATUS;
|
||||
--source include/wait_condition_with_debug.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
|
||||
--let $wait_condition_on_error_output = SHOW ALL SLAVES STATUS;
|
||||
--source include/wait_condition_with_debug.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t2;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
|
||||
--connection node_2
|
||||
--echo # Waiting for data to replicate to node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t2;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--connection primary1
|
||||
drop table t1;
|
||||
--connection primary2
|
||||
drop table t2;
|
||||
|
||||
--echo # Wait until drop table is replicated on Galera
|
||||
--connection replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection replica
|
||||
STOP ALL SLAVES;
|
||||
RESET SLAVE ALL;
|
||||
|
||||
--connection primary1
|
||||
RESET MASTER;
|
||||
--connection primary2
|
||||
RESET MASTER;
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--connection node_1
|
||||
--disconnect primary1
|
||||
--disconnect primary2
|
||||
--disconnect replica
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
25
mysql-test/suite/galera/t/galera_circular_replication.cnf
Normal file
25
mysql-test/suite/galera/t/galera_circular_replication.cnf
Normal file
@@ -0,0 +1,25 @@
|
||||
!include ../galera_3nodes_as_slave.cnf
|
||||
|
||||
[mysqld]
|
||||
wsrep-debug=1
|
||||
|
||||
[mysqld.1]
|
||||
server_id=15
|
||||
wsrep_gtid_mode=1
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=1
|
||||
|
||||
[mysqld.2]
|
||||
server_id=15
|
||||
wsrep_gtid_mode=1
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=1
|
||||
|
||||
[mysqld.3]
|
||||
server_id=15
|
||||
wsrep_gtid_mode=1
|
||||
wsrep_gtid_domain_id=16
|
||||
gtid_domain_id=11
|
||||
gtid_strict_mode=1
|
||||
234
mysql-test/suite/galera/t/galera_circular_replication.test
Normal file
234
mysql-test/suite/galera/t/galera_circular_replication.test
Normal file
@@ -0,0 +1,234 @@
|
||||
#
|
||||
# Test circular replication where galera cluster is async replica and master
|
||||
#
|
||||
# mariadb #4 galera galera
|
||||
# primary1
|
||||
# replica2
|
||||
# ---async replication-->replica1 #1 <--galera replication--> node_2 #2
|
||||
# ^ ^
|
||||
# | | galera replication
|
||||
# | v
|
||||
# +<------------------async replication----------------------primary2 (galera) #3
|
||||
#
|
||||
# Test outline:
|
||||
#
|
||||
# - Create user for async replication in primary1
|
||||
# - Create user for async replication in primary2
|
||||
# - Create table and some data in primary1
|
||||
# - Verify that table and data is replicated to galera nodes
|
||||
# - Verify that mysql.gtid_slave_pos has some rows in all Galera nodes
|
||||
# - Verify that gtid_slave_pos, gtid_binlog_pos and gtid_current_pos are
|
||||
# same in all Galera nodes and primary1
|
||||
# - Verify that writes on Galera nodes are replicated to all nodes
|
||||
# and to primary1
|
||||
#
|
||||
# The galera/galera_3nodes_as_slave.cnf describes the setup of the nodes
|
||||
#
|
||||
--source include/force_restart.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connect replica1, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--connect primary2, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
|
||||
# As node #4 is not a Galera node, and galera_cluster.inc does not open connetion to it
|
||||
# because it is both primary and replica we open both connections here
|
||||
--connect primary1, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connect replica2, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
|
||||
--connection primary1
|
||||
--echo # Primary1 node creating user for replication
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
||||
--let $node_1 = replica1
|
||||
--let $node_2 = node_2
|
||||
--let $node_3 = primary2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection replica1
|
||||
--echo # Galera replica changing master to primary1
|
||||
--disable_query_log
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='repl', master_password='repl', master_port=$NODE_MYPORT_4, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
START SLAVE;
|
||||
|
||||
--connection primary2
|
||||
--echo # Primary2 creating user for replication
|
||||
create user repl2@'%' identified by 'repl2';
|
||||
grant all on *.* to repl2@'%';
|
||||
|
||||
--connection replica2
|
||||
--echo # replica2 changing master to primary2
|
||||
--disable_query_log
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='repl2', master_password='repl2', master_port=$NODE_MYPORT_3, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
START SLAVE;
|
||||
|
||||
--connection primary1
|
||||
--echo # Primary1: Creating table and populating it with data
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection replica1
|
||||
--echo # Waiting for data to replicate to replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--echo # Writing more data to table
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--echo # Waiting for data to replicate to Galera node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 2000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
--echo # Writing more data to table
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_3000 FROM t1;
|
||||
|
||||
--connection primary2
|
||||
--echo # Waiting for data to replicate to primary2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 3000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_3000 FROM t1;
|
||||
|
||||
--echo # Writing more data to table
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
|
||||
--connection primary1
|
||||
--echo # Waiting for data to replicate to primary1
|
||||
--let $wait_condition = SELECT COUNT(*) = 4000 FROM t1;
|
||||
--let $wait_condition_on_error_output = SHOW SLAVE STATUS;
|
||||
--source include/wait_condition_with_debug.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
|
||||
--connection replica1
|
||||
--echo # Waiting for data to replicate to replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 4000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
|
||||
--connection node_2
|
||||
--echo # Waiting for data to replicate to node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
|
||||
--connection primary2
|
||||
--echo # Waiting for data to replicate to node_3
|
||||
--let $wait_condition = SELECT COUNT(*) = 4000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) AS EXPECT_4000 FROM t1;
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--connection primary1
|
||||
drop table t1;
|
||||
|
||||
--echo # Wait until drop table is replicated on Galera
|
||||
--connection replica1
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection primary2
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection replica1
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
|
||||
--connection replica2
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
RESET MASTER;
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--connection node_1
|
||||
--disconnect primary1
|
||||
--disconnect replica1
|
||||
--disconnect primary2
|
||||
--disconnect replica2
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
@@ -1,77 +1,115 @@
|
||||
#
|
||||
# Test Galera as a replica to a MySQL async replication
|
||||
# Test Galera as a replica to a MariaDB async replication
|
||||
#
|
||||
# MariaDB
|
||||
# primary ---async replication--->galera node_2 (replica)<----galera replication---> galera node1
|
||||
#
|
||||
# Test outline:
|
||||
#
|
||||
# - Create user for async replication
|
||||
# - Create table and some data in primary
|
||||
# - Verify that table and data is replicated to galera nodes
|
||||
# - Verify that mysql.gtid_slave_pos has some rows in all Galera nodes
|
||||
# - Verify that gtid_slave_pos, gtid_binlog_pos and gtid_current_pos are
|
||||
# same in all Galera nodes
|
||||
# - Verify that we can shutdown and restart Galera replica (node #2)
|
||||
# - Verify that gtid_slave_pos, gtid_binlog_pos and gtid_current_pos are
|
||||
# same in all Galera nodes
|
||||
# - Verify that mysql.gtid_slave_pos table has limited amount of rows
|
||||
# - Veruft that ddl works (drop table)
|
||||
#
|
||||
# Similar test is done so that new rows are added to table in
|
||||
# primary while async replica (node #2) is down.
|
||||
#
|
||||
# The galera/galera_2node_slave.cnf describes the setup of the nodes
|
||||
#
|
||||
--source include/force_restart.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
# In this test we mark node #2 as replica
|
||||
--connect replica, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
|
||||
# As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it
|
||||
# we open the node_3 connection here
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
# we open the primary connection her
|
||||
--connect primary, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
|
||||
create user repl@'%' identified by 'repl';
|
||||
grant all on *.* to repl@'%';
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
||||
--let $node_1 = node_1
|
||||
--let $node_2 = node_2
|
||||
--let $node_2 = replica
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_2
|
||||
--connection replica
|
||||
--disable_query_log
|
||||
--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='repl', master_password='repl', master_port=$NODE_MYPORT_3, master_use_gtid=slave_pos;
|
||||
--enable_query_log
|
||||
START SLAVE;
|
||||
|
||||
--connection node_3
|
||||
--connection primary
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
INSERT INTO t1 SELECT seq, 'test' from seq_1_to_10000;
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--echo # Verify that graceful shutdown succeeds.
|
||||
--connection replica
|
||||
--echo # Verify that graceful shutdown succeeds in replica.
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo # Force SST
|
||||
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
|
||||
|
||||
--connection node_1
|
||||
--echo # Waiting until node_2 is not part of cluster anymore
|
||||
--echo # Waiting until replica is not part of cluster anymore
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--echo # Start node_2 again
|
||||
--connection replica
|
||||
--echo # Start replica again
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--echo ¤ Wait until node_2 is back on cluster
|
||||
--echo # Wait until replica is back on cluster
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
@@ -79,24 +117,30 @@ SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_3
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
--connection primary
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--connection node_3
|
||||
drop table t1;
|
||||
|
||||
--connection node_2
|
||||
--connection replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
@@ -108,59 +152,80 @@ drop table t1;
|
||||
# Case 2 : While slave is down add writes to master
|
||||
#
|
||||
|
||||
--connection node_3
|
||||
|
||||
CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
|
||||
--connection primary
|
||||
CREATE TABLE t1 (id bigint auto_increment primary key, msg varchar(100)) engine=innodb;
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
INSERT INTO t1 SELECT seq, 'test' from seq_1_to_10000;
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--connection replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_10000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
|
||||
--connection node_2
|
||||
--echo # Verify that graceful shutdown succeeds.
|
||||
--connection replica
|
||||
--echo # Verify that graceful shutdown succeeds in replica.
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo # Force SST
|
||||
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
|
||||
|
||||
--connection node_1
|
||||
--echo # Waiting until node_2 is not part of cluster anymore
|
||||
--echo # Waiting until replica is not part of cluster anymore
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# Add writes to master
|
||||
--connection node_3
|
||||
--echo # Add writes to primary
|
||||
--connection primary
|
||||
--echo # Intentionally generate 1k GTID-events
|
||||
--let $inserts=1000
|
||||
--let $count=0
|
||||
--disable_query_log
|
||||
INSERT INTO t1 SELECT seq, 'test' from seq_20001_to_30000;
|
||||
while($count < $inserts)
|
||||
{
|
||||
--eval insert into t1 values (NULL,'test1')
|
||||
--inc $count
|
||||
}
|
||||
--enable_query_log
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
|
||||
--connection node_2
|
||||
--echo # Start node_2 again
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
--connection replica
|
||||
--echo # Start replica again
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--echo ¤ Wait until node_2 is back on cluster
|
||||
--echo # Wait until replica is back on cluster
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
@@ -168,28 +233,34 @@ SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 2000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 20000 FROM t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 2000 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
--let $wait_condition = SELECT COUNT(*) < 1000 FROM mysql.gtid_slave_pos;
|
||||
--source include/wait_condition.inc
|
||||
SELECT COUNT(*) > 0 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
SELECT COUNT(*) < 1000 AS EXPECT_1 FROM mysql.gtid_slave_pos;
|
||||
SELECT @@gtid_slave_pos,@@gtid_binlog_pos,@@gtid_current_pos;
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
--connection node_3
|
||||
SELECT COUNT(*) AS EXPECT_20000 FROM t1;
|
||||
--connection primary
|
||||
SELECT COUNT(*) AS EXPECT_2000 FROM t1;
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
--connection node_3
|
||||
drop table t1;
|
||||
|
||||
--connection node_2
|
||||
--connection replica
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
@@ -197,16 +268,18 @@ drop table t1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
--connection replica
|
||||
STOP SLAVE;
|
||||
RESET SLAVE ALL;
|
||||
|
||||
--connection node_3
|
||||
--connection primary
|
||||
RESET MASTER;
|
||||
|
||||
--connection node_1
|
||||
--disconnect node_3
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--connection node_1
|
||||
--disconnect primary
|
||||
--disconnect replica
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
||||
@@ -825,3 +825,22 @@ DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN';
|
||||
SELECT * from t1 WHERE ts = 1 AND color = 'GREEN';
|
||||
id color ts
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-22695 Server crashes in heap_rnext upon DELETE from a HEAP table
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(128), b VARCHAR(32), KEY(a) USING BTREE, KEY(b) USING BTREE) ENGINE=HEAP;
|
||||
INSERT INTO t1 VALUES ('foo',NULL),('m','b'),(6,'j'),('bar','qux'),(NULL,NULL);
|
||||
DELETE FROM t1 WHERE a <=> 'm' OR b <=> NULL;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-28130 MariaDB SEGV issue at tree_search_next
|
||||
#
|
||||
CREATE TABLE v(t1 INT, pk INT, KEY(t1), KEY pk using btree (pk), KEY v using btree(t1, pk)) engine=memory;
|
||||
HANDLER v OPEN;
|
||||
HANDLER v READ t1=(2) limit 3;
|
||||
t1 pk
|
||||
HANDLER v READ pk PREV;
|
||||
t1 pk
|
||||
HANDLER v READ pk PREV;
|
||||
t1 pk
|
||||
drop table v;
|
||||
|
||||
@@ -607,3 +607,22 @@ INSERT INTO t1 VALUES("7","GREEN", 2);
|
||||
DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN';
|
||||
SELECT * from t1 WHERE ts = 1 AND color = 'GREEN';
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22695 Server crashes in heap_rnext upon DELETE from a HEAP table
|
||||
--echo #
|
||||
CREATE TABLE t1 (a VARCHAR(128), b VARCHAR(32), KEY(a) USING BTREE, KEY(b) USING BTREE) ENGINE=HEAP;
|
||||
INSERT INTO t1 VALUES ('foo',NULL),('m','b'),(6,'j'),('bar','qux'),(NULL,NULL);
|
||||
DELETE FROM t1 WHERE a <=> 'm' OR b <=> NULL;
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28130 MariaDB SEGV issue at tree_search_next
|
||||
--echo #
|
||||
CREATE TABLE v(t1 INT, pk INT, KEY(t1), KEY pk using btree (pk), KEY v using btree(t1, pk)) engine=memory;
|
||||
HANDLER v OPEN;
|
||||
HANDLER v READ t1=(2) limit 3;
|
||||
HANDLER v READ pk PREV;
|
||||
HANDLER v READ pk PREV;
|
||||
drop table v;
|
||||
|
||||
@@ -3347,3 +3347,9 @@ Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
ALTER TABLE t1 FORCE;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-35723: applying zero offset to null pointer on INSERT
|
||||
#
|
||||
CREATE TABLE t1(c TEXT(1) NOT NULL, INDEX (c)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET c='';
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -2615,3 +2615,10 @@ CHECK TABLE t1;
|
||||
ALTER TABLE t1 FORCE;
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35723: applying zero offset to null pointer on INSERT
|
||||
--echo #
|
||||
CREATE TABLE t1(c TEXT(1) NOT NULL, INDEX (c)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET c='';
|
||||
DROP TABLE t1;
|
||||
|
||||
4
mysql-test/suite/mariabackup/undo_truncate.combinations
Normal file
4
mysql-test/suite/mariabackup/undo_truncate.combinations
Normal file
@@ -0,0 +1,4 @@
|
||||
[clear]
|
||||
--innodb-encrypt-log=OFF
|
||||
[crypt]
|
||||
--innodb-encrypt-log=ON
|
||||
6
mysql-test/suite/mariabackup/undo_truncate.opt
Normal file
6
mysql-test/suite/mariabackup/undo_truncate.opt
Normal file
@@ -0,0 +1,6 @@
|
||||
--innodb-undo-tablespaces=2
|
||||
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
|
||||
--loose-file-key-management
|
||||
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key
|
||||
--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc
|
||||
--loose-file-key-management-encryption-algorithm=aes_cbc
|
||||
39
mysql-test/suite/mariabackup/undo_truncate.result
Normal file
39
mysql-test/suite/mariabackup/undo_truncate.result
Normal file
@@ -0,0 +1,39 @@
|
||||
SET GLOBAL innodb_undo_log_truncate = 0;
|
||||
create table t1 (keyc int primary key default 0, c char(6)) engine=innodb;
|
||||
create table t2 (keyc int primary key default 0, c char(6)) engine=innodb;
|
||||
CREATE PROCEDURE p(t VARCHAR(64))
|
||||
BEGIN
|
||||
DECLARE i TEXT DEFAULT 'insert into t1 select seq,repeat(chr(48),6)
|
||||
from seq_1_to_20000';
|
||||
DECLARE u1 TEXT DEFAULT 'update t1 set c=repeat(chr(32),6)';
|
||||
DECLARE u2 TEXT DEFAULT 'update t1 set c=repeat(chr(64),6)';
|
||||
EXECUTE IMMEDIATE REPLACE(i,'t1', t);
|
||||
EXECUTE IMMEDIATE REPLACE(u1,'t1', t);
|
||||
EXECUTE IMMEDIATE REPLACE(u2,'t1', t);
|
||||
END;
|
||||
$$
|
||||
connect con1,localhost,root,,;
|
||||
begin;
|
||||
call p('t1');
|
||||
connection default;
|
||||
call p('t2');
|
||||
connection con1;
|
||||
commit;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP PROCEDURE p;
|
||||
SET GLOBAL innodb_undo_log_truncate = 1;
|
||||
SET GLOBAL innodb_max_undo_log_size=DEFAULT;
|
||||
SET GLOBAL innodb_max_purge_lag_wait=0;
|
||||
# Prepare full backup
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
20000
|
||||
DROP TABLE t1,t2;
|
||||
59
mysql-test/suite/mariabackup/undo_truncate.test
Normal file
59
mysql-test/suite/mariabackup/undo_truncate.test
Normal file
@@ -0,0 +1,59 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_file_key_management.inc
|
||||
|
||||
SET GLOBAL innodb_undo_log_truncate = 0;
|
||||
|
||||
#
|
||||
# Perform DML action using multiple clients and multiple undo tablespace.
|
||||
#
|
||||
|
||||
create table t1 (keyc int primary key default 0, c char(6)) engine=innodb;
|
||||
create table t2 (keyc int primary key default 0, c char(6)) engine=innodb;
|
||||
|
||||
DELIMITER $$;
|
||||
CREATE PROCEDURE p(t VARCHAR(64))
|
||||
BEGIN
|
||||
DECLARE i TEXT DEFAULT 'insert into t1 select seq,repeat(chr(48),6)
|
||||
from seq_1_to_20000';
|
||||
DECLARE u1 TEXT DEFAULT 'update t1 set c=repeat(chr(32),6)';
|
||||
DECLARE u2 TEXT DEFAULT 'update t1 set c=repeat(chr(64),6)';
|
||||
EXECUTE IMMEDIATE REPLACE(i,'t1', t);
|
||||
EXECUTE IMMEDIATE REPLACE(u1,'t1', t);
|
||||
EXECUTE IMMEDIATE REPLACE(u2,'t1', t);
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
begin;
|
||||
send call p('t1');
|
||||
|
||||
connection default;
|
||||
call p('t2');
|
||||
|
||||
connection con1;
|
||||
reap;
|
||||
commit;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP PROCEDURE p;
|
||||
|
||||
SET GLOBAL innodb_undo_log_truncate = 1;
|
||||
SET GLOBAL innodb_max_undo_log_size=DEFAULT;
|
||||
SET GLOBAL innodb_max_purge_lag_wait=0;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --throttle=1000;
|
||||
--echo # Prepare full backup
|
||||
exec $XTRABACKUP --prepare --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
source include/restart_and_restore.inc;
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
# Cleanup
|
||||
rmdir $targetdir;
|
||||
DROP TABLE t1,t2;
|
||||
@@ -280,32 +280,32 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
|
||||
|
||||
USE `test`;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v1` AS SELECT
|
||||
1 AS `a+b`,
|
||||
1 AS `c` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v2` AS SELECT
|
||||
1 AS `a+b`,
|
||||
1 AS `c`,
|
||||
1 AS `current_role()` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v3` AS SELECT
|
||||
1 AS `a+b`,
|
||||
1 AS `c` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v4` AS SELECT
|
||||
1 AS `a+b`,
|
||||
1 AS `c` */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
SET character_set_client = utf8mb4;
|
||||
/*!50001 CREATE VIEW `v5` AS SELECT
|
||||
1 AS `a+b`,
|
||||
1 AS `c` */;
|
||||
@@ -315,7 +315,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
|
||||
|
||||
USE `mysqltest1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
@@ -324,7 +324,7 @@ CREATE TABLE `t1` (
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
INSERT INTO `t1` VALUES (1,10,100),(2,20,200);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
#
|
||||
# Initialize system-versioned and partitioned table and its data
|
||||
connection master;
|
||||
SET timestamp=UNIX_TIMESTAMP('2025-01-01 01:00:00.000000');
|
||||
RESET MASTER;
|
||||
create table t1 (x int) engine=InnoDB with system versioning partition by system_time limit 3 partitions 5;
|
||||
insert into t1 values(1);
|
||||
insert into t1 values(2);
|
||||
insert into t1 values(3);
|
||||
insert into t1 values(4);
|
||||
insert into t1 values(5);
|
||||
# Verifying master partitions are correct after data insertion..
|
||||
# .. done
|
||||
connection slave;
|
||||
connection slave;
|
||||
# Verifying partitions of master and slave match on data setup..
|
||||
# .. done
|
||||
#
|
||||
# "Delete" each row -- these are the BINLOG commands generated by
|
||||
# mysqlbinlog from `delete from t1 where x=<n>` statments. Because the
|
||||
# table uses system versioning and system_time partition, the actual
|
||||
# events are updates, with added fields for the `row_start` and `row_end`
|
||||
# columns.
|
||||
connection master;
|
||||
# BINLOG for Format Description event
|
||||
BINLOG '
|
||||
APZ0Zw8BAAAA/AAAAAABAAAAAAQAMTAuNi4yMS1NYXJpYURCLWRlYnVnLWxvZwAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAA9nRnEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
|
||||
CgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAEEwQADQgICAoKCgHgiCNP
|
||||
';
|
||||
# BINLOG for delete from t1 where x=1;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAAQHAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBvaHPfA==
|
||||
APZ0ZxgBAAAASAAAAEwHAAAAACEAAAAAAAEAAwcH+AEAAABndPYAAAAAf////w9CP/gBAAAAZ3T2
|
||||
AAAAAGd09gAAAADnhA23
|
||||
';
|
||||
# BINLOG for delete from t1 where x=2;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAPUHAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBwNtQNQ==
|
||||
APZ0ZxgBAAAASAAAAD0IAAAAACEAAAAAAAEAAwcH+AIAAABndPYAAAAAf////w9CP/gCAAAAZ3T2
|
||||
AAAAAGd09gAAAABPYZUX
|
||||
';
|
||||
# BINLOG for delete from t1 where x=3;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAOYIAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBKWGevg==
|
||||
APZ0ZxgBAAAASAAAAC4JAAAAACEAAAAAAAEAAwcH+AMAAABndPYAAAAAf////w9CP/gDAAAAZ3T2
|
||||
AAAAAGd09gAAAAD0hz5S
|
||||
';
|
||||
# BINLOG for delete from t1 where x=4;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAANcJAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBaT9IZg==
|
||||
APZ0ZxgBAAAASAAAAB8KAAAAACEAAAAAAAEAAwcH+AQAAABndPYAAAAAf////w9CP/gEAAAAZ3T2
|
||||
AAAAAGd09gAAAADA4Tdx
|
||||
';
|
||||
# BINLOG for delete from t1 where x=5;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAMgKAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBMk64Mw==
|
||||
APZ0ZxgBAAAASAAAABALAAAAACEAAAAAAAEAAwcH+AUAAABndPYAAAAAf////w9CP/gFAAAAZ3T2
|
||||
AAAAAGd09gAAAAA5blY6
|
||||
';
|
||||
# Verifying master partitions are correct after deletion BINLOG stmts..
|
||||
# .. done
|
||||
connection slave;
|
||||
connection slave;
|
||||
connection master;
|
||||
drop table t1;
|
||||
include/rpl_end.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
!include ../my.cnf
|
||||
|
||||
[mysqld]
|
||||
default_time_zone="-7:00"
|
||||
248
mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test
Normal file
248
mysql-test/suite/rpl/t/rpl_system_versioning_partitions.test
Normal file
@@ -0,0 +1,248 @@
|
||||
#
|
||||
# Ensure that executing row-injected events (i.e. via BINLOG statments and
|
||||
# row-based binlog events) uses historical partitions. That is, for tables
|
||||
# which use system versioning and system_time partitions, MDEV-35096 reported
|
||||
# that row-injected events would not be stored into the correct historical
|
||||
# partition. This test considers both use cases of row-injected events.
|
||||
#
|
||||
# The test setup creates a system-versioned table with system_time-based
|
||||
# partitioning and fills the table up with enough records that bypass the size
|
||||
# limit of each historical partition.
|
||||
#
|
||||
# To test BINLOG statements, a series of BINLOG statements are used to delete
|
||||
# all the records in the test tables, and the resulting partitions are analyzed
|
||||
# to ensure that they match the partition specification. The BINLOG events
|
||||
# were collected by running an original set of delete statements on the table
|
||||
# data, and taking their binlog data from mysqlbinlog. Note these binary log
|
||||
# events are actually Update events, because system versioning just archives
|
||||
# the rows, rather than deleting them.
|
||||
#
|
||||
# To test row-based event replication, a slave replicates the master's
|
||||
# events, and the partitions are compared between the slave and master for
|
||||
# consistency.
|
||||
#
|
||||
# Note that the TIMESTAMP of this test is fixed so the BINLOG statements can
|
||||
# identify the correct rows to delete (system versioning adds implicit fields
|
||||
# `row_start` and `row_end`, which are automatically populated using the current
|
||||
# timestamp).
|
||||
#
|
||||
#
|
||||
# References:
|
||||
# MDEV-35096: History is stored in different partitions on different nodes
|
||||
# when using SYSTEM VERSION
|
||||
#
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
--echo #
|
||||
--echo # Initialize system-versioned and partitioned table and its data
|
||||
--connection master
|
||||
|
||||
# Fix the timestamp for the system versioned row_start and row_end fields, so
|
||||
# the later hard-coded BINLOG base64 data can find the rows.
|
||||
SET timestamp=UNIX_TIMESTAMP('2025-01-01 01:00:00.000000');
|
||||
RESET MASTER;
|
||||
|
||||
create table t1 (x int) engine=InnoDB with system versioning partition by system_time limit 3 partitions 5;
|
||||
insert into t1 values(1);
|
||||
insert into t1 values(2);
|
||||
insert into t1 values(3);
|
||||
insert into t1 values(4);
|
||||
insert into t1 values(5);
|
||||
--let $master_total_size= `select count(*) from t1`
|
||||
--let $master_p0_size= `select count(*) from t1 partition (p0)`
|
||||
--let $master_p1_size= `select count(*) from t1 partition (p1)`
|
||||
--let $master_p2_size= `select count(*) from t1 partition (p2)`
|
||||
|
||||
--echo # Verifying master partitions are correct after data insertion..
|
||||
if ($master_total_size != 5)
|
||||
{
|
||||
--echo # Master t1 count: $master_total_size
|
||||
--die Master table t1 should have 5 entries
|
||||
}
|
||||
if ($master_p0_size)
|
||||
{
|
||||
--echo # Master t1,p0 count: $master_p0_size
|
||||
--die Master t1 partition p0 should be empty
|
||||
}
|
||||
if ($master_p1_size)
|
||||
{
|
||||
--echo # Master t1,p1 count: $master_p1_size
|
||||
--die Master t1 partition p1 should be empty
|
||||
}
|
||||
if ($master_p2_size)
|
||||
{
|
||||
--echo # Master t1,p2 count: $master_p2_size
|
||||
--die Master t1 partition p2 should be empty
|
||||
}
|
||||
--echo # .. done
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--connection slave
|
||||
--let $slave_total_size= `select count(*) from t1`
|
||||
--let $slave_p0_size= `select count(*) from t1 partition (p0)`
|
||||
--let $slave_p1_size= `select count(*) from t1 partition (p1)`
|
||||
--let $slave_p2_size= `select count(*) from t1 partition (p2)`
|
||||
|
||||
--echo # Verifying partitions of master and slave match on data setup..
|
||||
if ($slave_total_size != $master_total_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t0;
|
||||
--connection slave
|
||||
select count(*) from t1;
|
||||
--die Size of t1 differs between master and slave
|
||||
}
|
||||
if ($slave_p0_size != $master_p0_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p0);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p0);
|
||||
--die Size of t1 partition p0 differs between master and slave
|
||||
}
|
||||
if ($slave_p1_size != $master_p1_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p1);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p1);
|
||||
--die Size of t1 partition p1 differs between master and slave
|
||||
}
|
||||
if ($slave_p2_size != $master_p2_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p2);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p2);
|
||||
--die Size of t1 partition p2 differs between master and slave
|
||||
}
|
||||
--echo # .. done
|
||||
|
||||
--echo #
|
||||
--echo # "Delete" each row -- these are the BINLOG commands generated by
|
||||
--echo # mysqlbinlog from `delete from t1 where x=<n>` statments. Because the
|
||||
--echo # table uses system versioning and system_time partition, the actual
|
||||
--echo # events are updates, with added fields for the `row_start` and `row_end`
|
||||
--echo # columns.
|
||||
--connection master
|
||||
|
||||
--echo # BINLOG for Format Description event
|
||||
BINLOG '
|
||||
APZ0Zw8BAAAA/AAAAAABAAAAAAQAMTAuNi4yMS1NYXJpYURCLWRlYnVnLWxvZwAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAA9nRnEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
|
||||
CgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAEEwQADQgICAoKCgHgiCNP
|
||||
';
|
||||
|
||||
--echo # BINLOG for delete from t1 where x=1;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAAQHAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBvaHPfA==
|
||||
APZ0ZxgBAAAASAAAAEwHAAAAACEAAAAAAAEAAwcH+AEAAABndPYAAAAAf////w9CP/gBAAAAZ3T2
|
||||
AAAAAGd09gAAAADnhA23
|
||||
';
|
||||
|
||||
--echo # BINLOG for delete from t1 where x=2;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAPUHAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBwNtQNQ==
|
||||
APZ0ZxgBAAAASAAAAD0IAAAAACEAAAAAAAEAAwcH+AIAAABndPYAAAAAf////w9CP/gCAAAAZ3T2
|
||||
AAAAAGd09gAAAABPYZUX
|
||||
';
|
||||
|
||||
|
||||
--echo # BINLOG for delete from t1 where x=3;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAOYIAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBKWGevg==
|
||||
APZ0ZxgBAAAASAAAAC4JAAAAACEAAAAAAAEAAwcH+AMAAABndPYAAAAAf////w9CP/gDAAAAZ3T2
|
||||
AAAAAGd09gAAAAD0hz5S
|
||||
';
|
||||
|
||||
--echo # BINLOG for delete from t1 where x=4;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAANcJAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBaT9IZg==
|
||||
APZ0ZxgBAAAASAAAAB8KAAAAACEAAAAAAAEAAwcH+AQAAABndPYAAAAAf////w9CP/gEAAAAZ3T2
|
||||
AAAAAGd09gAAAADA4Tdx
|
||||
';
|
||||
|
||||
--echo # BINLOG for delete from t1 where x=5;
|
||||
BINLOG '
|
||||
APZ0ZxMBAAAAMQAAAMgKAAAAACEAAAAAAAEABHRlc3QAAnQxAAMDERECBgYBMk64Mw==
|
||||
APZ0ZxgBAAAASAAAABALAAAAACEAAAAAAAEAAwcH+AUAAABndPYAAAAAf////w9CP/gFAAAAZ3T2
|
||||
AAAAAGd09gAAAAA5blY6
|
||||
';
|
||||
|
||||
--let $master_total_size= `select count(*) from t1`
|
||||
--let $master_p0_size= `select count(*) from t1 partition (p0)`
|
||||
--let $master_p1_size= `select count(*) from t1 partition (p1)`
|
||||
--let $master_p2_size= `select count(*) from t1 partition (p2)`
|
||||
--echo # Verifying master partitions are correct after deletion BINLOG stmts..
|
||||
if ($master_total_size > 0)
|
||||
{
|
||||
--echo # Master t1 count: $master_total_size
|
||||
--die Master table t1 should have 0 count
|
||||
}
|
||||
if ($master_p0_size != 3)
|
||||
{
|
||||
--echo # Master t1,p0 count: $master_p0_size
|
||||
--die Master t1 partition p0 should have 3 entries
|
||||
}
|
||||
if ($master_p1_size != 2)
|
||||
{
|
||||
--echo # Master t1,p1 count: $master_p1_size
|
||||
--die Master t1 partition p1 should have 2 entries
|
||||
}
|
||||
if ($master_p2_size)
|
||||
{
|
||||
--echo # Master t1,p2 count: $master_p2_size
|
||||
--die Master t1 partition p2 should be empty
|
||||
}
|
||||
--echo # .. done
|
||||
--sync_slave_with_master
|
||||
|
||||
--connection slave
|
||||
--let $slave_total_size= `select count(*) from t1`
|
||||
--let $slave_p0_size= `select count(*) from t1 partition (p0)`
|
||||
--let $slave_p1_size= `select count(*) from t1 partition (p1)`
|
||||
--let $slave_p2_size= `select count(*) from t1 partition (p2)`
|
||||
|
||||
if ($slave_total_size != $master_total_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1;
|
||||
--connection slave
|
||||
select count(*) from t1;
|
||||
--die Size of t1 differs between master and slave
|
||||
}
|
||||
if ($slave_p0_size != $master_p0_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p0);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p0);
|
||||
--die Size of t1 partition p0 differs between master and slave
|
||||
}
|
||||
if ($slave_p1_size != $master_p1_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p1);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p1);
|
||||
--die Size of t1 partition p1 differs between master and slave
|
||||
}
|
||||
if ($slave_p2_size != $master_p2_size)
|
||||
{
|
||||
--connection master
|
||||
select count(*) from t1 partition (p2);
|
||||
--connection slave
|
||||
select count(*) from t1 partition (p2);
|
||||
--die Size of t1 partition p2 differs between master and slave
|
||||
}
|
||||
|
||||
--connection master
|
||||
drop table t1;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
@@ -18,7 +18,7 @@ alter table t1 engine=S3;
|
||||
###
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`pk` int(11) NOT NULL,
|
||||
`a` int(11) DEFAULT NULL,
|
||||
|
||||
@@ -9,7 +9,7 @@ DO SETVAL(`a1`, 1, 0);
|
||||
CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB;
|
||||
DO SETVAL(`x1`, 1, 0);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`)
|
||||
@@ -23,7 +23,7 @@ DO SETVAL(`a1`, 1, 0);
|
||||
CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB;
|
||||
DO SETVAL(`x1`, 1, 0);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`)
|
||||
@@ -37,7 +37,7 @@ DO SETVAL(`a1`, 1, 0);
|
||||
CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB;
|
||||
DO SETVAL(`x1`, 1, 0);
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`)
|
||||
@@ -47,7 +47,7 @@ INSERT INTO `t1` VALUES (1),(2);
|
||||
# dump by tables only tables
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`)
|
||||
|
||||
@@ -2927,7 +2927,7 @@ VARIABLE_SCOPE SESSION ONLY
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT This variable is for internal server use
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_MAX_VALUE 4294967295
|
||||
NUMERIC_BLOCK_SIZE 1
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
|
||||
@@ -3087,7 +3087,7 @@ VARIABLE_SCOPE SESSION ONLY
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT This variable is for internal server use
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_MAX_VALUE 4294967295
|
||||
NUMERIC_BLOCK_SIZE 1
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
|
||||
@@ -577,3 +577,17 @@ drop table t;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-26891 Segfault in Field::register_field_in_read_map upon INSERT DELAYED with virtual columns
|
||||
#
|
||||
CREATE TABLE t (
|
||||
id INT AUTO_INCREMENT,
|
||||
a varchar(16) NOT NULL DEFAULT '',
|
||||
b varchar(16) GENERATED ALWAYS AS (a) VIRTUAL,
|
||||
KEY `col_year` (b(8),id)
|
||||
) ENGINE=MyISAM;
|
||||
INSERT DELAYED INTO t (a) VALUES ('foo'),('bar');
|
||||
DROP TABLE t;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
||||
@@ -541,3 +541,22 @@ drop table t;
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26891 Segfault in Field::register_field_in_read_map upon INSERT DELAYED with virtual columns
|
||||
--echo #
|
||||
CREATE TABLE t (
|
||||
id INT AUTO_INCREMENT,
|
||||
a varchar(16) NOT NULL DEFAULT '',
|
||||
b varchar(16) GENERATED ALWAYS AS (a) VIRTUAL,
|
||||
KEY `col_year` (b(8),id)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
INSERT DELAYED INTO t (a) VALUES ('foo'),('bar');
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
||||
@@ -27,7 +27,9 @@ id x current
|
||||
1 2 0
|
||||
1 3 1
|
||||
drop table t;
|
||||
#
|
||||
# MDEV-15645 Assertion `table->insert_values' failed in write_record upon REPLACE into a view with underlying versioned table
|
||||
#
|
||||
create or replace table t1 (a int, b int, primary key (a), unique(b)) with system versioning;
|
||||
insert into t1 values (1,1);
|
||||
create or replace table t2 (c int);
|
||||
@@ -48,7 +50,9 @@ INSERT INTO t1 () VALUES (),(),(),(),(),();
|
||||
UPDATE IGNORE t1 SET f = 1;
|
||||
REPLACE t1 SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-22540 ER_DUP_ENTRY upon REPLACE or Assertion failed
|
||||
#
|
||||
set timestamp=1589245268.41934;
|
||||
create table t1 (a int primary key) with system versioning;
|
||||
insert into t1 values (1),(2);
|
||||
@@ -72,3 +76,15 @@ Warnings:
|
||||
Warning 1062 Duplicate entry '1' for key 'a'
|
||||
load data infile '15330.data' replace into table t1 (a,b,c);
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-35343 unexpected replace behaviour when long unique index on system versioned table
|
||||
#
|
||||
create table t1 (data char(10));
|
||||
insert into t1 values ('o');
|
||||
alter ignore table t1 add unique index (data);
|
||||
alter ignore table t1 add unique index (data);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index `data_2`. This is deprecated and will be disallowed in a future release
|
||||
alter table t1 add system versioning;
|
||||
replace into t1 values ('o'), ('o');
|
||||
drop table t1;
|
||||
|
||||
@@ -35,7 +35,9 @@ replace t values (1, 3);
|
||||
select *, current_row(row_end) as current from t for system_time all order by x;
|
||||
drop table t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-15645 Assertion `table->insert_values' failed in write_record upon REPLACE into a view with underlying versioned table
|
||||
--echo #
|
||||
create or replace table t1 (a int, b int, primary key (a), unique(b)) with system versioning;
|
||||
insert into t1 values (1,1);
|
||||
create or replace table t2 (c int);
|
||||
@@ -59,7 +61,9 @@ UPDATE IGNORE t1 SET f = 1;
|
||||
REPLACE t1 SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22540 ER_DUP_ENTRY upon REPLACE or Assertion failed
|
||||
--echo #
|
||||
set timestamp=1589245268.41934;
|
||||
create table t1 (a int primary key) with system versioning;
|
||||
insert into t1 values (1),(2);
|
||||
@@ -105,4 +109,15 @@ drop table t1;
|
||||
eval set default_storage_engine= $default_engine;
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35343 unexpected replace behaviour when long unique index on system versioned table
|
||||
--echo #
|
||||
create table t1 (data char(10));
|
||||
insert into t1 values ('o');
|
||||
alter ignore table t1 add unique index (data);
|
||||
alter ignore table t1 add unique index (data);
|
||||
alter table t1 add system versioning;
|
||||
replace into t1 values ('o'), ('o');
|
||||
drop table t1;
|
||||
|
||||
--source suite/versioning/common_finish.inc
|
||||
|
||||
@@ -494,6 +494,9 @@ void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs,
|
||||
int r_offs)
|
||||
{
|
||||
TREE_ELEMENT *x= **last_pos;
|
||||
|
||||
if (x == &null_element)
|
||||
return NULL;
|
||||
|
||||
if (ELEMENT_CHILD(x, r_offs) != &null_element)
|
||||
{
|
||||
|
||||
@@ -36,8 +36,12 @@ int check_openssl_compatibility()
|
||||
static uint testing;
|
||||
static size_t alloc_size, alloc_count;
|
||||
|
||||
static void *coc_malloc(size_t size, const char *f __attribute__((unused)),
|
||||
int l __attribute__((unused)))
|
||||
static void *coc_malloc(size_t size
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *f __attribute__((unused)),
|
||||
int l __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (unlikely(testing))
|
||||
{
|
||||
@@ -47,15 +51,22 @@ static void *coc_malloc(size_t size, const char *f __attribute__((unused)),
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
static void *coc_realloc(void *addr, size_t num,
|
||||
const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
static void *coc_realloc(void *addr, size_t num
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return realloc(addr, num);
|
||||
}
|
||||
|
||||
static void coc_free(void *addr, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
static void coc_free(void *addr
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
free(addr);
|
||||
}
|
||||
|
||||
@@ -927,7 +927,7 @@ hs_longrun_main(int argc, char **argv)
|
||||
shared.verbose = shared.conf.get_int("verbose", 1);
|
||||
const int table_size = shared.conf.get_int("table_size", 10000);
|
||||
for (int i = 0; i < table_size; ++i) {
|
||||
std::auto_ptr<record_value> rec(new record_value());
|
||||
std::unique_ptr<record_value> rec(new record_value());
|
||||
rec->key = to_stdstring(i);
|
||||
shared.records.push_back_ptr(rec);
|
||||
}
|
||||
@@ -966,7 +966,7 @@ hs_longrun_main(int argc, char **argv)
|
||||
int id = thrs.size();
|
||||
const hs_longrun_thread_hs::arg_type arg(id, e.type, e.op, e.lock,
|
||||
shared);
|
||||
std::auto_ptr<hs_longrun_thread_base> thr;
|
||||
std::unique_ptr<hs_longrun_thread_base> thr;
|
||||
if (e.hs) {
|
||||
thr.reset(new hs_longrun_thread_hs(arg));
|
||||
} else {
|
||||
|
||||
@@ -561,7 +561,7 @@ hstest_thread::test_9(int test_num)
|
||||
flds += std::string(buf);
|
||||
}
|
||||
int connected = 0;
|
||||
std::auto_ptr<auto_mysql_stmt> stmt;
|
||||
std::unique_ptr<auto_mysql_stmt> stmt;
|
||||
string_buffer wbuf;
|
||||
for (int i = 0; i < num; ++i) {
|
||||
const double tm1 = gettimeofday_double();
|
||||
@@ -1474,7 +1474,7 @@ hstest_main(int argc, char **argv)
|
||||
#endif
|
||||
const int num_thrs = shared.num_threads;
|
||||
typedef thread<hstest_thread> thread_type;
|
||||
typedef std::auto_ptr<thread_type> thread_ptr;
|
||||
typedef std::unique_ptr<thread_type> thread_ptr;
|
||||
typedef auto_ptrcontainer< std::vector<thread_type *> > thrs_type;
|
||||
thrs_type thrs;
|
||||
for (int i = 0; i < num_thrs; ++i) {
|
||||
|
||||
@@ -175,7 +175,7 @@ struct dbcontext : public dbcontext_i, private noncopyable {
|
||||
THD *thd;
|
||||
MYSQL_LOCK *lock;
|
||||
bool lock_failed;
|
||||
std::auto_ptr<expr_user_lock> user_lock;
|
||||
std::unique_ptr<expr_user_lock> user_lock;
|
||||
int user_level_lock_timeout;
|
||||
bool user_level_lock_locked;
|
||||
bool commit_error;
|
||||
|
||||
@@ -9,11 +9,6 @@
|
||||
#ifndef DENA_DATABASE_HPP
|
||||
#define DENA_DATABASE_HPP
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* auto_ptr is deprecated */
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
@@ -26,10 +21,10 @@
|
||||
namespace dena {
|
||||
|
||||
struct database_i;
|
||||
typedef std::auto_ptr<volatile database_i> database_ptr;
|
||||
typedef std::unique_ptr<volatile database_i> database_ptr;
|
||||
|
||||
struct dbcontext_i;
|
||||
typedef std::auto_ptr<dbcontext_i> dbcontext_ptr;
|
||||
typedef std::unique_ptr<dbcontext_i> dbcontext_ptr;
|
||||
|
||||
struct database_i {
|
||||
virtual ~database_i() = default;
|
||||
|
||||
@@ -76,7 +76,7 @@ daemon_handlersocket_init(void *p)
|
||||
conf["readsize"] = to_stdstring(handlersocket_readsize);
|
||||
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
|
||||
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
|
||||
std::auto_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
||||
std::unique_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
||||
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
|
||||
conf["port"] = handlersocket_port;
|
||||
if (handlersocket_plain_secret) {
|
||||
|
||||
@@ -115,7 +115,7 @@ hstcpsvr::start_listen()
|
||||
arg.cshared = &cshared;
|
||||
arg.vshared = &vshared;
|
||||
arg.worker_id = i;
|
||||
std::auto_ptr< thread<worker_throbj> > thr(
|
||||
std::unique_ptr< thread<worker_throbj> > thr(
|
||||
new thread<worker_throbj>(arg, stack_size));
|
||||
threads.push_back_ptr(thr);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ struct hstcpsvr_shared_v : public mutex {
|
||||
};
|
||||
|
||||
struct hstcpsvr_i;
|
||||
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
||||
typedef std::unique_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
||||
|
||||
struct hstcpsvr_i {
|
||||
virtual ~hstcpsvr_i() = default;
|
||||
|
||||
@@ -451,7 +451,7 @@ hstcpsvr_worker::run_one_nb()
|
||||
{
|
||||
pollfd& pfd = pfds[nfds - 1];
|
||||
if ((pfd.revents & mask_in) != 0) {
|
||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||
c->nonblocking = true;
|
||||
c->readsize = cshared.readsize;
|
||||
c->accept(cshared);
|
||||
@@ -498,7 +498,7 @@ hstcpsvr_worker::run_one_ep()
|
||||
/* listener */
|
||||
++accept_count;
|
||||
DBG_EP(fprintf(stderr, "IN listener\n"));
|
||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||
c->nonblocking = true;
|
||||
c->readsize = cshared.readsize;
|
||||
c->accept(cshared);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
namespace dena {
|
||||
|
||||
struct hstcpsvr_worker_i;
|
||||
typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
||||
typedef std::unique_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
||||
|
||||
struct hstcpsvr_worker_arg {
|
||||
const hstcpsvr_shared_c *cshared;
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
#include "string_ref.hpp"
|
||||
#include "string_buffer.hpp"
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* auto_ptr is deprecated */
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
namespace dena {
|
||||
|
||||
struct hstcpcli_filter {
|
||||
@@ -35,7 +30,7 @@ struct hstcpcli_filter {
|
||||
};
|
||||
|
||||
struct hstcpcli_i;
|
||||
typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
|
||||
typedef std::unique_ptr<hstcpcli_i> hstcpcli_ptr;
|
||||
|
||||
struct hstcpcli_i {
|
||||
virtual ~hstcpcli_i() = default;
|
||||
|
||||
@@ -659,6 +659,9 @@ public:
|
||||
bool cleanup_session_expr();
|
||||
bool fix_and_check_expr(THD *thd, TABLE *table);
|
||||
inline bool is_equal(const Virtual_column_info* vcol) const;
|
||||
/* Same as is_equal() but for comparing with different table */
|
||||
bool is_equivalent(THD *thd, TABLE_SHARE *share, TABLE_SHARE *vcol_share,
|
||||
const Virtual_column_info* vcol, bool &error) const;
|
||||
inline void print(String*);
|
||||
};
|
||||
|
||||
@@ -5875,7 +5878,7 @@ uint pack_length_to_packflag(uint type);
|
||||
enum_field_types get_blob_type_from_length(ulong length);
|
||||
int set_field_to_null(Field *field);
|
||||
int set_field_to_null_with_conversions(Field *field, bool no_conversions);
|
||||
int convert_null_to_field_value_or_error(Field *field);
|
||||
int convert_null_to_field_value_or_error(Field *field, uint err);
|
||||
bool check_expression(Virtual_column_info *vcol, const LEX_CSTRING *name,
|
||||
enum_vcol_info_type type, Alter_info *alter_info= NULL);
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ static int set_bad_null_error(Field *field, int err)
|
||||
return 0;
|
||||
case CHECK_FIELD_ERROR_FOR_NULL:
|
||||
if (!field->table->in_use->no_errors)
|
||||
my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name.str);
|
||||
my_error(err, MYF(0), field->field_name.str);
|
||||
return -1;
|
||||
}
|
||||
DBUG_ASSERT(0); // impossible
|
||||
@@ -164,7 +164,7 @@ int set_field_to_null(Field *field)
|
||||
If no_conversion was not set, an error message is printed
|
||||
*/
|
||||
|
||||
int convert_null_to_field_value_or_error(Field *field)
|
||||
int convert_null_to_field_value_or_error(Field *field, uint err)
|
||||
{
|
||||
if (field->type() == MYSQL_TYPE_TIMESTAMP)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ int convert_null_to_field_value_or_error(Field *field)
|
||||
field->table->auto_increment_field_not_null= FALSE;
|
||||
return 0; // field is set in fill_record()
|
||||
}
|
||||
return set_bad_null_error(field, ER_BAD_NULL_ERROR);
|
||||
return set_bad_null_error(field, err);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,7 +216,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
|
||||
if (no_conversions)
|
||||
return -1;
|
||||
|
||||
return convert_null_to_field_value_or_error(field);
|
||||
return convert_null_to_field_value_or_error(field, ER_BAD_NULL_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -640,13 +640,6 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count,
|
||||
}
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
|
||||
/* Buffer where record is returned */
|
||||
char dbug_print_row_buff[512];
|
||||
|
||||
/* Temporary buffer for printing a column */
|
||||
char dbug_print_row_buff_tmp[512];
|
||||
|
||||
/*
|
||||
Print table's current row into a buffer and return a pointer to it.
|
||||
|
||||
@@ -659,38 +652,53 @@ char dbug_print_row_buff_tmp[512];
|
||||
Only columns in table->read_set are printed
|
||||
*/
|
||||
|
||||
const char* dbug_print_table_row(TABLE *table)
|
||||
const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names)
|
||||
{
|
||||
Field **pfield;
|
||||
String tmp(dbug_print_row_buff_tmp,
|
||||
sizeof(dbug_print_row_buff_tmp),&my_charset_bin);
|
||||
const size_t alloc_size= 512;
|
||||
char *row_buff= (char *) alloc_root(&table->mem_root, alloc_size);
|
||||
char *row_buff_tmp= (char *) alloc_root(&table->mem_root, alloc_size);
|
||||
String tmp(row_buff_tmp, alloc_size, &my_charset_bin);
|
||||
String output(row_buff, alloc_size, &my_charset_bin);
|
||||
|
||||
String output(dbug_print_row_buff, sizeof(dbug_print_row_buff),
|
||||
&my_charset_bin);
|
||||
auto move_back_lambda= [table, rec]() mutable {
|
||||
table->move_fields(table->field, table->record[0], rec);
|
||||
};
|
||||
auto move_back_guard= make_scope_exit(move_back_lambda, false);
|
||||
|
||||
if (rec != table->record[0])
|
||||
{
|
||||
table->move_fields(table->field, rec, table->record[0]);
|
||||
move_back_guard.engage();
|
||||
}
|
||||
|
||||
SCOPE_VALUE(table->read_set, (table->read_set && table->write_set) ?
|
||||
table->write_set : table->read_set);
|
||||
|
||||
output.length(0);
|
||||
output.append(table->alias);
|
||||
output.append('(');
|
||||
bool first= true;
|
||||
|
||||
for (pfield= table->field; *pfield ; pfield++)
|
||||
if (print_names)
|
||||
{
|
||||
const LEX_CSTRING *name;
|
||||
if (table->read_set && !bitmap_is_set(table->read_set, (*pfield)->field_index))
|
||||
continue;
|
||||
|
||||
if (first)
|
||||
first= false;
|
||||
else
|
||||
output.append(',');
|
||||
for (pfield= table->field; *pfield ; pfield++)
|
||||
{
|
||||
if (table->read_set && !bitmap_is_set(table->read_set, (*pfield)->field_index))
|
||||
continue;
|
||||
|
||||
name= (*pfield)->field_name.str ? &(*pfield)->field_name: &NULL_clex_str;
|
||||
output.append(name);
|
||||
if (first)
|
||||
first= false;
|
||||
else
|
||||
output.append(STRING_WITH_LEN(", "));
|
||||
|
||||
output.append((*pfield)->field_name.str
|
||||
? (*pfield)->field_name : NULL_clex_str);
|
||||
}
|
||||
|
||||
output.append(STRING_WITH_LEN(")=("));
|
||||
first= true;
|
||||
}
|
||||
|
||||
output.append(STRING_WITH_LEN(")=("));
|
||||
|
||||
first= true;
|
||||
for (pfield= table->field; *pfield ; pfield++)
|
||||
{
|
||||
Field *field= *pfield;
|
||||
@@ -701,7 +709,7 @@ const char* dbug_print_table_row(TABLE *table)
|
||||
if (first)
|
||||
first= false;
|
||||
else
|
||||
output.append(',');
|
||||
output.append(STRING_WITH_LEN(", "));
|
||||
|
||||
if (field->is_null())
|
||||
output.append(&NULL_clex_str);
|
||||
@@ -715,17 +723,14 @@ const char* dbug_print_table_row(TABLE *table)
|
||||
}
|
||||
}
|
||||
output.append(')');
|
||||
|
||||
|
||||
return output.c_ptr_safe();
|
||||
}
|
||||
|
||||
|
||||
const char* dbug_print_row(TABLE *table, uchar *rec)
|
||||
const char* dbug_print_table_row(TABLE *table)
|
||||
{
|
||||
table->move_fields(table->field, rec, table->record[0]);
|
||||
const char* ret= dbug_print_table_row(table);
|
||||
table->move_fields(table->field, table->record[0], rec);
|
||||
return ret;
|
||||
return dbug_print_row(table, table->record[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7743,6 +7743,7 @@ int handler::ha_write_row(const uchar *buf)
|
||||
|
||||
TABLE_IO_WAIT(tracker, PSI_TABLE_WRITE_ROW, MAX_KEY, error,
|
||||
{ error= write_row(buf); })
|
||||
DBUG_PRINT("dml", ("INSERT: %s = %d", dbug_print_row(table, buf, false), error));
|
||||
|
||||
MYSQL_INSERT_ROW_DONE(error);
|
||||
if (likely(!error))
|
||||
@@ -7803,6 +7804,8 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
|
||||
|
||||
TABLE_IO_WAIT(tracker, PSI_TABLE_UPDATE_ROW, active_index, 0,
|
||||
{ error= update_row(old_data, new_data);})
|
||||
DBUG_PRINT("dml", ("UPDATE: %s => %s = %d", dbug_print_row(table, old_data, false),
|
||||
dbug_print_row(table, new_data, false), error));
|
||||
|
||||
MYSQL_UPDATE_ROW_DONE(error);
|
||||
if (likely(!error))
|
||||
@@ -7882,6 +7885,7 @@ int handler::ha_delete_row(const uchar *buf)
|
||||
|
||||
TABLE_IO_WAIT(tracker, PSI_TABLE_DELETE_ROW, active_index, error,
|
||||
{ error= delete_row(buf);})
|
||||
DBUG_PRINT("dml", ("DELETE: %s = %d", dbug_print_row(table, buf, false), error));
|
||||
MYSQL_DELETE_ROW_DONE(error);
|
||||
if (likely(!error))
|
||||
{
|
||||
|
||||
@@ -5535,4 +5535,8 @@ uint ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list,
|
||||
|
||||
int get_select_field_pos(Alter_info *alter_info, int select_field_count,
|
||||
bool versioned);
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names= true);
|
||||
#endif /* DBUG_OFF */
|
||||
#endif /* HANDLER_INCLUDED */
|
||||
|
||||
33
sql/item.cc
33
sql/item.cc
@@ -845,6 +845,30 @@ bool Item_field::rename_fields_processor(void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Rename table and clean field for EXCHANGE comparison
|
||||
*/
|
||||
|
||||
bool Item_field::rename_table_processor(void *arg)
|
||||
{
|
||||
Item::func_processor_rename_table *p= (Item::func_processor_rename_table*) arg;
|
||||
|
||||
/* If (db_name, table_name) matches (p->old_db, p->old_table)
|
||||
rename to (p->new_db, p->new_table) */
|
||||
if (((!db_name.str && !p->old_db.str) ||
|
||||
db_name.streq(p->old_db)) &&
|
||||
((!table_name.str && !p->old_table.str) ||
|
||||
table_name.streq(p->old_table)))
|
||||
{
|
||||
db_name= p->new_db;
|
||||
table_name= p->new_table;
|
||||
}
|
||||
|
||||
/* Item_field equality is done by field pointer if it is set, we need to avoid that */
|
||||
field= NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check if an Item_field references some field from a list of fields.
|
||||
@@ -3972,7 +3996,7 @@ void Item_string::print(String *str, enum_query_type query_type)
|
||||
}
|
||||
else
|
||||
{
|
||||
str_value.print(str, system_charset_info);
|
||||
str_value.print(str, &my_charset_utf8mb4_general_ci);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4237,6 +4261,7 @@ void Item_param::set_null()
|
||||
max_length= 0;
|
||||
decimals= 0;
|
||||
state= NULL_VALUE;
|
||||
value.set_handler(&type_handler_null);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@@ -5050,7 +5075,10 @@ void Item_param::set_default(bool set_type_handler_null)
|
||||
*/
|
||||
null_value= true;
|
||||
if (set_type_handler_null)
|
||||
{
|
||||
value.set_handler(&type_handler_null);
|
||||
set_handler(&type_handler_null);
|
||||
}
|
||||
}
|
||||
|
||||
void Item_param::set_ignore(bool set_type_handler_null)
|
||||
@@ -5059,7 +5087,10 @@ void Item_param::set_ignore(bool set_type_handler_null)
|
||||
state= IGNORE_VALUE;
|
||||
null_value= true;
|
||||
if (set_type_handler_null)
|
||||
{
|
||||
value.set_handler(&type_handler_null);
|
||||
set_handler(&type_handler_null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2362,6 +2362,7 @@ public:
|
||||
virtual bool check_partition_func_processor(void *arg) { return true; }
|
||||
virtual bool post_fix_fields_part_expr_processor(void *arg) { return 0; }
|
||||
virtual bool rename_fields_processor(void *arg) { return 0; }
|
||||
virtual bool rename_table_processor(void *arg) { return 0; }
|
||||
/*
|
||||
TRUE if the function is knowingly TRUE or FALSE.
|
||||
Not to be used for AND/OR formulas.
|
||||
@@ -2390,6 +2391,13 @@ public:
|
||||
LEX_CSTRING table_name;
|
||||
List<Create_field> fields;
|
||||
};
|
||||
struct func_processor_rename_table
|
||||
{
|
||||
Lex_ident_db old_db;
|
||||
Lex_ident_table old_table;
|
||||
Lex_ident_db new_db;
|
||||
Lex_ident_table new_table;
|
||||
};
|
||||
virtual bool check_vcol_func_processor(void *arg)
|
||||
{
|
||||
return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE);
|
||||
@@ -3821,6 +3829,7 @@ public:
|
||||
bool switch_to_nullable_fields_processor(void *arg) override;
|
||||
bool update_vcol_processor(void *arg) override;
|
||||
bool rename_fields_processor(void *arg) override;
|
||||
bool rename_table_processor(void *arg) override;
|
||||
bool check_vcol_func_processor(void *arg) override;
|
||||
bool set_fields_as_dependent_processor(void *arg) override
|
||||
{
|
||||
|
||||
@@ -3792,7 +3792,7 @@ void subselect_single_select_engine::cleanup()
|
||||
DBUG_ENTER("subselect_single_select_engine::cleanup");
|
||||
prepared= executed= 0;
|
||||
join= 0;
|
||||
result->cleanup();
|
||||
result->reset_for_next_ps_execution();
|
||||
select_lex->uncacheable&= ~UNCACHEABLE_DEPENDENT_INJECTED;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@@ -3802,7 +3802,7 @@ void subselect_union_engine::cleanup()
|
||||
{
|
||||
DBUG_ENTER("subselect_union_engine::cleanup");
|
||||
unit->reinit_exec_mechanism();
|
||||
result->cleanup();
|
||||
result->reset_for_next_ps_execution();
|
||||
unit->uncacheable&= ~UNCACHEABLE_DEPENDENT_INJECTED;
|
||||
for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
|
||||
sl->uncacheable&= ~UNCACHEABLE_DEPENDENT_INJECTED;
|
||||
@@ -5475,7 +5475,7 @@ void subselect_hash_sj_engine::cleanup()
|
||||
}
|
||||
DBUG_ASSERT(lookup_engine->engine_type() == UNIQUESUBQUERY_ENGINE);
|
||||
lookup_engine->cleanup();
|
||||
result->cleanup(); /* Resets the temp table as well. */
|
||||
result->reset_for_next_ps_execution(); /* Resets the temp table as well. */
|
||||
DBUG_ASSERT(tmp_table);
|
||||
free_tmp_table(thd, tmp_table);
|
||||
tmp_table= NULL;
|
||||
|
||||
@@ -3666,22 +3666,14 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
|
||||
LOCK_thd_kill here (the limit will be enforced on the next allocation).
|
||||
*/
|
||||
if (!mysql_mutex_trylock(&thd->LOCK_thd_kill)) {
|
||||
char buf[50], *buf2;
|
||||
char buf[50], buf2[256];
|
||||
thd->set_killed_no_mutex(KILL_QUERY);
|
||||
my_snprintf(buf, sizeof(buf), "--max-session-mem-used=%llu",
|
||||
thd->variables.max_mem_used);
|
||||
if ((buf2= (char*) thd->alloc(256)))
|
||||
{
|
||||
my_snprintf(buf2, 256,
|
||||
ER_THD(thd, ER_OPTION_PREVENTS_STATEMENT), buf);
|
||||
thd->set_killed_no_mutex(KILL_QUERY,
|
||||
ER_OPTION_PREVENTS_STATEMENT, buf2);
|
||||
}
|
||||
else
|
||||
{
|
||||
thd->set_killed_no_mutex(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT,
|
||||
"--max-session-mem-used");
|
||||
}
|
||||
my_snprintf(buf2, 256,
|
||||
ER_THD(thd, ER_OPTION_PREVENTS_STATEMENT), buf);
|
||||
thd->set_killed_no_mutex(KILL_QUERY,
|
||||
ER_OPTION_PREVENTS_STATEMENT, buf2);
|
||||
mysql_mutex_unlock(&thd->LOCK_thd_kill);
|
||||
}
|
||||
}
|
||||
@@ -7316,8 +7308,8 @@ static int show_threadpool_threads(THD *, SHOW_VAR *var, void *buff,
|
||||
#endif
|
||||
|
||||
|
||||
static int show_cached_thread_count(THD *thd, SHOW_VAR *var, char *buff,
|
||||
enum enum_var_type scope)
|
||||
static int show_cached_thread_count(THD *thd, SHOW_VAR *var, void *buff,
|
||||
system_status_var *, enum enum_var_type scope)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
var->value= buff;
|
||||
@@ -9780,7 +9772,7 @@ void init_server_psi_keys(void)
|
||||
|
||||
*/
|
||||
|
||||
static my_thread_id thread_id_max= UINT_MAX32;
|
||||
static my_thread_id thread_id_max= MY_THREAD_ID_MAX;
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
#include "rpl_rli.h"
|
||||
#include "slave.h"
|
||||
#include "log_event.h"
|
||||
#ifdef WITH_WSREP
|
||||
#include "wsrep_mysqld.h" // wsrep_thd_is_local
|
||||
#include "wsrep_trans_observer.h" // wsrep_start_trx_if_not_started
|
||||
#endif
|
||||
|
||||
const LEX_CSTRING rpl_gtid_slave_state_table_name=
|
||||
{ STRING_WITH_LEN("gtid_slave_pos") };
|
||||
@@ -696,23 +692,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
|
||||
goto end;
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
/*
|
||||
We should replicate local gtid_slave_pos updates to other nodes if
|
||||
wsrep gtid mode is set.
|
||||
In applier we should not append them to galera writeset.
|
||||
*/
|
||||
if (WSREP_ON_ && wsrep_gtid_mode && wsrep_thd_is_local(thd))
|
||||
{
|
||||
thd->wsrep_ignore_table= false;
|
||||
table->file->row_logging= 1; // replication requires binary logging
|
||||
if (thd->wsrep_next_trx_id() == WSREP_UNDEFINED_TRX_ID)
|
||||
thd->set_query_id(next_query_id());
|
||||
wsrep_start_trx_if_not_started(thd);
|
||||
}
|
||||
else
|
||||
{
|
||||
thd->wsrep_ignore_table= true;
|
||||
}
|
||||
thd->wsrep_ignore_table= true; // Do not replicate mysql.gtid_slave_pos table
|
||||
#endif
|
||||
|
||||
if (!in_transaction)
|
||||
@@ -749,10 +729,6 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
|
||||
}
|
||||
end:
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_ignore_table= false;
|
||||
#endif
|
||||
|
||||
if (table_opened)
|
||||
{
|
||||
if (err || (err= ha_commit_trans(thd, FALSE)))
|
||||
@@ -764,6 +740,10 @@ end:
|
||||
else
|
||||
thd->release_transactional_locks();
|
||||
}
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
thd->wsrep_ignore_table= false;
|
||||
#endif
|
||||
thd->lex->restore_backup_query_tables_list(&lex_backup);
|
||||
thd->variables.option_bits= thd_saved_option;
|
||||
thd->resume_subsequent_commits(suspended_wfc);
|
||||
@@ -877,25 +857,7 @@ rpl_slave_state::gtid_delete_pending(THD *thd,
|
||||
return;
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
/*
|
||||
We should replicate local gtid_slave_pos updates to other nodes if
|
||||
wsrep gtid mode is set.
|
||||
In applier we should not append them to galera writeset.
|
||||
*/
|
||||
if (WSREP_ON_ && wsrep_gtid_mode &&
|
||||
wsrep_thd_is_local(thd) &&
|
||||
thd->wsrep_cs().state() != wsrep::client_state::s_none)
|
||||
{
|
||||
if (thd->wsrep_trx().active() == false)
|
||||
{
|
||||
if (thd->wsrep_next_trx_id() == WSREP_UNDEFINED_TRX_ID)
|
||||
thd->set_query_id(next_query_id());
|
||||
wsrep_start_transaction(thd, thd->wsrep_next_trx_id());
|
||||
}
|
||||
thd->wsrep_ignore_table= false;
|
||||
}
|
||||
else
|
||||
thd->wsrep_ignore_table= true;
|
||||
thd->wsrep_ignore_table= true; // No Galera replication for mysql.gtid_pos_table
|
||||
#endif
|
||||
|
||||
thd_saved_option= thd->variables.option_bits;
|
||||
|
||||
@@ -3669,6 +3669,17 @@ int sp_lex_keeper::cursor_reset_lex_and_exec_core(THD *thd, uint *nextp,
|
||||
return res;
|
||||
}
|
||||
|
||||
sp_lex_keeper::~sp_lex_keeper()
|
||||
{
|
||||
if (m_lex_resp)
|
||||
{
|
||||
/* Prevent endless recursion. */
|
||||
m_lex->sphead= NULL;
|
||||
delete m_lex->result;
|
||||
lex_end(m_lex);
|
||||
delete m_lex;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
sp_instr class functions
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user