mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Merge branch '10.1' into 10.2
This commit is contained in:
commit
4a5d25c338
802 changed files with 37504 additions and 15141 deletions
1
CREDITS
1
CREDITS
|
@ -10,6 +10,7 @@ Visma http://visma.com (2015 - 2016)
|
|||
Acronis http://acronis.com (2016)
|
||||
Nexedi https://www.nexedi.com (2016)
|
||||
Automattic https://automattic.com (2014 - 2016)
|
||||
Tencent Game DBA http://tencentdba.com/about (2016)
|
||||
Verkkokauppa.com https://www.verkkokauppa.com (2015 - 2016)
|
||||
Virtuozzo https://virtuozzo.com (2016)
|
||||
|
||||
|
|
|
@ -245,7 +245,8 @@ static void end_pager();
|
|||
static void init_tee(const char *);
|
||||
static void end_tee();
|
||||
static const char* construct_prompt();
|
||||
static char *get_arg(char *line, my_bool get_next_arg);
|
||||
enum get_arg_mode { CHECK, GET, GET_NEXT};
|
||||
static char *get_arg(char *line, get_arg_mode mode);
|
||||
static void init_username();
|
||||
static void add_int_to_prompt(int toadd);
|
||||
static int get_result_width(MYSQL_RES *res);
|
||||
|
@ -2257,7 +2258,7 @@ static COMMANDS *find_command(char *name)
|
|||
if (!my_strnncoll(&my_charset_latin1, (uchar*) name, len,
|
||||
(uchar*) commands[i].name, len) &&
|
||||
(commands[i].name[len] == '\0') &&
|
||||
(!end || commands[i].takes_params))
|
||||
(!end || (commands[i].takes_params && get_arg(name, CHECK))))
|
||||
{
|
||||
index= i;
|
||||
break;
|
||||
|
@ -3175,7 +3176,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
|
|||
char buff[256], *param;
|
||||
CHARSET_INFO * new_cs;
|
||||
strmake_buf(buff, line);
|
||||
param= get_arg(buff, 0);
|
||||
param= get_arg(buff, GET);
|
||||
if (!param || !*param)
|
||||
{
|
||||
return put_info("Usage: \\C charset_name | charset charset_name",
|
||||
|
@ -4260,12 +4261,12 @@ com_connect(String *buffer, char *line)
|
|||
#ifdef EXTRA_DEBUG
|
||||
tmp[1]= 0;
|
||||
#endif
|
||||
tmp= get_arg(buff, 0);
|
||||
tmp= get_arg(buff, GET);
|
||||
if (tmp && *tmp)
|
||||
{
|
||||
my_free(current_db);
|
||||
current_db= my_strdup(tmp, MYF(MY_WME));
|
||||
tmp= get_arg(buff, 1);
|
||||
tmp= get_arg(buff, GET_NEXT);
|
||||
if (tmp)
|
||||
{
|
||||
my_free(current_host);
|
||||
|
@ -4368,7 +4369,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
|
|||
char buff[256], *tmp;
|
||||
|
||||
strmake_buf(buff, line);
|
||||
tmp= get_arg(buff, 0);
|
||||
tmp= get_arg(buff, GET);
|
||||
|
||||
if (!tmp || !*tmp)
|
||||
{
|
||||
|
@ -4399,7 +4400,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
|
|||
|
||||
bzero(buff, sizeof(buff));
|
||||
strmake_buf(buff, line);
|
||||
tmp= get_arg(buff, 0);
|
||||
tmp= get_arg(buff, GET);
|
||||
if (!tmp || !*tmp)
|
||||
{
|
||||
put_info("USE must be followed by a database name", INFO_ERROR);
|
||||
|
@ -4484,23 +4485,22 @@ com_nowarnings(String *buffer __attribute__((unused)),
|
|||
}
|
||||
|
||||
/*
|
||||
Gets argument from a command on the command line. If get_next_arg is
|
||||
not defined, skips the command and returns the first argument. The
|
||||
line is modified by adding zero to the end of the argument. If
|
||||
get_next_arg is defined, then the function searches for end of string
|
||||
first, after found, returns the next argument and adds zero to the
|
||||
end. If you ever wish to use this feature, remember to initialize all
|
||||
items in the array to zero first.
|
||||
Gets argument from a command on the command line. If mode is not GET_NEXT,
|
||||
skips the command and returns the first argument. The line is modified by
|
||||
adding zero to the end of the argument. If mode is GET_NEXT, then the
|
||||
function searches for end of string first, after found, returns the next
|
||||
argument and adds zero to the end. If you ever wish to use this feature,
|
||||
remember to initialize all items in the array to zero first.
|
||||
*/
|
||||
|
||||
char *get_arg(char *line, my_bool get_next_arg)
|
||||
static char *get_arg(char *line, get_arg_mode mode)
|
||||
{
|
||||
char *ptr, *start;
|
||||
my_bool quoted= 0, valid_arg= 0;
|
||||
bool short_cmd= false;
|
||||
char qtype= 0;
|
||||
|
||||
ptr= line;
|
||||
if (get_next_arg)
|
||||
if (mode == GET_NEXT)
|
||||
{
|
||||
for (; *ptr; ptr++) ;
|
||||
if (*(ptr + 1))
|
||||
|
@ -4511,7 +4511,7 @@ char *get_arg(char *line, my_bool get_next_arg)
|
|||
/* skip leading white spaces */
|
||||
while (my_isspace(charset_info, *ptr))
|
||||
ptr++;
|
||||
if (*ptr == '\\') // short command was used
|
||||
if ((short_cmd= *ptr == '\\')) // short command was used
|
||||
ptr+= 2;
|
||||
else
|
||||
while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command
|
||||
|
@ -4524,24 +4524,28 @@ char *get_arg(char *line, my_bool get_next_arg)
|
|||
if (*ptr == '\'' || *ptr == '\"' || *ptr == '`')
|
||||
{
|
||||
qtype= *ptr;
|
||||
quoted= 1;
|
||||
ptr++;
|
||||
}
|
||||
for (start=ptr ; *ptr; ptr++)
|
||||
{
|
||||
if (*ptr == '\\' && ptr[1]) // escaped character
|
||||
if ((*ptr == '\\' && ptr[1]) || // escaped character
|
||||
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
|
||||
{
|
||||
// Remove the backslash
|
||||
strmov_overlapp(ptr, ptr+1);
|
||||
// Remove (or skip) the backslash (or a second quote)
|
||||
if (mode != CHECK)
|
||||
strmov_overlapp(ptr, ptr+1);
|
||||
else
|
||||
ptr++;
|
||||
}
|
||||
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
|
||||
else if (*ptr == (qtype ? qtype : ' '))
|
||||
{
|
||||
*ptr= 0;
|
||||
qtype= 0;
|
||||
if (mode != CHECK)
|
||||
*ptr= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
valid_arg= ptr != start;
|
||||
return valid_arg ? start : NullS;
|
||||
return ptr != start && !qtype ? start : NullS;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1267,6 +1267,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
goto err;
|
||||
break;
|
||||
}
|
||||
case START_ENCRYPTION_EVENT:
|
||||
glob_description_event->start_decryption((Start_encryption_log_event*)ev);
|
||||
/* fall through */
|
||||
default:
|
||||
print_skip_replication_statement(print_event_info, ev);
|
||||
ev->print(result_file, print_event_info);
|
||||
|
@ -2839,9 +2842,16 @@ err:
|
|||
}
|
||||
|
||||
|
||||
uint dummy1() { return 1; }
|
||||
struct encryption_service_st encryption_handler=
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0
|
||||
(uint(*)(uint))dummy1,
|
||||
(uint(*)(uint, uint, uchar*, uint*))dummy1,
|
||||
(uint(*)(uint, uint))dummy1,
|
||||
(int (*)(void*, const uchar*, uint, const uchar*, uint, int, uint, uint))dummy1,
|
||||
(int (*)(void*, const uchar*, uint, uchar*, uint*))dummy1,
|
||||
(int (*)(void*, uchar*, uint*))dummy1,
|
||||
(uint (*)(uint, uint, uint))dummy1
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -577,9 +577,7 @@ static int dump_all_tablespaces();
|
|||
static int dump_tablespaces_for_tables(char *db, char **table_names, int tables);
|
||||
static int dump_tablespaces_for_databases(char** databases);
|
||||
static int dump_tablespaces(char* ts_where);
|
||||
static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
|
||||
...);
|
||||
|
||||
static void print_comment(FILE *, my_bool, const char *, ...);
|
||||
|
||||
/*
|
||||
Print the supplied message if in verbose mode
|
||||
|
@ -657,6 +655,30 @@ static void short_usage(FILE *f)
|
|||
}
|
||||
|
||||
|
||||
/** returns a string fixed to be safely printed inside a -- comment
|
||||
|
||||
that is, any new line in it gets prefixed with --
|
||||
*/
|
||||
static const char *fix_for_comment(const char *ident)
|
||||
{
|
||||
static char buf[1024];
|
||||
char c, *s= buf;
|
||||
|
||||
while ((c= *s++= *ident++))
|
||||
{
|
||||
if (s >= buf + sizeof(buf) - 10)
|
||||
{
|
||||
strmov(s, "...");
|
||||
break;
|
||||
}
|
||||
if (c == '\n')
|
||||
s= strmov(s, "-- ");
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
static void write_header(FILE *sql_file, char *db_name)
|
||||
{
|
||||
if (opt_xml)
|
||||
|
@ -679,8 +701,8 @@ static void write_header(FILE *sql_file, char *db_name)
|
|||
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
|
||||
MACHINE_TYPE);
|
||||
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
|
||||
current_host ? current_host : "localhost",
|
||||
db_name ? db_name : "");
|
||||
fix_for_comment(current_host ? current_host : "localhost"),
|
||||
fix_for_comment(db_name ? db_name : ""));
|
||||
print_comment(sql_file, 0,
|
||||
"-- ------------------------------------------------------\n"
|
||||
);
|
||||
|
@ -2252,7 +2274,8 @@ static uint dump_events_for_db(char *db)
|
|||
|
||||
/* nice comments */
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Dumping events for database '%s'\n--\n", db);
|
||||
"\n--\n-- Dumping events for database '%s'\n--\n",
|
||||
fix_for_comment(db));
|
||||
|
||||
/*
|
||||
not using "mysql_query_with_error_report" because we may have not
|
||||
|
@ -2464,7 +2487,8 @@ static uint dump_routines_for_db(char *db)
|
|||
|
||||
/* nice comments */
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Dumping routines for database '%s'\n--\n", db);
|
||||
"\n--\n-- Dumping routines for database '%s'\n--\n",
|
||||
fix_for_comment(db));
|
||||
|
||||
/*
|
||||
not using "mysql_query_with_error_report" because we may have not
|
||||
|
@ -2760,11 +2784,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||
if (strcmp (table_type, "VIEW") == 0) /* view */
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Temporary table structure for view %s\n--\n\n",
|
||||
result_table);
|
||||
fix_for_comment(result_table));
|
||||
else
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Table structure for table %s\n--\n\n",
|
||||
result_table);
|
||||
fix_for_comment(result_table));
|
||||
|
||||
if (opt_drop)
|
||||
{
|
||||
|
@ -3008,7 +3032,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Table structure for table %s\n--\n\n",
|
||||
result_table);
|
||||
fix_for_comment(result_table));
|
||||
if (opt_drop)
|
||||
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table);
|
||||
if (!opt_xml)
|
||||
|
@ -3717,21 +3741,21 @@ static void dump_table(char *table, char *db)
|
|||
{
|
||||
print_comment(md_result_file, 0,
|
||||
"\n--\n-- Dumping data for table %s\n--\n",
|
||||
result_table);
|
||||
fix_for_comment(result_table));
|
||||
|
||||
dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM ");
|
||||
dynstr_append_checked(&query_string, result_table);
|
||||
|
||||
if (where)
|
||||
{
|
||||
print_comment(md_result_file, 0, "-- WHERE: %s\n", where);
|
||||
print_comment(md_result_file, 0, "-- WHERE: %s\n", fix_for_comment(where));
|
||||
|
||||
dynstr_append_checked(&query_string, " WHERE ");
|
||||
dynstr_append_checked(&query_string, where);
|
||||
}
|
||||
if (order_by)
|
||||
{
|
||||
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by);
|
||||
print_comment(md_result_file, 0, "-- ORDER BY: %s\n", fix_for_comment(order_by));
|
||||
|
||||
dynstr_append_checked(&query_string, " ORDER BY ");
|
||||
dynstr_append_checked(&query_string, order_by);
|
||||
|
@ -4241,7 +4265,7 @@ static int dump_tablespaces(char* ts_where)
|
|||
if (first)
|
||||
{
|
||||
print_comment(md_result_file, 0, "\n--\n-- Logfile group: %s\n--\n",
|
||||
row[0]);
|
||||
fix_for_comment(row[0]));
|
||||
|
||||
fprintf(md_result_file, "\nCREATE");
|
||||
}
|
||||
|
@ -4310,7 +4334,8 @@ static int dump_tablespaces(char* ts_where)
|
|||
first= 1;
|
||||
if (first)
|
||||
{
|
||||
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n", row[0]);
|
||||
print_comment(md_result_file, 0, "\n--\n-- Tablespace: %s\n--\n",
|
||||
fix_for_comment(row[0]));
|
||||
fprintf(md_result_file, "\nCREATE");
|
||||
}
|
||||
else
|
||||
|
@ -4514,7 +4539,8 @@ static int init_dumping(char *database, int init_func(char*))
|
|||
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
|
||||
|
||||
print_comment(md_result_file, 0,
|
||||
"\n--\n-- Current Database: %s\n--\n", qdatabase);
|
||||
"\n--\n-- Current Database: %s\n--\n",
|
||||
fix_for_comment(qdatabase));
|
||||
|
||||
/* Call the view or table specific function */
|
||||
init_func(qdatabase);
|
||||
|
@ -5774,7 +5800,7 @@ static my_bool get_view_structure(char *table, char* db)
|
|||
|
||||
print_comment(sql_file, 0,
|
||||
"\n--\n-- Final view structure for view %s\n--\n\n",
|
||||
result_table);
|
||||
fix_for_comment(result_table));
|
||||
|
||||
/* Table might not exist if this view was dumped with --tab. */
|
||||
fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);
|
||||
|
|
|
@ -1731,11 +1731,11 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
|
|||
while((len= my_read(fd, (uchar*)&buff,
|
||||
sizeof(buff)-1, MYF(0))) > 0)
|
||||
{
|
||||
char *p= buff, *start= buff;
|
||||
while (p < buff+len)
|
||||
char *p= buff, *start= buff,*end=buff+len;
|
||||
while (p < end)
|
||||
{
|
||||
/* Convert cr/lf to lf */
|
||||
if (*p == '\r' && *(p+1) && *(p+1)== '\n')
|
||||
if (*p == '\r' && p+1 < end && *(p+1)== '\n')
|
||||
{
|
||||
/* Add fake newline instead of cr and output the line */
|
||||
*p= '\n';
|
||||
|
@ -3373,10 +3373,6 @@ void do_exec(struct st_command *command)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* exec command is interpreted externally and will not take newlines */
|
||||
while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
|
||||
;
|
||||
|
||||
DBUG_PRINT("info", ("Executing '%s' as '%s'",
|
||||
command->first_argument, ds_cmd.str));
|
||||
|
||||
|
@ -3395,16 +3391,32 @@ void do_exec(struct st_command *command)
|
|||
ds_result= &ds_sorted;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Workaround for CRT bug, MDEV-9409 */
|
||||
_setmode(fileno(res_file), O_BINARY);
|
||||
#endif
|
||||
|
||||
while (fgets(buf, sizeof(buf), res_file))
|
||||
{
|
||||
int len = (int)strlen(buf);
|
||||
#ifdef _WIN32
|
||||
/* Strip '\r' off newlines. */
|
||||
if (len > 1 && buf[len-2] == '\r' && buf[len-1] == '\n')
|
||||
{
|
||||
buf[len-2] = '\n';
|
||||
buf[len-1] = 0;
|
||||
len--;
|
||||
}
|
||||
#endif
|
||||
if (disable_result_log)
|
||||
{
|
||||
buf[strlen(buf)-1]=0;
|
||||
if (len)
|
||||
buf[len-1] = 0;
|
||||
DBUG_PRINT("exec_result",("%s", buf));
|
||||
}
|
||||
else
|
||||
{
|
||||
replace_dynstr_append(ds_result, buf);
|
||||
replace_dynstr_append_mem(ds_result, buf, len);
|
||||
}
|
||||
}
|
||||
error= pclose(res_file);
|
||||
|
|
|
@ -83,7 +83,8 @@ IF(FEATURE_SET)
|
|||
ENDIF()
|
||||
|
||||
OPTION(ENABLED_LOCAL_INFILE "" ON)
|
||||
IF(RPM)
|
||||
IF(WIN32)
|
||||
ELSEIF(RPM)
|
||||
SET(WITH_SSL system CACHE STRING "")
|
||||
SET(WITH_ZLIB system CACHE STRING "")
|
||||
ELSEIF(DEB)
|
||||
|
|
|
@ -157,7 +157,7 @@ SETA(CPACK_RPM_server_PACKAGE_REQUIRES
|
|||
IF(WITH_WSREP)
|
||||
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
|
||||
"galera" "rsync" "lsof" "grep" "gawk" "iproute"
|
||||
"coreutils" "findutils" "tar")
|
||||
"coreutils" "findutils" "tar" "which")
|
||||
ENDIF()
|
||||
|
||||
SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
|
||||
|
|
|
@ -202,6 +202,7 @@ IF(WIN32)
|
|||
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
|
||||
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
|
||||
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86"
|
||||
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86"
|
||||
)
|
||||
IF(NOT SIGNTOOL_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR
|
||||
|
|
|
@ -115,7 +115,7 @@ IF(MSVC)
|
|||
|
||||
#TODO: update the code and remove the disabled warnings
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /we4099")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099")
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
# _WIN64 is defined by the compiler itself.
|
||||
|
|
|
@ -30,6 +30,10 @@ IF(NOT VERSION)
|
|||
SET(64BIT 1)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
|
||||
SET(DEFAULT_MACHINE "mips")
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
|
||||
SET(DEFAULT_PLATFORM "win")
|
||||
|
|
|
@ -207,5 +207,6 @@ MACRO (MYSQL_CHECK_READLINE)
|
|||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CMAKE_REQUIRED_INCLUDES)
|
||||
ENDIF(NOT WIN32)
|
||||
CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H)
|
||||
ENDMACRO()
|
||||
|
||||
|
|
|
@ -225,7 +225,6 @@ CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
|
|||
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H)
|
||||
CHECK_INCLUDE_FILES (sys/syscall.h HAVE_SYS_SYSCALL_H)
|
||||
CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H)
|
||||
CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H)
|
||||
CHECK_INCLUDE_FILES (termbits.h HAVE_TERMBITS_H)
|
||||
CHECK_INCLUDE_FILES (termios.h HAVE_TERMIOS_H)
|
||||
|
|
|
@ -12,6 +12,24 @@ before calling SSL_new();
|
|||
|
||||
*** end Note ***
|
||||
|
||||
yaSSL Release notes, version 2.4.2 (9/22/2016)
|
||||
This release of yaSSL fixes a medium security vulnerability. A fix for
|
||||
potential AES side channel leaks is included that a local user monitoring
|
||||
the same CPU core cache could exploit. VM users, hyper-threading users,
|
||||
and users where potential attackers have access to the CPU cache will need
|
||||
to update if they utilize AES.
|
||||
|
||||
DSA padding fixes for unusual sizes is included as well. Users with DSA
|
||||
certficiates should update.
|
||||
|
||||
yaSSL Release notes, version 2.4.0 (5/20/2016)
|
||||
This release of yaSSL fixes the OpenSSL compatibility function
|
||||
SSL_CTX_load_verify_locations() when using the path directory to allow
|
||||
unlimited path sizes. Minor Windows build fixes are included.
|
||||
No high level security fixes in this version but we always recommend
|
||||
updating.
|
||||
|
||||
|
||||
yaSSL Release notes, version 2.3.9b (2/03/2016)
|
||||
This release of yaSSL fixes the OpenSSL compatibility function
|
||||
X509_NAME_get_index_by_NID() to use the actual index of the common name
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDqzCCA2ugAwIBAgIJAMGqrgDU6DyhMAkGByqGSM44BAMwgY4xCzAJBgNVBAYT
|
||||
MIIDrzCCA2+gAwIBAgIJAK1zRM7YFcNjMAkGByqGSM44BAMwgZAxCzAJBgNVBAYT
|
||||
AlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQK
|
||||
DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wu
|
||||
Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTEzMDQyMjIw
|
||||
MDk0NFoXDTE2MDExNzIwMDk0NFowgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP
|
||||
cmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYD
|
||||
VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQYJKoZIhvcN
|
||||
AQkBFhBpbmZvQHdvbGZzc2wuY29tMIIBuDCCASwGByqGSM44BAEwggEfAoGBAL1R
|
||||
7koy4IrH6sbh6nDEUUPPKgfhxxLCWCVexF2+qzANEr+hC9M002haJXFOfeS9DyoO
|
||||
WFbL0qMZOuqv+22CaHnoUWl7q3PjJOAI3JH0P54ZyUPuU1909RzgTdIDp5+ikbr7
|
||||
KYjnltL73FQVMbjTZQKthIpPn3MjYcF+4jp2W2zFAhUAkcntYND6MGf+eYzIJDN2
|
||||
L7SonHUCgYEAklpxErfqznIZjVvqqHFaq+mgAL5J8QrKVmdhYZh/Y8z4jCjoCA8o
|
||||
TDoFKxf7s2ZzgaPKvglaEKiYqLqic9qY78DYJswzQMLFvjsF4sFZ+pYCBdWPQI4N
|
||||
PgxCiznK6Ce+JH9ikSBvMvG+tevjr2UpawDIHX3+AWYaZBZwKADAaboDgYUAAoGB
|
||||
AJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caaDDa0XJ7ak6A7
|
||||
TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WXS0kk3m/DHaC0
|
||||
3ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVo1AwTjAdBgNVHQ4EFgQU
|
||||
IJjk416o4v8qpH9LBtXlR9v8gccwHwYDVR0jBBgwFoAUIJjk416o4v8qpH9LBtXl
|
||||
R9v8gccwDAYDVR0TBAUwAwEB/zAJBgcqhkjOOAQDAy8AMCwCFCjGKIdOSV12LcTu
|
||||
k08owGM6YkO1AhQe+K173VuaO/OsDNsxZlKpyH8+1g==
|
||||
DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTYwOTIy
|
||||
MjEyMzA0WhcNMjIwMzE1MjEyMzA0WjCBkDELMAkGA1UEBhMCVVMxDzANBgNVBAgM
|
||||
Bk9yZWdvbjERMA8GA1UEBwwIUG9ydGxhbmQxEDAOBgNVBAoMB3dvbGZTU0wxEDAO
|
||||
BgNVBAsMB3Rlc3RpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
||||
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCAbgwggEsBgcqhkjOOAQBMIIBHwKB
|
||||
gQC9Ue5KMuCKx+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvTNNNoWiVxTn3k
|
||||
vQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNfdPUc4E3SA6ef
|
||||
opG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ7WDQ+jBn/nmM
|
||||
yCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZnYWGYf2PM+Iwo
|
||||
6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47BeLBWfqWAgXV
|
||||
j0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQWcCgAwGm6A4GF
|
||||
AAKBgQCdy2PPch8r0P07EOs5WG6L425P6IJ3bDKj3TVLy+Ebj04CT/3Gmgw2tFye
|
||||
2pOgO0yfkIXizcDl6GT2CQuBBhUgwF6WJ4hoW1iK1UwhnupZmQ358eNFl0tJJN5v
|
||||
wx2gtNxJSwIsm8VRscqqFH2092b9ScH7VjLoqhx+bgA4XV7l1aNQME4wHQYDVR0O
|
||||
BBYEFCCY5ONeqOL/KqR/SwbV5Ufb/IHHMB8GA1UdIwQYMBaAFCCY5ONeqOL/KqR/
|
||||
SwbV5Ufb/IHHMAwGA1UdEwQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhQRYSCVN/Ge
|
||||
agV3mffU3qNZ92fI0QIUPH7Jp+iASI7U1ocaYDc10qXGaGY=
|
||||
-----END CERTIFICATE-----
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "rsa.h"
|
||||
|
||||
|
||||
#define YASSL_VERSION "2.3.9b"
|
||||
#define YASSL_VERSION "2.4.2"
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -162,7 +162,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
|
|||
TaoCrypt::DSA_PrivateKey dsaKey;
|
||||
dsaKey.Initialize(dsaSource);
|
||||
|
||||
if (rsaSource.GetError().What()) {
|
||||
if (dsaSource.GetError().What()) {
|
||||
// neither worked
|
||||
ret = SSL_FAILURE;
|
||||
}
|
||||
|
@ -785,40 +785,67 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
|
|||
WIN32_FIND_DATA FindFileData;
|
||||
HANDLE hFind;
|
||||
|
||||
char name[MAX_PATH + 1]; // directory specification
|
||||
strncpy(name, path, MAX_PATH - 3);
|
||||
strncat(name, "\\*", 3);
|
||||
const int DELIMITER_SZ = 2;
|
||||
const int DELIMITER_STAR_SZ = 3;
|
||||
int pathSz = (int)strlen(path);
|
||||
int nameSz = pathSz + DELIMITER_STAR_SZ + 1; // plus 1 for terminator
|
||||
char* name = NEW_YS char[nameSz]; // directory specification
|
||||
memset(name, 0, nameSz);
|
||||
strncpy(name, path, nameSz - DELIMITER_STAR_SZ - 1);
|
||||
strncat(name, "\\*", DELIMITER_STAR_SZ);
|
||||
|
||||
hFind = FindFirstFile(name, &FindFileData);
|
||||
if (hFind == INVALID_HANDLE_VALUE) return SSL_BAD_PATH;
|
||||
if (hFind == INVALID_HANDLE_VALUE) {
|
||||
ysArrayDelete(name);
|
||||
return SSL_BAD_PATH;
|
||||
}
|
||||
|
||||
do {
|
||||
if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
|
||||
strncpy(name, path, MAX_PATH - 2 - HALF_PATH);
|
||||
strncat(name, "\\", 2);
|
||||
strncat(name, FindFileData.cFileName, HALF_PATH);
|
||||
if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
int curSz = (int)strlen(FindFileData.cFileName);
|
||||
if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
|
||||
ysArrayDelete(name);
|
||||
// plus 1 for terminator
|
||||
nameSz = pathSz + curSz + DELIMITER_SZ + 1;
|
||||
name = NEW_YS char[nameSz];
|
||||
}
|
||||
memset(name, 0, nameSz);
|
||||
strncpy(name, path, nameSz - curSz - DELIMITER_SZ - 1);
|
||||
strncat(name, "\\", DELIMITER_SZ);
|
||||
strncat(name, FindFileData.cFileName,
|
||||
nameSz - pathSz - DELIMITER_SZ - 1);
|
||||
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
|
||||
}
|
||||
} while (ret == SSL_SUCCESS && FindNextFile(hFind, &FindFileData));
|
||||
|
||||
ysArrayDelete(name);
|
||||
FindClose(hFind);
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
const int MAX_PATH = 260;
|
||||
|
||||
DIR* dir = opendir(path);
|
||||
if (!dir) return SSL_BAD_PATH;
|
||||
|
||||
struct dirent* entry;
|
||||
struct stat buf;
|
||||
char name[MAX_PATH + 1];
|
||||
const int DELIMITER_SZ = 1;
|
||||
int pathSz = (int)strlen(path);
|
||||
int nameSz = pathSz + DELIMITER_SZ + 1; //plus 1 for null terminator
|
||||
char* name = NEW_YS char[nameSz]; // directory specification
|
||||
|
||||
while (ret == SSL_SUCCESS && (entry = readdir(dir))) {
|
||||
strncpy(name, path, MAX_PATH - 1 - HALF_PATH);
|
||||
strncat(name, "/", 1);
|
||||
strncat(name, entry->d_name, HALF_PATH);
|
||||
int curSz = (int)strlen(entry->d_name);
|
||||
if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
|
||||
ysArrayDelete(name);
|
||||
nameSz = pathSz + DELIMITER_SZ + curSz + 1;
|
||||
name = NEW_YS char[nameSz];
|
||||
}
|
||||
memset(name, 0, nameSz);
|
||||
strncpy(name, path, nameSz - curSz - 1);
|
||||
strncat(name, "/", DELIMITER_SZ);
|
||||
strncat(name, entry->d_name, nameSz - pathSz - DELIMITER_SZ - 1);
|
||||
|
||||
if (stat(name, &buf) < 0) {
|
||||
ysArrayDelete(name);
|
||||
closedir(dir);
|
||||
return SSL_BAD_STAT;
|
||||
}
|
||||
|
@ -827,6 +854,7 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
|
|||
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
|
||||
}
|
||||
|
||||
ysArrayDelete(name);
|
||||
closedir(dir);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -60,6 +60,7 @@ private:
|
|||
|
||||
static const word32 Te[5][256];
|
||||
static const word32 Td[5][256];
|
||||
static const byte CTd4[256];
|
||||
|
||||
static const word32* Te0;
|
||||
static const word32* Te1;
|
||||
|
@ -80,11 +81,68 @@ private:
|
|||
|
||||
void ProcessAndXorBlock(const byte*, const byte*, byte*) const;
|
||||
|
||||
word32 PreFetchTe() const;
|
||||
word32 PreFetchTd() const;
|
||||
word32 PreFetchCTd4() const;
|
||||
|
||||
AES(const AES&); // hide copy
|
||||
AES& operator=(const AES&); // and assign
|
||||
};
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_M_X64) || \
|
||||
(defined(__ILP32__) && (__ILP32__ >= 1))
|
||||
#define TC_CACHE_LINE_SZ 64
|
||||
#else
|
||||
/* default cache line size */
|
||||
#define TC_CACHE_LINE_SZ 32
|
||||
#endif
|
||||
|
||||
inline word32 AES::PreFetchTe() const
|
||||
{
|
||||
word32 x = 0;
|
||||
|
||||
/* 4 tables of 256 entries */
|
||||
for (int i = 0; i < 4; i++) {
|
||||
/* each entry is 4 bytes */
|
||||
for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
|
||||
x &= Te[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
inline word32 AES::PreFetchTd() const
|
||||
{
|
||||
word32 x = 0;
|
||||
|
||||
/* 4 tables of 256 entries */
|
||||
for (int i = 0; i < 4; i++) {
|
||||
/* each entry is 4 bytes */
|
||||
for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
|
||||
x &= Td[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
inline word32 AES::PreFetchCTd4() const
|
||||
{
|
||||
word32 x = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i += TC_CACHE_LINE_SZ) {
|
||||
x &= CTd4[i];
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
typedef BlockCipher<ENCRYPTION, AES, ECB> AES_ECB_Encryption;
|
||||
typedef BlockCipher<DECRYPTION, AES, ECB> AES_ECB_Decryption;
|
||||
|
||||
|
|
|
@ -119,6 +119,9 @@ namespace TaoCrypt {
|
|||
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#undef max // avoid name clash
|
||||
#endif
|
||||
// general MAX
|
||||
template<typename T> inline
|
||||
const T& max(const T& a, const T& b)
|
||||
|
|
|
@ -109,10 +109,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
|
|||
{
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^
|
||||
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
rcon_[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
|
@ -128,10 +128,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
|
|||
{
|
||||
temp = rk[ 5];
|
||||
rk[ 6] = rk[ 0] ^
|
||||
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
rcon_[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
|
@ -149,10 +149,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
|
|||
{
|
||||
temp = rk[ 7];
|
||||
rk[ 8] = rk[ 0] ^
|
||||
(Te4[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(temp, 2)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
|
||||
rcon_[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
|
@ -161,10 +161,10 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
|
|||
break;
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^
|
||||
(Te4[GETBYTE(temp, 3)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(temp, 2)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(temp, 1)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(temp, 0)] & 0x000000ff);
|
||||
(Te2[GETBYTE(temp, 3)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(temp, 2)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(temp, 1)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(temp, 0)] & 0x000000ff);
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
|
@ -191,25 +191,25 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
|
|||
for (i = 1; i < rounds_; i++) {
|
||||
rk += 4;
|
||||
rk[0] =
|
||||
Td0[Te4[GETBYTE(rk[0], 3)] & 0xff] ^
|
||||
Td1[Te4[GETBYTE(rk[0], 2)] & 0xff] ^
|
||||
Td2[Te4[GETBYTE(rk[0], 1)] & 0xff] ^
|
||||
Td3[Te4[GETBYTE(rk[0], 0)] & 0xff];
|
||||
Td0[Te1[GETBYTE(rk[0], 3)] & 0xff] ^
|
||||
Td1[Te1[GETBYTE(rk[0], 2)] & 0xff] ^
|
||||
Td2[Te1[GETBYTE(rk[0], 1)] & 0xff] ^
|
||||
Td3[Te1[GETBYTE(rk[0], 0)] & 0xff];
|
||||
rk[1] =
|
||||
Td0[Te4[GETBYTE(rk[1], 3)] & 0xff] ^
|
||||
Td1[Te4[GETBYTE(rk[1], 2)] & 0xff] ^
|
||||
Td2[Te4[GETBYTE(rk[1], 1)] & 0xff] ^
|
||||
Td3[Te4[GETBYTE(rk[1], 0)] & 0xff];
|
||||
Td0[Te1[GETBYTE(rk[1], 3)] & 0xff] ^
|
||||
Td1[Te1[GETBYTE(rk[1], 2)] & 0xff] ^
|
||||
Td2[Te1[GETBYTE(rk[1], 1)] & 0xff] ^
|
||||
Td3[Te1[GETBYTE(rk[1], 0)] & 0xff];
|
||||
rk[2] =
|
||||
Td0[Te4[GETBYTE(rk[2], 3)] & 0xff] ^
|
||||
Td1[Te4[GETBYTE(rk[2], 2)] & 0xff] ^
|
||||
Td2[Te4[GETBYTE(rk[2], 1)] & 0xff] ^
|
||||
Td3[Te4[GETBYTE(rk[2], 0)] & 0xff];
|
||||
Td0[Te1[GETBYTE(rk[2], 3)] & 0xff] ^
|
||||
Td1[Te1[GETBYTE(rk[2], 2)] & 0xff] ^
|
||||
Td2[Te1[GETBYTE(rk[2], 1)] & 0xff] ^
|
||||
Td3[Te1[GETBYTE(rk[2], 0)] & 0xff];
|
||||
rk[3] =
|
||||
Td0[Te4[GETBYTE(rk[3], 3)] & 0xff] ^
|
||||
Td1[Te4[GETBYTE(rk[3], 2)] & 0xff] ^
|
||||
Td2[Te4[GETBYTE(rk[3], 1)] & 0xff] ^
|
||||
Td3[Te4[GETBYTE(rk[3], 0)] & 0xff];
|
||||
Td0[Te1[GETBYTE(rk[3], 3)] & 0xff] ^
|
||||
Td1[Te1[GETBYTE(rk[3], 2)] & 0xff] ^
|
||||
Td2[Te1[GETBYTE(rk[3], 1)] & 0xff] ^
|
||||
Td3[Te1[GETBYTE(rk[3], 0)] & 0xff];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,6 +244,7 @@ void AES::encrypt(const byte* inBlock, const byte* xorBlock,
|
|||
s2 ^= rk[2];
|
||||
s3 ^= rk[3];
|
||||
|
||||
s0 |= PreFetchTe();
|
||||
/*
|
||||
* Nr - 1 full rounds:
|
||||
*/
|
||||
|
@ -312,28 +313,28 @@ void AES::encrypt(const byte* inBlock, const byte* xorBlock,
|
|||
*/
|
||||
|
||||
s0 =
|
||||
(Te4[GETBYTE(t0, 3)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(t1, 2)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(t2, 1)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(t3, 0)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(t0, 3)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(t1, 2)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(t2, 1)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(t3, 0)] & 0x000000ff) ^
|
||||
rk[0];
|
||||
s1 =
|
||||
(Te4[GETBYTE(t1, 3)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(t2, 2)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(t3, 1)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(t0, 0)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(t1, 3)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(t2, 2)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(t3, 1)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(t0, 0)] & 0x000000ff) ^
|
||||
rk[1];
|
||||
s2 =
|
||||
(Te4[GETBYTE(t2, 3)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(t3, 2)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(t0, 1)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(t1, 0)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(t2, 3)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(t3, 2)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(t0, 1)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(t1, 0)] & 0x000000ff) ^
|
||||
rk[2];
|
||||
s3 =
|
||||
(Te4[GETBYTE(t3, 3)] & 0xff000000) ^
|
||||
(Te4[GETBYTE(t0, 2)] & 0x00ff0000) ^
|
||||
(Te4[GETBYTE(t1, 1)] & 0x0000ff00) ^
|
||||
(Te4[GETBYTE(t2, 0)] & 0x000000ff) ^
|
||||
(Te2[GETBYTE(t3, 3)] & 0xff000000) ^
|
||||
(Te3[GETBYTE(t0, 2)] & 0x00ff0000) ^
|
||||
(Te0[GETBYTE(t1, 1)] & 0x0000ff00) ^
|
||||
(Te1[GETBYTE(t2, 0)] & 0x000000ff) ^
|
||||
rk[3];
|
||||
|
||||
|
||||
|
@ -358,6 +359,8 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock,
|
|||
s2 ^= rk[2];
|
||||
s3 ^= rk[3];
|
||||
|
||||
s0 |= PreFetchTd();
|
||||
|
||||
/*
|
||||
* Nr - 1 full rounds:
|
||||
*/
|
||||
|
@ -423,29 +426,32 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock,
|
|||
* apply last round and
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
|
||||
t0 |= PreFetchCTd4();
|
||||
|
||||
s0 =
|
||||
(Td4[GETBYTE(t0, 3)] & 0xff000000) ^
|
||||
(Td4[GETBYTE(t3, 2)] & 0x00ff0000) ^
|
||||
(Td4[GETBYTE(t2, 1)] & 0x0000ff00) ^
|
||||
(Td4[GETBYTE(t1, 0)] & 0x000000ff) ^
|
||||
((word32)CTd4[GETBYTE(t0, 3)] << 24) ^
|
||||
((word32)CTd4[GETBYTE(t3, 2)] << 16) ^
|
||||
((word32)CTd4[GETBYTE(t2, 1)] << 8) ^
|
||||
((word32)CTd4[GETBYTE(t1, 0)]) ^
|
||||
rk[0];
|
||||
s1 =
|
||||
(Td4[GETBYTE(t1, 3)] & 0xff000000) ^
|
||||
(Td4[GETBYTE(t0, 2)] & 0x00ff0000) ^
|
||||
(Td4[GETBYTE(t3, 1)] & 0x0000ff00) ^
|
||||
(Td4[GETBYTE(t2, 0)] & 0x000000ff) ^
|
||||
((word32)CTd4[GETBYTE(t1, 3)] << 24) ^
|
||||
((word32)CTd4[GETBYTE(t0, 2)] << 16) ^
|
||||
((word32)CTd4[GETBYTE(t3, 1)] << 8) ^
|
||||
((word32)CTd4[GETBYTE(t2, 0)]) ^
|
||||
rk[1];
|
||||
s2 =
|
||||
(Td4[GETBYTE(t2, 3)] & 0xff000000) ^
|
||||
(Td4[GETBYTE(t1, 2)] & 0x00ff0000) ^
|
||||
(Td4[GETBYTE(t0, 1)] & 0x0000ff00) ^
|
||||
(Td4[GETBYTE(t3, 0)] & 0x000000ff) ^
|
||||
((word32)CTd4[GETBYTE(t2, 3)] << 24 ) ^
|
||||
((word32)CTd4[GETBYTE(t1, 2)] << 16 ) ^
|
||||
((word32)CTd4[GETBYTE(t0, 1)] << 8 ) ^
|
||||
((word32)CTd4[GETBYTE(t3, 0)]) ^
|
||||
rk[2];
|
||||
s3 =
|
||||
(Td4[GETBYTE(t3, 3)] & 0xff000000) ^
|
||||
(Td4[GETBYTE(t2, 2)] & 0x00ff0000) ^
|
||||
(Td4[GETBYTE(t1, 1)] & 0x0000ff00) ^
|
||||
(Td4[GETBYTE(t0, 0)] & 0x000000ff) ^
|
||||
((word32)CTd4[GETBYTE(t3, 3)] << 24) ^
|
||||
((word32)CTd4[GETBYTE(t2, 2)] << 16) ^
|
||||
((word32)CTd4[GETBYTE(t1, 1)] << 8) ^
|
||||
((word32)CTd4[GETBYTE(t0, 0)]) ^
|
||||
rk[3];
|
||||
|
||||
gpBlock::Put(xorBlock, outBlock)(s0)(s1)(s2)(s3);
|
||||
|
@ -1826,18 +1832,52 @@ const word32 AES::Td[5][256] = {
|
|||
}
|
||||
};
|
||||
|
||||
const byte AES::CTd4[256] =
|
||||
{
|
||||
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
|
||||
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
|
||||
0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
|
||||
0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
|
||||
0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
|
||||
0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
|
||||
0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
|
||||
0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
|
||||
0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
|
||||
0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
|
||||
0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
|
||||
0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
|
||||
0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
|
||||
0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
|
||||
0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
|
||||
0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
|
||||
0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
|
||||
0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
|
||||
0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
|
||||
0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
|
||||
0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
|
||||
0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
|
||||
0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
|
||||
0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
|
||||
0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
|
||||
0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
|
||||
0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
|
||||
0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
|
||||
0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
|
||||
0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
|
||||
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
|
||||
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
|
||||
};
|
||||
|
||||
|
||||
const word32* AES::Te0 = AES::Te[0];
|
||||
const word32* AES::Te1 = AES::Te[1];
|
||||
const word32* AES::Te2 = AES::Te[2];
|
||||
const word32* AES::Te3 = AES::Te[3];
|
||||
const word32* AES::Te4 = AES::Te[4];
|
||||
|
||||
const word32* AES::Td0 = AES::Td[0];
|
||||
const word32* AES::Td1 = AES::Td[1];
|
||||
const word32* AES::Td2 = AES::Td[2];
|
||||
const word32* AES::Td3 = AES::Td[3];
|
||||
const word32* AES::Td4 = AES::Td[4];
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1219,17 +1219,17 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
|||
}
|
||||
word32 rLen = GetLength(source);
|
||||
if (rLen != 20) {
|
||||
if (rLen == 21) { // zero at front, eat
|
||||
while (rLen > 20 && source.remaining() > 0) { // zero's at front, eat
|
||||
source.next();
|
||||
--rLen;
|
||||
}
|
||||
else if (rLen == 19) { // add zero to front so 20 bytes
|
||||
if (rLen < 20) { // add zero's to front so 20 bytes
|
||||
word32 tmpLen = rLen;
|
||||
while (tmpLen < 20) {
|
||||
decoded[0] = 0;
|
||||
decoded++;
|
||||
tmpLen++;
|
||||
}
|
||||
else {
|
||||
source.SetError(DSA_SZ_E);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
|
||||
|
@ -1242,17 +1242,17 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
|||
}
|
||||
word32 sLen = GetLength(source);
|
||||
if (sLen != 20) {
|
||||
if (sLen == 21) {
|
||||
source.next(); // zero at front, eat
|
||||
while (sLen > 20 && source.remaining() > 0) {
|
||||
source.next(); // zero's at front, eat
|
||||
--sLen;
|
||||
}
|
||||
else if (sLen == 19) {
|
||||
decoded[rLen] = 0; // add zero to front so 20 bytes
|
||||
if (sLen < 20) { // add zero's to front so 20 bytes
|
||||
word32 tmpLen = sLen;
|
||||
while (tmpLen < 20) {
|
||||
decoded[rLen] = 0;
|
||||
decoded++;
|
||||
tmpLen++;
|
||||
}
|
||||
else {
|
||||
source.SetError(DSA_SZ_E);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
|
||||
|
|
|
@ -172,6 +172,7 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig,
|
|||
const Integer& q = key_.GetSubGroupOrder();
|
||||
const Integer& g = key_.GetSubGroupGenerator();
|
||||
const Integer& x = key_.GetPrivatePart();
|
||||
byte* tmpPtr = sig; // initial signature output
|
||||
|
||||
Integer k(rng, 1, q - 1);
|
||||
|
||||
|
@ -187,22 +188,23 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig,
|
|||
return (word32) -1;
|
||||
|
||||
int rSz = r_.ByteCount();
|
||||
int tmpSz = rSz;
|
||||
|
||||
if (rSz == 19) {
|
||||
sig[0] = 0;
|
||||
sig++;
|
||||
while (tmpSz++ < SHA::DIGEST_SIZE) {
|
||||
*sig++ = 0;
|
||||
}
|
||||
|
||||
r_.Encode(sig, rSz);
|
||||
|
||||
sig = tmpPtr + SHA::DIGEST_SIZE; // advance sig output to s
|
||||
int sSz = s_.ByteCount();
|
||||
tmpSz = sSz;
|
||||
|
||||
if (sSz == 19) {
|
||||
sig[rSz] = 0;
|
||||
sig++;
|
||||
while (tmpSz++ < SHA::DIGEST_SIZE) {
|
||||
*sig++ = 0;
|
||||
}
|
||||
|
||||
s_.Encode(sig + rSz, sSz);
|
||||
s_.Encode(sig, sSz);
|
||||
|
||||
return 40;
|
||||
}
|
||||
|
|
|
@ -193,8 +193,9 @@ DWord() {}
|
|||
"a" (a), "rm" (b) : "cc");
|
||||
|
||||
#elif defined(__mips64)
|
||||
__asm__("dmultu %2,%3" : "=d" (r.halfs_.high), "=l" (r.halfs_.low)
|
||||
: "r" (a), "r" (b));
|
||||
unsigned __int128 t = (unsigned __int128) a * b;
|
||||
r.halfs_.high = t >> 64;
|
||||
r.halfs_.low = (word) t;
|
||||
|
||||
#elif defined(_M_IX86)
|
||||
// for testing
|
||||
|
|
|
@ -1281,6 +1281,9 @@ int dsa_test()
|
|||
if (!verifier.Verify(digest, decoded))
|
||||
return -90;
|
||||
|
||||
if (!verifier.Verify(digest, signature))
|
||||
return -91;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#define yaSSL_TEST_HPP
|
||||
|
||||
#include "runtime.hpp"
|
||||
#include "openssl/ssl.h" /* openssl compatibility test */
|
||||
#include "error.hpp"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -56,6 +55,7 @@
|
|||
#endif
|
||||
#define SOCKET_T int
|
||||
#endif /* _WIN32 */
|
||||
#include "openssl/ssl.h" /* openssl compatibility test */
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -27,19 +27,9 @@
|
|||
((uint32) (uchar) (A)[0])))
|
||||
#define sint4korr(A) (*((const long *) (A)))
|
||||
#define uint2korr(A) (*((const uint16 *) (A)))
|
||||
|
||||
/*
|
||||
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
|
||||
It means, that you have to provide enough allocated space.
|
||||
*/
|
||||
#if defined(HAVE_valgrind) && !defined(_WIN32)
|
||||
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
(((uint32) ((uchar) (A)[2])) << 16))
|
||||
#else
|
||||
#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF)
|
||||
#endif
|
||||
|
||||
#define uint4korr(A) (*((const uint32 *) (A)))
|
||||
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
|
|
|
@ -28,17 +28,9 @@
|
|||
((uint32) (uchar) (A)[0])))
|
||||
#define sint4korr(A) (int32) (*((int32 *) (A)))
|
||||
#define uint2korr(A) (uint16) (*((uint16 *) (A)))
|
||||
/*
|
||||
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
|
||||
It means, that you have to provide enough allocated space.
|
||||
*/
|
||||
#if defined(HAVE_valgrind) && !defined(_WIN32)
|
||||
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
(((uint32) ((uchar) (A)[2])) << 16))
|
||||
#else
|
||||
#define uint3korr(A) (uint32) (*((unsigned int *) (A)) & 0xFFFFFF)
|
||||
#endif
|
||||
#define uint4korr(A) (uint32) (*((uint32 *) (A)))
|
||||
|
||||
|
||||
|
|
|
@ -184,7 +184,6 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
|
|||
#define MY_CS_MBMAXLEN 6 /* Maximum supported mbmaxlen */
|
||||
#define MY_CS_IS_TOOSMALL(rc) ((rc) >= MY_CS_TOOSMALL6 && (rc) <= MY_CS_TOOSMALL)
|
||||
|
||||
|
||||
#define MY_SEQ_INTTAIL 1
|
||||
#define MY_SEQ_SPACES 2
|
||||
#define MY_SEQ_NONSPACES 3 /* Skip non-space characters, including bad bytes */
|
||||
|
|
|
@ -149,7 +149,7 @@ typedef struct st_maria_create_info
|
|||
uint null_bytes;
|
||||
uint old_options;
|
||||
enum data_file_type org_data_file_type;
|
||||
uint8 language;
|
||||
uint16 language;
|
||||
my_bool with_auto_increment, transactional;
|
||||
} MARIA_CREATE_INFO;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */
|
|||
uint16 language;
|
||||
uint8 type; /* Type of key (for sort) */
|
||||
uint8 null_bit; /* bitmask to test for NULL */
|
||||
uint8 bit_start,bit_end; /* if bit field */
|
||||
uint8 bit_start;
|
||||
uint8 bit_length; /* Length of bit part */
|
||||
} HA_KEYSEG;
|
||||
|
||||
|
|
|
@ -879,8 +879,7 @@ typedef long long my_ptrdiff_t;
|
|||
and related routines are refactored.
|
||||
*/
|
||||
|
||||
#define my_offsetof(TYPE, MEMBER) \
|
||||
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
|
||||
#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)
|
||||
|
||||
#define NullS (char *) 0
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2013, Monty Program Ab.
|
||||
Copyright (c) 2010, 2016, Monty Program Ab.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -279,7 +279,7 @@ extern my_bool my_use_symdir;
|
|||
extern ulong my_default_record_cache_size;
|
||||
extern my_bool my_disable_locking, my_disable_async_io,
|
||||
my_disable_flush_key_blocks, my_disable_symlinks;
|
||||
extern my_bool my_disable_sync;
|
||||
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
|
||||
extern char wild_many,wild_one,wild_prefix;
|
||||
extern const char *charsets_dir;
|
||||
extern my_bool timed_mutexes;
|
||||
|
|
|
@ -450,8 +450,9 @@ void read_user_name(char *name)
|
|||
|
||||
void read_user_name(char *name)
|
||||
{
|
||||
char *str=getenv("USER"); /* ODBC will send user variable */
|
||||
strmake(name,str ? str : "ODBC", USERNAME_LENGTH);
|
||||
DWORD len= USERNAME_LENGTH;
|
||||
if (!GetUserName(name, &len))
|
||||
strmov(name,"UNKNOWN_USER");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'\" t
|
||||
.\"
|
||||
.TH "\FBMYSQLD_MULTI\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
|
||||
.TH "\FBMYSQLD_MULTI\FR" "1" "7 December 2016" "MariaDB 10\&.2" "MariaDB Database System"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
|
@ -419,6 +419,21 @@ Be more verbose\&.
|
|||
.sp
|
||||
Display version information and exit\&.
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
.\" mysqld_multi: wsrep-new-cluster option
|
||||
.\" wsrep-new-cluster option: mysqld_multi
|
||||
\fB\-\-wsrep\-new\-cluster\fR
|
||||
.sp
|
||||
Bootstrap a cluster\&.
|
||||
.RE
|
||||
.PP
|
||||
Some notes about
|
||||
\fBmysqld_multi\fR:
|
||||
|
@ -653,7 +668,7 @@ user = jani
|
|||
.SH "COPYRIGHT"
|
||||
.br
|
||||
.PP
|
||||
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
|
||||
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2016 MariaDB Foundation
|
||||
.PP
|
||||
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
|
||||
.PP
|
||||
|
|
|
@ -753,6 +753,29 @@ suppresses date printing\&
|
|||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
.\" mysqldump: dump-slave option
|
||||
.\" dump-slave option: mysqldump
|
||||
\fB\-\-dump\-slave[=\fR\fB\fIvalue\fR\fR\fB]\fR
|
||||
.sp
|
||||
Used for producing a dump file from a replication slave server that can be used to set up another slave server
|
||||
with the same master\&. Causes the binary log position and filename of the master to be appended to the dumped
|
||||
data output\&. Setting the value to 1 (the default) will print it as a CHANGE MASTER command in the dumped data
|
||||
output; if set to 2, that command will be prefixed with a comment symbol\&. This option will turn
|
||||
\-\-lock\-all\-tables on, unless \-\-single-transaction is specified too (in which case a global read lock is only
|
||||
taken a short time at the beginning of the dump \- don't forget to read about \-\-single-transaction below)\&. In
|
||||
all cases any action on logs will happen at the exact moment of the dump\&. Option automatically turns
|
||||
\-\-lock\-tables off\&. Using this option causes mysqldump to stop the slave SQL thread before beginning the dump,
|
||||
and restart it again after completion\&.
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
.\" mysqldump: events option
|
||||
.\" events option: mysqldump
|
||||
\fB\-\-events\fR,
|
||||
|
|
68
mysql-test/extra/binlog_tests/binlog_incident.inc
Normal file
68
mysql-test/extra/binlog_tests/binlog_incident.inc
Normal file
|
@ -0,0 +1,68 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# --let $use_remote_mysqlbinlog= 1 # optional
|
||||
# --let $binlog_start_pos= <binlog position> # optional
|
||||
# --let $binlog_file= <binlog filename> # optional
|
||||
#
|
||||
# --source extra/binlog_tests/binlog_incident.inc
|
||||
#
|
||||
# The script uses MYSQLBINLOG to verify certain results.
|
||||
# By default, it uses binary logs directly. If it is undesirable,
|
||||
# this behavior can be overridden by setting $use_remote_binlog
|
||||
# as shown above.
|
||||
#
|
||||
# All values will be unset after every execution of the script,
|
||||
# so if they are needed, they should be set explicitly before each call.
|
||||
#
|
||||
|
||||
# The purpose of this test is to provide a reference for how the
|
||||
# incident log event is represented in the output from the mysqlbinlog
|
||||
# program.
|
||||
|
||||
source include/have_log_bin.inc;
|
||||
source include/have_debug.inc;
|
||||
source include/binlog_start_pos.inc;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT * FROM t1;
|
||||
|
||||
# This will generate an incident log event and store it in the binary
|
||||
# log before the replace statement.
|
||||
REPLACE INTO t1 VALUES (4);
|
||||
|
||||
DROP TABLE t1;
|
||||
FLUSH LOGS;
|
||||
|
||||
if ($binlog_start_pos)
|
||||
{
|
||||
--let $startpos= --start-position=$binlog_start_pos
|
||||
--let $binlog_start_pos=
|
||||
}
|
||||
--let $filename= master-bin.000001
|
||||
if ($binlog_file)
|
||||
{
|
||||
--let $filename= $binlog_file
|
||||
--let $binlog_file=
|
||||
}
|
||||
--let $mysqlbinlog_args= $MYSQLD_DATADIR/$filename
|
||||
if ($use_remote_mysqlbinlog)
|
||||
{
|
||||
--let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot $filename
|
||||
--let $use_remote_mysqlbinlog= 0
|
||||
}
|
||||
exec $MYSQL_BINLOG $startpos $mysqlbinlog_args >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
|
||||
--disable_query_log
|
||||
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
|
||||
--enable_query_log
|
||||
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
|
278
mysql-test/extra/binlog_tests/binlog_index.inc
Normal file
278
mysql-test/extra/binlog_tests/binlog_index.inc
Normal file
|
@ -0,0 +1,278 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#
|
||||
# testing of purging of binary log files bug#18199/Bug#18453
|
||||
#
|
||||
source include/have_log_bin.inc;
|
||||
source include/not_embedded.inc;
|
||||
# Don't test this under valgrind, memory leaks will occur
|
||||
--source include/not_valgrind.inc
|
||||
source include/have_debug.inc;
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
call mtr.add_suppression('Attempting backtrace');
|
||||
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
|
||||
call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
|
||||
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
|
||||
call mtr.add_suppression('Could not open .*');
|
||||
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
|
||||
flush tables;
|
||||
|
||||
let $old=`select @@debug`;
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $INDEX=$MYSQLD_DATADIR/master-bin.index;
|
||||
|
||||
#
|
||||
# testing purge binary logs TO
|
||||
#
|
||||
|
||||
flush logs;
|
||||
flush logs;
|
||||
flush logs;
|
||||
|
||||
source include/show_binary_logs.inc;
|
||||
remove_file $MYSQLD_DATADIR/master-bin.000001;
|
||||
flush tables;
|
||||
|
||||
# there must be a warning with file names
|
||||
replace_regex /\.[\\\/]master/master/;
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
purge binary logs TO 'master-bin.000004';
|
||||
|
||||
--echo *** must show a list starting from the 'TO' argument of PURGE ***
|
||||
source include/show_binary_logs.inc;
|
||||
|
||||
#
|
||||
# testing purge binary logs BEFORE
|
||||
#
|
||||
|
||||
reset master;
|
||||
|
||||
flush logs;
|
||||
flush logs;
|
||||
flush logs;
|
||||
remove_file $MYSQLD_DATADIR/master-bin.000001;
|
||||
|
||||
--echo *** must be a warning master-bin.000001 was not found ***
|
||||
let $date=`select NOW() + INTERVAL 1 MINUTE`;
|
||||
--disable_query_log
|
||||
replace_regex /\.[\\\/]master/master/;
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
eval purge binary logs BEFORE '$date';
|
||||
--enable_query_log
|
||||
|
||||
--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
|
||||
source include/show_binary_logs.inc;
|
||||
|
||||
#
|
||||
# testing a fatal error
|
||||
# Turning a binlog file into a directory must be a portable setup
|
||||
#
|
||||
|
||||
reset master;
|
||||
|
||||
flush logs;
|
||||
flush logs;
|
||||
flush logs;
|
||||
|
||||
remove_file $MYSQLD_DATADIR/master-bin.000001;
|
||||
mkdir $MYSQLD_DATADIR/master-bin.000001;
|
||||
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--error ER_BINLOG_PURGE_FATAL_ERR
|
||||
purge binary logs TO 'master-bin.000002';
|
||||
replace_regex /\.[\\\/]master/master/;
|
||||
show warnings;
|
||||
rmdir $MYSQLD_DATADIR/master-bin.000001;
|
||||
--disable_warnings
|
||||
reset master;
|
||||
--enable_warnings
|
||||
|
||||
--echo # crash_purge_before_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_purge_before_update_index";
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000002';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000001;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000002;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000003;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_purge_non_critical_after_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000004';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000001;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000002;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000003;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_purge_critical_after_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000006';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000004;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000005;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000006;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000007;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000008;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_non_critical_before_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000008;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000009;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_critical_before_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000009;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000010;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000011;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_after_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug_dbug="+d,crash_create_after_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000010;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000011;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo #
|
||||
--echo # This should put the server in unsafe state and stop
|
||||
--echo # accepting any command. If we inject a fault at this
|
||||
--echo # point and continue the execution the server crashes.
|
||||
--echo #
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # fault_injection_registering_index
|
||||
SET SESSION debug_dbug="+d,fault_injection_registering_index";
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
-- error ER_CANT_OPEN_FILE
|
||||
flush logs;
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # fault_injection_updating_index
|
||||
SET SESSION debug_dbug="+d,fault_injection_updating_index";
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
-- error ER_CANT_OPEN_FILE
|
||||
flush logs;
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
eval SET SESSION debug_dbug="$old";
|
||||
|
||||
--echo End of tests
|
36
mysql-test/extra/binlog_tests/binlog_ioerr.inc
Normal file
36
mysql-test/extra/binlog_tests/binlog_ioerr.inc
Normal file
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
source include/have_debug.inc;
|
||||
source include/have_innodb.inc;
|
||||
source include/have_log_bin.inc;
|
||||
source include/have_binlog_format_mixed_or_statement.inc;
|
||||
|
||||
CALL mtr.add_suppression("Error writing file 'master-bin'");
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
SET SESSION debug_dbug='+d,fail_binlog_write_1';
|
||||
--error ER_ERROR_ON_WRITE
|
||||
INSERT INTO t1 VALUES(1);
|
||||
--error ER_ERROR_ON_WRITE
|
||||
INSERT INTO t1 VALUES(2);
|
||||
SET SESSION debug_dbug='';
|
||||
INSERT INTO t1 VALUES(3);
|
||||
SELECT * FROM t1;
|
||||
|
||||
# Actually the output from this currently shows a bug.
|
||||
# The injected IO error leaves partially written transactions in the binlog in
|
||||
# the form of stray "BEGIN" events.
|
||||
# These should disappear from the output if binlog error handling is improved
|
||||
# (see MySQL Bug#37148 and WL#1790).
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
|
||||
--replace_column 1 BINLOG 2 POS 5 ENDPOS
|
||||
SHOW BINLOG EVENTS;
|
||||
|
||||
DROP TABLE t1;
|
50
mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
Normal file
50
mysql-test/extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
Normal file
|
@ -0,0 +1,50 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
# Usage:
|
||||
# --let $use_remote_mysqlbinlog= 1 # optional
|
||||
# --source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
|
||||
#
|
||||
# By default, the script calls mysqlbinlog to read binary logs directly.
|
||||
# If it is undesirable, this behavior can be overridden by setting
|
||||
# $use_remote_binlog as shown above.
|
||||
# The value will be unset after every execution of the script,
|
||||
# so if it is needed, it should be set explicitly before each call.
|
||||
|
||||
|
||||
# disabled in embedded until tools running is fixed with embedded
|
||||
--source include/not_embedded.inc
|
||||
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/have_cp932.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
# Bug#16217 (mysql client did not know how not switch its internal charset)
|
||||
create table t3 (f text character set utf8);
|
||||
create table t4 (f text character set cp932);
|
||||
--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
|
||||
--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');"
|
||||
flush logs;
|
||||
rename table t3 to t03, t4 to t04;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--let $mysqlbinlog_args= $MYSQLD_DATADIR/master-bin.000001
|
||||
if ($use_remote_mysqlbinlog)
|
||||
{
|
||||
--let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot master-bin.000001
|
||||
--let $use_remote_mysqlbinlog= 0
|
||||
}
|
||||
|
||||
--exec $MYSQL_BINLOG --short-form $mysqlbinlog_args | $MYSQL --default-character-set=utf8
|
||||
# original and recovered data must be equal
|
||||
select HEX(f) from t03;
|
||||
select HEX(f) from t3;
|
||||
select HEX(f) from t04;
|
||||
select HEX(f) from t4;
|
||||
|
||||
drop table t3, t4, t03, t04;
|
||||
--echo End of 5.0 tests
|
215
mysql-test/extra/binlog_tests/binlog_row_annotate.inc
Normal file
215
mysql-test/extra/binlog_tests/binlog_row_annotate.inc
Normal file
|
@ -0,0 +1,215 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
# Usage:
|
||||
# --let $use_remote_mysqlbinlog= 1 # optional
|
||||
# --source extra/binlog_tests/binlog_row_annotate.inc
|
||||
#
|
||||
# By default, the script uses mysqlbinlog both with direct access to files
|
||||
# and via connection to the server. In some cases, direct access to files
|
||||
# might be impossible (e.g. with encryption). If use_remote_mysqlbinlog
|
||||
# flag is set, this part of the logic will be omitted.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# WL47: Store in binlog text of statements that caused RBR events
|
||||
# new event: ANNOTATE_ROWS_EVENT
|
||||
# new master option: --binlog-annotate-row-events
|
||||
# new mysqlbinlog option: --skip-annotate-row-events
|
||||
#
|
||||
# Intended to test that:
|
||||
# *** If the --binlog-annotate-row-events option is switched on on master
|
||||
# then Annotate_rows events:
|
||||
# - are generated;
|
||||
# - are generated only once for "multi-table-maps" rbr queries;
|
||||
# - are not generated when the corresponding queries are filtered away;
|
||||
# - are generated when the corresponding queries are filtered away partialy
|
||||
# (e.g. in case of multi-delete).
|
||||
# *** Annotate_rows events are printed by mysqlbinlog started without
|
||||
# --skip-annotate-row-events options both in remote and local cases.
|
||||
# *** Annotate_rows events are not printed by mysqlbinlog started with
|
||||
# --skip-annotate-row-events options both in remote and local cases.
|
||||
###############################################################################
|
||||
|
||||
set @old_binlog_checksum=@@binlog_checksum;
|
||||
set global binlog_checksum=NONE;
|
||||
|
||||
--source include/have_log_bin.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
--disable_query_log
|
||||
|
||||
set sql_mode="";
|
||||
|
||||
# Fix timestamp to avoid varying results
|
||||
SET timestamp=1000000000;
|
||||
|
||||
# Delete all existing binary logs
|
||||
RESET MASTER;
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
DROP DATABASE IF EXISTS test3;
|
||||
DROP DATABASE IF EXISTS xtest1;
|
||||
DROP DATABASE IF EXISTS xtest2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE test1;
|
||||
CREATE TABLE test1.t1(a int);
|
||||
|
||||
CREATE DATABASE test2;
|
||||
CREATE TABLE test2.t2(a int);
|
||||
CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
|
||||
|
||||
CREATE DATABASE test3;
|
||||
CREATE TABLE test3.t3(a int);
|
||||
|
||||
CREATE DATABASE xtest1;
|
||||
CREATE TABLE xtest1.xt1(a int);
|
||||
|
||||
CREATE DATABASE xtest2;
|
||||
CREATE TABLE xtest2.xt2(a int);
|
||||
|
||||
# By default SESSION binlog_annotate_row_events = OFF
|
||||
|
||||
INSERT INTO test1.t1 VALUES (1), (2), (3);
|
||||
|
||||
SET SESSION binlog_annotate_row_events = ON;
|
||||
|
||||
INSERT INTO test2.t2 VALUES (1), (2), (3);
|
||||
INSERT INTO test3.t3 VALUES (1), (2), (3);
|
||||
|
||||
# This query generates two Table maps but the Annotate
|
||||
# event should appear only once before the first Table map
|
||||
DELETE test1.t1, test2.t2
|
||||
FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
|
||||
WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
|
||||
|
||||
# This event should be filtered out together with Annotate event
|
||||
INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
|
||||
|
||||
# This event should pass the filter
|
||||
INSERT INTO test2.v2 VALUES (1), (2), (3);
|
||||
|
||||
# This event should pass the filter only for test2.t2 part
|
||||
DELETE xtest1.xt1, test2.t2
|
||||
FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
|
||||
WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
|
||||
|
||||
# These events should be filtered out together with Annotate events
|
||||
INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
|
||||
INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
|
||||
DELETE xtest1.xt1, xtest2.xt2
|
||||
FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
|
||||
WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
|
||||
|
||||
FLUSH LOGS;
|
||||
--enable_query_log
|
||||
|
||||
--echo #####################################################################################
|
||||
--echo # The following Annotate_rows events should appear below:
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
|
||||
--echo # - DELETE test1.t1, test2.t2 FROM <...>
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
|
||||
--echo #####################################################################################
|
||||
|
||||
let $start_pos= `select @binlog_start_pos`;
|
||||
--replace_column 2 # 5 #
|
||||
--replace_result $start_pos <start_pos>
|
||||
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
|
||||
--eval show binlog events in 'master-bin.000001' from $start_pos
|
||||
|
||||
if (!$use_remote_mysqlbinlog)
|
||||
{
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog
|
||||
--echo # The following Annotates should appear in this output:
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
|
||||
--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog --database=test1
|
||||
--echo # The following Annotate should appear in this output:
|
||||
--echo # - DELETE test1.t1, test2.t2 FROM <...>
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog --skip-annotate-row-events
|
||||
--echo # No Annotates should appear in this output
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--let $use_remote_mysqlbinlog= 0
|
||||
}
|
||||
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog --read-from-remote-server
|
||||
--echo # The following Annotates should appear in this output:
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
|
||||
--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
|
||||
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
|
||||
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog --read-from-remote-server --database=test1
|
||||
--echo # The following Annotate should appear in this output:
|
||||
--echo # - DELETE test1.t1, test2.t2 FROM <...>
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo #####################################################################################
|
||||
--echo # mysqlbinlog --read-from-remote-server --skip-annotate-row-events
|
||||
--echo # No Annotates should appear in this output
|
||||
--echo #####################################################################################
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-row-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
# Clean-up
|
||||
|
||||
--disable_query_log
|
||||
set global binlog_checksum=@old_binlog_checksum;
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test2;
|
||||
DROP DATABASE test3;
|
||||
DROP DATABASE xtest1;
|
||||
DROP DATABASE xtest2;
|
||||
--enable_query_log
|
||||
|
108
mysql-test/extra/binlog_tests/binlog_write_error.inc
Normal file
108
mysql-test/extra/binlog_tests/binlog_write_error.inc
Normal file
|
@ -0,0 +1,108 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#
|
||||
# === Name ===
|
||||
#
|
||||
# binlog_write_error.test
|
||||
#
|
||||
# === Description ===
|
||||
#
|
||||
# This test case check if the error of writing binlog file is properly
|
||||
# reported and handled when executing statements.
|
||||
#
|
||||
# === Related Bugs ===
|
||||
#
|
||||
# BUG#37148
|
||||
#
|
||||
|
||||
source include/have_log_bin.inc;
|
||||
source include/have_debug.inc;
|
||||
source include/have_binlog_format_mixed_or_statement.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Initialization
|
||||
--echo #
|
||||
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP PROCEDURE IF EXISTS p2;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP TRIGGER IF EXISTS tr2;
|
||||
DROP VIEW IF EXISTS v1, v2;
|
||||
enable_warnings;
|
||||
|
||||
--echo #
|
||||
--echo # Test injecting binlog write error when executing queries
|
||||
--echo #
|
||||
|
||||
let $query= CREATE TABLE t1 (a INT);
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
|
||||
let $query= INSERT INTO t1 VALUES (4),(5),(6);
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= UPDATE t1 set a=a+1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DELETE FROM t1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP TRIGGER tr1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= ALTER TABLE t1 ADD (b INT);
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= CREATE VIEW v1 AS SELECT a FROM t1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP VIEW v1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP PROCEDURE p1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP TABLE t1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= CREATE FUNCTION f1() RETURNS INT return 1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP FUNCTION f1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= CREATE USER user1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
let $query= DROP USER user1;
|
||||
source include/binlog_inject_error.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP VIEW IF EXISTS v1, v2;
|
||||
enable_warnings;
|
281
mysql-test/extra/binlog_tests/binlog_xa_recover.inc
Normal file
281
mysql-test/extra/binlog_tests/binlog_xa_recover.inc
Normal file
|
@ -0,0 +1,281 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently binlog and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
# Valgrind does not work well with test that crashes the server
|
||||
--source include/not_valgrind.inc
|
||||
|
||||
# (We do not need to restore these settings, as we crash the server).
|
||||
SET GLOBAL max_binlog_size= 4096;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
|
||||
# Insert some data to force a couple binlog rotations (3), so we get some
|
||||
# normal binlog checkpoints before starting the test.
|
||||
INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
|
||||
# Wait for the master-bin.000002 binlog checkpoint to appear.
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000002"
|
||||
--source include/wait_show_condition.inc
|
||||
INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000003"
|
||||
--source include/wait_show_condition.inc
|
||||
INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000004"
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# Now start a bunch of transactions that span multiple binlog
|
||||
# files. Leave then in the state prepared-but-not-committed in the engine
|
||||
# and crash the server. Check that crash recovery is able to recover all
|
||||
# of them.
|
||||
#
|
||||
# We use debug_sync to get all the transactions into the prepared state before
|
||||
# we commit any of them. This is because the prepare step flushes the InnoDB
|
||||
# redo log - including any commits made before, so recovery would become
|
||||
# unnecessary, decreasing the value of this test.
|
||||
#
|
||||
# We arrange to have con1 with a prepared transaction in master-bin.000004,
|
||||
# con2 and con3 with a prepared transaction in master-bin.000005, and a new
|
||||
# empty master-bin.000006. So the latest binlog checkpoint should be
|
||||
# master-bin.000006.
|
||||
|
||||
connect(con1,localhost,root,,);
|
||||
# First wait after prepare and before write to binlog.
|
||||
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
|
||||
# Then complete InnoDB commit in memory (but not commit checkpoint / write to
|
||||
# disk), and hang until crash, leaving a transaction to be XA recovered.
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
|
||||
send INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
|
||||
|
||||
connect(con2,localhost,root,,);
|
||||
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
|
||||
send INSERT INTO t1 VALUES (2, NULL);
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
|
||||
|
||||
connect(con3,localhost,root,,);
|
||||
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
|
||||
send INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
|
||||
|
||||
connect(con4,localhost,root,,);
|
||||
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
|
||||
SET SESSION debug_dbug="+d,crash_commit_after_log";
|
||||
send INSERT INTO t1 VALUES (4, NULL);
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
|
||||
|
||||
SET DEBUG_SYNC= "now SIGNAL con1_cont";
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
|
||||
SET DEBUG_SYNC= "now SIGNAL con2_cont";
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
|
||||
SET DEBUG_SYNC= "now SIGNAL con3_cont";
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
|
||||
|
||||
# Check that everything is committed in binary log.
|
||||
--source include/show_binary_logs.inc
|
||||
--let $binlog_file= master-bin.000003
|
||||
--let $binlog_start= 4
|
||||
--source include/show_binlog_events.inc
|
||||
--let $binlog_file= master-bin.000004
|
||||
--source include/show_binlog_events.inc
|
||||
--let $binlog_file= master-bin.000005
|
||||
--source include/show_binlog_events.inc
|
||||
--let $binlog_file= master-bin.000006
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
|
||||
# Check that server will not purge too much.
|
||||
PURGE BINARY LOGS TO "master-bin.000006";
|
||||
--source include/show_binary_logs.inc
|
||||
|
||||
# Now crash the server with one more transaction in prepared state.
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait-binlog_xa_recover.test
|
||||
EOF
|
||||
--error 0,2006,2013
|
||||
SET DEBUG_SYNC= "now SIGNAL con4_cont";
|
||||
connection con4;
|
||||
--error 2006,2013
|
||||
reap;
|
||||
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart-group_commit_binlog_pos.test
|
||||
EOF
|
||||
|
||||
connection default;
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Check that all transactions are recovered.
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
|
||||
--echo Test that with multiple binlog checkpoints, recovery starts from the last one.
|
||||
SET GLOBAL max_binlog_size= 4096;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
|
||||
RESET MASTER;
|
||||
|
||||
# Rotate to binlog master-bin.000003 while delaying binlog checkpoints.
|
||||
# So we get multiple binlog checkpoints in master-bin.000003.
|
||||
# Then complete the checkpoints, crash, and check that we only scan
|
||||
# the necessary binlog file (ie. that we use the _last_ checkpoint).
|
||||
|
||||
connect(con10,localhost,root,,);
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
|
||||
send INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
|
||||
|
||||
connect(con11,localhost,root,,);
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
|
||||
send INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
|
||||
|
||||
connect(con12,localhost,root,,);
|
||||
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
|
||||
send INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
|
||||
INSERT INTO t1 VALUES (13, NULL);
|
||||
|
||||
--source include/show_binary_logs.inc
|
||||
--let $binlog_file= master-bin.000004
|
||||
--let $binlog_start= 4
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
SET DEBUG_SYNC= "now SIGNAL con10_cont";
|
||||
connection con10;
|
||||
reap;
|
||||
connection default;
|
||||
|
||||
# We need to sync the test case with the background processing of the
|
||||
# commit checkpoint, otherwise we get nondeterministic results.
|
||||
SET @old_dbug= @@global.DEBUG_DBUG;
|
||||
SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
|
||||
|
||||
SET DEBUG_SYNC= "now SIGNAL con12_cont";
|
||||
connection con12;
|
||||
reap;
|
||||
connection default;
|
||||
SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
|
||||
SET GLOBAL debug_dbug= @old_dbug;
|
||||
|
||||
SET DEBUG_SYNC= "now SIGNAL con11_cont";
|
||||
connection con11;
|
||||
reap;
|
||||
|
||||
connection default;
|
||||
# Wait for the last (master-bin.000004) binlog checkpoint to appear.
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000004"
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--echo Checking that master-bin.000004 is the last binlog checkpoint
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--echo Now crash the server
|
||||
# It is not too easy to test XA recovery, as it runs early during server
|
||||
# startup, before any connections can be made.
|
||||
# What we do is set a DBUG error insert which will crash if XA recovery
|
||||
# starts from any other binlog than master-bin.000004 (check the file
|
||||
# binlog_xa_recover-master.opt). Then we will fail here if XA recovery
|
||||
# would start from the wrong place.
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait-binlog_xa_recover.test
|
||||
EOF
|
||||
SET SESSION debug_dbug="+d,crash_commit_after_log";
|
||||
--error 2006,2013
|
||||
INSERT INTO t1 VALUES (14, NULL);
|
||||
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart-group_commit_binlog_pos.test
|
||||
EOF
|
||||
|
||||
connection default;
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Check that all transactions are recovered.
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
|
||||
|
||||
--echo *** Check that recovery works if we crashed early during rotate, before
|
||||
--echo *** binlog checkpoint event could be written.
|
||||
|
||||
SET GLOBAL max_binlog_size= 4096;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
|
||||
RESET MASTER;
|
||||
|
||||
# We need some initial data to reach binlog master-bin.000004. Otherwise
|
||||
# crash recovery fails due to the error insert used for previous test.
|
||||
INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
|
||||
INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
|
||||
# Wait for the master-bin.000003 binlog checkpoint to appear.
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000003"
|
||||
--source include/wait_show_condition.inc
|
||||
INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
|
||||
# Wait for the last (master-bin.000004) binlog checkpoint to appear.
|
||||
--let $wait_for_all= 0
|
||||
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
|
||||
--let $field= Info
|
||||
--let $condition= = "master-bin.000004"
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
wait-binlog_xa_recover.test
|
||||
EOF
|
||||
SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
|
||||
--error 2006,2013
|
||||
INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
|
||||
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
restart-group_commit_binlog_pos.test
|
||||
EOF
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Check that all transactions are recovered.
|
||||
SELECT a FROM t1 ORDER BY a;
|
||||
|
||||
--source include/show_binary_logs.inc
|
||||
--let $binlog_file= master-bin.000004
|
||||
--let $binlog_start= 4
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
# Cleanup
|
||||
connection default;
|
||||
DROP TABLE t1;
|
|
@ -52,7 +52,7 @@ eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix';
|
|||
|
||||
# Use '/' instead of '\' in the error message. On windows platform, dir is
|
||||
# formed with '\'.
|
||||
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /17/39/ /File exists/Directory not empty/
|
||||
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /93/39/ /17/39/ /247/39/ /File exists/Directory not empty/
|
||||
--error 1010
|
||||
DROP DATABASE testing_1;
|
||||
let $wait_binlog_event= DROP TABLE IF EXIST;
|
||||
|
|
304
mysql-test/extra/rpl_tests/multisource.inc
Normal file
304
mysql-test/extra/rpl_tests/multisource.inc
Normal file
|
@ -0,0 +1,304 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently multisource and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
# Usage:
|
||||
# --source extra/rpl_tests/multisource.inc
|
||||
#
|
||||
# By default, the script expects the length of the 2nd binary log to be
|
||||
# $binlog_start_pos + length(Gtid_list event) + 2 x length(Binlog_checkpoint event)
|
||||
# Some tests can have specific configuration which would change it,
|
||||
|
||||
#
|
||||
# Test basic replication functionality
|
||||
# in multi-source setup
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/binlog_start_pos.inc
|
||||
--let $rpl_server_count= 0
|
||||
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
|
||||
# MDEV-3984: crash/read of freed memory when changing master with named connection
|
||||
# This fails after adding the new master 'abc', check we do not free twice.
|
||||
--error ER_RELAY_LOG_INIT
|
||||
change master 'abc' to relay_log_file='';
|
||||
# This fails before adding the new master, check that we do free it.
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
change master 'abc2' to master_host='';
|
||||
|
||||
|
||||
# Start replication from the first master
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||
eval change master 'master1' to
|
||||
master_port=$SERVER_MYPORT_1,
|
||||
master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
|
||||
start slave 'master1';
|
||||
set default_master_connection = 'master1';
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0,'master1'
|
||||
|
||||
# Here and further: add an extra check on SQL thread status
|
||||
# as the normal sync is not always enough
|
||||
--source include/wait_for_sql_thread_read_all.inc
|
||||
|
||||
# each of the 3 commands should produce
|
||||
# 'master1' status
|
||||
|
||||
let $wait_for_all= 1;
|
||||
let $show_statement= SHOW ALL SLAVES STATUS;
|
||||
let $field= Slave_IO_State;
|
||||
let $condition= = 'Waiting for master to send event';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking SHOW SLAVE 'master1' STATUS
|
||||
--echo #
|
||||
--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
|
||||
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
|
||||
--let $slave_name= 'master1'
|
||||
--source include/show_slave_status.inc
|
||||
--let $slave_name=
|
||||
|
||||
--echo #
|
||||
--echo # Checking SHOW SLAVE STATUS
|
||||
--echo #
|
||||
--source include/show_slave_status.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking SHOW ALL SLAVES STATUS
|
||||
--echo #
|
||||
--let $all_slaves_status= 1
|
||||
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
|
||||
--source include/show_slave_status.inc
|
||||
--let $all_slaves_status=
|
||||
--echo #
|
||||
|
||||
|
||||
# Check that replication actually works
|
||||
|
||||
--connection master1
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists db1;
|
||||
--enable_warnings
|
||||
create database db1;
|
||||
use db1;
|
||||
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
|
||||
insert into t1 (f1) values ('one'),('two');
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0,'master1'
|
||||
|
||||
--sorted_result
|
||||
select * from db1.t1;
|
||||
|
||||
--let $datadir = `SELECT @@datadir`
|
||||
|
||||
--echo # List of relay log files in the datadir
|
||||
--list_files $datadir mysqld-relay-bin-master1.*
|
||||
|
||||
# Check that relay logs are recognizable
|
||||
|
||||
let binlog_start=4;
|
||||
let binlog_file=;
|
||||
source include/show_relaylog_events.inc;
|
||||
let binlog_file= mysqld-relay-bin-master1.000002;
|
||||
source include/show_relaylog_events.inc;
|
||||
|
||||
# Try to configure connection with the same name again,
|
||||
# should get an error because the slave is running
|
||||
|
||||
--replace_result $SERVER_MYPORT_2 MYPORT_2
|
||||
--error ER_SLAVE_MUST_STOP
|
||||
eval change master 'master1' to
|
||||
master_port=$SERVER_MYPORT_2,
|
||||
master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
|
||||
# Try to configure using the default connection name
|
||||
# (which is 'master1' at the moment),
|
||||
# again, should get an error
|
||||
|
||||
--replace_result $SERVER_MYPORT_2 MYPORT_2
|
||||
--error ER_SLAVE_MUST_STOP
|
||||
eval change master to
|
||||
master_port=$SERVER_MYPORT_2,
|
||||
master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
|
||||
# Try to configure a connection with the same master
|
||||
# using a different name, should get a conflict
|
||||
|
||||
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
||||
--error ER_CONNECTION_ALREADY_EXISTS
|
||||
eval change master 'master2' to
|
||||
master_port=$SERVER_MYPORT_1,
|
||||
master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
|
||||
|
||||
# Set up a proper 'default' connection to master2
|
||||
|
||||
set default_master_connection = '';
|
||||
|
||||
--replace_result $SERVER_MYPORT_2 MYPORT_2
|
||||
eval change master to
|
||||
master_port=$SERVER_MYPORT_2,
|
||||
master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
--source include/wait_for_sql_thread_read_all.inc
|
||||
|
||||
# See both connections in the same status output
|
||||
|
||||
let $wait_for_all= 1;
|
||||
let $show_statement= SHOW ALL SLAVES STATUS;
|
||||
let $field= Slave_IO_State;
|
||||
let $condition= = 'Waiting for master to send event';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking SHOW ALL SLAVES STATUS
|
||||
--echo #
|
||||
--let $all_slaves_status= 1
|
||||
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
|
||||
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
|
||||
--source include/show_slave_status.inc
|
||||
--let $all_slaves_status=
|
||||
--echo #
|
||||
|
||||
# Check that replication from two servers actually works
|
||||
|
||||
--connection master1
|
||||
|
||||
insert into t1 (f1) values ('three');
|
||||
--save_master_pos
|
||||
|
||||
--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists db2;
|
||||
--enable_warnings
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
|
||||
begin;
|
||||
insert into t1 (f1) values (1),(2);
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0,'master1'
|
||||
|
||||
--connection master2
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0
|
||||
--sorted_result
|
||||
select * from db1.t1;
|
||||
select * from db2.t1;
|
||||
|
||||
--connection master2
|
||||
commit;
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0
|
||||
--sorted_result
|
||||
select * from db2.t1;
|
||||
|
||||
# Flush and purge logs on one master,
|
||||
# make sure slaves don't get confused
|
||||
|
||||
--connection master1
|
||||
flush logs;
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--save_master_pos
|
||||
--connection slave
|
||||
--sync_with_master 0, 'master1'
|
||||
|
||||
--connection master1
|
||||
purge binary logs to 'master-bin.000002';
|
||||
# Additional events: 43 (Gtid_list) + 2 x 44 (Binlog_checkpoint) = 131
|
||||
let filesize=`select $binlog_start_pos+131`;
|
||||
--replace_result $filesize filesize
|
||||
show binary logs;
|
||||
insert into t1 (f1) values ('four');
|
||||
create table db1.t3 (f1 int) engine=InnoDB;
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master 0,'master1'
|
||||
|
||||
--source include/wait_for_sql_thread_read_all.inc
|
||||
|
||||
let $wait_for_all= 1;
|
||||
let $show_statement= SHOW ALL SLAVES STATUS;
|
||||
let $field= Slave_IO_State;
|
||||
let $condition= = 'Waiting for master to send event';
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
--echo #
|
||||
--echo # Checking SHOW ALL SLAVES STATUS
|
||||
--echo #
|
||||
--let $all_slaves_status= 1
|
||||
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
|
||||
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
|
||||
--source include/show_slave_status.inc
|
||||
--let $all_slaves_status=
|
||||
--echo #
|
||||
|
||||
--sorted_result
|
||||
select * from db1.t1;
|
||||
|
||||
# This should show relay log events for the default master
|
||||
# (the one with the empty name)
|
||||
let binlog_file=;
|
||||
source include/show_relaylog_events.inc;
|
||||
let binlog_file= mysqld-relay-bin.000002;
|
||||
source include/show_relaylog_events.inc;
|
||||
|
||||
# Make sure we don't lose control over replication connections
|
||||
# after reconnecting to the slave
|
||||
|
||||
--disconnect slave
|
||||
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
|
||||
|
||||
stop slave io_thread;
|
||||
show status like 'Slave_running';
|
||||
set default_master_connection = 'master1';
|
||||
show status like 'Slave_running';
|
||||
|
||||
# Cleanup
|
||||
|
||||
drop database db1;
|
||||
drop database db2;
|
||||
|
||||
--source include/reset_master_slave.inc
|
||||
--disconnect slave
|
||||
|
||||
--connection master1
|
||||
drop database db1;
|
||||
--source include/reset_master_slave.inc
|
||||
--disconnect master1
|
||||
|
||||
--connection master2
|
||||
drop database db2;
|
||||
--source include/reset_master_slave.inc
|
||||
--disconnect master2
|
||||
|
422
mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
Normal file
422
mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
Normal file
|
@ -0,0 +1,422 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
# Usage:
|
||||
# --let $binlog_limit= X[,Y] # optional
|
||||
#
|
||||
# Semantics of the value is the same as in include/show_binlog_events.inc
|
||||
# which the script calls as a part of the test flow.
|
||||
# The goal is to print the event demonstrating the triggered error,
|
||||
# so normally Y should be 1 (print the exact event only);
|
||||
# however, depending on test-specific server options, the offset X
|
||||
# can be different.
|
||||
#
|
||||
|
||||
# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
|
||||
# when generating new name.
|
||||
#
|
||||
# WHY
|
||||
# ===
|
||||
#
|
||||
# We want to check whether error is reported or not when
|
||||
# new_file_impl fails (this may happen when rotation is not
|
||||
# possible because there is some problem finding an
|
||||
# unique filename).
|
||||
#
|
||||
# HOW
|
||||
# ===
|
||||
#
|
||||
# Test cases are documented inline.
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_debug.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
-- echo #######################################################################
|
||||
-- echo ####################### PART 1: MASTER TESTS ##########################
|
||||
-- echo #######################################################################
|
||||
|
||||
|
||||
### ACTION: stopping slave as it is not needed for the first part of
|
||||
### the test
|
||||
|
||||
-- connection slave
|
||||
-- source include/stop_slave.inc
|
||||
-- connection master
|
||||
|
||||
call mtr.add_suppression("Can't generate a unique log-filename");
|
||||
call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
|
||||
call mtr.add_suppression("Error writing file .*");
|
||||
|
||||
SET @old_debug= @@global.debug;
|
||||
|
||||
### ACTION: create a large file (> 4096 bytes) that will be later used
|
||||
### in LOAD DATA INFILE to check binlog errors in its vacinity
|
||||
-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
|
||||
|
||||
### ACTION: create a small file (< 4096 bytes) that will be later used
|
||||
### in LOAD DATA INFILE to check for absence of binlog errors
|
||||
### when file loading this file does not force flushing and
|
||||
### rotating the binary log
|
||||
-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #1
|
||||
|
||||
### ASSERTION: no problem flushing logs (should show two binlogs)
|
||||
FLUSH LOGS;
|
||||
-- echo # assert: must show two binlogs
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
-- echo ###################### TEST #2
|
||||
|
||||
### ASSERTION: check that FLUSH LOGS actually fails and reports
|
||||
### failure back to the user if find_uniq_filename fails
|
||||
### (should show just one binlog)
|
||||
|
||||
RESET MASTER;
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
FLUSH LOGS;
|
||||
-- echo # assert: must show one binlog
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
### ACTION: clean up and move to next test
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #3
|
||||
|
||||
### ACTION: create some tables (t1, t2, t4) and insert some values in
|
||||
### table t1
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
|
||||
CREATE TABLE t4 (a VARCHAR(16384));
|
||||
INSERT INTO t1 VALUES (1);
|
||||
RESET MASTER;
|
||||
|
||||
### ASSERTION: we force rotation of the binary log because it exceeds
|
||||
### the max_binlog_size option (should show two binary
|
||||
### logs)
|
||||
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
|
||||
|
||||
# shows two binary logs
|
||||
-- echo # assert: must show two binlog
|
||||
-- source include/show_binary_logs.inc
|
||||
|
||||
# clean up the table and the binlog to be used in next part of test
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
DELETE FROM t2;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #4
|
||||
|
||||
### ASSERTION: load the big file into a transactional table and check
|
||||
### that it reports error. The table will contain the
|
||||
### changes performed despite the fact that it reported an
|
||||
### error.
|
||||
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
|
||||
|
||||
# show table
|
||||
-- echo # assert: must show one entry
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
# clean up the table and the binlog to be used in next part of test
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
DELETE FROM t2;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #5
|
||||
|
||||
### ASSERTION: load the small file into a transactional table and
|
||||
### check that it succeeds
|
||||
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
|
||||
|
||||
# show table
|
||||
-- echo # assert: must show one entry
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
# clean up the table and the binlog to be used in next part of test
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
DELETE FROM t2;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #6
|
||||
|
||||
### ASSERTION: check that even if one is using a transactional table
|
||||
### and explicit transactions (no autocommit) if rotation
|
||||
### fails we get the error. Transaction is not rolledback
|
||||
### because rotation happens after the commit.
|
||||
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
SET AUTOCOMMIT=0;
|
||||
INSERT INTO t2 VALUES ('muse');
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
|
||||
INSERT INTO t2 VALUES ('muse');
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
COMMIT;
|
||||
|
||||
### ACTION: Show the contents of the table after the test
|
||||
-- echo # assert: must show three entries
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
### ACTION: clean up and move to the next test
|
||||
SET AUTOCOMMIT= 1;
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
DELETE FROM t2;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #7
|
||||
|
||||
### ASSERTION: check that on a non-transactional table, if rotation
|
||||
### fails then an error is reported and an incident event
|
||||
### is written to the current binary log.
|
||||
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
SELECT count(*) FROM t4;
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
|
||||
|
||||
-- echo # assert: must show 1 entry
|
||||
SELECT count(*) FROM t4;
|
||||
|
||||
-- echo ### check that the incident event is written to the current log
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
if (!$binlog_limit)
|
||||
{
|
||||
-- let $binlog_limit= 4,1
|
||||
}
|
||||
-- source include/show_binlog_events.inc
|
||||
|
||||
# clean up and move to next test
|
||||
DELETE FROM t4;
|
||||
RESET MASTER;
|
||||
|
||||
-- echo ###################### TEST #8
|
||||
|
||||
### ASSERTION: check that statements end up in error but they succeed
|
||||
### on changing the data.
|
||||
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
-- echo # must show 0 entries
|
||||
SELECT count(*) FROM t4;
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
|
||||
|
||||
-- echo # INFO: Count(*) Before Offending DELETEs
|
||||
-- echo # assert: must show 1 entry
|
||||
SELECT count(*) FROM t4;
|
||||
-- echo # assert: must show 4 entries
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
DELETE FROM t4;
|
||||
-- error ER_NO_UNIQUE_LOGFILE
|
||||
DELETE FROM t2;
|
||||
|
||||
-- echo # INFO: Count(*) After Offending DELETEs
|
||||
-- echo # assert: must show zero entries
|
||||
SELECT count(*) FROM t4;
|
||||
SELECT count(*) FROM t2;
|
||||
|
||||
# remove fault injection
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
|
||||
-- echo ###################### TEST #9
|
||||
|
||||
### ASSERTION: check that if we disable binlogging, then statements
|
||||
### succeed.
|
||||
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
|
||||
SET SQL_LOG_BIN=0;
|
||||
INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
|
||||
INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
|
||||
-- echo # assert: must show four entries
|
||||
SELECT count(*) FROM t2;
|
||||
SELECT count(*) FROM t4;
|
||||
DELETE FROM t2;
|
||||
DELETE FROM t4;
|
||||
-- echo # assert: must show zero entries
|
||||
SELECT count(*) FROM t2;
|
||||
SELECT count(*) FROM t4;
|
||||
SET SQL_LOG_BIN=1;
|
||||
SET GLOBAL debug_dbug=@old_debug;
|
||||
|
||||
-- echo ###################### TEST #10
|
||||
|
||||
### ASSERTION: check that error is reported if there is a failure
|
||||
### while registering the index file and the binary log
|
||||
### file or failure to write the rotate event.
|
||||
|
||||
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
|
||||
call mtr.add_suppression("Could not open .*");
|
||||
|
||||
RESET MASTER;
|
||||
SHOW WARNINGS;
|
||||
|
||||
# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
|
||||
SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
-- error ER_CANT_OPEN_FILE
|
||||
FLUSH LOGS;
|
||||
SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
|
||||
|
||||
-- error ER_NO_BINARY_LOGGING
|
||||
SHOW BINARY LOGS;
|
||||
|
||||
# issue some statements and check that they don't fail
|
||||
CREATE TABLE t5 (a INT);
|
||||
INSERT INTO t4 VALUES ('bbbbb');
|
||||
INSERT INTO t2 VALUES ('aaaaa');
|
||||
DELETE FROM t4;
|
||||
DELETE FROM t2;
|
||||
DROP TABLE t5;
|
||||
|
||||
-- echo ###################### TEST #11
|
||||
|
||||
### ASSERTION: check that error is reported if there is a failure
|
||||
### while opening the index file and the binary log file or
|
||||
### failure to write the rotate event.
|
||||
|
||||
# restart the server so that we have binlog again
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_restart_server.inc
|
||||
|
||||
# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
|
||||
SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
-- error ER_CANT_OPEN_FILE
|
||||
FLUSH LOGS;
|
||||
SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
|
||||
|
||||
-- error ER_FLUSH_MASTER_BINLOG_CLOSED
|
||||
RESET MASTER;
|
||||
|
||||
# issue some statements and check that they don't fail
|
||||
CREATE TABLE t5 (a INT);
|
||||
INSERT INTO t4 VALUES ('bbbbb');
|
||||
INSERT INTO t2 VALUES ('aaaaa');
|
||||
DELETE FROM t4;
|
||||
DELETE FROM t2;
|
||||
DROP TABLE t5;
|
||||
|
||||
# restart the server so that we have binlog again
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_restart_server.inc
|
||||
|
||||
-- echo ###################### TEST #12
|
||||
|
||||
### ASSERTION: check that error is reported if there is a failure
|
||||
### while writing the rotate event when creating a new log
|
||||
### file.
|
||||
|
||||
# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
|
||||
SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
|
||||
-- error ER_ERROR_ON_WRITE
|
||||
FLUSH LOGS;
|
||||
SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
|
||||
|
||||
-- error ER_FLUSH_MASTER_BINLOG_CLOSED
|
||||
RESET MASTER;
|
||||
|
||||
# issue some statements and check that they don't fail
|
||||
CREATE TABLE t5 (a INT);
|
||||
INSERT INTO t4 VALUES ('bbbbb');
|
||||
INSERT INTO t2 VALUES ('aaaaa');
|
||||
DELETE FROM t4;
|
||||
DELETE FROM t2;
|
||||
DROP TABLE t5;
|
||||
|
||||
# restart the server so that we have binlog again
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_restart_server.inc
|
||||
|
||||
## clean up
|
||||
DROP TABLE t1, t2, t4;
|
||||
RESET MASTER;
|
||||
|
||||
# restart slave again
|
||||
-- connection slave
|
||||
-- source include/start_slave.inc
|
||||
-- connection master
|
||||
|
||||
-- echo #######################################################################
|
||||
-- echo ####################### PART 2: SLAVE TESTS ###########################
|
||||
-- echo #######################################################################
|
||||
|
||||
### setup
|
||||
--source include/rpl_reset.inc
|
||||
-- connection slave
|
||||
|
||||
# slave suppressions
|
||||
|
||||
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
|
||||
call mtr.add_suppression("Error writing file .*");
|
||||
call mtr.add_suppression("Could not open .*");
|
||||
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
|
||||
call mtr.add_suppression("Can't generate a unique log-filename .*");
|
||||
-- echo ###################### TEST #13
|
||||
|
||||
#### ASSERTION: check against unique log filename error
|
||||
-- let $io_thd_injection_fault_flag= error_unique_log_filename
|
||||
-- let $slave_io_errno= 1595
|
||||
-- let $show_slave_io_error= 1
|
||||
-- source include/io_thd_fault_injection.inc
|
||||
|
||||
-- echo ###################### TEST #14
|
||||
|
||||
#### ASSERTION: check against rotate failing
|
||||
-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
|
||||
-- let $slave_io_errno= 1595
|
||||
-- let $show_slave_io_error= 1
|
||||
-- source include/io_thd_fault_injection.inc
|
||||
|
||||
-- echo ###################### TEST #15
|
||||
|
||||
#### ASSERTION: check against relay log open failure
|
||||
-- let $io_thd_injection_fault_flag= fault_injection_registering_index
|
||||
-- let $slave_io_errno= 1595
|
||||
-- let $show_slave_io_error= 1
|
||||
-- source include/io_thd_fault_injection.inc
|
||||
|
||||
-- echo ###################### TEST #16
|
||||
|
||||
#### ASSERTION: check against relay log index open failure
|
||||
-- let $io_thd_injection_fault_flag= fault_injection_openning_index
|
||||
-- let $slave_io_errno= 1595
|
||||
-- let $show_slave_io_error= 1
|
||||
-- source include/io_thd_fault_injection.inc
|
||||
|
||||
### clean up
|
||||
-- source include/stop_slave_sql.inc
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
83
mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc
Normal file
83
mysql-test/extra/rpl_tests/rpl_cant_read_event_incident.inc
Normal file
|
@ -0,0 +1,83 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#
|
||||
# Bug#11747416 : 32228 A disk full makes binary log corrupt.
|
||||
#
|
||||
#
|
||||
# The test demonstrates reading from binlog error propagation to slave
|
||||
# and reporting there.
|
||||
# Conditions for the bug include a crash at time of the last event to
|
||||
# the binlog was written partly. With the fixes the event is not sent out
|
||||
# any longer, but rather the dump thread sends out a sound error message.
|
||||
#
|
||||
# Crash is not simulated. A binlog with partly written event in its end is installed
|
||||
# and replication is started from it.
|
||||
#
|
||||
|
||||
--source include/master-slave.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
|
||||
--connection slave
|
||||
# Make sure the slave is stopped while we are messing with master.
|
||||
# Otherwise we get occasional failures as the slave manages to re-connect
|
||||
# to the newly started master and we get extra events applied, causing
|
||||
# conflicts.
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection master
|
||||
call mtr.add_suppression("Error in Log_event::read_log_event()");
|
||||
--let $datadir= `SELECT @@datadir`
|
||||
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_stop_server.inc
|
||||
|
||||
--remove_file $datadir/master-bin.000001
|
||||
--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
|
||||
|
||||
--let $rpl_server_number= 1
|
||||
--source include/rpl_start_server.inc
|
||||
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# evidence of the partial binlog
|
||||
--error ER_ERROR_WHEN_EXECUTING_COMMAND
|
||||
show binlog events;
|
||||
|
||||
--connection slave
|
||||
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
|
||||
reset slave;
|
||||
start slave;
|
||||
|
||||
# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
|
||||
--let $slave_param=Last_IO_Errno
|
||||
--let $slave_param_value=1236
|
||||
--source include/wait_for_slave_param.inc
|
||||
|
||||
--let $slave_field_result_replace= / at [0-9]*/ at XXX/
|
||||
--let $status_items= Last_IO_Errno, Last_IO_Error
|
||||
--source include/show_slave_status.inc
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
--connection master
|
||||
reset master;
|
||||
|
||||
--connection slave
|
||||
stop slave;
|
||||
reset slave;
|
||||
# Table was created from binlog, it may not be created if SQL thread is running
|
||||
# slowly and IO thread reaches incident before SQL thread applies it.
|
||||
--disable_warnings
|
||||
drop table if exists t;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
--echo End of the tests
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
334
mysql-test/extra/rpl_tests/rpl_checksum.inc
Normal file
334
mysql-test/extra/rpl_tests/rpl_checksum.inc
Normal file
|
@ -0,0 +1,334 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
# WL2540 replication events checksum
|
||||
# Testing configuration parameters
|
||||
|
||||
--source include/master-slave.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
|
||||
call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
|
||||
call mtr.add_suppression('Replication event checksum verification failed');
|
||||
# due to C failure simulation
|
||||
call mtr.add_suppression('Relay log write failure: could not queue event from master');
|
||||
call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
|
||||
|
||||
# A. read/write access to the global vars:
|
||||
# binlog_checksum master_verify_checksum slave_sql_verify_checksum
|
||||
|
||||
connection master;
|
||||
|
||||
set @master_save_binlog_checksum= @@global.binlog_checksum;
|
||||
set @save_master_verify_checksum = @@global.master_verify_checksum;
|
||||
|
||||
select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.binlog_checksum as 'no session var';
|
||||
|
||||
select @@global.master_verify_checksum as 'must be zero because of default';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.master_verify_checksum as 'no session var';
|
||||
|
||||
connection slave;
|
||||
|
||||
set @slave_save_binlog_checksum= @@global.binlog_checksum;
|
||||
set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
|
||||
|
||||
select @@global.slave_sql_verify_checksum as 'must be one because of default';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
select @@session.slave_sql_verify_checksum as 'no session var';
|
||||
|
||||
connection master;
|
||||
|
||||
source include/show_binary_logs.inc;
|
||||
set @@global.binlog_checksum = NONE;
|
||||
select @@global.binlog_checksum;
|
||||
--echo *** must be rotations seen ***
|
||||
source include/show_binary_logs.inc;
|
||||
|
||||
set @@global.binlog_checksum = default;
|
||||
select @@global.binlog_checksum;
|
||||
|
||||
# testing lack of side-effects in non-effective update of binlog_checksum:
|
||||
set @@global.binlog_checksum = CRC32;
|
||||
select @@global.binlog_checksum;
|
||||
set @@global.binlog_checksum = CRC32;
|
||||
|
||||
set @@global.master_verify_checksum = 0;
|
||||
set @@global.master_verify_checksum = default;
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set @@global.binlog_checksum = ADLER32;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set @@global.master_verify_checksum = 2; # the var is of bool type
|
||||
|
||||
connection slave;
|
||||
|
||||
set @@global.slave_sql_verify_checksum = 0;
|
||||
set @@global.slave_sql_verify_checksum = default;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
|
||||
|
||||
#
|
||||
# B. Old Slave to New master conditions
|
||||
#
|
||||
# while master does not send a checksum-ed binlog the Old Slave can
|
||||
# work with the New Master
|
||||
|
||||
connection master;
|
||||
|
||||
set @@global.binlog_checksum = NONE;
|
||||
create table t1 (a int);
|
||||
|
||||
# testing that binlog rotation preserves opt_binlog_checksum value
|
||||
flush logs;
|
||||
flush logs;
|
||||
-- source include/wait_for_binlog_checkpoint.inc
|
||||
flush logs;
|
||||
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
# checking that rotation on the slave side leaves slave stable
|
||||
flush logs;
|
||||
flush logs;
|
||||
flush logs;
|
||||
select count(*) as zero from t1;
|
||||
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
set @@global.binlog_checksum = CRC32;
|
||||
-- source include/wait_for_binlog_checkpoint.inc
|
||||
insert into t1 values (1) /* will not be applied on slave due to simulation */;
|
||||
|
||||
# instruction to the dump thread
|
||||
|
||||
connection slave;
|
||||
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
|
||||
start slave;
|
||||
--let $slave_io_errno= 1236
|
||||
--let $show_slave_io_error= 1
|
||||
source include/wait_for_slave_io_error.inc;
|
||||
|
||||
select count(*) as zero from t1;
|
||||
|
||||
###connection master;
|
||||
set @@global.debug_dbug='';
|
||||
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
|
||||
#
|
||||
# C. checksum failure simulations
|
||||
#
|
||||
|
||||
# C1. Failure by a client thread
|
||||
connection master;
|
||||
set @@global.master_verify_checksum = 1;
|
||||
set @@session.debug_dbug='d,simulate_checksum_test_failure';
|
||||
--error ER_ERROR_WHEN_EXECUTING_COMMAND
|
||||
show binlog events;
|
||||
set @@session.debug_dbug='';
|
||||
set @@global.master_verify_checksum = default;
|
||||
|
||||
#connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
create table t2 (a int);
|
||||
let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
|
||||
connection slave;
|
||||
|
||||
# C2. Failure by IO thread
|
||||
# instruction to io thread
|
||||
set @@global.debug_dbug='d,simulate_checksum_test_failure';
|
||||
start slave io_thread;
|
||||
# When the checksum error is detected, the slave sets error code 1913
|
||||
# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
|
||||
# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
|
||||
# So we usually get 1595, but it is occasionally possible to get 1913.
|
||||
--let $slave_io_errno= 1595,1913
|
||||
--let $show_slave_io_error= 0
|
||||
source include/wait_for_slave_io_error.inc;
|
||||
set @@global.debug_dbug='';
|
||||
|
||||
# to make IO thread re-read it again w/o the failure
|
||||
start slave io_thread;
|
||||
let $slave_param= Read_Master_Log_Pos;
|
||||
let $slave_param_value= $pos_master;
|
||||
source include/wait_for_slave_param.inc;
|
||||
|
||||
# C3. Failure by SQL thread
|
||||
# instruction to sql thread;
|
||||
set @@global.slave_sql_verify_checksum = 1;
|
||||
|
||||
set @@global.debug_dbug='d,simulate_checksum_test_failure';
|
||||
|
||||
start slave sql_thread;
|
||||
--let $slave_sql_errno= 1593
|
||||
--let $show_slave_sql_error= 1
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
|
||||
# resuming SQL thread to parse out the event w/o the failure
|
||||
|
||||
set @@global.debug_dbug='';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select count(*) as 'must be zero' from t2;
|
||||
|
||||
#
|
||||
# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
|
||||
# random value on binlog_checksum on both master and slave
|
||||
#
|
||||
connection slave;
|
||||
stop slave;
|
||||
reset slave;
|
||||
|
||||
# randomize slave server's own checksum policy
|
||||
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
|
||||
flush logs;
|
||||
|
||||
connection master;
|
||||
set @@global.binlog_checksum= CRC32;
|
||||
reset master;
|
||||
flush logs;
|
||||
create table t3 (a int, b char(5));
|
||||
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select count(*) as 'must be zero' from t3;
|
||||
source include/stop_slave.inc;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
|
||||
|
||||
connection master;
|
||||
flush logs;
|
||||
reset master;
|
||||
insert into t3 value (1, @@global.binlog_checksum);
|
||||
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
flush logs;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select count(*) as 'must be one' from t3;
|
||||
|
||||
connection master;
|
||||
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
|
||||
insert into t3 value (1, @@global.binlog_checksum);
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
|
||||
#clean-up
|
||||
|
||||
connection master;
|
||||
drop table t1, t2, t3;
|
||||
set @@global.binlog_checksum = @master_save_binlog_checksum;
|
||||
set @@global.master_verify_checksum = @save_master_verify_checksum;
|
||||
|
||||
#
|
||||
# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
|
||||
#
|
||||
# Sanity check that verifies that no assertions are triggered because
|
||||
# of old FD events (generated by versions prior to server released with
|
||||
# checksums feature)
|
||||
#
|
||||
# There is no need for query log, if something wrong this should trigger
|
||||
# an assertion
|
||||
|
||||
--disable_query_log
|
||||
|
||||
BINLOG '
|
||||
MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
|
||||
';
|
||||
|
||||
--enable_query_log
|
||||
|
||||
#connection slave;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
|
||||
|
||||
--connection master
|
||||
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
CREATE TABLE t4 (a INT PRIMARY KEY);
|
||||
INSERT INTO t4 VALUES (1);
|
||||
|
||||
SET sql_log_bin=0;
|
||||
CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
|
||||
SET sql_log_bin=1;
|
||||
SET @old_dbug= @@GLOBAL.debug_dbug;
|
||||
SET debug_dbug= '+d,binlog_inject_new_name_error';
|
||||
--error ER_NO_UNIQUE_LOGFILE
|
||||
FLUSH LOGS;
|
||||
SET debug_dbug= @old_dbug;
|
||||
|
||||
INSERT INTO t4 VALUES (2);
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1590
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Search the error log for the error message.
|
||||
# The bug was that 4 garbage bytes were output in the middle of the error
|
||||
# message; by searching for a pattern that spans that location, we can
|
||||
# catch the error.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
--let SEARCH_FILE= $log_error_
|
||||
--let SEARCH_RANGE=-50000
|
||||
--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SELECT * FROM t4 ORDER BY a;
|
||||
STOP SLAVE IO_THREAD;
|
||||
SET sql_slave_skip_counter= 1;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection master
|
||||
--save_master_pos
|
||||
|
||||
--connection slave
|
||||
--sync_with_master
|
||||
SELECT * FROM t4 ORDER BY a;
|
||||
|
||||
|
||||
--connection slave
|
||||
set @@global.binlog_checksum = @slave_save_binlog_checksum;
|
||||
set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
|
||||
|
||||
--echo End of tests
|
||||
|
||||
--connection master
|
||||
DROP TABLE t4;
|
||||
|
||||
--source include/rpl_end.inc
|
261
mysql-test/extra/rpl_tests/rpl_checksum_cache.inc
Normal file
261
mysql-test/extra/rpl_tests/rpl_checksum_cache.inc
Normal file
|
@ -0,0 +1,261 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
--disable_warnings
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
set @save_binlog_cache_size = @@global.binlog_cache_size;
|
||||
set @save_binlog_checksum = @@global.binlog_checksum;
|
||||
set @save_master_verify_checksum = @@global.master_verify_checksum;
|
||||
set @@global.binlog_cache_size = 4096;
|
||||
set @@global.binlog_checksum = CRC32;
|
||||
set @@global.master_verify_checksum = 1;
|
||||
|
||||
# restart slave to force the dump thread to verify events (on master side)
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
#
|
||||
# Testing a critical part of checksum handling dealing with transaction cache.
|
||||
# The cache's buffer size is set to be less than the transaction's footprint
|
||||
# in binlog.
|
||||
#
|
||||
# To verify combined buffer-by-buffer read out of the file and fixing crc per event
|
||||
# there are the following parts:
|
||||
#
|
||||
# 1. the event size is much less than the cache's buffer
|
||||
# 2. the event size is bigger than the cache's buffer
|
||||
# 3. the event size if approximately the same as the cache's buffer
|
||||
# 4. all in above
|
||||
|
||||
#
|
||||
# 1. the event size is much less than the cache's buffer
|
||||
#
|
||||
|
||||
flush status;
|
||||
show status like "binlog_cache_use";
|
||||
show status like "binlog_cache_disk_use";
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# parameter to ensure the test slightly varies binlog content
|
||||
# between different invocations
|
||||
#
|
||||
let $deviation_size=32;
|
||||
eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
|
||||
|
||||
# Now we are going to create transaction which is long enough so its
|
||||
# transaction binlog will be flushed to disk...
|
||||
|
||||
delimiter |;
|
||||
create procedure test.p_init (n int, size int)
|
||||
begin
|
||||
while n > 0 do
|
||||
select round(RAND() * size) into @act_size;
|
||||
set @data = repeat('a', @act_size);
|
||||
insert into t1 values(n, @data );
|
||||
set n= n-1;
|
||||
end while;
|
||||
end|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
|
||||
|
||||
begin;
|
||||
--disable_warnings
|
||||
# todo: check if it is really so.
|
||||
#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
|
||||
eval call test.p_init($1, $deviation_size);
|
||||
--enable_warnings
|
||||
commit;
|
||||
|
||||
show status like "binlog_cache_use";
|
||||
--echo *** binlog_cache_disk_use must be non-zero ***
|
||||
show status like "binlog_cache_disk_use";
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:test.t1, slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# undoing changes with verifying the above once again
|
||||
connection master;
|
||||
|
||||
begin;
|
||||
delete from t1;
|
||||
commit;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
#
|
||||
# 2. the event size is bigger than the cache's buffer
|
||||
#
|
||||
connection master;
|
||||
|
||||
flush status;
|
||||
let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
|
||||
let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
|
||||
let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
|
||||
|
||||
eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
|
||||
let $1=100;
|
||||
--disable_query_log
|
||||
begin;
|
||||
while ($1)
|
||||
{
|
||||
eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
|
||||
set @data = repeat('a', @act_size);
|
||||
insert into t2 set data = @data;
|
||||
dec $1;
|
||||
}
|
||||
commit;
|
||||
--enable_query_log
|
||||
show status like "binlog_cache_use";
|
||||
--echo *** binlog_cache_disk_use must be non-zero ***
|
||||
show status like "binlog_cache_disk_use";
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:test.t2, slave:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# undoing changes with verifying the above once again
|
||||
connection master;
|
||||
|
||||
begin;
|
||||
delete from t2;
|
||||
commit;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# 3. the event size if approximately the same as the cache's buffer
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
flush status;
|
||||
let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
|
||||
let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
|
||||
let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
|
||||
|
||||
eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
|
||||
|
||||
let $1= 300;
|
||||
--disable_query_log
|
||||
begin;
|
||||
while ($1)
|
||||
{
|
||||
eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
|
||||
insert into t3 set data= repeat('a', @act_size);
|
||||
dec $1;
|
||||
}
|
||||
commit;
|
||||
--enable_query_log
|
||||
show status like "binlog_cache_use";
|
||||
--echo *** binlog_cache_disk_use must be non-zero ***
|
||||
show status like "binlog_cache_disk_use";
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:test.t3, slave:test.t3;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# undoing changes with verifying the above once again
|
||||
connection master;
|
||||
|
||||
begin;
|
||||
delete from t3;
|
||||
commit;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
#
|
||||
# 4. all in above
|
||||
#
|
||||
|
||||
connection master;
|
||||
flush status;
|
||||
|
||||
delimiter |;
|
||||
eval create procedure test.p1 (n int)
|
||||
begin
|
||||
while n > 0 do
|
||||
case (select (round(rand()*100) % 3) + 1)
|
||||
when 1 then
|
||||
select round(RAND() * $deviation_size) into @act_size;
|
||||
set @data = repeat('a', @act_size);
|
||||
insert into t1 values(n, @data);
|
||||
when 2 then
|
||||
begin
|
||||
select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
|
||||
insert into t2 set data=repeat('a', @act_size);
|
||||
end;
|
||||
when 3 then
|
||||
begin
|
||||
select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
|
||||
insert into t3 set data= repeat('a', @act_size);
|
||||
end;
|
||||
end case;
|
||||
set n= n-1;
|
||||
end while;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
let $1= 1000;
|
||||
set autocommit= 0;
|
||||
begin;
|
||||
--disable_warnings
|
||||
eval call test.p1($1);
|
||||
--enable_warnings
|
||||
commit;
|
||||
|
||||
show status like "binlog_cache_use";
|
||||
--echo *** binlog_cache_disk_use must be non-zero ***
|
||||
show status like "binlog_cache_disk_use";
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:test.t1, slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
let $diff_tables=master:test.t2, slave:test.t2;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
let $diff_tables=master:test.t3, slave:test.t3;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
|
||||
connection master;
|
||||
|
||||
begin;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t3;
|
||||
commit;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
set @@global.binlog_cache_size = @save_binlog_cache_size;
|
||||
set @@global.binlog_checksum = @save_binlog_checksum;
|
||||
set @@global.master_verify_checksum = @save_master_verify_checksum;
|
||||
drop procedure test.p_init;
|
||||
drop procedure test.p1;
|
||||
|
||||
--source include/rpl_end.inc
|
176
mysql-test/extra/rpl_tests/rpl_corruption.inc
Normal file
176
mysql-test/extra/rpl_tests/rpl_corruption.inc
Normal file
|
@ -0,0 +1,176 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
############################################################
|
||||
# Purpose: WL#5064 Testing with corrupted events.
|
||||
# The test emulates the corruption at the vary stages
|
||||
# of replication:
|
||||
# - in binlog file
|
||||
# - in network
|
||||
# - in relay log
|
||||
############################################################
|
||||
|
||||
#
|
||||
# The tests intensively utilize @@global.debug. Note,
|
||||
# Bug#11765758 - 58754,
|
||||
# @@global.debug is read by the slave threads through dbug-interface.
|
||||
# Hence, before a client thread set @@global.debug we have to ensure that:
|
||||
# (a) the slave threads are stopped, or (b) the slave threads are in
|
||||
# sync and waiting.
|
||||
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
# Block legal errors for MTR
|
||||
call mtr.add_suppression('Found invalid event in binary log');
|
||||
call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
|
||||
call mtr.add_suppression('event read from binlog did not pass crc check');
|
||||
call mtr.add_suppression('Replication event checksum verification failed');
|
||||
call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
|
||||
call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
|
||||
|
||||
SET @old_master_verify_checksum = @@master_verify_checksum;
|
||||
|
||||
# Creating test table/data and set corruption position for testing
|
||||
--echo # 1. Creating test table/data and set corruption position for testing
|
||||
--connection master
|
||||
--echo * insert/update/delete rows in table t1 *
|
||||
# Corruption algorithm modifies only the first event and
|
||||
# then will be reset. To avoid checking always the first event
|
||||
# from binlog (usually it is FD) we randomly execute different
|
||||
# statements and set position for corruption inside events.
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
|
||||
--disable_query_log
|
||||
let $i=`SELECT 3+CEILING(10*RAND())`;
|
||||
let $j=1;
|
||||
let $pos=0;
|
||||
while ($i) {
|
||||
eval INSERT INTO t1 VALUES ($j, 'a', NULL);
|
||||
if (`SELECT RAND() > 0.7`)
|
||||
{
|
||||
eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
|
||||
}
|
||||
if (`SELECT RAND() > 0.8`)
|
||||
{
|
||||
eval DELETE FROM t1 WHERE a = $j;
|
||||
}
|
||||
if (!$pos) {
|
||||
let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
--sync_slave_with_master
|
||||
--source include/stop_slave.inc
|
||||
--disable_query_log
|
||||
--connection master
|
||||
}
|
||||
dec $i;
|
||||
inc $j;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
|
||||
# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
|
||||
--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
|
||||
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
|
||||
--echo SHOW BINLOG EVENTS;
|
||||
--disable_query_log
|
||||
send_eval SHOW BINLOG EVENTS FROM $pos;
|
||||
--enable_query_log
|
||||
--error ER_ERROR_WHEN_EXECUTING_COMMAND
|
||||
reap;
|
||||
|
||||
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
|
||||
|
||||
# Emulate corruption on master with crc checking on master
|
||||
--echo # 3. Master read a corrupted event from binlog and send the error to slave
|
||||
|
||||
# We have a rare but nasty potential race here: if the dump thread on
|
||||
# the master for the _old_ slave connection has not yet discovered
|
||||
# that the slave has disconnected, we will inject the corrupt event on
|
||||
# the wrong connection, and the test will fail
|
||||
# (+d,corrupt_read_log_event2 corrupts only one event).
|
||||
# So kill any lingering dump thread (we need to kill; otherwise dump thread
|
||||
# could manage to send all events down the socket before seeing it close, and
|
||||
# hang forever waiting for new binlog events to be created).
|
||||
let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
|
||||
if ($id)
|
||||
{
|
||||
--disable_query_log
|
||||
--error 0,1094
|
||||
eval kill $id;
|
||||
--enable_query_log
|
||||
}
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
|
||||
--connection slave
|
||||
START SLAVE IO_THREAD;
|
||||
let $slave_io_errno= 1236;
|
||||
--let $slave_timeout= 10
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
--connection master
|
||||
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
|
||||
|
||||
# Emulate corruption on master without crc checking on master
|
||||
--echo # 4. Master read a corrupted event from binlog and send it to slave
|
||||
--connection master
|
||||
SET GLOBAL master_verify_checksum=0;
|
||||
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
|
||||
--connection slave
|
||||
START SLAVE IO_THREAD;
|
||||
# When the checksum error is detected, the slave sets error code 1913
|
||||
# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
|
||||
# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
|
||||
# So we usually get 1595, but it is occasionally possible to get 1913.
|
||||
let $slave_io_errno= 1595,1913;
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
--connection master
|
||||
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
|
||||
SET GLOBAL debug_dbug= "";
|
||||
SET GLOBAL master_verify_checksum=1;
|
||||
|
||||
# Emulate corruption in network
|
||||
--echo # 5. Slave. Corruption in network
|
||||
--connection slave
|
||||
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
|
||||
START SLAVE IO_THREAD;
|
||||
let $slave_io_errno= 1595,1913;
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
SET GLOBAL debug_dbug="-d,corrupt_queue_event";
|
||||
|
||||
# Emulate corruption in relay log
|
||||
--echo # 6. Slave. Corruption in relay log
|
||||
|
||||
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
|
||||
|
||||
START SLAVE SQL_THREAD;
|
||||
let $slave_sql_errno= 1593;
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
|
||||
SET GLOBAL debug_dbug= "";
|
||||
|
||||
# Start normal replication and compare same table on master
|
||||
# and slave
|
||||
--echo # 7. Seek diff for tables on master and slave
|
||||
--connection slave
|
||||
--source include/start_slave.inc
|
||||
--connection master
|
||||
--sync_slave_with_master
|
||||
let $diff_tables= master:test.t1, slave:test.t1;
|
||||
--source include/diff_tables.inc
|
||||
|
||||
# Clean up
|
||||
--echo # 8. Clean up
|
||||
--connection master
|
||||
SET GLOBAL debug_dbug= "";
|
||||
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
SET GLOBAL debug_dbug= "";
|
||||
|
||||
--source include/rpl_end.inc
|
568
mysql-test/extra/rpl_tests/rpl_gtid_basic.inc
Normal file
568
mysql-test/extra/rpl_tests/rpl_gtid_basic.inc
Normal file
|
@ -0,0 +1,568 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--let $rpl_topology=1->2->3->4
|
||||
--source include/rpl_init.inc
|
||||
|
||||
# Set up a 4-deep replication topology, then test various fail-overs
|
||||
# using GTID.
|
||||
#
|
||||
# A -> B -> C -> D
|
||||
|
||||
connection server_1;
|
||||
--source include/wait_for_binlog_checkpoint.inc
|
||||
--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
|
||||
--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
|
||||
--echo *** GTID position should be empty here ***
|
||||
--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
|
||||
eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, "m1");
|
||||
INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
|
||||
INSERT INTO t2 VALUES (1, "i1");
|
||||
BEGIN;
|
||||
INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
|
||||
INSERT INTO t2 VALUES (4, "i4");
|
||||
COMMIT;
|
||||
save_master_pos;
|
||||
source include/wait_for_binlog_checkpoint.inc;
|
||||
--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
|
||||
--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
|
||||
--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
|
||||
--echo *** GTID position should be non-empty here ***
|
||||
--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
|
||||
eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
|
||||
|
||||
connection server_2;
|
||||
sync_with_master;
|
||||
source include/wait_for_binlog_checkpoint.inc;
|
||||
--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
|
||||
--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
|
||||
--echo *** GTID position should be the same as on server_1 ***
|
||||
--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
|
||||
eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
save_master_pos;
|
||||
|
||||
connection server_3;
|
||||
sync_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
save_master_pos;
|
||||
|
||||
connection server_4;
|
||||
sync_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
|
||||
--echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
|
||||
connection server_4;
|
||||
--source include/stop_slave.inc
|
||||
|
||||
connection server_1;
|
||||
INSERT INTO t1 VALUES (5, "m1a");
|
||||
INSERT INTO t2 VALUES (5, "i1a");
|
||||
save_master_pos;
|
||||
|
||||
connection server_4;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
--source include/start_slave.inc
|
||||
sync_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
--echo *** Now move B to D (C is still replicating from B) ***
|
||||
connection server_2;
|
||||
--source include/stop_slave.inc
|
||||
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
--source include/start_slave.inc
|
||||
|
||||
connection server_4;
|
||||
UPDATE t2 SET b="j1a" WHERE a=5;
|
||||
save_master_pos;
|
||||
|
||||
connection server_2;
|
||||
sync_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
--echo *** Now move C to D, after letting it fall a little behind ***
|
||||
connection server_3;
|
||||
--source include/stop_slave.inc
|
||||
|
||||
connection server_1;
|
||||
INSERT INTO t2 VALUES (6, "i6b");
|
||||
INSERT INTO t2 VALUES (7, "i7b");
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
connection server_3;
|
||||
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
--source include/start_slave.inc
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
--echo *** Now change everything back to what it was, to make rpl_end.inc happy
|
||||
# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
|
||||
connection server_2;
|
||||
# We need to sync up server_2 before switching. If it happened to have reached
|
||||
# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
|
||||
# server_1, which is (deliberately) missing that transaction.
|
||||
--source include/sync_with_master_gtid.inc
|
||||
--source include/stop_slave.inc
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
|
||||
--source include/start_slave.inc
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
connection server_3;
|
||||
--source include/stop_slave.inc
|
||||
--replace_result $SLAVE_MYPORT SLAVE_MYPORT
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
|
||||
--source include/start_slave.inc
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
connection server_4;
|
||||
--source include/stop_slave.inc
|
||||
--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
|
||||
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
|
||||
--source include/start_slave.inc
|
||||
|
||||
connection server_1;
|
||||
DROP TABLE t1,t2;
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--echo *** A few more checks for BINLOG_GTID_POS function ***
|
||||
--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
|
||||
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
|
||||
SELECT BINLOG_GTID_POS();
|
||||
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
|
||||
SELECT BINLOG_GTID_POS('a');
|
||||
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
|
||||
SELECT BINLOG_GTID_POS('a',1,NULL);
|
||||
SELECT BINLOG_GTID_POS(1,'a');
|
||||
SELECT BINLOG_GTID_POS(NULL,NULL);
|
||||
SELECT BINLOG_GTID_POS('',1);
|
||||
SELECT BINLOG_GTID_POS('a',1);
|
||||
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
|
||||
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
|
||||
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
|
||||
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
|
||||
|
||||
|
||||
--echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
|
||||
--connection server_2
|
||||
--source include/sync_with_master_gtid.inc
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET @old_state= @@GLOBAL.gtid_binlog_state;
|
||||
|
||||
--error ER_BINLOG_MUST_BE_EMPTY
|
||||
SET GLOBAL gtid_binlog_state = '';
|
||||
RESET MASTER;
|
||||
SET GLOBAL gtid_binlog_state = '';
|
||||
FLUSH LOGS;
|
||||
--source include/show_binary_logs.inc
|
||||
SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
|
||||
--source include/show_binary_logs.inc
|
||||
--let $binlog_file= master-bin.000001
|
||||
--let $binlog_start= 4
|
||||
--source include/show_binlog_events.inc
|
||||
#SELECT @@GLOBAL.gtid_binlog_pos;
|
||||
#SELECT @@GLOBAL.gtid_binlog_state;
|
||||
--error ER_BINLOG_MUST_BE_EMPTY
|
||||
SET GLOBAL gtid_binlog_state = @old_state;
|
||||
RESET MASTER;
|
||||
SET GLOBAL gtid_binlog_state = @old_state;
|
||||
|
||||
# Check that slave can reconnect again, despite the RESET MASTER, as we
|
||||
# restored the state.
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
SET gtid_seq_no=100;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection server_2
|
||||
--source include/start_slave.inc
|
||||
# We cannot just use sync_with_master as we've done RESET MASTER, so
|
||||
# slave old-style position is wrong.
|
||||
# So sync on gtid position instead.
|
||||
--source include/sync_with_master_gtid.inc
|
||||
|
||||
SELECT * FROM t1;
|
||||
# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
|
||||
--let $status_items= Gtid_IO_Pos
|
||||
--source include/show_slave_status.inc
|
||||
|
||||
--echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
|
||||
|
||||
--connection server_1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
|
||||
SELECT @@last_gtid;
|
||||
SET gtid_seq_no=110;
|
||||
SELECT @@last_gtid;
|
||||
BEGIN;
|
||||
SELECT @@last_gtid;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
SELECT @@last_gtid;
|
||||
COMMIT;
|
||||
SELECT @@last_gtid;
|
||||
--let $pos= `SELECT @@gtid_binlog_pos`
|
||||
|
||||
--connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
eval SET @pos= '$pos';
|
||||
# Check NULL argument.
|
||||
SELECT master_gtid_wait(NULL);
|
||||
# Check empty argument returns immediately.
|
||||
SELECT master_gtid_wait('', NULL);
|
||||
# Check this gets counted
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_count';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_time';
|
||||
# Let's check that we get a timeout
|
||||
SELECT master_gtid_wait(@pos, 0.5);
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
# Now actually wait until the slave reaches the position
|
||||
send SELECT master_gtid_wait(@pos);
|
||||
|
||||
--connection server_2
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection s1
|
||||
reap;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
# Test waiting on a domain that does not exist yet.
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id= 1;
|
||||
INSERT INTO t1 VALUES (3);
|
||||
--let $pos= `SELECT @@gtid_binlog_pos`
|
||||
|
||||
--connection s1
|
||||
--replace_result $pos POS
|
||||
eval SET @pos= '$pos';
|
||||
SELECT master_gtid_wait(@pos, 0);
|
||||
SELECT * FROM t1 WHERE a >= 3;
|
||||
send SELECT master_gtid_wait(@pos, -1);
|
||||
|
||||
--connection server_2
|
||||
--source include/start_slave.inc
|
||||
|
||||
--connection s1
|
||||
reap;
|
||||
SELECT * FROM t1 WHERE a >= 3;
|
||||
# Waiting for only part of the position.
|
||||
SELECT master_gtid_wait('1-1-1', 0);
|
||||
|
||||
# Now test a lot of parallel master_gtid_wait() calls, completing in different
|
||||
# order, and some of which time out or get killed on the way.
|
||||
|
||||
--connection s1
|
||||
send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
|
||||
|
||||
--connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
# This will time out. No event 0-1-1000 exists
|
||||
send SELECT master_gtid_wait('0-1-1000', 0.5);
|
||||
|
||||
--connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
# This one we will kill
|
||||
--let $kill1_id= `SELECT connection_id()`
|
||||
send SELECT master_gtid_wait('0-1-2000');
|
||||
|
||||
--connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('2-1-10');
|
||||
|
||||
--connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('2-1-6', 1);
|
||||
|
||||
# This one we will kill also.
|
||||
--connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
--let $kill2_id= `SELECT connection_id()`
|
||||
send SELECT master_gtid_wait('2-1-5');
|
||||
|
||||
--connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('2-1-10');
|
||||
|
||||
--connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
|
||||
|
||||
--connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('2-1-2');
|
||||
|
||||
--connection server_2
|
||||
# This one completes immediately.
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_count';
|
||||
SELECT master_gtid_wait('1-1-1');
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_count';
|
||||
let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
|
||||
--replace_result $wait_time MASTER_GTID_WAIT_TIME
|
||||
eval SET @a= $wait_time;
|
||||
SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
|
||||
AS Master_gtid_wait_time_as_expected;
|
||||
|
||||
|
||||
--connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
|
||||
send SELECT master_gtid_wait('0-1-109');
|
||||
|
||||
--connection server_2
|
||||
# This one should time out.
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_count';
|
||||
SELECT master_gtid_wait('2-1-2', 0.5);
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
|
||||
SHOW STATUS LIKE 'Master_gtid_wait_count';
|
||||
let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
|
||||
--replace_result $wait_time MASTER_GTID_WAIT_TIME
|
||||
eval SET @a= $wait_time;
|
||||
# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling
|
||||
# and timer inaccuracies could introduce significant jitter. So allow a
|
||||
# generous interval.
|
||||
SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
|
||||
|
||||
--replace_result $kill1_id KILL_ID
|
||||
eval KILL QUERY $kill1_id;
|
||||
--connection s3
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
reap;
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=2;
|
||||
INSERT INTO t1 VALUES (4);
|
||||
|
||||
--connection s9
|
||||
reap;
|
||||
|
||||
--connection server_2
|
||||
--replace_result $kill2_id KILL_ID
|
||||
eval KILL CONNECTION $kill2_id;
|
||||
|
||||
--connection s6
|
||||
--error 2013,ER_CONNECTION_KILLED
|
||||
reap;
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=1;
|
||||
SET gtid_seq_no=4;
|
||||
INSERT INTO t1 VALUES (5);
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=5;
|
||||
INSERT INTO t1 VALUES (6);
|
||||
|
||||
--connection s8
|
||||
reap;
|
||||
--connection s1
|
||||
reap;
|
||||
--connection s2
|
||||
reap;
|
||||
--connection s5
|
||||
reap;
|
||||
--connection s10
|
||||
reap;
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=10;
|
||||
INSERT INTO t1 VALUES (7);
|
||||
|
||||
--connection s4
|
||||
reap;
|
||||
--connection s7
|
||||
reap;
|
||||
|
||||
|
||||
--echo *** Test gtid_slave_pos when used with GTID ***
|
||||
|
||||
--connection server_2
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=1000;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
INSERT INTO t1 VALUES (11);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
SET sql_slave_skip_counter= 1;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=1010;
|
||||
INSERT INTO t1 VALUES (12);
|
||||
INSERT INTO t1 VALUES (13);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
SET sql_slave_skip_counter= 2;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=1020;
|
||||
INSERT INTO t1 VALUES (14);
|
||||
INSERT INTO t1 VALUES (15);
|
||||
INSERT INTO t1 VALUES (16);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
SET sql_slave_skip_counter= 3;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=1030;
|
||||
INSERT INTO t1 VALUES (17);
|
||||
INSERT INTO t1 VALUES (18);
|
||||
INSERT INTO t1 VALUES (19);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
SET sql_slave_skip_counter= 5;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id=3;
|
||||
SET gtid_seq_no=100;
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY);
|
||||
DROP TABLE t2;
|
||||
SET gtid_domain_id=2;
|
||||
SET gtid_seq_no=1040;
|
||||
INSERT INTO t1 VALUES (20);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
|
||||
SET GLOBAL slave_ddl_exec_mode=STRICT;
|
||||
SET sql_slave_skip_counter=1;
|
||||
START SLAVE UNTIL master_gtid_pos="3-1-100";
|
||||
--let $master_pos=3-1-100
|
||||
--source include/sync_with_master_gtid.inc
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t2;
|
||||
SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
# Start the slave again, it should fail on the DROP TABLE as the table is not there.
|
||||
SET sql_log_bin=0;
|
||||
CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
|
||||
SET sql_log_bin=1;
|
||||
START SLAVE;
|
||||
--let $slave_sql_errno=1051
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
STOP SLAVE IO_THREAD;
|
||||
SET sql_slave_skip_counter=2;
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
|
||||
|
||||
SET GLOBAL slave_ddl_exec_mode= @saved_mode;
|
||||
|
||||
|
||||
--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
|
||||
|
||||
# Create an out-of-order binlog on server 2.
|
||||
# Let server 3 replicate to an out-of-order point, stop it, restart it,
|
||||
# and check that it replicates correctly despite the out-of-order.
|
||||
|
||||
--connection server_1
|
||||
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
|
||||
INSERT INTO t1 VALUES (31);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
--sync_with_master
|
||||
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
|
||||
INSERT INTO t1 VALUES (32);
|
||||
|
||||
--connection server_1
|
||||
INSERT INTO t1 VALUES (33);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
--sync_with_master
|
||||
--save_master_pos
|
||||
|
||||
--connection server_3
|
||||
--sync_with_master
|
||||
--source include/stop_slave.inc
|
||||
|
||||
--connection server_1
|
||||
INSERT INTO t1 VALUES (34);
|
||||
--save_master_pos
|
||||
|
||||
--connection server_2
|
||||
--sync_with_master
|
||||
--save_master_pos
|
||||
|
||||
--connection server_3
|
||||
--source include/start_slave.inc
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
|
||||
--save_master_pos
|
||||
|
||||
--connection server_4
|
||||
--sync_with_master
|
||||
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
|
||||
|
||||
|
||||
# Clean up.
|
||||
--connection server_1
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--source include/rpl_end.inc
|
63
mysql-test/extra/rpl_tests/rpl_incident.inc
Normal file
63
mysql-test/extra/rpl_tests/rpl_incident.inc
Normal file
|
@ -0,0 +1,63 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
SET @old_binlog_checksum=@@binlog_checksum;
|
||||
SET GLOBAL BINLOG_CHECKSUM=none;
|
||||
connection slave;
|
||||
SET @old_binlog_checksum=@@binlog_checksum;
|
||||
SET GLOBAL BINLOG_CHECKSUM=none;
|
||||
connection master;
|
||||
|
||||
--echo **** On Master ****
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT * FROM t1;
|
||||
|
||||
let $debug_save= `SELECT @@GLOBAL.debug`;
|
||||
SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
|
||||
|
||||
# This will generate an incident log event and store it in the binary
|
||||
# log before the replace statement.
|
||||
REPLACE INTO t1 VALUES (4);
|
||||
--save_master_pos
|
||||
SELECT * FROM t1;
|
||||
|
||||
--disable_query_log
|
||||
eval SET GLOBAL debug_dbug= '$debug_save';
|
||||
--enable_query_log
|
||||
|
||||
connection slave;
|
||||
# Wait until SQL thread stops with error LOST_EVENT on master
|
||||
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
|
||||
let $slave_sql_errno= 1590;
|
||||
let $show_slave_sql_error= 1;
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
|
||||
# The 4 should not be inserted into the table, since the incident log
|
||||
# event should have stop the slave.
|
||||
--echo **** On Slave ****
|
||||
SELECT * FROM t1;
|
||||
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
|
||||
START SLAVE;
|
||||
--sync_with_master
|
||||
|
||||
# Now, we should have inserted the row into the table and the slave
|
||||
# should be running. We should also have rotated to a new binary log.
|
||||
|
||||
SELECT * FROM t1;
|
||||
source include/check_slave_is_running.inc;
|
||||
|
||||
connection master;
|
||||
SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
|
||||
--source include/rpl_end.inc
|
95
mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc
Normal file
95
mysql-test/extra/rpl_tests/rpl_init_slave_errors.inc
Normal file
|
@ -0,0 +1,95 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
######################################################################
|
||||
# Some errors that cause the slave SQL thread to stop are not shown in
|
||||
# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
|
||||
# is only in the server's error log.
|
||||
#
|
||||
# Two failures and their respective reporting are verified:
|
||||
#
|
||||
# 1 - Failures during slave thread initialization
|
||||
# 2 - Failures while processing queries passed through the init_slave
|
||||
# option.
|
||||
#
|
||||
# In order to check the first type of failure, we inject a fault in the
|
||||
# SQL/IO Threads through SET GLOBAL debug.
|
||||
#
|
||||
# To check the second type, we set @@global.init_slave to an invalid
|
||||
# command thus preventing the initialization of the SQL Thread.
|
||||
#
|
||||
# Obs:
|
||||
# 1 - Note that testing failures while initializing the relay log position
|
||||
# is hard as the same function is called before the code reaches the point
|
||||
# that we want to test.
|
||||
#
|
||||
# 2 - This test does not target failures that are reported while applying
|
||||
# events such as duplicate keys, errors while reading the relay-log.bin*,
|
||||
# etc. Such errors are already checked on other tests.
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# Configuring the Environment
|
||||
######################################################################
|
||||
source include/have_debug.inc;
|
||||
source include/master-slave.inc;
|
||||
source include/have_log_bin.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
--enable_warnings
|
||||
reset slave;
|
||||
|
||||
######################################################################
|
||||
# Injecting faults in the threads' initialization
|
||||
######################################################################
|
||||
connection slave;
|
||||
|
||||
# Set debug flags on slave to force errors to occur
|
||||
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
|
||||
|
||||
start slave;
|
||||
|
||||
#
|
||||
# slave is going to stop because of emulated failures
|
||||
# but there won't be any crashes nor asserts hit.
|
||||
#
|
||||
# 1593 = ER_SLAVE_FATAL_ERROR
|
||||
--let $slave_sql_errno= 1593
|
||||
--let $show_slave_sql_error= 1
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
call mtr.add_suppression("Failed during slave.* thread initialization");
|
||||
|
||||
SET GLOBAL debug_dbug= "";
|
||||
|
||||
######################################################################
|
||||
# Injecting faults in the init_slave option
|
||||
######################################################################
|
||||
connection slave;
|
||||
|
||||
reset slave;
|
||||
|
||||
SET GLOBAL init_slave= "garbage";
|
||||
|
||||
start slave;
|
||||
# 1064 = ER_PARSE_ERROR
|
||||
--let $slave_sql_errno= 1064
|
||||
--let $show_slave_sql_error= 1
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
######################################################################
|
||||
# Clean up
|
||||
######################################################################
|
||||
SET GLOBAL init_slave= "";
|
||||
|
||||
# Clean up Last_SQL_Error
|
||||
--source include/stop_slave_io.inc
|
||||
RESET SLAVE;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
232
mysql-test/extra/rpl_tests/rpl_loaddata_local.inc
Normal file
232
mysql-test/extra/rpl_tests/rpl_loaddata_local.inc
Normal file
|
@ -0,0 +1,232 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
# See if "LOAD DATA LOCAL INFILE" is well replicated
|
||||
# (LOAD DATA LOCAL INFILE is not written to the binlog
|
||||
# the same way as LOAD DATA INFILE : Append_blocks are smaller).
|
||||
# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
|
||||
# - the loaded file was not written entirely to the master's binlog,
|
||||
# only the first 4KB, 8KB or 16KB usually.
|
||||
# - the loaded file's first line was not written entirely to the
|
||||
# master's binlog (1st char was absent)
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table t1(a int);
|
||||
let $1=10000;
|
||||
disable_query_log;
|
||||
set SQL_LOG_BIN=0;
|
||||
while ($1)
|
||||
{
|
||||
insert into t1 values(1);
|
||||
dec $1;
|
||||
}
|
||||
set SQL_LOG_BIN=1;
|
||||
enable_query_log;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
#This will generate a 20KB file, now test LOAD DATA LOCAL
|
||||
truncate table t1;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
|
||||
sync_slave_with_master;
|
||||
select a,count(*) from t1 group by a;
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
# Now let us test how well we replicate LOAD DATA LOCAL in situation when
|
||||
# we met duplicates in tables to which we are adding rows.
|
||||
# (It supposed that LOAD DATA LOCAL ignores such errors)
|
||||
#
|
||||
connection master;
|
||||
create table t1(a int);
|
||||
insert into t1 values (1), (2), (2), (3);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
drop table t1;
|
||||
create table t1(a int primary key);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
|
||||
#
|
||||
# Bug22504 load data infile sql statement in replication architecture get error
|
||||
#
|
||||
--echo ==== Bug22504 Initialize ====
|
||||
|
||||
--connection master
|
||||
|
||||
SET sql_mode='ignore_space';
|
||||
CREATE TABLE t1(a int);
|
||||
insert into t1 values (1), (2), (3), (4);
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
|
||||
truncate table t1;
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
--echo ==== Clean up ====
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo
|
||||
--echo Bug #43746:
|
||||
--echo "return wrong query string when parse 'load data infile' sql statement"
|
||||
--echo
|
||||
|
||||
connection master;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
SELECT @@SESSION.sql_mode INTO @old_mode;
|
||||
|
||||
SET sql_mode='ignore_space';
|
||||
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4);
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA /*!10000 LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
|
||||
|
||||
SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo
|
||||
--echo Bug #59267:
|
||||
--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
|
||||
--echo
|
||||
|
||||
connection master;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
|
||||
|
||||
SELECT 'Master', COUNT(*) FROM t1;
|
||||
|
||||
--sync_slave_with_master
|
||||
SELECT 'Slave', COUNT(*) FROM t1;
|
||||
|
||||
# cleanup
|
||||
connection master;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/bug43746.sql
|
||||
--remove_file $MYSQLD_DATADIR/bug59267.sql
|
||||
|
||||
DROP TABLE t1;
|
||||
SET SESSION sql_mode=@old_mode;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
|
||||
--echo
|
||||
--echo Bug #60580/#11902767:
|
||||
--echo "statement improperly replicated crashes slave sql thread"
|
||||
--echo
|
||||
|
||||
connection master;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
CREATE TABLE t1(f1 INT, f2 INT);
|
||||
CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
|
||||
|
||||
INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
|
||||
INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
|
||||
INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
|
||||
|
||||
CREATE TABLE t3 AS SELECT * FROM t2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t2
|
||||
WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
sleep 1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/bug60580.csv
|
||||
|
||||
connection master;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
--source include/rpl_end.inc
|
||||
|
||||
--echo # End of 5.1 tests
|
120
mysql-test/extra/rpl_tests/rpl_loadfile.inc
Normal file
120
mysql-test/extra/rpl_tests/rpl_loadfile.inc
Normal file
|
@ -0,0 +1,120 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#############################################################################
|
||||
# Original Author: JBM #
|
||||
# Original Date: Aug/18/2005 #
|
||||
#############################################################################
|
||||
# TEST: To test the LOAD_FILE() in rbr #
|
||||
#############################################################################
|
||||
# Change Author: JBM
|
||||
# Change Date: 2006-01-16
|
||||
##########
|
||||
|
||||
# Includes
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
-- source extra/rpl_tests/rpl_loadfile.test
|
||||
|
||||
# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Problem: when using load_file string function and mixed binlogging format
|
||||
# there was no switch to row based binlogging format. This leads
|
||||
# to scenarios on which the slave replicates the statement and it
|
||||
# will try to load the file from local file system, which in most
|
||||
# likely it will not exist.
|
||||
#
|
||||
# Solution:
|
||||
# Marking this function as unsafe for statement format, makes the
|
||||
# statement using it to be logged in row based format. As such, data
|
||||
# replicated from the master, becomes the content of the loaded file.
|
||||
# Consequently, the slave receives the necessary data to complete
|
||||
# the load_file instruction correctly.
|
||||
#
|
||||
# IMPLEMENTATION
|
||||
#
|
||||
# The test is implemented as follows:
|
||||
#
|
||||
# On Master,
|
||||
# i) write to file the desired content.
|
||||
# ii) create table and stored procedure with load_file
|
||||
# iii) stop slave
|
||||
# iii) execute load_file
|
||||
# iv) remove file
|
||||
#
|
||||
# On Slave,
|
||||
# v) start slave
|
||||
# vi) sync it with master so that it gets the updates from binlog (which
|
||||
# should have bin logged in row format).
|
||||
#
|
||||
# If the the binlog format does not change to row, then the assertion
|
||||
# done in the following step fails. This happens because tables differ
|
||||
# since the file does not exist anymore, meaning that when slave
|
||||
# attempts to execute LOAD_FILE statement it inserts NULL on table
|
||||
# instead of the same contents that the master loaded when it executed
|
||||
# the procedure (which was executed when file existed).
|
||||
#
|
||||
# vii) assert that the contents of master and slave
|
||||
# table are the same
|
||||
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
connection master;
|
||||
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval SELECT repeat('x',20) INTO OUTFILE '$file'
|
||||
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
enable_warnings;
|
||||
|
||||
CREATE TABLE t1 (t text);
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p(file varchar(4096))
|
||||
BEGIN
|
||||
INSERT INTO t1 VALUES (LOAD_FILE(file));
|
||||
END|
|
||||
DELIMITER ;|
|
||||
|
||||
# stop slave before issuing the load_file on master
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
# test: check that logging falls back to rbr.
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--eval CALL p('$file')
|
||||
|
||||
# test: remove the file from the filesystem and assert that slave still
|
||||
# gets the loaded file
|
||||
remove_file $file;
|
||||
|
||||
# now that the file is removed it is safe (regarding what we want to test)
|
||||
# to start slave
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
# assertion: assert that the slave got the updates even
|
||||
# if the file was removed before the slave started,
|
||||
# meaning that contents were indeed transfered
|
||||
# through binlog (in row format)
|
||||
let $diff_tables= master:t1, slave:t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
# CLEAN UP
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p;
|
||||
|
||||
--source include/rpl_end.inc
|
183
mysql-test/extra/rpl_tests/rpl_packet.inc
Normal file
183
mysql-test/extra/rpl_tests/rpl_packet.inc
Normal file
|
@ -0,0 +1,183 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Check replication protocol packet size handling
|
||||
#
|
||||
# ==== Related bugs ====
|
||||
# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
|
||||
# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
|
||||
# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
|
||||
# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
|
||||
|
||||
# max-out size db name
|
||||
source include/master-slave.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
|
||||
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
|
||||
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
disable_warnings;
|
||||
eval drop database if exists $db;
|
||||
enable_warnings;
|
||||
eval create database $db;
|
||||
|
||||
connection master;
|
||||
let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
|
||||
let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
|
||||
let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
|
||||
SET @@global.max_allowed_packet=1024;
|
||||
SET @@global.net_buffer_length=1024;
|
||||
|
||||
sync_slave_with_master;
|
||||
# Restart slave for setting to take effect
|
||||
source include/stop_slave.inc;
|
||||
source include/start_slave.inc;
|
||||
|
||||
# Reconnect to master for new setting to take effect
|
||||
disconnect master;
|
||||
|
||||
# alas, can't use eval here; if db name changed apply the change here
|
||||
connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
|
||||
|
||||
connection master;
|
||||
select @@net_buffer_length, @@max_allowed_packet;
|
||||
|
||||
create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
|
||||
|
||||
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
|
||||
sync_slave_with_master;
|
||||
|
||||
eval select count(*) from `$db`.`t1` /* must be 1 */;
|
||||
|
||||
SHOW STATUS LIKE 'Slave_running';
|
||||
select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
|
||||
connection master;
|
||||
eval drop database $db;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
|
||||
#
|
||||
# Check that a situation when the size of event on the master is greater than
|
||||
# max_allowed_packet on the slave does not lead to infinite re-transmits.
|
||||
|
||||
connection master;
|
||||
|
||||
# Change the max packet size on master
|
||||
|
||||
SET @@global.max_allowed_packet=4096;
|
||||
SET @@global.net_buffer_length=4096;
|
||||
|
||||
# Restart slave for new setting to take effect
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
source include/start_slave.inc;
|
||||
|
||||
# Reconnect to master for new setting to take effect
|
||||
disconnect master;
|
||||
connect (master, localhost, root);
|
||||
connection master;
|
||||
|
||||
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
|
||||
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
|
||||
|
||||
|
||||
#
|
||||
# Bug#42914: The slave I/O thread must stop after trying to read the above
|
||||
# event, However there is no Last_IO_Error report.
|
||||
#
|
||||
|
||||
# The slave I/O thread must stop after trying to read the above event
|
||||
connection slave;
|
||||
# 1153 = ER_NET_PACKET_TOO_LARGE
|
||||
--let $slave_io_errno= 1153
|
||||
--let $show_slave_io_error= 1
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
|
||||
# TODO: this is needed because of BUG#55790. Remove once that is fixed.
|
||||
--source include/stop_slave_sql.inc
|
||||
|
||||
#
|
||||
# Bug#42914: On the master, if a binary log event is larger than
|
||||
# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
|
||||
# is sent to a slave when it requests a dump from the master, thus leading the
|
||||
# I/O thread to stop. However, there is no Last_IO_Error reported.
|
||||
#
|
||||
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
|
||||
connection master;
|
||||
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
|
||||
|
||||
connection slave;
|
||||
# The slave I/O thread must stop after receiving
|
||||
# 1153 = ER_NET_PACKET_TOO_LARGE
|
||||
--let $slave_io_errno= 1153
|
||||
--let $show_slave_io_error= 1
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
|
||||
# Remove the bad binlog and clear error status on slave.
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
--connection master
|
||||
RESET MASTER;
|
||||
|
||||
|
||||
#
|
||||
# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
|
||||
#
|
||||
# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
|
||||
# BINLOG EVENTS was issued. To verify that this bug is fixed, we
|
||||
# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
|
||||
# never changes. We turn off the result log because we don't care
|
||||
# about the contents of the binlog.
|
||||
|
||||
--disable_result_log
|
||||
SET @max_allowed_packet_0= @@session.max_allowed_packet;
|
||||
SHOW BINLOG EVENTS;
|
||||
SET @max_allowed_packet_1= @@session.max_allowed_packet;
|
||||
SHOW BINLOG EVENTS;
|
||||
SET @max_allowed_packet_2= @@session.max_allowed_packet;
|
||||
--enable_result_log
|
||||
if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
|
||||
{
|
||||
--echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
|
||||
--source include/show_rpl_debug_info.inc
|
||||
SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
|
||||
--die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
|
||||
}
|
||||
|
||||
|
||||
--echo ==== clean up ====
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
|
||||
eval SET @@global.net_buffer_length= $old_net_buffer_length;
|
||||
eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
|
||||
# slave is stopped
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Clear Last_IO_Error
|
||||
RESET SLAVE;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
# End of tests
|
2219
mysql-test/extra/rpl_tests/rpl_parallel.inc
Normal file
2219
mysql-test/extra/rpl_tests/rpl_parallel.inc
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
|
||||
#
|
||||
# The function mysql_show_binlog_events has a local stack variable
|
||||
# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
|
||||
# this variable goes out of scope and is destroyed before clean
|
||||
# thd->current_linfo.
|
||||
#
|
||||
# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
|
||||
# that with the fix local variable linfo is valid along all
|
||||
# mysql_show_binlog_events function scope.
|
||||
#
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection slave
|
||||
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
|
||||
--send SHOW BINLOG EVENTS
|
||||
|
||||
--connection slave1
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
|
||||
FLUSH LOGS;
|
||||
SET DEBUG_SYNC= 'now SIGNAL end';
|
||||
|
||||
--connection slave
|
||||
--disable_result_log
|
||||
--reap
|
||||
--enable_result_log
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
--connection master
|
||||
--source include/rpl_end.inc
|
18
mysql-test/extra/rpl_tests/rpl_relayrotate.inc
Normal file
18
mysql-test/extra/rpl_tests/rpl_relayrotate.inc
Normal file
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#######################################################
|
||||
# Wrapper for rpl_relayrotate.test to allow multi #
|
||||
# Engines to reuse test code. By JBM 2006-02-15 #
|
||||
#######################################################
|
||||
-- source include/have_innodb.inc
|
||||
# Slow test, don't run during staging part
|
||||
-- source include/not_staging.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
let $engine_type=innodb;
|
||||
-- source extra/rpl_tests/rpl_relayrotate.test
|
||||
--source include/rpl_end.inc
|
551
mysql-test/extra/rpl_tests/rpl_semi_sync.inc
Normal file
551
mysql-test/extra/rpl_tests/rpl_semi_sync.inc
Normal file
|
@ -0,0 +1,551 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
source include/have_semisync.inc;
|
||||
source include/not_embedded.inc;
|
||||
source include/have_innodb.inc;
|
||||
source include/master-slave.inc;
|
||||
|
||||
let $engine_type= InnoDB;
|
||||
#let $engine_type= MyISAM;
|
||||
|
||||
# Suppress warnings that might be generated during the test
|
||||
connection master;
|
||||
call mtr.add_suppression("Timeout waiting for reply of binlog");
|
||||
call mtr.add_suppression("Read semi-sync reply");
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
|
||||
connection slave;
|
||||
call mtr.add_suppression("Master server does not support semi-sync");
|
||||
call mtr.add_suppression("Semi-sync slave .* reply");
|
||||
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
|
||||
connection master;
|
||||
|
||||
# wait for dying connections (if any) to disappear
|
||||
let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# After fix of BUG#45848, semi-sync slave should not create any extra
|
||||
# connections on master, save the count of connections before start
|
||||
# semi-sync slave for comparison below.
|
||||
let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
|
||||
|
||||
--echo #
|
||||
--echo # Uninstall semi-sync plugins on master and slave
|
||||
--echo #
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
reset slave;
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
set global rpl_semi_sync_slave_enabled= 0;
|
||||
|
||||
connection master;
|
||||
reset master;
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
set global rpl_semi_sync_slave_enabled= 0;
|
||||
|
||||
--echo #
|
||||
--echo # Main test of semi-sync replication start here
|
||||
--echo #
|
||||
|
||||
connection master;
|
||||
|
||||
set global rpl_semi_sync_master_timeout= 60000; # 60s
|
||||
|
||||
echo [ default state of semi-sync on master should be OFF ];
|
||||
show variables like 'rpl_semi_sync_master_enabled';
|
||||
|
||||
echo [ enable semi-sync on master ];
|
||||
set global rpl_semi_sync_master_enabled = 1;
|
||||
show variables like 'rpl_semi_sync_master_enabled';
|
||||
|
||||
echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
--echo #
|
||||
--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
|
||||
--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
|
||||
--echo #
|
||||
|
||||
# BUG#45672 When semi-sync is enabled on master, it would allocate
|
||||
# transaction node even without semi-sync slave connected, and would
|
||||
# finally result in transaction node allocation error.
|
||||
#
|
||||
# Semi-sync master will pre-allocate 'max_connections' transaction
|
||||
# nodes, so here we do more than that much transactions to check if it
|
||||
# will fail or not.
|
||||
# select @@global.max_connections + 1;
|
||||
let $i= `select @@global.max_connections + 1`;
|
||||
disable_query_log;
|
||||
eval create table t1 (a int) engine=$engine_type;
|
||||
while ($i)
|
||||
{
|
||||
eval insert into t1 values ($i);
|
||||
dec $i;
|
||||
}
|
||||
drop table t1;
|
||||
enable_query_log;
|
||||
|
||||
# BUG#45673
|
||||
echo [ status of semi-sync on master should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# reset master to make sure the following test will start with a clean environment
|
||||
reset master;
|
||||
|
||||
connection slave;
|
||||
|
||||
echo [ default state of semi-sync on slave should be OFF ];
|
||||
show variables like 'rpl_semi_sync_slave_enabled';
|
||||
|
||||
echo [ enable semi-sync on slave ];
|
||||
set global rpl_semi_sync_slave_enabled = 1;
|
||||
show variables like 'rpl_semi_sync_slave_enabled';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
# NOTE: Rpl_semi_sync_master_client will only be updated when
|
||||
# semi-sync slave has started binlog dump request
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 1;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
echo [ initial master state after the semi-sync slave connected ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
replace_result $engine_type ENGINE_TYPE;
|
||||
eval create table t1(a int) engine = $engine_type;
|
||||
|
||||
echo [ master state after CREATE TABLE statement ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# After fix of BUG#45848, semi-sync slave should not create any extra
|
||||
# connections on master.
|
||||
let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
|
||||
replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
|
||||
eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
|
||||
|
||||
echo [ insert records to table ];
|
||||
insert t1 values (10);
|
||||
insert t1 values (9);
|
||||
insert t1 values (8);
|
||||
insert t1 values (7);
|
||||
insert t1 values (6);
|
||||
insert t1 values (5);
|
||||
insert t1 values (4);
|
||||
insert t1 values (3);
|
||||
insert t1 values (2);
|
||||
insert t1 values (1);
|
||||
|
||||
echo [ master status after inserts ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
echo [ slave status after replicated inserts ];
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
|
||||
select count(distinct a) from t1;
|
||||
select min(a) from t1;
|
||||
select max(a) from t1;
|
||||
|
||||
--echo
|
||||
--echo # BUG#50157
|
||||
--echo # semi-sync replication crashes when replicating a transaction which
|
||||
--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
|
||||
|
||||
connection master;
|
||||
SET SESSION AUTOCOMMIT= 0;
|
||||
CREATE TABLE t2(c1 INT) ENGINE=innodb;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
BEGIN;
|
||||
--echo
|
||||
--echo # Even though it is in a transaction, this statement is binlogged into binlog
|
||||
--echo # file immediately.
|
||||
--disable_warnings
|
||||
CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
|
||||
--enable_warnings
|
||||
--echo
|
||||
--echo # These statements will not be binlogged until the transaction is committed
|
||||
INSERT INTO t2 VALUES(11);
|
||||
INSERT INTO t2 VALUES(22);
|
||||
COMMIT;
|
||||
|
||||
DROP TABLE t2, t3;
|
||||
SET SESSION AUTOCOMMIT= 1;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test semi-sync master will switch OFF after one transaction
|
||||
--echo # timeout waiting for slave reply.
|
||||
--echo #
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
|
||||
# The first semi-sync check should be on because after slave stop,
|
||||
# there are no transactions on the master.
|
||||
echo [ master status should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
|
||||
echo [ semi-sync replication of these transactions will fail ];
|
||||
insert into t1 values (500);
|
||||
|
||||
# Wait for the semi-sync replication of this transaction to timeout
|
||||
let $status_var= Rpl_semi_sync_master_status;
|
||||
let $status_var_value= OFF;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
# The second semi-sync check should be off because one transaction
|
||||
# times out during waiting.
|
||||
echo [ master status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# Semi-sync status on master is now OFF, so all these transactions
|
||||
# will be replicated asynchronously.
|
||||
delete from t1 where a=10;
|
||||
delete from t1 where a=9;
|
||||
delete from t1 where a=8;
|
||||
delete from t1 where a=7;
|
||||
delete from t1 where a=6;
|
||||
delete from t1 where a=5;
|
||||
delete from t1 where a=4;
|
||||
delete from t1 where a=3;
|
||||
delete from t1 where a=2;
|
||||
delete from t1 where a=1;
|
||||
|
||||
insert into t1 values (100);
|
||||
|
||||
echo [ master status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
--echo #
|
||||
--echo # Test semi-sync status on master will be ON again when slave catches up
|
||||
--echo #
|
||||
|
||||
# Save the master position for later use.
|
||||
save_master_pos;
|
||||
|
||||
connection slave;
|
||||
|
||||
echo [ slave status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
source include/start_slave.inc;
|
||||
sync_with_master;
|
||||
|
||||
echo [ slave status should be ON ];
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
|
||||
select count(distinct a) from t1;
|
||||
select min(a) from t1;
|
||||
select max(a) from t1;
|
||||
|
||||
connection master;
|
||||
|
||||
# The master semi-sync status should be on again after slave catches up.
|
||||
echo [ master status should be ON again after slave catches up ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
|
||||
--echo #
|
||||
--echo # Test disable/enable master semi-sync on the fly.
|
||||
--echo #
|
||||
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
source include/stop_slave.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Flush status
|
||||
--echo #
|
||||
connection master;
|
||||
echo [ Semi-sync master status variables before FLUSH STATUS ];
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
|
||||
# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
|
||||
# clean status after this.
|
||||
FLUSH NO_WRITE_TO_BINLOG STATUS;
|
||||
echo [ Semi-sync master status variables after FLUSH STATUS ];
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
connection master;
|
||||
|
||||
source include/show_master_logs.inc;
|
||||
show variables like 'rpl_semi_sync_master_enabled';
|
||||
|
||||
echo [ disable semi-sync on the fly ];
|
||||
set global rpl_semi_sync_master_enabled=0;
|
||||
show variables like 'rpl_semi_sync_master_enabled';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
echo [ enable semi-sync on the fly ];
|
||||
set global rpl_semi_sync_master_enabled=1;
|
||||
show variables like 'rpl_semi_sync_master_enabled';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
--echo #
|
||||
--echo # Test RESET MASTER/SLAVE
|
||||
--echo #
|
||||
|
||||
connection slave;
|
||||
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
replace_result $engine_type ENGINE_TYPE;
|
||||
eval create table t1 (a int) engine = $engine_type;
|
||||
drop table t1;
|
||||
|
||||
##show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
sync_slave_with_master;
|
||||
--replace_column 2 #
|
||||
show status like 'Rpl_relay%';
|
||||
|
||||
echo [ test reset master ];
|
||||
connection master;
|
||||
|
||||
reset master;
|
||||
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
connection slave;
|
||||
|
||||
source include/stop_slave.inc;
|
||||
reset slave;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and
|
||||
# wait for it to exit
|
||||
connection master;
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
|
||||
# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
|
||||
# 1 after dump thread started.
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 1;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
replace_result $engine_type ENGINE_TYPE;
|
||||
eval create table t1 (a int) engine = $engine_type;
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2), (3);
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
select * from t1;
|
||||
|
||||
connection master;
|
||||
|
||||
echo [ master semi-sync status should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
--echo #
|
||||
--echo # Start semi-sync replication without SUPER privilege
|
||||
--echo #
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and wait for it to exit
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
|
||||
# Do not binlog the following statement because it will generate
|
||||
# different events for ROW and STATEMENT format
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
set sql_log_bin=1;
|
||||
connection slave;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
change master to master_user='rpl',master_password='rpl_password';
|
||||
source include/start_slave.inc;
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
connection master;
|
||||
|
||||
# Wait for the semi-sync binlog dump thread to start
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 1;
|
||||
source include/wait_for_status_var.inc;
|
||||
echo [ master semi-sync should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
insert into t1 values (4);
|
||||
insert into t1 values (5);
|
||||
echo [ master semi-sync should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
--echo #
|
||||
--echo # Test semi-sync slave connect to non-semi-sync master
|
||||
--echo #
|
||||
|
||||
# Disable semi-sync on master
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
|
||||
connection master;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and wait for it to exit
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
|
||||
echo [ Semi-sync status on master should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
|
||||
connection slave;
|
||||
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
|
||||
source include/start_slave.inc;
|
||||
connection master;
|
||||
insert into t1 values (8);
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 1;
|
||||
source include/wait_for_status_var.inc;
|
||||
echo [ master semi-sync clients should be 1, status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
sync_slave_with_master;
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
|
||||
# Uninstall semi-sync plugin on master
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
connection master;
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
|
||||
connection slave;
|
||||
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
insert into t1 values (10);
|
||||
sync_slave_with_master;
|
||||
|
||||
--echo #
|
||||
--echo # Test non-semi-sync slave connect to semi-sync master
|
||||
--echo #
|
||||
|
||||
connection master;
|
||||
set global rpl_semi_sync_master_timeout= 5000; # 5s
|
||||
set global rpl_semi_sync_master_enabled= 1;
|
||||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
|
||||
echo [ uninstall semi-sync slave plugin ];
|
||||
set global rpl_semi_sync_slave_enabled= 0;
|
||||
|
||||
echo [ reinstall semi-sync slave plugin and disable semi-sync ];
|
||||
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
source include/start_slave.inc;
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
|
||||
--echo #
|
||||
--echo # Clean up
|
||||
--echo #
|
||||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
set global rpl_semi_sync_slave_enabled= 0;
|
||||
|
||||
connection master;
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
|
||||
connection slave;
|
||||
change master to master_user='root',master_password='';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
drop user rpl@127.0.0.1;
|
||||
flush privileges;
|
||||
set global rpl_semi_sync_master_timeout= default;
|
||||
--source include/rpl_end.inc
|
402
mysql-test/extra/rpl_tests/rpl_skip_replication.inc
Normal file
402
mysql-test/extra/rpl_tests/rpl_skip_replication.inc
Normal file
|
@ -0,0 +1,402 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# --let $use_remote_mysqlbinlog= 1 # optional
|
||||
# --source extra/rpl_tests/rpl_skip_replication.inc
|
||||
#
|
||||
# The script uses MYSQLBINLOG to verify certain results.
|
||||
# By default, it uses binary logs directly. If it is undesirable,
|
||||
# this behavior can be overridden by setting $use_remote_binlog
|
||||
# as shown above.
|
||||
# The value will be unset after every execution of the script,
|
||||
# so if it is needed, it should be set explicitly before each call.
|
||||
#
|
||||
|
||||
--source include/master-slave.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
connection slave;
|
||||
# Test that SUPER is required to change @@replicate_events_marked_for_skip.
|
||||
CREATE USER 'nonsuperuser'@'127.0.0.1';
|
||||
GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
|
||||
SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
|
||||
connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
|
||||
connection nonpriv;
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
|
||||
disconnect nonpriv;
|
||||
connection slave;
|
||||
DROP USER'nonsuperuser'@'127.0.0.1';
|
||||
|
||||
SELECT @@global.replicate_events_marked_for_skip;
|
||||
--error ER_SLAVE_MUST_STOP
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
|
||||
SELECT @@global.replicate_events_marked_for_skip;
|
||||
STOP SLAVE;
|
||||
--error ER_GLOBAL_VARIABLE
|
||||
SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
|
||||
SELECT @@global.replicate_events_marked_for_skip;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
|
||||
SELECT @@global.replicate_events_marked_for_skip;
|
||||
START SLAVE;
|
||||
|
||||
connection master;
|
||||
SELECT @@skip_replication;
|
||||
--error ER_LOCAL_VARIABLE
|
||||
SET GLOBAL skip_replication=1;
|
||||
SELECT @@skip_replication;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
|
||||
INSERT INTO t1(a) VALUES (1);
|
||||
INSERT INTO t2(a) VALUES (1);
|
||||
|
||||
|
||||
# Test that master-side filtering works.
|
||||
SET skip_replication=1;
|
||||
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
|
||||
INSERT INTO t1(a) VALUES (2);
|
||||
INSERT INTO t2(a) VALUES (2);
|
||||
|
||||
# Inject a rotate event in the binlog stream sent to slave (otherwise we will
|
||||
# fail sync_slave_with_master as the last event on the master is not present
|
||||
# on the slave).
|
||||
FLUSH NO_WRITE_TO_BINLOG LOGS;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
SHOW TABLES;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
|
||||
FLUSH NO_WRITE_TO_BINLOG LOGS;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
# Test that slave-side filtering works.
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
|
||||
START SLAVE;
|
||||
|
||||
connection master;
|
||||
SET skip_replication=1;
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
|
||||
INSERT INTO t1(a) VALUES (3);
|
||||
INSERT INTO t2(a) VALUES (3);
|
||||
|
||||
# Inject a rotate event in the binlog stream sent to slave (otherwise we will
|
||||
# fail sync_slave_with_master as the last event on the master is not present
|
||||
# on the slave).
|
||||
FLUSH NO_WRITE_TO_BINLOG LOGS;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
SHOW TABLES;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
|
||||
FLUSH NO_WRITE_TO_BINLOG LOGS;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
|
||||
START SLAVE;
|
||||
|
||||
|
||||
# Test that events with @@skip_replication=1 are not filtered when filtering is
|
||||
# not set on slave.
|
||||
connection master;
|
||||
SET skip_replication=1;
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
|
||||
INSERT INTO t3(a) VALUES(2);
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
SELECT * FROM t3;
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
|
||||
#
|
||||
# Test that the slave will preserve the @@skip_replication flag in its
|
||||
# own binlog.
|
||||
#
|
||||
|
||||
TRUNCATE t1;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
RESET MASTER;
|
||||
|
||||
connection master;
|
||||
SET skip_replication=0;
|
||||
INSERT INTO t1 VALUES (1,0);
|
||||
SET skip_replication=1;
|
||||
INSERT INTO t1 VALUES (2,0);
|
||||
SET skip_replication=0;
|
||||
INSERT INTO t1 VALUES (3,0);
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
|
||||
# applied all events.
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
|
||||
let $SLAVE_DATADIR= `select @@datadir`;
|
||||
|
||||
connection master;
|
||||
TRUNCATE t1;
|
||||
|
||||
# Now apply the slave binlog to the master, to check that both the slave
|
||||
# and mysqlbinlog will preserve the @@skip_replication flag.
|
||||
|
||||
--let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001
|
||||
if ($use_remote_mysqlbinlog)
|
||||
{
|
||||
--let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001
|
||||
--let $use_remote_mysqlbinlog= 0
|
||||
}
|
||||
--exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
|
||||
|
||||
# The master should have all three events.
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
|
||||
# The slave should be missing event 2, which is marked with the
|
||||
# @@skip_replication flag.
|
||||
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
|
||||
#
|
||||
# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
|
||||
# events.
|
||||
#
|
||||
|
||||
connection master;
|
||||
TRUNCATE t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
# We will skip two INSERTs (in addition to any skipped due to
|
||||
# @@skip_replication). Since from 5.5 every statement is wrapped in
|
||||
# BEGIN ... END, we need to skip 6 events for this.
|
||||
SET GLOBAL sql_slave_skip_counter=6;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
|
||||
START SLAVE;
|
||||
|
||||
connection master;
|
||||
# Need to fix @@binlog_format to get consistent event count.
|
||||
SET @old_binlog_format= @@binlog_format;
|
||||
SET binlog_format= statement;
|
||||
SET skip_replication=0;
|
||||
INSERT INTO t1 VALUES (1,5);
|
||||
SET skip_replication=1;
|
||||
INSERT INTO t1 VALUES (2,5);
|
||||
SET skip_replication=0;
|
||||
INSERT INTO t1 VALUES (3,5);
|
||||
INSERT INTO t1 VALUES (4,5);
|
||||
SET binlog_format= @old_binlog_format;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
|
||||
# The slave should have skipped the first three inserts (number 1 and 3 due
|
||||
# to @@sql_slave_skip_counter=2, number 2 due to
|
||||
# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
|
||||
# should be left.
|
||||
SELECT * FROM t1;
|
||||
|
||||
|
||||
#
|
||||
# Check that BINLOG statement preserves the @@skip_replication flag.
|
||||
#
|
||||
connection slave;
|
||||
# Need row @@binlog_format for BINLOG statements containing row events.
|
||||
--source include/stop_slave.inc
|
||||
SET @old_slave_binlog_format= @@global.binlog_format;
|
||||
SET GLOBAL binlog_format= row;
|
||||
--source include/start_slave.inc
|
||||
|
||||
connection master;
|
||||
TRUNCATE t1;
|
||||
|
||||
SET @old_binlog_format= @@binlog_format;
|
||||
SET binlog_format= row;
|
||||
# Format description log event.
|
||||
BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAA371saA==';
|
||||
# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
|
||||
BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
|
||||
wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
|
||||
# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
|
||||
BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
|
||||
wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
|
||||
SET binlog_format= @old_binlog_format;
|
||||
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Slave should have only the second insert, the first should be ignored due to
|
||||
# the @@skip_replication flag.
|
||||
SELECT * FROM t1 ORDER by a;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
SET GLOBAL binlog_format= @old_slave_binlog_format;
|
||||
--source include/start_slave.inc
|
||||
|
||||
|
||||
# Test that it is not possible to change @@skip_replication inside a
|
||||
# transaction or statement, thereby replicating only parts of statements
|
||||
# or transactions.
|
||||
connection master;
|
||||
SET skip_replication=0;
|
||||
|
||||
BEGIN;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET skip_replication=0;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET skip_replication=1;
|
||||
ROLLBACK;
|
||||
SET skip_replication=1;
|
||||
BEGIN;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET skip_replication=0;
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET skip_replication=1;
|
||||
COMMIT;
|
||||
SET autocommit=0;
|
||||
INSERT INTO t2(a) VALUES(100);
|
||||
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET skip_replication=1;
|
||||
ROLLBACK;
|
||||
SET autocommit=1;
|
||||
|
||||
SET skip_replication=1;
|
||||
--delimiter |
|
||||
CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
|
||||
CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
|
||||
CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
|
||||
--delimiter ;
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SELECT foo(0);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SELECT baz(0);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET @a= foo(1);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
SET @a= baz(1);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
UPDATE t2 SET b=foo(0);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
UPDATE t2 SET b=baz(0);
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
INSERT INTO t1 VALUES (101, foo(1));
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
|
||||
INSERT INTO t1 VALUES (101, baz(0));
|
||||
SELECT @@skip_replication;
|
||||
CALL bar(0);
|
||||
SELECT @@skip_replication;
|
||||
CALL bar(1);
|
||||
SELECT @@skip_replication;
|
||||
DROP FUNCTION foo;
|
||||
DROP PROCEDURE bar;
|
||||
DROP FUNCTION baz;
|
||||
|
||||
|
||||
# Test that master-side filtering happens on the master side, and that
|
||||
# slave-side filtering happens on the slave.
|
||||
|
||||
# First test that events do not reach the slave when master-side filtering
|
||||
# is configured. Do this by replicating first with only the IO thread running
|
||||
# and master-side filtering; then change to no filtering and start the SQL
|
||||
# thread. This should still skip the events, as master-side filtering
|
||||
# means the events never reached the slave.
|
||||
connection master;
|
||||
SET skip_replication= 0;
|
||||
TRUNCATE t1;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
|
||||
START SLAVE IO_THREAD;
|
||||
connection master;
|
||||
SET skip_replication= 1;
|
||||
INSERT INTO t1(a) VALUES (1);
|
||||
SET skip_replication= 0;
|
||||
INSERT INTO t1(a) VALUES (2);
|
||||
--source include/save_master_pos.inc
|
||||
connection slave;
|
||||
--source include/sync_io_with_master.inc
|
||||
STOP SLAVE IO_THREAD;
|
||||
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Now only the second insert of (2) should be visible, as the first was
|
||||
# filtered on the master, so even though the SQL thread ran without skipping
|
||||
# events, it will never see the event in the first place.
|
||||
SELECT * FROM t1;
|
||||
|
||||
# Now tests that when slave-side filtering is configured, events _do_ reach
|
||||
# the slave.
|
||||
connection master;
|
||||
SET skip_replication= 0;
|
||||
TRUNCATE t1;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
|
||||
START SLAVE IO_THREAD;
|
||||
connection master;
|
||||
SET skip_replication= 1;
|
||||
INSERT INTO t1(a) VALUES (1);
|
||||
SET skip_replication= 0;
|
||||
INSERT INTO t1(a) VALUES (2);
|
||||
--source include/save_master_pos.inc
|
||||
connection slave;
|
||||
--source include/sync_io_with_master.inc
|
||||
STOP SLAVE IO_THREAD;
|
||||
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Now both inserts should be visible. Since filtering was configured to be
|
||||
# slave-side, the event is in the relay log, and when the SQL thread ran we
|
||||
# had disabled filtering again.
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
|
||||
# Clean up.
|
||||
connection master;
|
||||
SET skip_replication=0;
|
||||
DROP TABLE t1,t2;
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
|
||||
START SLAVE;
|
||||
|
||||
--source include/rpl_end.inc
|
32
mysql-test/extra/rpl_tests/rpl_special_charset.inc
Normal file
32
mysql-test/extra/rpl_tests/rpl_special_charset.inc
Normal file
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
|
||||
# Problem: IO thread fails to connect to master if servers are configured with
|
||||
# special character sets like utf16, utf32, ucs2.
|
||||
#
|
||||
# Analysis: MySQL server does not support few special character sets like
|
||||
# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
|
||||
# When IO thread is trying to connect to Master, it sets server's character
|
||||
# set as client's character set. When Slave server is started with these
|
||||
# special character sets, IO thread (a connection to Master) fails because
|
||||
# of the above said reason.
|
||||
#
|
||||
# Fix: If server's character set is not supported as client's character set,
|
||||
# then set default's client character set(latin1) as client's character set.
|
||||
###############################################################################
|
||||
--source include/master-slave.inc
|
||||
call mtr.add_suppression("Cannot use utf16 as character_set_client");
|
||||
CREATE TABLE t1(i VARCHAR(20));
|
||||
INSERT INTO t1 VALUES (0xFFFF);
|
||||
--sync_slave_with_master
|
||||
--let diff_tables=master:t1, slave:t1
|
||||
--source include/diff_tables.inc
|
||||
# Cleanup
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--source include/rpl_end.inc
|
32
mysql-test/extra/rpl_tests/rpl_sporadic_master.inc
Normal file
32
mysql-test/extra/rpl_tests/rpl_sporadic_master.inc
Normal file
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
# test to see if replication can continue when master sporadically fails on
|
||||
# COM_BINLOG_DUMP and additionally limits the number of events per dump
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table t2(n int);
|
||||
create table t1(n int not null auto_increment primary key);
|
||||
insert into t1 values (NULL),(NULL);
|
||||
truncate table t1;
|
||||
# We have to use 4 in the following to make this test work with all table types
|
||||
insert into t1 values (4),(NULL);
|
||||
sync_slave_with_master;
|
||||
--source include/stop_slave.inc
|
||||
--source include/start_slave.inc
|
||||
connection master;
|
||||
insert into t1 values (NULL),(NULL);
|
||||
flush logs;
|
||||
truncate table t1;
|
||||
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
sync_slave_with_master;
|
||||
select * from t1 ORDER BY n;
|
||||
connection master;
|
||||
drop table t1,t2;
|
||||
sync_slave_with_master;
|
||||
|
||||
--source include/rpl_end.inc
|
115
mysql-test/extra/rpl_tests/rpl_ssl.inc
Normal file
115
mysql-test/extra/rpl_tests/rpl_ssl.inc
Normal file
|
@ -0,0 +1,115 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
source include/have_ssl_communication.inc;
|
||||
source include/master-slave.inc;
|
||||
|
||||
# create a user for replication that requires ssl encryption
|
||||
connection master;
|
||||
create user replssl@localhost;
|
||||
grant replication slave on *.* to replssl@localhost require ssl;
|
||||
create table t1 (t int auto_increment, KEY(t));
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
# Set slave to use SSL for connection to master
|
||||
stop slave;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval change master to
|
||||
master_user='replssl',
|
||||
master_password='',
|
||||
master_ssl=1,
|
||||
master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
|
||||
master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
|
||||
master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
|
||||
start slave;
|
||||
|
||||
# Switch to master and insert one record, then sync it to slave
|
||||
connection master;
|
||||
insert into t1 values(1);
|
||||
sync_slave_with_master;
|
||||
|
||||
# The record should now be on slave
|
||||
select * from t1;
|
||||
|
||||
# The slave is synced and waiting/reading from master
|
||||
# SHOW SLAVE STATUS will show "Waiting for master to send event"
|
||||
let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Cert, Master_SSL_Key;
|
||||
source include/show_slave_status.inc;
|
||||
source include/check_slave_is_running.inc;
|
||||
|
||||
# Stop the slave, as reported in bug#21871 it would hang
|
||||
STOP SLAVE;
|
||||
|
||||
select * from t1;
|
||||
|
||||
# Do the same thing a number of times
|
||||
disable_query_log;
|
||||
disable_result_log;
|
||||
# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
|
||||
# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
|
||||
# red trees.
|
||||
disable_parsing;
|
||||
let $i= 100;
|
||||
while ($i)
|
||||
{
|
||||
start slave;
|
||||
connection master;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1; # Some variance
|
||||
connection slave;
|
||||
select * from t1; # Some variance
|
||||
stop slave;
|
||||
dec $i;
|
||||
}
|
||||
enable_parsing;
|
||||
START SLAVE;
|
||||
enable_query_log;
|
||||
enable_result_log;
|
||||
connection master;
|
||||
# INSERT one more record to make sure
|
||||
# the sync has something to do
|
||||
insert into t1 values (NULL);
|
||||
let $master_count= `select count(*) from t1`;
|
||||
|
||||
sync_slave_with_master;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
source include/show_slave_status.inc;
|
||||
source include/check_slave_is_running.inc;
|
||||
|
||||
let $slave_count= `select count(*) from t1`;
|
||||
|
||||
if ($slave_count != $master_count)
|
||||
{
|
||||
echo master and slave differed in number of rows;
|
||||
echo master: $master_count;
|
||||
echo slave: $slave_count;
|
||||
|
||||
connection master;
|
||||
select count(*) t1;
|
||||
select * from t1;
|
||||
connection slave;
|
||||
select count(*) t1;
|
||||
select * from t1;
|
||||
query_vertical show slave status;
|
||||
}
|
||||
|
||||
connection master;
|
||||
drop user replssl@localhost;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
CHANGE MASTER TO
|
||||
master_user = 'root',
|
||||
master_ssl = 0,
|
||||
master_ssl_ca = '',
|
||||
master_ssl_cert = '',
|
||||
master_ssl_key = '';
|
||||
|
||||
--echo End of 5.0 tests
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
107
mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc
Normal file
107
mysql-test/extra/rpl_tests/rpl_stm_relay_ign_space.inc
Normal file
|
@ -0,0 +1,107 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#
|
||||
# BUG#12400313 / BUG#64503 test case
|
||||
#
|
||||
#
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# This test case starts the slave server with:
|
||||
# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
|
||||
#
|
||||
# Then it issues some queries that will cause the slave to reach
|
||||
# relay-log-space-limit. We lock the table so that the SQL thread is
|
||||
# not able to purge the log and then we issue some more statements.
|
||||
#
|
||||
# The purpose is to show that the IO thread will honor the limits
|
||||
# while the SQL thread is not able to purge the relay logs, which did
|
||||
# not happen before this patch. In addition we assert that while
|
||||
# ignoring the limit (SQL thread needs to rotate before purging), the
|
||||
# IO thread does not do it in an uncontrolled manner.
|
||||
|
||||
--source include/have_binlog_format_statement.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
# wait for the SQL thread to sleep
|
||||
--let $show_statement= SHOW PROCESSLIST
|
||||
--let $field= State
|
||||
--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# now the io thread has set rli->ignore_space_limit
|
||||
# lets lock the table so that once the SQL thread awakes
|
||||
# it blocks there and does not set rli->ignore_space_limit
|
||||
# back to zero
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
# now issue more statements that will overflow the
|
||||
# rli->log_space_limit (in this case ~10K)
|
||||
--connection master
|
||||
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
|
||||
--connection slave
|
||||
|
||||
# ASSERT that the IO thread waits for the SQL thread to release some
|
||||
# space before continuing
|
||||
--let $show_statement= SHOW PROCESSLIST
|
||||
--let $field= State
|
||||
--let $condition= LIKE 'Waiting for %'
|
||||
# before the patch (IO would have transfered everything)
|
||||
#--let $condition= = 'Waiting for master to send event'
|
||||
# after the patch (now it waits for space to be freed)
|
||||
#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# without the patch we can uncomment the following two lines and
|
||||
# watch the IO thread synchronize with the master, thus writing
|
||||
# relay logs way over the space limit
|
||||
#--connection master
|
||||
#--source include/sync_slave_io_with_master.inc
|
||||
|
||||
## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
|
||||
--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
|
||||
--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
|
||||
--let $assert_text= Assert that relay log space is close to the limit
|
||||
--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
|
||||
--source include/assert.inc
|
||||
|
||||
# unlock the table and let SQL thread continue applying events
|
||||
UNLOCK TABLES;
|
||||
|
||||
--connection master
|
||||
--sync_slave_with_master
|
||||
--let $diff_tables=master:test.t1,slave:test.t1
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/rpl_end.inc
|
631
mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc
Normal file
631
mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc
Normal file
|
@ -0,0 +1,631 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
#
|
||||
# rpl_switch_stm_row_mixed tests covers
|
||||
#
|
||||
# - Master is switching explicitly between STATEMENT, ROW, and MIXED
|
||||
# binlog format showing when it is possible and when not.
|
||||
# - Master switching from MIXED to RBR implicitly listing all use
|
||||
# cases, e.g a query invokes UUID(), thereafter to serve as the
|
||||
# definition of MIXED binlog format
|
||||
# - correctness of execution
|
||||
|
||||
|
||||
-- source include/have_binlog_format_mixed_or_row.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
# Since this test generates row-based events in the binary log, the
|
||||
# slave SQL thread cannot be in STATEMENT mode to execute this test,
|
||||
# so we only execute it for MIXED and ROW as default value of
|
||||
# BINLOG_FORMAT.
|
||||
|
||||
connection slave;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest1;
|
||||
create database mysqltest1;
|
||||
--enable_warnings
|
||||
use mysqltest1;
|
||||
|
||||
# Save binlog format
|
||||
set @my_binlog_format= @@global.binlog_format;
|
||||
|
||||
# play with switching
|
||||
set session binlog_format=mixed;
|
||||
show session variables like "binlog_format%";
|
||||
set session binlog_format=statement;
|
||||
show session variables like "binlog_format%";
|
||||
set session binlog_format=row;
|
||||
show session variables like "binlog_format%";
|
||||
|
||||
set global binlog_format=DEFAULT;
|
||||
show global variables like "binlog_format%";
|
||||
set global binlog_format=MIXED;
|
||||
show global variables like "binlog_format%";
|
||||
set global binlog_format=STATEMENT;
|
||||
show global variables like "binlog_format%";
|
||||
set global binlog_format=ROW;
|
||||
show global variables like "binlog_format%";
|
||||
show session variables like "binlog_format%";
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
|
||||
CREATE TABLE t1 (a varchar(100));
|
||||
|
||||
prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
|
||||
set @string="emergency_1_";
|
||||
insert into t1 values("work_2_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values(concat(UUID(),"work_3_"));
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
insert into t1 values(concat("for_4_",UUID()));
|
||||
insert into t1 select "yesterday_5_";
|
||||
|
||||
# verify that temp tables prevent a switch to SBR
|
||||
create temporary table tmp(a char(100));
|
||||
insert into tmp values("see_6_");
|
||||
--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
|
||||
set binlog_format=statement;
|
||||
insert into t1 select * from tmp;
|
||||
drop temporary table tmp;
|
||||
|
||||
# Now we go to SBR
|
||||
set binlog_format=statement;
|
||||
show global variables like "binlog_format%";
|
||||
show session variables like "binlog_format%";
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
set global binlog_format=statement;
|
||||
show global variables like "binlog_format%";
|
||||
show session variables like "binlog_format%";
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
set @string="emergency_7_";
|
||||
insert into t1 values("work_8_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values("work_9_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
insert into t1 values("for_10_");
|
||||
insert into t1 select "yesterday_11_";
|
||||
|
||||
# test statement (is not default after wl#3368)
|
||||
set binlog_format=statement;
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
set global binlog_format=statement;
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
set @string="emergency_12_";
|
||||
insert into t1 values("work_13_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values("work_14_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
insert into t1 values("for_15_");
|
||||
insert into t1 select "yesterday_16_";
|
||||
|
||||
# and now the mixed mode
|
||||
|
||||
set global binlog_format=mixed;
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
set binlog_format=default;
|
||||
select @@global.binlog_format, @@session.binlog_format;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
|
||||
set @string="emergency_17_";
|
||||
insert into t1 values("work_18_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values(concat(UUID(),"work_19_"));
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
insert into t1 values(concat("for_20_",UUID()));
|
||||
insert into t1 select "yesterday_21_";
|
||||
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values(concat(UUID(),"work_22_"));
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
insert into t1 values(concat("for_23_",UUID()));
|
||||
insert into t1 select "yesterday_24_";
|
||||
|
||||
# Test of CREATE TABLE SELECT
|
||||
|
||||
create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
|
||||
create table t3 select 1 union select UUID();
|
||||
--disable_warnings
|
||||
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
|
||||
--enable_warnings
|
||||
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
|
||||
# what if UUID() is first:
|
||||
--disable_warnings
|
||||
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
|
||||
--enable_warnings
|
||||
|
||||
# inside a stored procedure
|
||||
|
||||
delimiter |;
|
||||
create procedure foo()
|
||||
begin
|
||||
insert into t1 values("work_25_");
|
||||
insert into t1 values(concat("for_26_",UUID()));
|
||||
insert into t1 select "yesterday_27_";
|
||||
end|
|
||||
create procedure foo2()
|
||||
begin
|
||||
insert into t1 values(concat("emergency_28_",UUID()));
|
||||
insert into t1 values("work_29_");
|
||||
insert into t1 values(concat("for_30_",UUID()));
|
||||
set session binlog_format=row; # accepted for stored procs
|
||||
insert into t1 values("more work_31_");
|
||||
set session binlog_format=mixed;
|
||||
end|
|
||||
create function foo3() returns bigint unsigned
|
||||
begin
|
||||
set session binlog_format=row; # rejected for stored funcs
|
||||
insert into t1 values("alarm");
|
||||
return 100;
|
||||
end|
|
||||
create procedure foo4(x varchar(100))
|
||||
begin
|
||||
insert into t1 values(concat("work_250_",x));
|
||||
insert into t1 select "yesterday_270_";
|
||||
end|
|
||||
delimiter ;|
|
||||
call foo();
|
||||
call foo2();
|
||||
call foo4("hello");
|
||||
call foo4(UUID());
|
||||
call foo4("world");
|
||||
|
||||
# test that can't SET in a stored function
|
||||
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
|
||||
select foo3();
|
||||
select * from t1 where a="alarm";
|
||||
|
||||
# Tests of stored functions/triggers/views for BUG#20930 "Mixed
|
||||
# binlogging mode does not work with stored functions, triggers,
|
||||
# views"
|
||||
|
||||
# Function which calls procedure
|
||||
drop function foo3;
|
||||
delimiter |;
|
||||
create function foo3() returns bigint unsigned
|
||||
begin
|
||||
insert into t1 values("foo3_32_");
|
||||
call foo();
|
||||
return 100;
|
||||
end|
|
||||
delimiter ;|
|
||||
insert into t2 select foo3();
|
||||
|
||||
prepare stmt1 from 'insert into t2 select foo3()';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
# Test if stored function calls stored function which calls procedure
|
||||
# which requires row-based.
|
||||
|
||||
delimiter |;
|
||||
create function foo4() returns bigint unsigned
|
||||
begin
|
||||
insert into t2 select foo3();
|
||||
return 100;
|
||||
end|
|
||||
delimiter ;|
|
||||
select foo4();
|
||||
|
||||
prepare stmt1 from 'select foo4()';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
# A simple stored function
|
||||
delimiter |;
|
||||
create function foo5() returns bigint unsigned
|
||||
begin
|
||||
insert into t2 select UUID();
|
||||
return 100;
|
||||
end|
|
||||
delimiter ;|
|
||||
select foo5();
|
||||
|
||||
prepare stmt1 from 'select foo5()';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
# A simple stored function where UUID() is in the argument
|
||||
delimiter |;
|
||||
create function foo6(x varchar(100)) returns bigint unsigned
|
||||
begin
|
||||
insert into t2 select x;
|
||||
return 100;
|
||||
end|
|
||||
delimiter ;|
|
||||
select foo6("foo6_1_");
|
||||
select foo6(concat("foo6_2_",UUID()));
|
||||
|
||||
prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
|
||||
# Test of views using UUID()
|
||||
|
||||
create view v1 as select uuid();
|
||||
create table t11 (data varchar(255));
|
||||
insert into t11 select * from v1;
|
||||
# Test of querying INFORMATION_SCHEMA which parses the view's body,
|
||||
# to verify that it binlogs statement-based (is not polluted by
|
||||
# the parsing of the view's body).
|
||||
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
|
||||
prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
|
||||
execute stmt1;
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
|
||||
# Test of triggers with UUID()
|
||||
delimiter |;
|
||||
create trigger t11_bi before insert on t11 for each row
|
||||
begin
|
||||
set NEW.data = concat(NEW.data,UUID());
|
||||
end|
|
||||
delimiter ;|
|
||||
insert into t11 values("try_560_");
|
||||
|
||||
# Test that INSERT DELAYED works in mixed mode (BUG#20649)
|
||||
insert delayed into t2 values("delay_1_");
|
||||
insert delayed into t2 values(concat("delay_2_",UUID()));
|
||||
insert delayed into t2 values("delay_6_");
|
||||
|
||||
# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
|
||||
# replicate fine in statement-based ; we test that in mixed mode it
|
||||
# works).
|
||||
insert delayed into t2 values(rand());
|
||||
set @a=2.345;
|
||||
insert delayed into t2 values(@a);
|
||||
|
||||
# With INSERT DELAYED, rows are written to the binlog after they are
|
||||
# written to the table. Therefore, it is not enough to wait until the
|
||||
# rows make it to t2 on the master (the rows may not be in the binlog
|
||||
# at that time, and may still not be in the binlog when
|
||||
# sync_slave_with_master is later called). Instead, we wait until the
|
||||
# rows make it to t2 on the slave. We first call
|
||||
# sync_slave_with_master, so that we are sure that t2 has been created
|
||||
# on the slave.
|
||||
sync_slave_with_master;
|
||||
let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
|
||||
--source include/wait_condition.inc
|
||||
connection master;
|
||||
|
||||
# If you want to do manual testing of the mixed mode regarding UDFs (not
|
||||
# testable automatically as quite platform- and compiler-dependent),
|
||||
# you just need to set the variable below to 1, and to
|
||||
# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
|
||||
# MYSQL_TEST_DIR/lib/mysql.
|
||||
let $you_want_to_test_UDF=0;
|
||||
if ($you_want_to_test_UDF)
|
||||
{
|
||||
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
|
||||
prepare stmt1 from 'insert into t1 select metaphon(?)';
|
||||
set @string="emergency_133_";
|
||||
insert into t1 values("work_134_");
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
prepare stmt1 from 'insert into t1 select ?';
|
||||
insert into t1 values(metaphon("work_135_"));
|
||||
execute stmt1 using @string;
|
||||
deallocate prepare stmt1;
|
||||
insert into t1 values(metaphon("for_136_"));
|
||||
insert into t1 select "yesterday_137_";
|
||||
create table t6 select metaphon("for_138_");
|
||||
create table t7 select 1 union select metaphon("for_139_");
|
||||
create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
|
||||
create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
|
||||
}
|
||||
|
||||
create table t20 select * from t1; # save for comparing later
|
||||
create table t21 select * from t2;
|
||||
create table t22 select * from t3;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
# This tests the fix to
|
||||
# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
|
||||
# We verify that under the mixed binlog mode, a stored function
|
||||
# modifying at least two tables having an auto_increment column,
|
||||
# is binlogged row-based. Indeed in statement-based binlogging,
|
||||
# only the auto_increment value generated for the first table
|
||||
# is recorded in the binlog, the value generated for the 2nd table
|
||||
# lacking.
|
||||
|
||||
create table t1 (a int primary key auto_increment, b varchar(100));
|
||||
create table t2 (a int primary key auto_increment, b varchar(100));
|
||||
create table t3 (b varchar(100));
|
||||
delimiter |;
|
||||
create function f (x varchar(100)) returns int deterministic
|
||||
begin
|
||||
insert into t1 values(null,x);
|
||||
insert into t2 values(null,x);
|
||||
return 1;
|
||||
end|
|
||||
delimiter ;|
|
||||
select f("try_41_");
|
||||
# Two operations which compensate each other except that their net
|
||||
# effect is that they advance the auto_increment counter of t2 on slave:
|
||||
sync_slave_with_master;
|
||||
use mysqltest1;
|
||||
insert into t2 values(2,null),(3,null),(4,null);
|
||||
delete from t2 where a>=2;
|
||||
|
||||
connection master;
|
||||
# this is the call which didn't replicate well
|
||||
select f("try_42_");
|
||||
sync_slave_with_master;
|
||||
|
||||
# now use prepared statement and test again, just to see that the RBB
|
||||
# mode isn't set at PREPARE but at EXECUTE.
|
||||
|
||||
insert into t2 values(3,null),(4,null);
|
||||
delete from t2 where a>=3;
|
||||
|
||||
connection master;
|
||||
prepare stmt1 from 'select f(?)';
|
||||
set @string="try_43_";
|
||||
insert into t1 values(null,"try_44_"); # should be SBB
|
||||
execute stmt1 using @string; # should be RBB
|
||||
deallocate prepare stmt1;
|
||||
sync_slave_with_master;
|
||||
|
||||
# verify that if only one table has auto_inc, it does not trigger RBB
|
||||
# (we'll check in binlog further below)
|
||||
|
||||
connection master;
|
||||
create table t12 select * from t1; # save for comparing later
|
||||
drop table t1;
|
||||
create table t1 (a int, b varchar(100), key(a));
|
||||
select f("try_45_");
|
||||
|
||||
# restore table's key
|
||||
create table t13 select * from t1;
|
||||
drop table t1;
|
||||
create table t1 (a int primary key auto_increment, b varchar(100));
|
||||
|
||||
# now test if it's two functions, each of them inserts in one table
|
||||
|
||||
drop function f;
|
||||
# we need a unique key to have sorting of rows by mysqldump
|
||||
create table t14 (unique (a)) select * from t2;
|
||||
truncate table t2;
|
||||
delimiter |;
|
||||
create function f1 (x varchar(100)) returns int deterministic
|
||||
begin
|
||||
insert into t1 values(null,x);
|
||||
return 1;
|
||||
end|
|
||||
create function f2 (x varchar(100)) returns int deterministic
|
||||
begin
|
||||
insert into t2 values(null,x);
|
||||
return 1;
|
||||
end|
|
||||
delimiter ;|
|
||||
select f1("try_46_"),f2("try_47_");
|
||||
|
||||
sync_slave_with_master;
|
||||
insert into t2 values(2,null),(3,null),(4,null);
|
||||
delete from t2 where a>=2;
|
||||
|
||||
connection master;
|
||||
# Test with SELECT and INSERT
|
||||
select f1("try_48_"),f2("try_49_");
|
||||
insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
|
||||
sync_slave_with_master;
|
||||
|
||||
# verify that if f2 does only read on an auto_inc table, this does not
|
||||
# switch to RBB
|
||||
connection master;
|
||||
drop function f2;
|
||||
delimiter |;
|
||||
create function f2 (x varchar(100)) returns int deterministic
|
||||
begin
|
||||
declare y int;
|
||||
insert into t1 values(null,x);
|
||||
set y = (select count(*) from t2);
|
||||
return y;
|
||||
end|
|
||||
delimiter ;|
|
||||
select f1("try_53_"),f2("try_54_");
|
||||
sync_slave_with_master;
|
||||
|
||||
# And now, a normal statement with a trigger (no stored functions)
|
||||
|
||||
connection master;
|
||||
drop function f2;
|
||||
delimiter |;
|
||||
create trigger t1_bi before insert on t1 for each row
|
||||
begin
|
||||
insert into t2 values(null,"try_55_");
|
||||
end|
|
||||
delimiter ;|
|
||||
insert into t1 values(null,"try_56_");
|
||||
# and now remove one auto_increment and verify SBB
|
||||
alter table t1 modify a int, drop primary key;
|
||||
insert into t1 values(null,"try_57_");
|
||||
sync_slave_with_master;
|
||||
|
||||
# Test for BUG#20499 "mixed mode with temporary table breaks binlog"
|
||||
# Slave used to have only 2 rows instead of 3.
|
||||
connection master;
|
||||
CREATE TEMPORARY TABLE t15 SELECT UUID();
|
||||
create table t16 like t15;
|
||||
INSERT INTO t16 SELECT * FROM t15;
|
||||
# we'll verify that this one is done RBB
|
||||
insert into t16 values("try_65_");
|
||||
drop table t15;
|
||||
# we'll verify that this one is done SBB
|
||||
insert into t16 values("try_66_");
|
||||
sync_slave_with_master;
|
||||
|
||||
# and now compare:
|
||||
|
||||
connection master;
|
||||
|
||||
# first check that data on master is sensible
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
select count(*) from t11;
|
||||
select count(*) from t20;
|
||||
select count(*) from t21;
|
||||
select count(*) from t22;
|
||||
select count(*) from t12;
|
||||
select count(*) from t13;
|
||||
select count(*) from t14;
|
||||
select count(*) from t16;
|
||||
if ($you_want_to_test_UDF)
|
||||
{
|
||||
select count(*) from t6;
|
||||
select count(*) from t7;
|
||||
select count(*) from t8;
|
||||
select count(*) from t9;
|
||||
}
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug#20863 If binlog format is changed between update and unlock of
|
||||
# tables, wrong binlog
|
||||
#
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS t11;
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
||||
CREATE TABLE t11 (song VARCHAR(255));
|
||||
LOCK TABLES t11 WRITE;
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
||||
INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
||||
INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
|
||||
UNLOCK TABLES;
|
||||
|
||||
--query_vertical SELECT * FROM t11
|
||||
sync_slave_with_master;
|
||||
USE mysqltest1;
|
||||
--query_vertical SELECT * FROM t11
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS t12;
|
||||
SET SESSION BINLOG_FORMAT=MIXED;
|
||||
CREATE TABLE t12 (data LONG);
|
||||
LOCK TABLES t12 WRITE;
|
||||
INSERT INTO t12 VALUES(UUID());
|
||||
UNLOCK TABLES;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# BUG#28086: SBR of USER() becomes corrupted on slave
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
# Just to get something that is non-trivial, albeit still simple, we
|
||||
# stuff the result of USER() and CURRENT_USER() into a variable.
|
||||
--delimiter $$
|
||||
CREATE FUNCTION my_user()
|
||||
RETURNS CHAR(64)
|
||||
BEGIN
|
||||
DECLARE user CHAR(64);
|
||||
SELECT USER() INTO user;
|
||||
RETURN user;
|
||||
END $$
|
||||
--delimiter ;
|
||||
|
||||
--delimiter $$
|
||||
CREATE FUNCTION my_current_user()
|
||||
RETURNS CHAR(64)
|
||||
BEGIN
|
||||
DECLARE user CHAR(64);
|
||||
SELECT CURRENT_USER() INTO user;
|
||||
RETURN user;
|
||||
END $$
|
||||
--delimiter ;
|
||||
|
||||
DROP TABLE IF EXISTS t13;
|
||||
CREATE TABLE t13 (data CHAR(64));
|
||||
INSERT INTO t13 VALUES (USER());
|
||||
INSERT INTO t13 VALUES (my_user());
|
||||
INSERT INTO t13 VALUES (CURRENT_USER());
|
||||
INSERT INTO t13 VALUES (my_current_user());
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
|
||||
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
|
||||
|
||||
# Let's compare. Note: If they match test will pass, if they do not match
|
||||
# the test will show that the diff statement failed and not reject file
|
||||
# will be created. You will need to go to the mysql-test dir and diff
|
||||
# the files your self to see what is not matching
|
||||
|
||||
diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
|
||||
|
||||
connection master;
|
||||
|
||||
# Now test that mysqlbinlog works fine on a binlog generated by the
|
||||
# mixed mode
|
||||
|
||||
# BUG#11312 "DELIMITER is not written to the binary log that causes
|
||||
# syntax error" makes that mysqlbinlog will fail if we pass it the
|
||||
# text of queries; this forces us to use --base64-output here.
|
||||
|
||||
# BUG#20929 "BINLOG command causes invalid free plus assertion
|
||||
# failure" makes mysqld segfault when receiving --base64-output
|
||||
|
||||
# So I can't enable this piece of test
|
||||
# SIGH
|
||||
|
||||
if ($enable_when_11312_or_20929_fixed)
|
||||
{
|
||||
--exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
|
||||
drop database mysqltest1;
|
||||
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
|
||||
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
|
||||
# the old mysqldump output on slave is the same as what it was on
|
||||
# master before restoring on master.
|
||||
diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
|
||||
}
|
||||
|
||||
drop database mysqltest1;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
# Restore binlog format setting
|
||||
set global binlog_format =@my_binlog_format;
|
||||
--source include/rpl_end.inc
|
159
mysql-test/extra/rpl_tests/rpl_sync.inc
Normal file
159
mysql-test/extra/rpl_tests/rpl_sync.inc
Normal file
|
@ -0,0 +1,159 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
########################################################################################
|
||||
# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
|
||||
# crashing the slave in two different situations:
|
||||
# (case-1) - Corrupt the relay log with changes which were not processed by
|
||||
# the SQL Thread and crashes it.
|
||||
# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
|
||||
#
|
||||
# Case 1:
|
||||
# 1 - Stops the SQL Thread
|
||||
# 2 - Inserts new records into the master.
|
||||
# 3 - Corrupts the relay-log.bin* which most likely has such changes.
|
||||
# 4 - Crashes the slave
|
||||
# 5 - Verifies if the slave is sync with the master which means that the information
|
||||
# loss was circumvented by the recovery process.
|
||||
#
|
||||
# Case 2:
|
||||
# 1 - Stops the SQL/IO Threads
|
||||
# 2 - Inserts new records into the master.
|
||||
# 3 - Corrupts the master.info with wrong coordinates.
|
||||
# 4 - Crashes the slave
|
||||
# 5 - Verifies if the slave is sync with the master which means that the information
|
||||
# loss was circumvented by the recovery process.
|
||||
########################################################################################
|
||||
|
||||
########################################################################################
|
||||
# Configuring the environment
|
||||
########################################################################################
|
||||
--echo =====Configuring the enviroment=======;
|
||||
--source include/master-slave.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_valgrind.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
call mtr.add_suppression('Attempting backtrace');
|
||||
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
|
||||
# Use innodb so we do not get "table should be repaired" issues.
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
flush tables;
|
||||
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
|
||||
|
||||
insert into t1(a) values(1);
|
||||
insert into t1(a) values(2);
|
||||
insert into t1(a) values(3);
|
||||
|
||||
########################################################################################
|
||||
# Case 1: Corrupt a relay-log.bin*
|
||||
########################################################################################
|
||||
--echo =====Inserting data on the master but without the SQL Thread being running=======;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
|
||||
--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
|
||||
--source include/stop_slave_sql.inc
|
||||
|
||||
connection master;
|
||||
insert into t1(a) values(4);
|
||||
insert into t1(a) values(5);
|
||||
insert into t1(a) values(6);
|
||||
|
||||
--echo =====Removing relay log files and crashing/recoverying the slave=======;
|
||||
connection slave;
|
||||
--source include/stop_slave_io.inc
|
||||
|
||||
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
|
||||
|
||||
--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
|
||||
perl;
|
||||
$file= $ENV{'FILE_TO_CORRUPT'};
|
||||
open(FILE, ">$file") || die "Unable to open $file.";
|
||||
truncate(FILE,0);
|
||||
print FILE "failure";
|
||||
close ($file);
|
||||
EOF
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
|
||||
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
|
||||
--error 2013
|
||||
FLUSH LOGS;
|
||||
|
||||
--let $rpl_server_number= 2
|
||||
--source include/rpl_reconnect.inc
|
||||
|
||||
--echo =====Dumping and comparing tables=======;
|
||||
--source include/start_slave.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:t1,slave:t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
########################################################################################
|
||||
# Case 2: Corrupt a master.info
|
||||
########################################################################################
|
||||
--echo =====Corrupting the master.info=======;
|
||||
connection slave;
|
||||
--source include/stop_slave.inc
|
||||
|
||||
connection master;
|
||||
FLUSH LOGS;
|
||||
|
||||
insert into t1(a) values(7);
|
||||
insert into t1(a) values(8);
|
||||
insert into t1(a) values(9);
|
||||
|
||||
connection slave;
|
||||
let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
|
||||
|
||||
--perl
|
||||
use strict;
|
||||
use warnings;
|
||||
my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
|
||||
my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
|
||||
open(FILE, "<", $src) or die;
|
||||
my @content= <FILE>;
|
||||
close FILE;
|
||||
open(FILE, ">", $dst) or die;
|
||||
binmode FILE;
|
||||
print FILE @content;
|
||||
close FILE;
|
||||
EOF
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
|
||||
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
|
||||
--error 2013
|
||||
FLUSH LOGS;
|
||||
|
||||
--let $rpl_server_number= 2
|
||||
--source include/rpl_reconnect.inc
|
||||
|
||||
--echo =====Dumping and comparing tables=======;
|
||||
--source include/start_slave.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_tables=master:t1,slave:t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
########################################################################################
|
||||
# Clean up
|
||||
########################################################################################
|
||||
--echo =====Clean up=======;
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
|
||||
--source include/rpl_end.inc
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
--source include/master-slave.inc
|
||||
|
||||
if ($force_master_mysql56_temporal_format)
|
||||
{
|
||||
connection master;
|
||||
eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
|
||||
}
|
||||
|
||||
if ($force_slave_mysql56_temporal_format)
|
||||
{
|
||||
connection slave;
|
||||
eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
|
||||
}
|
||||
|
||||
connection master;
|
||||
SELECT @@global.mysql56_temporal_format AS on_master;
|
||||
connection slave;
|
||||
SELECT @@global.mysql56_temporal_format AS on_slave;
|
||||
connection master;
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c0 TIME(0),
|
||||
c1 TIME(1),
|
||||
c2 TIME(2),
|
||||
c3 TIME(3),
|
||||
c4 TIME(4),
|
||||
c5 TIME(5),
|
||||
c6 TIME(6)
|
||||
);
|
||||
CREATE TABLE t2
|
||||
(
|
||||
c0 TIMESTAMP(0),
|
||||
c1 TIMESTAMP(1),
|
||||
c2 TIMESTAMP(2),
|
||||
c3 TIMESTAMP(3),
|
||||
c4 TIMESTAMP(4),
|
||||
c5 TIMESTAMP(5),
|
||||
c6 TIMESTAMP(6)
|
||||
);
|
||||
|
||||
CREATE TABLE t3
|
||||
(
|
||||
c0 DATETIME(0),
|
||||
c1 DATETIME(1),
|
||||
c2 DATETIME(2),
|
||||
c3 DATETIME(3),
|
||||
c4 DATETIME(4),
|
||||
c5 DATETIME(5),
|
||||
c6 DATETIME(6)
|
||||
);
|
||||
INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
|
||||
INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
|
||||
INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
|
||||
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
--query_vertical SELECT * FROM t1;
|
||||
--query_vertical SELECT * FROM t2;
|
||||
--query_vertical SELECT * FROM t3;
|
||||
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
|
||||
connection slave;
|
||||
SET @@global.mysql56_temporal_format=DEFAULT;
|
||||
connection master;
|
||||
SET @@global.mysql56_temporal_format=DEFAULT;
|
||||
|
||||
--source include/rpl_end.inc
|
78
mysql-test/extra/rpl_tests/rpl_typeconv.inc
Normal file
78
mysql-test/extra/rpl_tests/rpl_typeconv.inc
Normal file
|
@ -0,0 +1,78 @@
|
|||
#
|
||||
# This include file is used by more than one test suite
|
||||
# (currently rpl and binlog_encryption suite).
|
||||
# Please check all dependent tests after modifying it
|
||||
#
|
||||
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
connection slave;
|
||||
set @saved_slave_type_conversions = @@global.slave_type_conversions;
|
||||
CREATE TABLE type_conversions (
|
||||
TestNo INT AUTO_INCREMENT PRIMARY KEY,
|
||||
Source TEXT,
|
||||
Target TEXT,
|
||||
Flags TEXT,
|
||||
On_Master TEXT,
|
||||
On_Slave TEXT,
|
||||
Expected TEXT,
|
||||
Compare INT,
|
||||
Error TEXT);
|
||||
|
||||
SELECT @@global.slave_type_conversions;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
||||
SELECT @@global.slave_type_conversions;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||
SELECT @@global.slave_type_conversions;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||
SELECT @@global.slave_type_conversions;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||
SELECT @@global.slave_type_conversions;
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
|
||||
SELECT @@global.slave_type_conversions;
|
||||
|
||||
# Checking strict interpretation of type conversions
|
||||
connection slave;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
||||
source extra/rpl_tests/type_conversions.test;
|
||||
|
||||
# Checking lossy integer type conversions
|
||||
connection slave;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||
source extra/rpl_tests/type_conversions.test;
|
||||
|
||||
# Checking non-lossy integer type conversions
|
||||
connection slave;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||
source extra/rpl_tests/type_conversions.test;
|
||||
|
||||
# Checking all type conversions
|
||||
connection slave;
|
||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||
source extra/rpl_tests/type_conversions.test;
|
||||
|
||||
connection slave;
|
||||
--echo **** Result of conversions ****
|
||||
disable_query_log;
|
||||
SELECT RPAD(Source, 15, ' ') AS Source_Type,
|
||||
RPAD(Target, 15, ' ') AS Target_Type,
|
||||
RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
|
||||
IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
|
||||
IF(Compare, '<Correct value>',
|
||||
CONCAT("'", On_Slave, "' != '", Expected, "'")))
|
||||
AS Value_On_Slave
|
||||
FROM type_conversions;
|
||||
enable_query_log;
|
||||
DROP TABLE type_conversions;
|
||||
|
||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
set global slave_type_conversions = @saved_slave_type_conversions;
|
||||
|
||||
--source include/rpl_end.inc
|
59
mysql-test/extra/table_index_statistics.inc
Normal file
59
mysql-test/extra/table_index_statistics.inc
Normal file
|
@ -0,0 +1,59 @@
|
|||
# include file to test index and table statstics for specific storage engine
|
||||
# requires includer set the default strorage engine for the session
|
||||
|
||||
# Bug 602047 (wrong rows_read value)
|
||||
|
||||
FLUSH INDEX_STATISTICS;
|
||||
FLUSH TABLE_STATISTICS;
|
||||
|
||||
SET @userstat_old= @@userstat;
|
||||
SET GLOBAL userstat=ON;
|
||||
|
||||
CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
|
||||
|
||||
# Test that FLUSH clears one table but not another
|
||||
|
||||
FLUSH TABLE_STATISTICS;
|
||||
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
|
||||
|
||||
# Test that FLUSH clears both tables now
|
||||
|
||||
FLUSH INDEX_STATISTICS;
|
||||
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
|
||||
|
||||
# Test that stats are collected after the FLUSH again
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
|
||||
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Bug 1183625 (handler::update_global_table_stats crash).
|
||||
|
||||
CREATE TABLE t2 (c1 INT UNSIGNED);
|
||||
|
||||
ALTER TABLE t2 MODIFY c1 FLOAT;
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
# Bug 1183625 (handler::update_global_table_stats crash).
|
||||
|
||||
CREATE TABLE t2 (c1 INT UNSIGNED);
|
||||
|
||||
ALTER TABLE t2 MODIFY c1 FLOAT;
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
SET GLOBAL userstat= @userstat_old;
|
|
@ -21,8 +21,8 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
let $binlog_start_pos=256;
|
||||
--disable_query_log
|
||||
SET @binlog_start_pos=256;
|
||||
set @binlog_start_pos=256 + @@encrypt_binlog * (36 + (@@binlog_checksum != 'NONE') * 4);
|
||||
--enable_query_log
|
||||
let $binlog_start_pos=`select @binlog_start_pos`;
|
||||
|
||||
|
|
24
mysql-test/include/func_str_ascii_checksum.inc
Normal file
24
mysql-test/include/func_str_ascii_checksum.inc
Normal file
|
@ -0,0 +1,24 @@
|
|||
--echo # Start of func_str_ascii_checksum.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
|
||||
--echo #
|
||||
|
||||
--eval CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2))
|
||||
--eval INSERT INTO t1 VALUES ('test',$func('test')), ('TEST', $func('TEST'))
|
||||
--eval SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
|
||||
--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
|
||||
--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("TEST") OR f2= $func("test"))
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
|
||||
--echo #
|
||||
|
||||
--eval PREPARE stmt FROM "SELECT $func(CONVERT('foo' USING latin1))"
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
|
||||
--echo # End of func_str_ascii_checksum.inc
|
|
@ -341,6 +341,7 @@ while ($1)
|
|||
alter table t1 add index i2(key2);
|
||||
alter table t1 add index i3(key3);
|
||||
update t1 set key2=key1,key3=key1;
|
||||
analyze table t1;
|
||||
|
||||
# to test the bug, the following must use "sort_union":
|
||||
--replace_column 9 REF
|
||||
|
|
|
@ -60,25 +60,30 @@
|
|||
|
||||
perl;
|
||||
use strict;
|
||||
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
|
||||
die "SEARCH_FILE not set" unless $ENV{'SEARCH_FILE'};
|
||||
my @search_files= glob($ENV{'SEARCH_FILE'});
|
||||
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
|
||||
my $search_range= $ENV{'SEARCH_RANGE'};
|
||||
my $file_content;
|
||||
my $content;
|
||||
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
|
||||
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
foreach my $search_file (@search_files) {
|
||||
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
|
||||
my $file_content;
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
}
|
||||
close(FILE);
|
||||
$content.= $file_content;
|
||||
}
|
||||
close(FILE);
|
||||
$search_file =~ s{^.*?([^/\\]+)$}{$1};
|
||||
if ($file_content =~ m{$search_pattern}) {
|
||||
print "FOUND /$search_pattern/ in $search_file\n"
|
||||
$ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
|
||||
if ($content =~ m{$search_pattern}) {
|
||||
print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
|
||||
} else {
|
||||
print "NOT FOUND /$search_pattern/ in $search_file\n"
|
||||
print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -261,11 +261,7 @@ sub show {
|
|||
# On Windows, rely on cdb to be there...
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
# Starting cdb is unsafe when used with --parallel > 1 option
|
||||
if ( $parallel < 2 )
|
||||
{
|
||||
_cdb($core_name);
|
||||
}
|
||||
_cdb($core_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ use File::Path;
|
|||
use base qw(Exporter);
|
||||
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
|
||||
native_path posix_path mixed_path
|
||||
check_socket_path_length process_alive);
|
||||
check_socket_path_length process_alive open_for_append);
|
||||
|
||||
BEGIN {
|
||||
if ($^O eq "cygwin") {
|
||||
|
@ -161,4 +161,51 @@ sub process_alive {
|
|||
}
|
||||
|
||||
|
||||
|
||||
use Symbol qw( gensym );
|
||||
|
||||
use if $^O eq 'MSWin32', 'Win32API::File', qw( CloseHandle CreateFile GetOsFHandle OsFHandleOpen OPEN_ALWAYS FILE_APPEND_DATA
|
||||
FILE_SHARE_READ FILE_SHARE_WRITE FILE_SHARE_DELETE );
|
||||
use if $^O eq 'MSWin32', 'Win32::API';
|
||||
|
||||
use constant WIN32API_FILE_NULL => [];
|
||||
|
||||
# Open a file for append
|
||||
# On Windows we use CreateFile with FILE_APPEND_DATA
|
||||
# to insure that writes are atomic, not interleaved
|
||||
# with writes by another processes.
|
||||
sub open_for_append
|
||||
{
|
||||
my ($file) = @_;
|
||||
my $fh = gensym();
|
||||
|
||||
if (IS_WIN32PERL)
|
||||
{
|
||||
my $handle;
|
||||
if (!($handle = CreateFile(
|
||||
$file,
|
||||
FILE_APPEND_DATA(),
|
||||
FILE_SHARE_READ()|FILE_SHARE_WRITE()|FILE_SHARE_DELETE(),
|
||||
WIN32API_FILE_NULL,
|
||||
OPEN_ALWAYS(),# Create if doesn't exist.
|
||||
0,
|
||||
WIN32API_FILE_NULL,
|
||||
)))
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
|
||||
if (!OsFHandleOpen($fh, $handle, 'wat'))
|
||||
{
|
||||
CloseHandle($handle);
|
||||
return undef;
|
||||
}
|
||||
return $fh;
|
||||
}
|
||||
|
||||
open($fh,">>",$file) or return undef;
|
||||
return $fh;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
use strict;
|
||||
use Carp;
|
||||
use My::Platform;
|
||||
|
||||
sub mtr_fromfile ($);
|
||||
sub mtr_tofile ($@);
|
||||
|
@ -45,10 +46,10 @@ sub mtr_fromfile ($) {
|
|||
|
||||
sub mtr_tofile ($@) {
|
||||
my $file= shift;
|
||||
|
||||
open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!");
|
||||
print FILE join("", @_);
|
||||
close FILE;
|
||||
my $fh= open_for_append $file;
|
||||
mtr_error("can't open file \"$file\": $!") unless defined($fh);
|
||||
print $fh join("", @_);
|
||||
close $fh;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -170,6 +170,7 @@ my @DEFAULT_SUITES= qw(
|
|||
main-
|
||||
archive-
|
||||
binlog-
|
||||
binlog_encryption-
|
||||
csv-
|
||||
encryption-
|
||||
federated-
|
||||
|
|
|
@ -1544,17 +1544,17 @@ ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= DEFAULT;
|
|||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i2`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= COPY;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= INVALID;
|
||||
ERROR HY000: Unknown ALGORITHM 'INVALID'
|
||||
ALTER TABLE m1 ENABLE KEYS;
|
||||
|
@ -1579,17 +1579,17 @@ ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= DEFAULT;
|
|||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i2`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= COPY;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
|
||||
SET SESSION old_alter_table= 0;
|
||||
affected rows: 0
|
||||
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
|
||||
|
@ -1611,17 +1611,17 @@ ALTER TABLE t1 ADD INDEX i2(b), LOCK= NONE;
|
|||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i2`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i3(b), LOCK= SHARED;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i4(b), LOCK= EXCLUSIVE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i5(b), LOCK= INVALID;
|
||||
ERROR HY000: Unknown LOCK type 'INVALID'
|
||||
ALTER TABLE m1 ENABLE KEYS, LOCK= DEFAULT;
|
||||
|
@ -1641,24 +1641,24 @@ ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= INPLACE, LOCK= SHARED;
|
|||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i2`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
|
||||
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i5' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i5`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE t1 ADD INDEX i6(b), ALGORITHM= COPY, LOCK= EXCLUSIVE;
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 1
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'i6' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `i6`. This is deprecated and will be disallowed in a future release
|
||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= NONE;
|
||||
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
|
||||
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
|
||||
|
@ -2034,6 +2034,64 @@ Warnings:
|
|||
Note 1061 Multiple primary key defined
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-11126 Crash while altering persistent virtual column
|
||||
#
|
||||
CREATE TABLE `tab1` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`field2` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
|
||||
`field4` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field5` varchar(32) NOT NULL,
|
||||
`field6` varchar(32) NOT NULL,
|
||||
`field7` varchar(32) NOT NULL,
|
||||
`field8` varchar(32) NOT NULL,
|
||||
`field9` int(11) NOT NULL DEFAULT '1',
|
||||
`field10` varchar(16) NOT NULL,
|
||||
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
|
||||
`v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET=latin1;
|
||||
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128);
|
||||
SHOW CREATE TABLE `tab1`;
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`field2` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
|
||||
`field4` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field5` varchar(32) NOT NULL,
|
||||
`field6` varchar(32) NOT NULL,
|
||||
`field7` varchar(32) NOT NULL,
|
||||
`field8` varchar(32) NOT NULL,
|
||||
`field9` int(11) NOT NULL DEFAULT 1,
|
||||
`field10` varchar(16) NOT NULL,
|
||||
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
|
||||
`v_col` varchar(128) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
ALTER TABLE `tab1` CHANGE COLUMN v_col `v_col` varchar(128) AS (IF(field11='option1',CONCAT_WS(":","field1",field2,field3,field4,field5,field6,field7,field8,field9,field10), CONCAT_WS(":","field1",field11,field2,field3,field4,field5,field6,field7,field8,field9,field10))) PERSISTENT;
|
||||
SHOW CREATE TABLE `tab1`;
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`field2` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field3` set('option1','option2','option3','option4','option5') NOT NULL,
|
||||
`field4` set('option1','option2','option3','option4') NOT NULL,
|
||||
`field5` varchar(32) NOT NULL,
|
||||
`field6` varchar(32) NOT NULL,
|
||||
`field7` varchar(32) NOT NULL,
|
||||
`field8` varchar(32) NOT NULL,
|
||||
`field9` int(11) NOT NULL DEFAULT 1,
|
||||
`field10` varchar(16) NOT NULL,
|
||||
`field11` enum('option1','option2','option3') NOT NULL DEFAULT 'option1',
|
||||
`v_col` varchar(128) GENERATED ALWAYS AS (if(`field11` = 'option1',concat_ws(':','field1',`field2`,`field3`,`field4`,`field5`,`field6`,`field7`,`field8`,`field9`,`field10`),concat_ws(':','field1',`field11`,`field2`,`field3`,`field4`,`field5`,`field6`,`field7`,`field8`,`field9`,`field10`))) STORED,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE `tab1`;
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
|
||||
#
|
||||
CREATE TABLE t1(i INT) ENGINE=INNODB;
|
||||
|
@ -2042,9 +2100,6 @@ INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e;
|
|||
ALTER TABLE t1 MODIFY i FLOAT;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-7816 ALTER with DROP INDEX and ADD INDEX .. COMMENT='comment2' ignores the new comment
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
|
|
|
@ -5,9 +5,9 @@ drop table if exists t1,t2;
|
|||
drop view if exists v1;
|
||||
create table t1(n int not null, key(n), key(n), key(n), key(n));
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'n_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'n_3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'n_4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `n_2`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `n_3`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `n_4`. This is deprecated and will be disallowed in a future release
|
||||
check table t1 extended;
|
||||
connection con2;
|
||||
insert into t1 values (200000);
|
||||
|
|
|
@ -45,10 +45,10 @@ create table t1 (a int null);
|
|||
alter table t1 add constraint constraint_1 unique (a);
|
||||
alter table t1 add constraint unique key_1(a);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'key_1' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `key_1`. This is deprecated and will be disallowed in a future release
|
||||
alter table t1 add constraint constraint_2 unique key_2(a);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'key_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `key_2`. This is deprecated and will be disallowed in a future release
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
|
|
@ -9,6 +9,7 @@ Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
|
|||
Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation
|
||||
Verkkokauppa.com https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
|
||||
Virtuozzo https://virtuozzo.com/ Bronze Sponsor of the MariaDB Foundation
|
||||
Tencent Game DBA http://tencentdba.com/about/ Bronze Sponsor of the MariaDB Foundation
|
||||
Google USA Sponsoring encryption, parallel replication and GTID
|
||||
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
|
||||
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
|
||||
|
|
|
@ -181,36 +181,36 @@ Warnings:
|
|||
Note 1051 Unknown table 'test.t2'
|
||||
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'b_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_5' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_6' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_7' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_8' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_9' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_10' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_11' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_12' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_13' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_14' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_15' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_16' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_17' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_18' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_19' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_20' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_21' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_22' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_23' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_24' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_25' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_26' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_27' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_28' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_29' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_30' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_31' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_2`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_3`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_4`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_5`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_6`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_7`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_8`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_9`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_10`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_11`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_12`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_13`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_14`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_15`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_16`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_17`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_18`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_19`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_20`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_21`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_22`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_23`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_24`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_25`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_26`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_27`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_28`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_29`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_30`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_31`. This is deprecated and will be disallowed in a future release
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -1915,3 +1915,7 @@ drop function f1;
|
|||
End of 5.5 tests
|
||||
create table t1;
|
||||
ERROR 42000: A table must have at least 1 column
|
||||
create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j;
|
||||
Warnings:
|
||||
Note 1831 Duplicate index `i_2`. This is deprecated and will be disallowed in a future release
|
||||
drop table t1;
|
||||
|
|
|
@ -447,3 +447,14 @@ disconnect con1;
|
|||
connection default;
|
||||
drop table t1;
|
||||
DROP TABLE t2;
|
||||
#
|
||||
# MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE FUNCTION f1() RETURNS VARCHAR(16383) RETURN 'test';
|
||||
CREATE OR REPLACE TABLE t1 AS SELECT f1();
|
||||
LOCK TABLE t1 WRITE;
|
||||
CREATE OR REPLACE TABLE t1 AS SELECT f1();
|
||||
UNLOCK TABLES;
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -131,69 +131,69 @@ key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
|
|||
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
|
||||
);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'a002_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a003_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a004_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a005_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a006_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a007_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a008_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a009_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a010_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a011_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a012_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a013_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a014_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a015_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a016_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a017_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a018_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a019_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a020_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a021_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a022_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a023_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a024_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a025_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a026_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a027_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a028_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a029_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a030_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a031_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a032_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a033_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a034_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a035_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a036_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a037_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a038_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a039_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a040_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a041_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a042_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a043_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a044_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a045_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a046_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a047_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a048_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a049_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a050_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a051_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a052_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a053_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a054_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a055_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a056_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a057_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a058_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a059_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a060_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a061_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a062_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a063_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a064_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -496,69 +496,69 @@ c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16),
|
|||
add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
|
||||
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'a002_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a003_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a004_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a005_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a006_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a007_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a008_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a009_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a010_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a011_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a012_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a013_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a014_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a015_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a016_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a017_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a018_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a019_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a020_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a021_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a022_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a023_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a024_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a025_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a026_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a027_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a028_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a029_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a030_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a031_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a032_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a033_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a034_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a035_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a036_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a037_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a038_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a039_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a040_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a041_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a042_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a043_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a044_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a045_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a046_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a047_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a048_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a049_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a050_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a051_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a052_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a053_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a054_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a055_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a056_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a057_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a058_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a059_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a060_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a061_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a062_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a063_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'a064_long_123456789_123456789_123456789_123456789_123456789_1234' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a002_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a003_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a004_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a005_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a006_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a007_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a008_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a009_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a010_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a011_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a012_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a013_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a014_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a015_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a016_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a017_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a018_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a019_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a020_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a021_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a022_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a023_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a024_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a025_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a026_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a027_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a028_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a029_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a030_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a031_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a032_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a033_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a034_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a035_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a036_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a037_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a038_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a039_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a040_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a041_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a042_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a043_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a044_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a045_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a046_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a047_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a048_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a049_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a050_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a051_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a052_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a053_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a054_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a055_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a056_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a057_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a058_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a059_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a060_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a061_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a062_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a063_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `a064_long_123456789_123456789_123456789_123456789_123456789_1234`. This is deprecated and will be disallowed in a future release
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
|
|
@ -1662,6 +1662,11 @@ CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061))
|
|||
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
|
||||
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
|
||||
1
|
||||
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
|
||||
c
|
||||
0000003F0000003F0000003F0000003F
|
||||
Warnings:
|
||||
Warning 1300 Invalid utf32 character string: '\xFF\xFF\x00\x00'
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
|
|
|
@ -6248,6 +6248,32 @@ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
|
|||
len
|
||||
131074
|
||||
#
|
||||
# MDEV-10717 Assertion `!null_value' failed in virtual bool Item::send(Protocol*, String*)
|
||||
#
|
||||
CREATE TABLE t1 (i INT, KEY(i));
|
||||
INSERT INTO t1 VALUES (20081205),(20050327);
|
||||
SELECT HEX(i), HEX(CHAR(i USING utf8)) FROM t1;
|
||||
HEX(i) HEX(CHAR(i USING utf8))
|
||||
131F197 0131
|
||||
1326A35 01326A35
|
||||
Warnings:
|
||||
Warning 1300 Invalid utf8 character string: 'F197'
|
||||
SET sql_mode='STRICT_ALL_TABLES';
|
||||
SELECT HEX(i), HEX(CHAR(i USING utf8)) FROM t1;
|
||||
HEX(i) HEX(CHAR(i USING utf8))
|
||||
131F197 NULL
|
||||
1326A35 01326A35
|
||||
Warnings:
|
||||
Warning 1300 Invalid utf8 character string: 'F197'
|
||||
SELECT CHAR(i USING utf8) FROM t1;
|
||||
CHAR(i USING utf8)
|
||||
###
|
||||
###
|
||||
Warnings:
|
||||
### 1300 Invalid utf8 character string: 'F197'
|
||||
SET sql_mode=DEFAULT;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -3359,6 +3359,26 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
|||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-11343 LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character
|
||||
#
|
||||
CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
|
||||
LOAD DATA INFILE '../../std_data/loaddata/mdev-11343.txt' INTO TABLE t1 CHARACTER SET utf8mb4;
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
C3A4
|
||||
C3A478
|
||||
78C3A4
|
||||
78C3A478
|
||||
EA99A0
|
||||
EA99A078
|
||||
78EA99A0
|
||||
78EA99A078
|
||||
F09F988E
|
||||
F09F988E78
|
||||
78F09F988E
|
||||
78F09F988E78
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion
|
||||
#
|
||||
#
|
||||
|
@ -3404,9 +3424,6 @@ DROP TABLE t1;
|
|||
# End of 10.0 tests
|
||||
#
|
||||
#
|
||||
# End of tests
|
||||
#
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -223,6 +223,50 @@ NULL
|
|||
drop table t1, t2;
|
||||
# End of 5.0 tests
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
# MDEV-11265 Access defied when CREATE VIIEW v1 AS SELECT DEFAULT(column) FROM t1
|
||||
#
|
||||
CREATE TABLE t1 (a INT DEFAULT 10);
|
||||
INSERT INTO t1 VALUES (11);
|
||||
CREATE VIEW v1 AS SELECT a AS a FROM t1;
|
||||
CREATE VIEW v2 AS SELECT DEFAULT(a) AS a FROM t1;
|
||||
CREATE VIEW v3 AS SELECT VALUES(a) AS a FROM t1;
|
||||
SELECT * FROM v1;
|
||||
a
|
||||
11
|
||||
SELECT * FROM v2;
|
||||
a
|
||||
10
|
||||
SELECT * FROM v3;
|
||||
a
|
||||
NULL
|
||||
UPDATE v2 SET a=123;
|
||||
ERROR HY000: Column 'a' is not updatable
|
||||
UPDATE v3 SET a=123;
|
||||
ERROR HY000: Column 'a' is not updatable
|
||||
DROP VIEW v3;
|
||||
DROP VIEW v2;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-10780 Server crashes in in create_tmp_table
|
||||
#
|
||||
connect con1,localhost,root,,test;
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ();
|
||||
INSERT INTO t1 VALUES ();
|
||||
SELECT DISTINCT DEFAULT (pk) FROM t1 GROUP BY RAND() WITH ROLLUP;
|
||||
DEFAULT (pk)
|
||||
0
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
CREATE TABLE t1 (a INT DEFAULT 100, b INT DEFAULT NULL);
|
||||
|
|
|
@ -955,6 +955,71 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
DROP TABLES t1,t2;
|
||||
set optimizer_switch=@save_derived_optimizer_switch;
|
||||
#
|
||||
# MDEV-10663: Use of Inline table columns in HAVING clause
|
||||
# throws 1463 Error
|
||||
#
|
||||
set @save_sql_mode = @@sql_mode;
|
||||
set sql_mode='ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
|
||||
CREATE TABLE `example1463` (
|
||||
`Customer` varchar(255) NOT NULL,
|
||||
`DeliveryStatus` varchar(255) NOT NULL,
|
||||
`OrderSize` int(11) NOT NULL
|
||||
);
|
||||
INSERT INTO example1463 VALUES ('Charlie', 'Success', 100);
|
||||
INSERT INTO example1463 VALUES ('David', 'Success', 110);
|
||||
INSERT INTO example1463 VALUES ('Charlie', 'Failed', 200);
|
||||
INSERT INTO example1463 VALUES ('David', 'Success', 100);
|
||||
INSERT INTO example1463 VALUES ('David', 'Unknown', 100);
|
||||
INSERT INTO example1463 VALUES ('Edward', 'Success', 150);
|
||||
INSERT INTO example1463 VALUES ('Edward', 'Pending', 150);
|
||||
SELECT Customer, Success, SUM(OrderSize)
|
||||
FROM (SELECT Customer,
|
||||
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
|
||||
OrderSize
|
||||
FROM example1463) as subQ
|
||||
GROUP BY Success, Customer
|
||||
WITH ROLLUP;
|
||||
Customer Success SUM(OrderSize)
|
||||
Charlie No 200
|
||||
David No 100
|
||||
Edward No 150
|
||||
NULL No 450
|
||||
Charlie Yes 100
|
||||
David Yes 210
|
||||
Edward Yes 150
|
||||
NULL Yes 460
|
||||
NULL NULL 910
|
||||
SELECT Customer, Success, SUM(OrderSize)
|
||||
FROM (SELECT Customer,
|
||||
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
|
||||
OrderSize
|
||||
FROM example1463) as subQ
|
||||
GROUP BY Success, Customer;
|
||||
Customer Success SUM(OrderSize)
|
||||
Charlie No 200
|
||||
David No 100
|
||||
Edward No 150
|
||||
Charlie Yes 100
|
||||
David Yes 210
|
||||
Edward Yes 150
|
||||
SELECT Customer, Success, SUM(OrderSize)
|
||||
FROM (SELECT Customer,
|
||||
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
|
||||
OrderSize
|
||||
FROM example1463) as subQ
|
||||
GROUP BY Success, Customer
|
||||
HAVING Success IS NOT NULL;
|
||||
Customer Success SUM(OrderSize)
|
||||
Charlie No 200
|
||||
David No 100
|
||||
Edward No 150
|
||||
Charlie Yes 100
|
||||
David Yes 210
|
||||
Edward Yes 150
|
||||
DROP TABLE example1463;
|
||||
set sql_mode= @save_sql_mode;
|
||||
# end of 5.5
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -1268,16 +1268,16 @@ a b max_c avg_c a b c d
|
|||
execute stmt;
|
||||
a b max_c avg_c a b c d
|
||||
1 21 500 234.6000 2 3 207 207
|
||||
5 27 132 132.0000 2 3 207 207
|
||||
5 27 132 132.0000 1 21 909 12
|
||||
1 21 500 234.6000 7 13 312 406
|
||||
1 21 500 234.6000 8 64 248 107
|
||||
1 21 500 234.6000 6 20 315 279
|
||||
5 27 132 132.0000 1 19 203 107
|
||||
1 21 500 234.6000 8 80 800 314
|
||||
1 21 500 234.6000 3 12 231 190
|
||||
5 27 132 132.0000 3 12 231 190
|
||||
1 21 500 234.6000 6 23 303 909
|
||||
5 27 132 132.0000 2 3 207 207
|
||||
5 27 132 132.0000 1 21 909 12
|
||||
5 27 132 132.0000 1 19 203 107
|
||||
5 27 132 132.0000 3 12 231 190
|
||||
deallocate prepare stmt;
|
||||
prepare stmt from
|
||||
"explain format=json select * from v1,t2 where
|
||||
|
|
|
@ -2826,5 +2826,90 @@ DROP TABLE t1,t2;
|
|||
#
|
||||
# end of 5.3 tests
|
||||
#
|
||||
#
|
||||
# Bug mdev-11161: The second execution of prepared statement
|
||||
# does not use generated key for materialized
|
||||
# derived table / view
|
||||
# (actually this is a 5.3 bug.)
|
||||
#
|
||||
create table t1 (
|
||||
mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
matintnum CHAR(6) NOT NULL,
|
||||
test MEDIUMINT UNSIGNED NULL
|
||||
);
|
||||
create table t2 (
|
||||
mat_id MEDIUMINT UNSIGNED NOT NULL,
|
||||
pla_id MEDIUMINT UNSIGNED NOT NULL
|
||||
);
|
||||
insert into t1 values
|
||||
(NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4),
|
||||
(NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8),
|
||||
(NULL, 'i', 9);
|
||||
insert into t2 values
|
||||
(1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104),
|
||||
(3, 101), (3, 102), (3, 105);
|
||||
explain
|
||||
SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id
|
||||
FROM t1 m2
|
||||
INNER JOIN
|
||||
(SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum
|
||||
FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id
|
||||
GROUP BY mp.pla_id) d
|
||||
ON d.matintnum=m2.matintnum;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
|
||||
1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
|
||||
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
|
||||
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
|
||||
prepare stmt1 from
|
||||
"SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id
|
||||
FROM t1 m2
|
||||
INNER JOIN
|
||||
(SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum
|
||||
FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id
|
||||
GROUP BY mp.pla_id) d
|
||||
ON d.matintnum=m2.matintnum";
|
||||
flush status;
|
||||
execute stmt1;
|
||||
pla_id mat_id
|
||||
102 1
|
||||
101 1
|
||||
100 1
|
||||
104 2
|
||||
103 2
|
||||
105 3
|
||||
show status like '%Handler_read%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 21
|
||||
Handler_read_last 0
|
||||
Handler_read_next 6
|
||||
Handler_read_prev 0
|
||||
Handler_read_retry 0
|
||||
Handler_read_rnd 6
|
||||
Handler_read_rnd_deleted 0
|
||||
Handler_read_rnd_next 27
|
||||
flush status;
|
||||
execute stmt1;
|
||||
pla_id mat_id
|
||||
102 1
|
||||
101 1
|
||||
100 1
|
||||
104 2
|
||||
103 2
|
||||
105 3
|
||||
show status like '%Handler_read%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 21
|
||||
Handler_read_last 0
|
||||
Handler_read_next 6
|
||||
Handler_read_prev 0
|
||||
Handler_read_retry 0
|
||||
Handler_read_rnd 6
|
||||
Handler_read_rnd_deleted 0
|
||||
Handler_read_rnd_next 27
|
||||
deallocate prepare stmt1;
|
||||
drop table t1,t2;
|
||||
set optimizer_switch=@exit_optimizer_switch;
|
||||
set join_cache_level=@exit_join_cache_level;
|
||||
|
|
|
@ -224,3 +224,9 @@ INSERT INTO table1 VALUES (1);
|
|||
ERROR 42S02: Unknown table 't.notable'
|
||||
DROP TABLE table1,table2;
|
||||
# End BUG#34750
|
||||
#
|
||||
# MDEV-11105 Table named 'db' has weird side effect.
|
||||
#
|
||||
CREATE DATABASE mysqltest;
|
||||
CREATE TABLE mysqltest.db(id INT);
|
||||
DROP DATABASE mysqltest;
|
||||
|
|
|
@ -99,45 +99,45 @@ KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
|||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b));
|
||||
Warnings:
|
||||
Note 1831 Duplicate index 'b_2' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_3' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_4' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_5' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_6' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_7' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_8' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_9' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_10' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_11' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_12' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_13' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_14' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_15' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_16' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_17' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_18' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_19' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_20' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_21' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_22' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_23' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_24' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_25' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_26' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_27' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_28' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_29' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_30' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_31' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_32' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_33' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_34' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_35' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_36' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_37' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_38' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_39' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index 'b_40' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_2`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_3`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_4`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_5`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_6`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_7`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_8`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_9`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_10`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_11`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_12`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_13`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_14`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_15`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_16`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_17`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_18`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_19`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_20`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_21`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_22`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_23`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_24`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_25`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_26`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_27`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_28`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_29`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_30`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_31`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_32`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_33`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_34`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_35`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_36`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_37`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_38`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_39`. This is deprecated and will be disallowed in a future release
|
||||
Note 1831 Duplicate index `b_40`. This is deprecated and will be disallowed in a future release
|
||||
INSERT INTO t2 VALUES (),(),();
|
||||
EXPLAIN SELECT 1 FROM
|
||||
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
|
||||
|
|
7
mysql-test/r/fulltext_charsets.result
Normal file
7
mysql-test/r/fulltext_charsets.result
Normal file
|
@ -0,0 +1,7 @@
|
|||
set names utf8mb4;
|
||||
create table t1 (a int, b text, fulltext (b)) charset=utf8mb4 collate=utf8mb4_unicode_ci;
|
||||
insert t1 values (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,̠̬͚ ̺T͇̲h͈̱e ̬̜D̖o̦̖͔̗͖̩̘c̣̼t̝͉̫̮̗o͉̫̭r̙͎̗.͓̪̥');
|
||||
select a from t1 where match(b) against ('ciao' in boolean mode);
|
||||
a
|
||||
1000
|
||||
drop table t1;
|
|
@ -168,6 +168,30 @@ set global max_allowed_packet=default;
|
|||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
|
||||
#
|
||||
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
|
||||
INSERT INTO t1 VALUES ('test',compress('test')), ('TEST', compress('TEST'));
|
||||
SELECT f1,HEX(f2) FROM t1 ignore index(k1) WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
|
||||
f1 HEX(f2)
|
||||
test 04000000789C2B492D2E0100045D01C1
|
||||
TEST 04000000789C0B710D0E0100031D0141
|
||||
SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("test") OR f2= compress("TEST"));
|
||||
f1 HEX(f2)
|
||||
TEST 04000000789C0B710D0E0100031D0141
|
||||
test 04000000789C2B492D2E0100045D01C1
|
||||
SELECT f1,HEX(f2) FROM t1 WHERE f1='test' AND (f2= compress("TEST") OR f2= compress("test"));
|
||||
f1 HEX(f2)
|
||||
TEST 04000000789C0B710D0E0100031D0141
|
||||
test 04000000789C2B492D2E0100045D01C1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -105,8 +105,85 @@ SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1;
|
|||
OLD_PASSWORD(c1) PASSWORD(c1)
|
||||
77023ffe214c04ff *82E58A2C08AAFE72C8EB523069CD8ADB33F78F58
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
Start of 10.2 tests
|
||||
# End of 5.0 tests
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
# Start of func_str_ascii_checksum.inc
|
||||
#
|
||||
# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
|
||||
#
|
||||
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
|
||||
INSERT INTO t1 VALUES ('test',password('test')), ('TEST', password('TEST'));
|
||||
SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= password("test") OR f2= password("TEST"));
|
||||
f1 f2
|
||||
test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
|
||||
TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= password("test") OR f2= password("TEST"));
|
||||
f1 f2
|
||||
TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
|
||||
test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= password("TEST") OR f2= password("test"));
|
||||
f1 f2
|
||||
TEST *47A6B0EA08A36FAEBE4305B373FE37E3CF27C357
|
||||
test *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
|
||||
#
|
||||
PREPARE stmt FROM "SELECT password(CONVERT('foo' USING latin1))";
|
||||
EXECUTE stmt;
|
||||
password(CONVERT('foo' USING latin1))
|
||||
*F3A2A51A9B0F2BE2468926B4132313728C250DBF
|
||||
DEALLOCATE PREPARE stmt;
|
||||
# End of func_str_ascii_checksum.inc
|
||||
# Start of func_str_ascii_checksum.inc
|
||||
#
|
||||
# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
|
||||
#
|
||||
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2));
|
||||
INSERT INTO t1 VALUES ('test',old_password('test')), ('TEST', old_password('TEST'));
|
||||
SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= old_password("test") OR f2= old_password("TEST"));
|
||||
f1 f2
|
||||
test 378b243e220ca493
|
||||
TEST 06df397e084be793
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= old_password("test") OR f2= old_password("TEST"));
|
||||
f1 f2
|
||||
TEST 06df397e084be793
|
||||
test 378b243e220ca493
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= old_password("TEST") OR f2= old_password("test"));
|
||||
f1 f2
|
||||
TEST 06df397e084be793
|
||||
test 378b243e220ca493
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
|
||||
#
|
||||
PREPARE stmt FROM "SELECT old_password(CONVERT('foo' USING latin1))";
|
||||
EXECUTE stmt;
|
||||
old_password(CONVERT('foo' USING latin1))
|
||||
7c786c222596437b
|
||||
DEALLOCATE PREPARE stmt;
|
||||
# End of func_str_ascii_checksum.inc
|
||||
#
|
||||
# MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
|
||||
#
|
||||
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
|
||||
INSERT INTO t1 VALUES ('test',encrypt('test','key')), ('TEST', encrypt('TEST','key'));
|
||||
SELECT f1 FROM t1 ignore index(k1) WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
|
||||
f1
|
||||
test
|
||||
TEST
|
||||
SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('test','key') OR f2= encrypt('TEST','key'));
|
||||
f1
|
||||
TEST
|
||||
test
|
||||
SELECT f1 FROM t1 WHERE f1='test' AND (f2= encrypt('TEST','key') OR f2= encrypt('test','key'));
|
||||
f1
|
||||
TEST
|
||||
test
|
||||
DROP TABLE t1;
|
||||
# Start of 10.2 tests
|
||||
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
|
|
|
@ -1427,6 +1427,35 @@ def sha2('1',224) 253 56 56 Y 0 39 8
|
|||
sha2('1',224)
|
||||
e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BAS E64('TEST'))
|
||||
#
|
||||
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2));
|
||||
INSERT INTO t1 VALUES ('test',SHA2('test',224)), ('TEST', SHA2('TEST',224));
|
||||
SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
|
||||
f1 f2
|
||||
test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
|
||||
TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("test",224) OR f2= SHA2("TEST",224));
|
||||
f1 f2
|
||||
test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
|
||||
TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
|
||||
SELECT * FROM t1 WHERE f1='test' AND (f2= SHA2("TEST",224) OR f2= SHA2("test",224));
|
||||
f1 f2
|
||||
test 90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809
|
||||
TEST 917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
|
||||
#
|
||||
PREPARE stmt FROM "SELECT SHA2(CONVERT('foo' USING latin1), 224)";
|
||||
EXECUTE stmt;
|
||||
SHA2(CONVERT('foo' USING latin1), 224)
|
||||
0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
|
||||
DEALLOCATE PREPARE stmt;
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -2436,5 +2436,14 @@ c1
|
|||
3
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
|
||||
#
|
||||
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (10),(20),(30);
|
||||
SELECT DISTINCT STDDEV(1) FROM t1 GROUP BY i ORDER BY BENCHMARK(0, BIT_XOR(i));
|
||||
STDDEV(1)
|
||||
0.0000
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue