Merge bb-10.2-ext into 10.3

This commit is contained in:
Marko Mäkelä 2018-01-04 09:22:59 +02:00
commit 145ae15a33
209 changed files with 6868 additions and 1522 deletions

1
.gitignore vendored
View File

@ -193,6 +193,7 @@ storage/myisam/sp_test
storage/rocksdb/ldb
storage/rocksdb/mysql_ldb
storage/rocksdb/sst_dump
storage/rocksdb/rdb_source_revision.h
storage/tokudb/PerconaFT/buildheader/db.h
storage/tokudb/PerconaFT/buildheader/make_tdb
storage/tokudb/PerconaFT/buildheader/runcat.sh

17
appveyor.yml Normal file
View File

@ -0,0 +1,17 @@
version: 10.2-{build}
before_build:
- md %APPVEYOR_BUILD_FOLDER%\win_build
- cd %APPVEYOR_BUILD_FOLDER%\win_build
- cmake .. -G "Visual Studio 15 2017" -DBISON_EXECUTABLE=C:\cygwin\bin\bison
- dir
build:
project: win_build\MySQL.sln
parallel: true
verbosity: minimal
configuration:
- Debug
test:
test_script:
- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
- perl mysql-test-run.pl --force --max-test-fail=20 --parallel=6 --testcase-timeout=4 --skip-test-list=unstable-tests --suite=main,innodb,plugins,mariabackup
image: Visual Studio 2017

View File

@ -98,6 +98,7 @@ enum options_client
OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_SSL_CRL, OPT_SSL_CRLPATH,
OPT_PRINT_ROW_COUNT, OPT_PRINT_ROW_EVENT_POSITIONS,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};

View File

@ -1795,8 +1795,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
#endif
break;
case OPT_SERVER_ARG:

View File

@ -299,8 +299,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
}
return 0;

View File

@ -89,7 +89,8 @@ static char *result_file_name= 0;
static const char *output_prefix= "";
#ifndef DBUG_OFF
static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
static const char *default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
const char *current_dbug_option= default_dbug_option;
#endif
static const char *load_groups[]=
{ "mysqlbinlog", "client", "client-server", "client-mariadb", 0 };
@ -109,6 +110,8 @@ static char *opt_base64_output_mode_str= NullS;
static char* database= 0;
static char* table= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static my_bool print_row_count= 0, print_row_event_positions= 0;
static my_bool print_row_count_used= 0, print_row_event_positions_used= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool force_if_open_opt= 1;
static my_bool opt_raw_mode= 0, opt_stop_never= 0;
@ -224,14 +227,16 @@ void keep_annotate_event(Annotate_rows_log_event* event)
annotate_event= event;
}
void print_annotate_event(PRINT_EVENT_INFO *print_event_info)
bool print_annotate_event(PRINT_EVENT_INFO *print_event_info)
{
bool error= 0;
if (annotate_event)
{
annotate_event->print(result_file, print_event_info);
error= annotate_event->print(result_file, print_event_info);
delete annotate_event; // the event should not be printed more than once
annotate_event= 0;
}
return error;
}
static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *, const char*);
@ -795,7 +800,7 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
static void
print_skip_replication_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
{
int cur_val;
bool cur_val;
cur_val= (ev->flags & LOG_EVENT_SKIP_REPLICATION_F) != 0;
if (cur_val == pinfo->skip_replication)
@ -847,8 +852,9 @@ write_event_header_and_base64(Log_event *ev, FILE *result_file,
DBUG_ENTER("write_event_header_and_base64");
/* Write header and base64 output to cache */
ev->print_header(head, print_event_info, FALSE);
ev->print_base64(body, print_event_info, FALSE);
if (ev->print_header(head, print_event_info, FALSE) ||
ev->print_base64(body, print_event_info, FALSE))
DBUG_RETURN(ERROR_STOP);
/* Read data from cache and write to result file */
if (copy_event_cache_to_file_and_reinit(head, result_file) ||
@ -870,24 +876,20 @@ static bool print_base64(PRINT_EVENT_INFO *print_event_info, Log_event *ev)
passed --short-form, because --short-form disables printing
row events.
*/
if (!print_event_info->printed_fd_event && !short_form &&
opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS &&
opt_base64_output_mode != BASE64_OUTPUT_NEVER)
{
const char* type_str= ev->get_type_str();
if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
error("--base64-output=never specified, but binlog contains a "
"%s event which must be printed in base64.",
type_str);
else
error("malformed binlog: it does not contain any "
"Format_description_log_event. I now found a %s event, which "
error("malformed binlog: it does not contain any "
"Format_description_log_event. Found a %s event, which "
"is not safe to process without a "
"Format_description_log_event.",
type_str);
return 1;
}
ev->print(result_file, print_event_info);
return print_event_info->head_cache.error == -1;
return ev->print(result_file, print_event_info);
}
@ -897,6 +899,8 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Table_map_log_event *ignored_map=
print_event_info->m_table_map_ignored.get_table(table_id);
bool skip_event= (ignored_map != NULL);
char ll_buff[21];
bool result= 0;
if (opt_flashback)
{
@ -969,19 +973,18 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
return 0;
if (!opt_flashback)
return print_base64(print_event_info, ev);
result= print_base64(print_event_info, ev);
else
{
if (is_stmt_end)
{
bool res= false;
Log_event *e= NULL;
// Print the row_event from the last one to the first one
for (uint i= events_in_stmt.elements; i > 0; --i)
{
e= *(dynamic_element(&events_in_stmt, i - 1, Log_event**));
res= res || print_base64(print_event_info, e);
result= result || print_base64(print_event_info, e);
}
// Copy all output into the Log_event
ev->output_buf.copy(e->output_buf);
@ -992,12 +995,17 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
delete e;
}
reset_dynamic(&events_in_stmt);
return res;
}
}
return 0;
if (is_stmt_end && !result)
{
if (print_event_info->print_row_count)
fprintf(result_file, "# Number of rows: %s\n",
llstr(print_event_info->row_events, ll_buff));
print_event_info->row_events= 0;
}
return result;
}
@ -1028,7 +1036,6 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Log_event_type ev_type= ev->get_type_code();
my_bool destroy_evt= TRUE;
DBUG_ENTER("process_event");
print_event_info->short_form= short_form;
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
@ -1074,7 +1081,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
retval= OK_STOP;
goto end;
}
if (!short_form && !opt_flashback)
if (print_row_event_positions)
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
if (!opt_hexdump)
@ -1115,7 +1122,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else
{
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
if (ev->print(result_file, print_event_info))
goto err;
}
if (head->error == -1)
goto err;
@ -1150,8 +1158,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else
{
print_skip_replication_statement(print_event_info, ev);
ce->print(result_file, print_event_info, TRUE);
if (head->error == -1)
if (ce->print(result_file, print_event_info, TRUE))
goto err;
}
// If this binlog is not 3.23 ; why this test??
@ -1174,8 +1181,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
the subsequent call load_processor.process fails, because the
output of Append_block_log_event::print is only a comment.
*/
ev->print(result_file, print_event_info);
if (head->error == -1)
if (ev->print(result_file, print_event_info))
goto err;
if ((retval= load_processor.process((Append_block_log_event*) ev)) !=
OK_CONTINUE)
@ -1184,8 +1190,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case EXEC_LOAD_EVENT:
{
ev->print(result_file, print_event_info);
if (head->error == -1)
if (ev->print(result_file, print_event_info))
goto err;
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
@ -1196,15 +1201,16 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
if (ce)
{
bool error;
/*
We must not convert earlier, since the file is used by
my_open() in Load_log_processor::append().
*/
convert_path_to_forward_slashes((char*) ce->fname);
ce->print(result_file, print_event_info, TRUE);
error= ce->print(result_file, print_event_info, TRUE);
my_free((void*)ce->fname);
delete ce;
if (head->error == -1)
if (error)
goto err;
}
else
@ -1215,10 +1221,10 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case FORMAT_DESCRIPTION_EVENT:
delete glob_description_event;
glob_description_event= (Format_description_log_event*) ev;
destroy_evt= 0;
print_event_info->common_header_len=
glob_description_event->common_header_len;
ev->print(result_file, print_event_info);
if (head->error == -1)
if (ev->print(result_file, print_event_info))
goto err;
if (!remote_opt)
{
@ -1248,8 +1254,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
break;
case BEGIN_LOAD_QUERY_EVENT:
ev->print(result_file, print_event_info);
if (head->error == -1)
if (ev->print(result_file, print_event_info))
goto err;
if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) !=
OK_CONTINUE)
@ -1267,11 +1272,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
convert_path_to_forward_slashes(fname);
print_skip_replication_statement(print_event_info, ev);
exlq->print(result_file, print_event_info, fname);
if (head->error == -1)
if (exlq->print(result_file, print_event_info, fname))
{
if (fname)
my_free(fname);
my_free(fname);
goto err;
}
}
@ -1279,9 +1282,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
warning("Ignoring Execute_load_query since there is no "
"Begin_load_query event for file_id: %u", exlq->file_id);
}
if (fname)
my_free(fname);
my_free(fname);
break;
}
case ANNOTATE_ROWS_EVENT:
@ -1427,7 +1428,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print the kept Annotate event (if there is any).
print_annotate_event() also deletes the kept Annotate event.
*/
print_annotate_event(print_event_info);
if (print_annotate_event(print_event_info))
goto err;
size_t len_to= 0;
const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to);
@ -1457,10 +1459,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
Rows_log_event *e= (Rows_log_event*) ev;
bool is_stmt_end= e->get_flags(Rows_log_event::STMT_END_F);
if (!print_event_info->found_row_event)
{
print_event_info->found_row_event= 1;
print_event_info->row_events= 0;
}
if (print_row_event(print_event_info, ev, e->get_table_id(),
e->get_flags(Rows_log_event::STMT_END_F)))
goto err;
if (!is_stmt_end)
DBUG_PRINT("info", ("is_stmt_end: %d", (int) is_stmt_end));
if (is_stmt_end)
print_event_info->found_row_event= 0;
else if (opt_flashback)
destroy_evt= FALSE;
break;
}
@ -1473,7 +1483,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (print_row_event(print_event_info, ev, e->get_table_id(),
e->get_flags(Old_rows_log_event::STMT_END_F)))
goto err;
if (!is_stmt_end)
DBUG_PRINT("info", ("is_stmt_end: %d", (int) is_stmt_end));
if (!is_stmt_end && opt_flashback)
destroy_evt= FALSE;
break;
}
@ -1482,8 +1493,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
/* fall through */
default:
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
if (head->error == -1)
if (ev->print(result_file, print_event_info))
goto err;
}
}
@ -1494,7 +1504,8 @@ err:
retval= ERROR_STOP;
end:
rec_count++;
DBUG_PRINT("info", ("end event processing"));
/*
Destroy the log_event object.
MariaDB MWL#36: mainline does this:
@ -1539,6 +1550,7 @@ end:
if (destroy_evt) /* destroy it later if not set (ignored table map) */
delete ev;
}
DBUG_PRINT("exit",("return: %d", retval));
DBUG_RETURN(retval);
}
@ -1550,14 +1562,15 @@ static struct my_option my_options[] =
{"base64-output", OPT_BASE64_OUTPUT_MODE,
/* 'unspec' is not mentioned because it is just a placeholder. */
"Determine when the output statements should be base64-encoded BINLOG "
"statements: 'never' disables it and works only for binlogs without "
"row-based events; 'decode-rows' decodes row events into commented SQL "
"statements if the --verbose option is also given; 'auto' prints base64 "
"only when necessary (i.e., for row-based events and format description "
"events); 'always' prints base64 whenever possible. 'always' is "
"deprecated, will be removed in a future version, and should not be used "
"in a production system. --base64-output with no 'name' argument is "
"equivalent to --base64-output=always and is also deprecated. If no "
"statements: 'never' doesn't print binlog row events and should not be "
"used when directing output to a MariaDB master; "
"'decode-rows' decodes row events into commented SQL statements if the "
"--verbose option is also given; "
"'auto' prints base64 only when necessary (i.e., for row-based events and "
"format description events); "
"'always' prints base64 whenever possible. "
"--base64-output with no 'name' argument is equivalent to "
"--base64-output=always and is also deprecated. If no "
"--base64-output[=name] option is given at all, the default is 'auto'.",
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@ -1574,8 +1587,8 @@ static struct my_option my_options[] =
&database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Output debug log.", &default_dbug_option,
&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log.", &current_dbug_option,
&current_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
&debug_check_flag, &debug_check_flag, 0,
@ -1657,6 +1670,14 @@ static struct my_option my_options[] =
&flashback_review_tablename, &flashback_review_tablename,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"print-row-count", OPT_PRINT_ROW_COUNT,
"Print row counts for each row events",
&print_row_count, &print_row_count, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0},
{"print-row-event-positions", OPT_PRINT_ROW_EVENT_POSITIONS,
"Print row event positions",
&print_row_event_positions, &print_row_event_positions, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"server-id", 0,
"Extract only binlog entries created by the server having the given id.",
&server_id, &server_id, 0, GET_ULONG,
@ -1670,10 +1691,11 @@ static struct my_option my_options[] =
&shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"short-form", 's', "Just show regular queries: no extra info and no "
"row-based events. This is for testing only, and should not be used in "
"production systems. If you want to suppress base64-output, consider "
"using --base64-output=never instead.",
{"short-form", 's', "Just show regular queries: no extra info, no "
"row-based events and no row counts. This is mainly for testing only, "
"and should not be used to feed to the MariaDB server. "
"If you want to just suppress base64-output, you can instead "
"use --base64-output=never",
&short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"socket", 'S', "The socket file to use for connection.",
@ -1775,9 +1797,12 @@ Example: rewrite-db='from->to'.",
*/
static void error_or_warning(const char *format, va_list args, const char *msg)
{
if (result_file)
fflush(result_file);
fprintf(stderr, "%s: ", msg);
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
fflush(stderr);
}
/**
@ -1830,6 +1855,7 @@ static void warning(const char *format,...)
*/
static void cleanup()
{
DBUG_ENTER("cleanup");
my_free(pass);
my_free(database);
my_free(table);
@ -1843,12 +1869,13 @@ static void cleanup()
delete glob_description_event;
if (mysql)
mysql_close(mysql);
DBUG_VOID_RETURN;
}
static void print_version()
{
printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 3.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
@ -1899,7 +1926,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
switch (optid) {
#ifndef DBUG_OFF
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
if (!argument)
argument= (char*) default_dbug_option;
current_dbug_option= argument;
DBUG_PUSH(argument);
break;
#endif
#include <sslopt-case.h>
@ -1931,8 +1961,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
one_table= 1;
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
case opt_flashback_review:
@ -1950,8 +1984,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_base64_output_mode= BASE64_OUTPUT_ALWAYS;
else
{
opt_base64_output_mode= (enum_base64_output_mode)
(find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1);
int val;
if ((val= find_type_with_warning(argument, &base64_output_mode_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
opt_base64_output_mode= (enum_base64_output_mode) (val - 1);
}
break;
case OPT_REWRITE_DB: // db_from->db_to
@ -2001,6 +2042,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
binlog_filter->add_db_rewrite(key, val);
break;
}
case OPT_PRINT_ROW_COUNT:
print_row_count_used= 1;
break;
case OPT_PRINT_ROW_EVENT_POSITIONS:
print_row_event_positions_used= 1;
break;
case 'v':
if (argument == disabled_my_option)
verbose= 0;
@ -2133,11 +2180,30 @@ static Exit_status dump_log_entries(const char* logname)
fprintf(result_file, "DELIMITER /*!*/;\n");
strmov(print_event_info.delimiter, "/*!*/;");
print_event_info.verbose= short_form ? 0 : verbose;
if (short_form)
{
if (!print_row_event_positions_used)
print_row_event_positions= 0;
if (!print_row_count_used)
print_row_count = 0;
}
if (opt_flashback)
{
if (!print_row_event_positions_used)
print_row_event_positions= 0;
}
print_event_info.verbose= short_form ? 0 : verbose;
print_event_info.short_form= short_form;
print_event_info.print_row_count= print_row_count;
print_event_info.file= result_file;
fflush(result_file);
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
if (rc == ERROR_STOP)
return rc;
/* Set delimiter back to semicolon */
if (!opt_raw_mode && !opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
@ -2208,6 +2274,8 @@ static Exit_status check_master_version()
}
delete glob_description_event;
glob_description_event= NULL;
switch (version) {
case 3:
glob_description_event= new Format_description_log_event(1);
@ -2226,7 +2294,6 @@ static Exit_status check_master_version()
glob_description_event= new Format_description_log_event(3);
break;
default:
glob_description_event= NULL;
error("Could not find server version: "
"Master reported unrecognized MySQL version '%s'.", row[0]);
goto err;
@ -2467,6 +2534,7 @@ static Exit_status handle_event_raw_mode(PRINT_EVENT_INFO *print_event_info,
error("Could not write into log file '%s'", out_file_name);
DBUG_RETURN(ERROR_STOP);
}
print_event_info->file= result_file;
delete glob_description_event;
glob_description_event= (Format_description_log_event*) ev;
@ -2965,13 +3033,6 @@ int main(int argc, char** argv)
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
opt_base64_output_mode= BASE64_OUTPUT_AUTO;
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
warning("The --base64-output=always flag and the --base64-output flag "
"(with '=MODE' omitted), are deprecated. "
"The output generated when these flags are used cannot be "
"parsed by mysql 5.6.0 and later. "
"The flags will be removed in a future version. "
"Please use --base64-output=auto instead.");
my_set_max_open_files(open_files_limit);
@ -3084,7 +3145,7 @@ int main(int argc, char** argv)
If enable flashback, need to print the events from the end to the
beginning
*/
if (opt_flashback)
if (opt_flashback && retval != ERROR_STOP)
{
for (uint i= binlog_events.elements; i > 0; --i)
{
@ -3099,12 +3160,15 @@ int main(int argc, char** argv)
}
/* Set delimiter back to semicolon */
if (!stop_event_string.is_empty())
fprintf(result_file, "%s", stop_event_string.ptr());
if (!opt_raw_mode && opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
if (retval != ERROR_STOP)
{
if (!stop_event_string.is_empty())
fprintf(result_file, "%s", stop_event_string.ptr());
if (!opt_raw_mode && opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
}
if (!opt_raw_mode)
if (retval != ERROR_STOP && !opt_raw_mode)
{
/*
Issue a ROLLBACK in case the last printed binlog was crashed and had half

View File

@ -367,8 +367,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
print_version(); exit(0);
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
}

View File

@ -961,8 +961,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
case (int) OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
}
return 0;

View File

@ -249,8 +249,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
#endif
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");

View File

@ -330,8 +330,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");

View File

@ -779,8 +779,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);

View File

@ -701,6 +701,8 @@ public:
void write(DYNAMIC_STRING* ds)
{
DBUG_ENTER("LogFile::write");
DBUG_PRINT("enter", ("length: %u", (uint) ds->length));
DBUG_ASSERT(m_file);
if (ds->length == 0)
@ -6959,6 +6961,7 @@ int read_command(struct st_command** command_ptr)
if (parser.current_line < parser.read_lines)
{
get_dynamic(&q_lines, command_ptr, parser.current_line) ;
DBUG_PRINT("info", ("query: %s", (*command_ptr)->query));
DBUG_RETURN(0);
}
if (!(*command_ptr= command=
@ -7320,8 +7323,12 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
exit(0);
case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
#endif
break;
case '?':

View File

@ -162,6 +162,8 @@ SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock")
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
#
# DEB layout
@ -191,6 +193,8 @@ SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql")
SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
#
# SVR4 layout
@ -232,7 +236,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF SYSCONF2
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA UNIX_ADDR
SYSTEMD_UNIT)
SYSTEMD_UNIT SYSTEMD_SYSUSERS SYSTEMD_TMPFILES)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)

View File

@ -55,6 +55,9 @@ ENDIF()
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/include/source_revision.h
${PACKAGE_DIR}/include/source_revision.h COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/storage/rocksdb/rdb_source_revision.h
${PACKAGE_DIR}/storage/rocksdb/rdb_source_revision.h COPYONLY)
IF(NOT GIT_EXECUTABLE)
MESSAGE(STATUS "git not found or source dir is not a repo, use CPack")

View File

@ -230,7 +230,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
IF (NOT ARG_CLIENT)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE)
ENDIF()
# workarounds for cmake issues #13248 and #12864:
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)

View File

@ -80,11 +80,11 @@ GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
then
sed '/Package: mariadb-plugin-rocksdb/,+11d' -i debian/control
sed '/Package: mariadb-plugin-rocksdb/,+13d' -i debian/control
fi
if [[ $GCCVERSION -lt 40800 ]] || [[ $TRAVIS ]]
then
sed '/Package: mariadb-plugin-aws-key-management-10.2/,+13d' -i debian/control
sed '/Package: mariadb-plugin-aws-key-management-10.3/,+15d' -i debian/control
fi

27
debian/control vendored
View File

@ -452,7 +452,7 @@ Description: MariaDB database client (metapackage depending on the latest versio
Package: mariadb-plugin-connect
Architecture: any
Depends: libxml2,
mariadb-server-10.3,
mariadb-server-10.3 (= ${binary:Version}),
unixodbc,
${misc:Depends},
${shlibs:Depends}
@ -470,7 +470,9 @@ Description: Connect storage engine for MariaDB
Package: mariadb-plugin-rocksdb
Architecture: any
Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-rocksdb-engine-10.2,
mariadb-rocksdb-engine-10.3
Replaces: mariadb-rocksdb-engine-10.2,
@ -482,7 +484,10 @@ Description: RocksDB storage engine for MariaDB
Package: mariadb-plugin-oqgraph
Architecture: any
Depends: libjudydebian1, mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: libjudydebian1,
mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-oqgraph-engine-10.1,
mariadb-oqgraph-engine-10.2,
mariadb-oqgraph-engine-10.3
@ -496,7 +501,9 @@ Description: OQGraph storage engine for MariaDB
Package: mariadb-plugin-tokudb
Architecture: any
Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@ -513,7 +520,9 @@ Description: TokuDB storage engine for MariaDB
Package: mariadb-plugin-mroonga
Architecture: any
Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@ -529,7 +538,9 @@ Description: Mroonga storage engine for MariaDB
Package: mariadb-plugin-spider
Architecture: any
Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@ -546,7 +557,9 @@ Description: Spider storage engine for MariaDB
Package: mariadb-plugin-cassandra
Architecture: any
Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
Depends: mariadb-server-10.3 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,

19
debian/rules vendored
View File

@ -45,11 +45,6 @@ else
TESTSUITE_FAIL_CMD:=exit 1
endif
# Skip TokuDB if arch is not amd64
ifneq ($(ARCH), amd64)
CMAKEFLAGS += -DWITHOUT_TOKUDB=true
endif
# Add support for verbose builds
MAKEFLAGS += VERBOSE=1
@ -119,19 +114,15 @@ override_dh_auto_install:
dh_testdir
dh_testroot
# If TokuDB plugin was not built skip the package
[ -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || sed -i -e "/Package: mariadb-plugin-tokudb/,+16d" debian/control
# If Mroonga plugin was not built skip the package
[ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+15d" debian/control
# Skip TokuDB if arch is not amd64
ifneq ($(ARCH), amd64)
sed -i -e "/Package: mariadb-plugin-tokudb/,+18d" debian/control
endif
# If libthrift-dev was available (manually installed, as it is
# not in Debian) and ha_cassandra.so was thus built, create package,
# otherwise skip it.
[ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+18d" debian/control
# If Spider plugin was not built skip the package
[ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+16d" debian/control
[ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+20d" debian/control
# Copy systemd files to a location available for dh_installinit
cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.3.mariadb.service

View File

@ -1422,8 +1422,12 @@ xb_get_one_option(int optid,
case OPT_PROTOCOL:
if (argument)
{
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
}
break;
#include "sslopt-case.h"

View File

@ -64,15 +64,6 @@
extern "C" {
#endif
/*
my_str_malloc(), my_str_realloc() and my_str_free() are assigned to
implementations in strings/alloc.c, but can be overridden in
the calling program.
*/
extern void *(*my_str_malloc)(size_t);
extern void *(*my_str_realloc)(void *, size_t);
extern void (*my_str_free)(void *);
#ifdef DBUG_OFF
#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
#define strmov(A,B) __builtin_stpcpy((A),(B))

View File

@ -551,12 +551,13 @@ static inline int my_b_get(IO_CACHE *info)
return _my_b_get(info);
}
/* my_b_write_byte dosn't have any err-check */
static inline void my_b_write_byte(IO_CACHE *info, uchar chr)
static inline my_bool my_b_write_byte(IO_CACHE *info, uchar chr)
{
if (info->write_pos >= info->write_end)
my_b_flush_io_cache(info, 1);
if (my_b_flush_io_cache(info, 1))
return 1;
*info->write_pos++= chr;
return 0;
}
/**
@ -824,9 +825,9 @@ extern int end_io_cache(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
extern size_t my_b_write_backtick_quote(IO_CACHE *info, const char *str,
size_t len);
extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern my_bool my_b_write_backtick_quote(IO_CACHE *info, const char *str,
size_t len);
extern my_bool my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
const char *prefix, size_t cache_size,

View File

@ -252,8 +252,6 @@ typedef struct st_typelib {
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
extern int find_type_or_exit(const char *x, TYPELIB *typelib,
const char *option);
extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);

View File

@ -30,8 +30,6 @@ typedef struct st_typelib { /* Different types saved here */
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
extern int find_type_or_exit(const char *x, TYPELIB *typelib,
const char *option);
#define FIND_TYPE_BASIC 0
/** makes @c find_type() require the whole name, no prefix */
#define FIND_TYPE_NO_PREFIX (1U << 0)

@ -1 +1 @@
Subproject commit 63f841f78f520d7f3bcff1fe8cecec9d8c47829d
Subproject commit fe129ed39f33ba2b430aac91473baee84de88b12

View File

@ -121,6 +121,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
my_free(mysql->options.my_cnf_file);
my_free(mysql->options.my_cnf_group);
mysql->options.my_cnf_file=mysql->options.my_cnf_group=0;
if (mysql->options.protocol == UINT_MAX32)
goto error;
}
if (!db || !db[0])

View File

@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLADMIN\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System"
.TH "\FBMYSQLADMIN\FR" "1" "28 December 2017" "MariaDB 10\&.3" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@ -106,6 +106,97 @@ Display the server status variables and their values\&.
.sp -1
.IP \(bu 2.3
.\}
flush\-all\-statistics
.sp
Flush all statistics tables\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-all\-status
.sp
Flush all status and statistics\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-binary\-log
.sp
Flush the binary log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-client\-statistics
.sp
Flush client statistics\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-engine\-log
.sp
Flush engine log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-error\-log
.sp
Flush error log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-general\-log
.sp
Flush general query log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-hosts
.sp
Flush all information in the host cache\&.
@ -119,6 +210,19 @@ Flush all information in the host cache\&.
.sp -1
.IP \(bu 2.3
.\}
flush\-index\-statistics
.sp
Flush index statistics\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-logs
.sp
Flush all logs\&.
@ -146,6 +250,32 @@ reload)\&.
.sp -1
.IP \(bu 2.3
.\}
flush\-relay\-log
.sp
Flush relay log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-slow\-log
.sp
Flush slow query log\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-status
.sp
Clear status variables\&.
@ -159,6 +289,19 @@ Clear status variables\&.
.sp -1
.IP \(bu 2.3
.\}
flush\-table\-statistics
.sp
Flush table statistics\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
flush\-tables
.sp
Flush all tables\&.
@ -185,6 +328,19 @@ Flush the thread cache\&.
.sp -1
.IP \(bu 2.3
.\}
flush\-user\-resources
.sp
Flush user resources\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
kill \fIid\fR,\fIid\fR,\&.\&.\&.
.sp
Kill server threads\&. If multiple thread ID values are given, there must be no spaces in the list\&.
@ -344,6 +500,19 @@ Stop the server\&.
.sp -1
.IP \(bu 2.3
.\}
start\-all\-slaves
.sp
Start all slaves\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
start\-slave
.sp
Start replication on a slave server\&.
@ -370,6 +539,19 @@ Display a short server status message\&.
.sp -1
.IP \(bu 2.3
.\}
stop\-all\-slaves
.sp
Stop all slaves\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
stop\-slave
.sp
Stop replication on a slave server\&.
@ -821,7 +1003,7 @@ Connect to the MariaDB server on the given host\&.
\fB\-\-local\fR,
\fB\-l\fR
.sp
Suppress the SQL command(s) from being written to the binary log by enabling sql_log_bin=0 for the session\&.
Suppress the SQL command(s) from being written to the binary log by using FLUSH LOCAL or enabling sql_log_bin=0 for the session\&.
.RE
.sp
.RS 4

View File

@ -1,16 +1,11 @@
# truncate a giving file, all contents of the file are be cleared
if (!$file)
if (!$TRUNCATE_FILE)
{
--echo Please assign a file name to $file!!
exit;
die TRUNCATE_FILE is not set;
}
let TRUNCATE_FILE= $file;
perl;
use Env;
Env::import('TRUNCATE_FILE');
open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file";
open FILE, '>', $ENV{TRUNCATE_FILE} or die "open(>$ENV{TRUNCATE_FILE}): $!";
close FILE;
EOF

View File

@ -1,3 +1,4 @@
reset master;
CREATE OR REPLACE DATABASE d1;
CREATE OR REPLACE DATABASE d1;
DROP DATABASE d1;

View File

@ -458,3 +458,23 @@ CREATE OR REPLACE TABLE t1 AS SELECT f1();
UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
# Locked_tables_list::unlock_locked_tables
#
CREATE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2(a INT);
CREATE TABLE t3(a INT);
LOCK TABLE t2 WRITE;
SELECT * FROM t2;
a
CREATE OR REPLACE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SELECT * FROM t3;
ERROR HY000: Table 't3' was not locked with LOCK TABLES
CREATE OR REPLACE TEMPORARY TABLE t2(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SELECT * FROM t3;
ERROR HY000: Table 't3' was not locked with LOCK TABLES
UNLOCK TABLES;
DROP TABLE t3;

View File

@ -1147,3 +1147,121 @@ SELECT * FROM cte_test;
a
1
DROP VIEW cte_test;
#
# mdev-14755 : PS for query using CTE in select with subquery
#
create table t1 (a int);
insert into t1 values
(7), (2), (8), (1), (3), (2), (7), (5), (4), (7), (9), (8);
with cte as
(select a from t1 where a between 4 and 7 group by a)
(select a from cte where exists( select a from t1 where cte.a=t1.a ))
union
(select a from t1 where a < 2);
a
7
5
4
1
prepare stmt from "with cte as
(select a from t1 where a between 4 and 7 group by a)
(select a from cte where exists( select a from t1 where cte.a=t1.a ))
union
(select a from t1 where a < 2)";
execute stmt;
a
7
5
4
1
execute stmt;
a
7
5
4
1
deallocate prepare stmt;
with cte as
(select a from t1 where a between 4 and 7 group by a)
(select a from t1 where a < 2)
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ));
a
1
7
5
4
prepare stmt from "with cte as
(select a from t1 where a between 4 and 7 group by a)
(select a from t1 where a < 2)
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
execute stmt;
a
1
7
5
4
execute stmt;
a
1
7
5
4
deallocate prepare stmt;
with cte as
(select a from t1 where a between 4 and 7)
(select a from t1 where a < 2)
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ));
a
1
7
5
4
prepare stmt from "with cte as
(select a from t1 where a between 4 and 7)
(select a from t1 where a < 2)
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
execute stmt;
a
1
7
5
4
execute stmt;
a
1
7
5
4
deallocate prepare stmt;
with cte as
(select a from t1 where a between 4 and 7)
(select a from cte
where exists( select a from t1 where t1.a < 2 and cte.a=t1.a ))
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ));
a
7
5
4
prepare stmt from "with cte as
(select a from t1 where a between 4 and 7)
(select a from cte
where exists( select a from t1 where t1.a < 2 and cte.a=t1.a ))
union
(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
execute stmt;
a
7
5
4
execute stmt;
a
7
5
4
deallocate prepare stmt;
drop table t1;

View File

@ -1584,3 +1584,63 @@ EXPLAIN
}
}
drop table t0,t1;
#
# MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
#
create table t1 (a int, b int);
insert into t1 values (1,2),(3,4),(2,3);
explain format=json select * from t1 order by a, b desc;
EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a, t1.b desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
explain format=json select * from t1 order by a desc, b desc;
EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc, t1.b desc",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
explain format=json select * from t1 order by a desc, b ;
EXPLAIN
{
"query_block": {
"select_id": 1,
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc, t1.b",
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
drop table t1;

View File

@ -731,6 +731,11 @@ Warning 4042 Syntax error in JSON path in argument 3 to function 'json_contains_
select JSON_VALID(0x36f0c8dccd83c5eac156da);
JSON_VALID(0x36f0c8dccd83c5eac156da)
0
create table t1(a double not null);
insert into t1 values (2),(1);
select 1 from t1 where json_extract(a,'$','$[81]');
1
drop table t1;
#
# Start of 10.3 tests
#

View File

@ -1523,6 +1523,21 @@ str str1 b c
::10.0.5.9 ::10.0.5.9 1 0
DROP TABLE t1;
#
# MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
#
CREATE TABLE `t1` (
`numgtfmt` char(10) COLLATE utf8_bin NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
create view v1(numgtfmt)
as
select 'x' from t1
union
select 'x' from t1 ;
SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
numgtfmt
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.2 tests
#
#

View File

@ -221,21 +221,11 @@ NULL
DROP TABLE t1;
#
# Start of 5.3 tests
#
#
# MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types
#
CREATE TABLE t1 (pk INT PRIMARY KEY);
INSERT INTO t1 VALUES (10),(11);
SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1;
INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 )
8
8
Warnings:
Warning 1292 Incorrect datetime value: '10' for column 'pk' at row 1
Warning 1292 Incorrect datetime value: '11' for column 'pk' at row 2
DROP TABLE t1;
#
# End of 5.3 tests
# MDEV-14596 Crash in INTERVAL(ROW(..),ROW(..))
#
SELECT INTERVAL(ROW(1,1),ROW(1,2));
ERROR 21000: Operand should contain 1 column(s)
SELECT INTERVAL(1,ROW(1,2));
ERROR 21000: Operand should contain 1 column(s)
SELECT INTERVAL(ROW(1,2),1);
ERROR 21000: Operand should contain 1 column(s)

View File

@ -2667,6 +2667,31 @@ create table t2 (c1 int, c2 int);
select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group by t1.c1, t2.c2 having t1.c1 < 3;
c1 c1
drop table t1, t2;
SET @old_sort_buff_size = @@sort_buffer_size;
SET @@sort_buffer_size=256*1024;
CREATE TABLE t1 (c INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES
(2011),(1977),(1982),(2027),(2023),(NULL),(NULL),(2004),(1974),(2032),
(1993),(NULL),(1995),(2034),(NULL),(2009),(1900),(NULL),(2025),(1900),
(2033),(1900),(2012),(NULL),(2009),(1992),(1974),(1974),(2012),(2028),
(2007),(2012),(1900),(1983),(1900),(2010),(1987),(1994),(1981),(2032),
(2010),(1989),(2014),(1900),(1900),(1976),(1978),(2007),(2030),(NULL),
(2002),(1997),(1900),(NULL),(2000),(2027),(1975),(2026),(1975),(2026),
(2029),(1977),(1900),(1900),(2031),(1993),(1986),(2012),(1979),(2013),
(1994),(2014),(2025),(2006),(1971),(1974),(2021),(2011),(NULL),(1991),
(2001),(1977),(2023),(2012),(1900),(1978),(1998),(NULL),(1988),(1999),
(2017),(2008),(1976),(1900),(2005),(2030),(2023),(1900),(1978),(1990),
(1978),(1987),(2030),(1900),(2034),(2006),(2015),(2001),(2019),(2024),
(2030),(1989),(1997),(2007),(2023),(1994),(1971),(2011),(2011),(2015),
(1984),(1978),(1979),(1989),(2008),(2030);
SELECT ExtractValue('<a></a>','/a') AS f1, SPACE(c) AS f2 FROM t1 GROUP BY f1, f2 WITH ROLLUP;
f1 f2
NULL
NULL
NULL NULL
SET @@sort_buffer_size = @old_sort_buff_size;
DROP TABLE t1;
#
# Bug #58782
# Missing rows with SELECT .. WHERE .. IN subquery

View File

@ -696,6 +696,21 @@ id column_1
expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR
drop table t1;
#
# mdev-14368: grouping query with alias for aggregate function in HAVING
# when sql_mode = 'ONLY_FULL_GROUP_BY'
set @save_sql_mode= @@sql_mode;
set sql_mode = 'ONLY_FULL_GROUP_BY';
create table t1(a int);
insert t1 values (4),(1),(2),(1), (3),(4);
SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0;
a ct
1 2
2 1
3 1
4 2
set sql_mode=@save_sql_mode;
drop table t1;
#
# Bug mdev-5160: two-way join with HAVING over the second table
#
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;

View File

@ -2431,5 +2431,18 @@ Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
DROP TABLE t1,t2;
#
# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
#
CREATE TABLE t1 (b1 BIT NOT NULL);
INSERT INTO t1 VALUES (0),(1);
CREATE TABLE t2 (b2 BIT NOT NULL);
INSERT INTO t2 VALUES (0),(1);
SET SESSION JOIN_CACHE_LEVEL = 3;
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
t1.b1+'0' t2.b2 + '0'
0 0
1 1
DROP TABLE t1, t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;

View File

@ -2442,6 +2442,19 @@ Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
DROP TABLE t1,t2;
#
# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
#
CREATE TABLE t1 (b1 BIT NOT NULL);
INSERT INTO t1 VALUES (0),(1);
CREATE TABLE t2 (b2 BIT NOT NULL);
INSERT INTO t2 VALUES (0),(1);
SET SESSION JOIN_CACHE_LEVEL = 3;
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
t1.b1+'0' t2.b2 + '0'
0 0
1 1
DROP TABLE t1, t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;

View File

@ -879,9 +879,7 @@ ROLLBACK /* added by mysqlbinlog */;
End of 5.0 tests
End of 5.1 tests
# Expect deprecation warning.
WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
# Expect deprecation warning again.
WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
RESET MASTER;
CREATE DATABASE test1;
USE test1;

View File

@ -73,6 +73,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 967
#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -101,6 +102,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
# Number of rows: 1
# at 1281
#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -129,6 +131,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1596
#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -157,6 +160,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1909
#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -218,6 +222,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2225
#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -298,6 +303,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 3
# at 2561
#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -359,6 +365,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2861
#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -420,6 +427,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 3154
#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;

View File

@ -71,6 +71,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1015
#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -99,6 +100,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
# Number of rows: 1
# at 1330
#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -127,6 +129,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1646
#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -155,6 +158,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1962
#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -216,6 +220,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2354
#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -251,6 +256,7 @@ BEGIN
### @5=NULL /* INT meta=0 nullable=1 is_null=1 */
### SET
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at 2665
#<date> server id 1 end_log_pos 2738 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -280,6 +286,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
# Number of rows: 4
# at 2927
#<date> server id 1 end_log_pos 3000 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@ -309,6 +316,7 @@ BEGIN
### DELETE FROM `test`.`t2`
### WHERE
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
# Number of rows: 4
# at 3189
#<date> server id 1 end_log_pos 3262 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;

View File

@ -228,8 +228,4 @@ End of 5.1 tests
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
ERROR: Failed on connect: SSL connection error

View File

@ -26,9 +26,5 @@ ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data
Warnings:
Warning 1618 <DATA DIRECTORY> option ignored
Warning 1618 <INDEX DIRECTORY> option ignored
Warning 1618 <DATA DIRECTORY> option ignored
Warning 1618 <INDEX DIRECTORY> option ignored
Warning 1618 <DATA DIRECTORY> option ignored
Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "last", 4);
DROP TABLE t1;

View File

@ -4345,6 +4345,24 @@ set join_cache_level=@join_cache_level_save;
deallocate prepare stmt;
drop view v1,v2,v3;
drop table t1,t2,t3;
#
# MDEV-10657: incorrect result returned with binary protocol
# (prepared statements)
#
create table t1 (code varchar(10) primary key);
INSERT INTO t1(code) VALUES ('LINE1'), ('LINE2'), ('LINE3');
SELECT X.*
FROM
(SELECT CODE, RN
FROM
(SELECT A.CODE, @cnt := @cnt + 1 AS RN
FROM t1 A, (SELECT @cnt := 0) C) T
) X;
CODE RN
LINE1 1
LINE2 2
LINE3 3
drop table t1;
# End of 5.5 tests
#
# Start of 10.2 tests
@ -5075,6 +5093,35 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
DROP PROCEDURE p1;
#
# MDEV-14426 Assertion in Diagnostics_area::set_error_status when using a bad datetime with PS and SP
#
CREATE PROCEDURE p1(OUT a VARCHAR(20))
BEGIN
SET a=10;
END;
$$
BEGIN NOT ATOMIC
DECLARE a DATETIME;
CALL p1(a);
END;
$$
ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
BEGIN NOT ATOMIC
DECLARE a DATETIME;
EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
END;
$$
ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
BEGIN NOT ATOMIC
DECLARE a DATETIME;
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING a;
DEALLOCATE PREPARE stmt;
END;
$$
ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
DROP PROCEDURE p1;
#
# MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
#
CREATE PROCEDURE p1(OUT v CHAR(32) CHARACTER SET utf8) SET v='aaa';

View File

@ -5621,6 +5621,20 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
#
# MDEV-14619: VIEW and GROUP_CONCAT
#
CREATE TABLE t1 (str text);
INSERT INTO t1 VALUES ("My"),("SQL");
CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
SELECT * FROM v1;
GROUP_CONCAT(str SEPARATOR '\\')
My\SQL
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------

View File

@ -1779,7 +1779,7 @@ EXPLAIN
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2)",
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"filesort": {

View File

@ -33,10 +33,10 @@ a
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
<#>ROLLBACK/*!*/;
# at 102
<#>use `test`/*!*/;
<#>
ROLLBACK/*!*/;
<#>
use `test`/*!*/;
SET TIMESTAMP=1196959712/*!*/;
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
SET @@session.sql_mode=0/*!*/;
@ -47,7 +47,11 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int) engine= myisam
/*!*/;
# at 203
<#>
<#>
<#>
<#>
<#>
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;

File diff suppressed because it is too large Load Diff

View File

@ -2543,6 +2543,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -2724,6 +2725,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -3071,6 +3073,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -3410,6 +3413,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -3754,6 +3758,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -4096,6 +4101,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -4441,6 +4447,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -4620,6 +4627,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -4796,6 +4804,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -4975,6 +4984,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5152,6 +5162,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5345,6 +5356,7 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5423,6 +5435,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5473,6 +5486,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5766,6 +5780,7 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5835,6 +5850,7 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -5904,6 +5920,7 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -6093,6 +6110,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -6207,6 +6225,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -6338,6 +6357,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;

View File

@ -2543,6 +2543,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -2727,6 +2728,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -3076,6 +3078,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -3417,6 +3420,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -3763,6 +3767,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -4107,6 +4112,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -4454,6 +4460,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -4635,6 +4642,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -4813,6 +4821,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -4994,6 +5003,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5173,6 +5183,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5368,6 +5379,7 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5448,6 +5460,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5500,6 +5513,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5795,6 +5809,7 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5866,6 +5881,7 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -5937,6 +5953,7 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -6128,6 +6145,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -6244,6 +6262,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -6377,6 +6396,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;

View File

@ -193,6 +193,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@ -221,6 +222,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@ -232,6 +234,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -275,6 +278,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -313,6 +317,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -334,6 +339,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -363,6 +369,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@ -391,6 +398,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@ -402,6 +410,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -445,6 +454,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -483,6 +493,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -504,6 +515,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;

View File

@ -162,6 +162,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -188,6 +189,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -214,6 +216,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -255,6 +258,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -281,6 +285,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -309,6 +314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -386,6 +392,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -551,6 +558,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -575,6 +583,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -599,6 +608,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -636,6 +646,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -660,6 +671,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -684,6 +696,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -773,6 +786,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -799,6 +813,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -825,6 +840,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -866,6 +882,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -892,6 +909,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -920,6 +938,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -997,6 +1016,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1161,6 +1181,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1184,6 +1205,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1207,6 +1229,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1243,6 +1266,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1266,6 +1290,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -1289,6 +1314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;

View File

@ -18,6 +18,8 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
BEGIN
/*!*/;
# Annotate_rows:
#Q> insert into t2 values (@v)
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
@ -114,6 +116,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@ -134,6 +137,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@ -154,6 +158,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@ -174,6 +179,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@ -194,6 +200,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@ -214,6 +221,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;

View File

@ -79,6 +79,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -111,6 +112,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -132,6 +134,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -164,6 +167,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -185,6 +189,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -223,6 +228,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -243,6 +249,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -313,6 +320,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -345,6 +353,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -366,6 +375,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -398,6 +408,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -419,6 +430,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -457,6 +469,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -477,6 +490,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;

View File

@ -100,6 +100,7 @@ BEGIN
### @6='' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -125,6 +126,7 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -150,6 +152,7 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -203,6 +206,7 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# Number of rows: 2
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -248,6 +252,7 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@ -272,18 +277,23 @@ ROLLBACK/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(0,0,0,0,0,'','','')
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz")
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 255))
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> UPDATE t1 SET c01=100 WHERE c02=0 OR c03=3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# Number of rows: 2
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> DELETE FROM t1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# Number of rows: 3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;

View File

@ -68,15 +68,12 @@ TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
select * from t1;
# Test that mysqlbinlog stops with an error message when the
# --base64-output=never flag is used on a binlog with base64 events.
# New mysqlbinlog supports --base64-output=never
--echo ==== Test --base64-output=never on a binlog with row events ====
# mysqlbinlog should fail
--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
error 1;
exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/bug32407.001;
# the above line should output the query log event and then stop
--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] \N*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
exec $MYSQL_BINLOG --base64-output=never --print-row-count=0 --print-row-event-positions=0 suite/binlog/std_data/bug32407.001;
# Test that the following fails cleanly: "First, read a

View File

@ -438,6 +438,8 @@ INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
@ -455,3 +457,8 @@ flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--error 1
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1

View File

@ -163,6 +163,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -189,6 +190,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -215,6 +217,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -256,6 +259,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -282,6 +286,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -310,6 +315,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -387,6 +393,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -551,6 +558,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -574,6 +582,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -597,6 +606,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -633,6 +643,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -656,6 +667,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@ -679,6 +691,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;

View File

@ -0,0 +1,36 @@
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2;
START SLAVE;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
begin;
insert into t2 values(21);
insert into t2 values(22);
commit;
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4
connection node_2;
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4,2-2-2
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
INSERT INTO t1 VALUES(4);
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4,2-2-2,2-3-3
connection node_1;
DROP TABLE t1,t2;
reset master;
connection node_2;
connection node_3;
connection node_2;
STOP SLAVE;
RESET SLAVE ALL;
reset master;
connection node_3;
reset master;

View File

@ -0,0 +1,130 @@
#Connection 2
START SLAVE;
#Connection 1
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
INSERT INTO t2 VALUES(1,11);
INSERT INTO t2 VALUES(2,22);
INSERT INTO t2 VALUES(3,33);
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4
include/save_master_gtid.inc
#Connection 2
include/sync_with_master_gtid.inc
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4
INSERT INTO t2 VALUES(4,44);
INSERT INTO t2 VALUES(5,55);
INSERT INTO t2 VALUES(6,66);
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4,2-2-3
#Connection 3
INSERT INTO t2 VALUES(7,77);
INSERT INTO t2 VALUES(8,88);
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-4,2-2-3,2-3-5
#Connection 1
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
COMMIT;
include/save_master_gtid.inc
#Connection 2
include/sync_with_master_gtid.inc
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node2_committed_before');
INSERT INTO t1 VALUES ('node2_committed_before');
COMMIT;
#Connection 3
Shutting down server ...
#Connection 2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_during');
INSERT INTO t1 VALUES ('node1_committed_during');
COMMIT;
#Connection 3
Starting server ...
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node3_committed_after');
INSERT INTO t1 VALUES ('node3_committed_after');
COMMIT;
#Connection 2
Select * from t1 order by f1;
f1
node1_committed_before
node1_committed_before
node1_committed_during
node1_committed_during
node2_committed_before
node2_committed_before
node3_committed_after
node3_committed_after
#Connection 3
Select * from t1 order by f1;
f1
node1_committed_before
node1_committed_before
node1_committed_during
node1_committed_during
node2_committed_before
node2_committed_before
node3_committed_after
node3_committed_after
#Connection 2
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-6,2-2-7,2-3-8
#Connection 3
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-6,2-2-7,2-3-8
#Connection 1
SET AUTOCOMMIT=ON;
#Connection 2
SET AUTOCOMMIT=ON;
#Connection 3
SET AUTOCOMMIT=ON;
#Connection 2
STOP slave;
INSERT INTO t1 VALUES ('node2_slave_stoped');
#Connection 1
INSERT INTO t1 VALUES ('node1_normal_entry');
include/save_master_gtid.inc
#Connection 2
INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
start slave;
include/sync_with_master_gtid.inc
INSERT INTO t1 VALUES ('node2_slave_started');
SELECT count(*) from t1;
count(*)
12
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-7,2-3-8,2-2-11
#Connection 3
SELECT count(*) from t1;
count(*)
12
SELECT @@global.gtid_binlog_state;
@@global.gtid_binlog_state
1-1-7,2-3-8,2-2-11
#Connection 1
DROP TABLE t2,t1;
#Connection 2
#Connection 3
#Connection 2
STOP SLAVE;
RESET SLAVE ALL;
reset master;
#Connection 3
reset master;
#Connection 1
reset master;

View File

@ -820,6 +820,9 @@ Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 21
insert delayed into t1 values (4);
select a from t1;
a
@ -870,6 +873,9 @@ Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 22
# On node-2
connection node_2;
show global variables like "query_cache_min_res_unit";
@ -916,12 +922,15 @@ a
1
2
3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 24
# On node-2
connection node_2;
select * from t1;
@ -944,12 +953,12 @@ a
1
2
3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 10
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 10
drop table t1;
select a from t2;
a
@ -961,12 +970,15 @@ a
1
2
3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 18
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
Variable_name Value
@ -983,12 +995,15 @@ a
1
2
3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 25
drop table t2;
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@ -1010,6 +1025,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 27
# On node-2
connection node_2;
select "aaa" from t1;
@ -1024,6 +1042,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 20
drop table t1;
# On node-1
connection node_1;
@ -1322,6 +1343,9 @@ select count(*) from t1;
count(*)
140
drop table t1;
#
# INTO OUTFILE/DUMPFILE test
#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@ -1342,7 +1366,13 @@ Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 36
drop table t1;
#
# Test of SQL_SELECT_LIMIT
#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@ -1367,6 +1397,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 38
SET SQL_SELECT_LIMIT=DEFAULT;
# On node-2
connection node_2;
@ -1392,6 +1425,9 @@ Variable_name Value
Qcache_hits 11
SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
#
# WRITE LOCK & QC
#
# On node-1
connection node_1;
create table t1 (a int not null) engine=innodb;
@ -1408,6 +1444,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 40
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
@ -1431,6 +1470,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 41
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
@ -1471,10 +1513,16 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 34
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
#
# Hiding real table stored in query cache by temporary table
#
# On node-1
connection node_1;
create table t1 (id int primary key) engine=innodb;
@ -1498,92 +1546,119 @@ SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
à Â 0
à Â 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 43
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
à Â 0
à Â 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 44
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ç? 'ç?'='ç?'
à ç? 1
à ç? 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 45
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a � 'â'='Â'
ö Ã? 1
ö Ã? 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 46
SET NAMES default;
# On node-2
connection node_2;
#
# Run select
#
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
? Â 0
? Â 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a ?? 'â'='Â'
? ?? 1
? ?? 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 36
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ?? '??'='?'
? ?? 1
? ?? 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 37
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a � 'â'='Â'
ö Ã? 1
ö Ã? 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 38
drop table t1;
#
# Comments before command
#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@ -1634,6 +1709,9 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
drop table t1;
#
# Information schema & query cache test
#
# On node-1
connection node_1;
set session query_cache_type = 2;

View File

@ -1 +1 @@
--binlog-row-event-max-size=4294967295
--binlog-row-event-max-size=4294967040

View File

@ -0,0 +1,18 @@
!include ../galera_2nodes_as_slave.cnf
[mysqld]
log-bin=mysqld-bin
log-slave-updates
binlog-format=ROW
[mysqld.1]
gtid-domain-id=1
[mysqld.2]
gtid-domain-id=2
wsrep_gtid_mode=1
wsrep_gtid_domain_id=2
[mysqld.3]
gtid-domain-id=2
wsrep_gtid_mode=1
wsrep_gtid_domain_id=2

View File

@ -0,0 +1,78 @@
#
# Test Galera as a slave to a MariaDB master using GTIDs
#
# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options
#
# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
#
--source include/have_innodb.inc
# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--source include/galera_cluster.inc
--connection node_2
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE;
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
#multi stmt trans
begin;
insert into t2 values(21);
insert into t2 values(22);
commit;
SELECT @@global.gtid_binlog_state;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
--sleep 1
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
SELECT @@global.gtid_binlog_state;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
--source include/wait_condition.inc
INSERT INTO t1 VALUES(4);
SELECT @@global.gtid_binlog_state;
--connection node_1
DROP TABLE t1,t2;
reset master;
#
# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
# warning is also reported by MTR, which is also weird.
#
--sleep 1
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--connection node_2
STOP SLAVE;
RESET SLAVE ALL;
reset master;
--connection node_3
reset master;

View File

@ -0,0 +1,18 @@
!include ../galera_2nodes_as_slave.cnf
[mysqld]
log-bin=mysqld-bin
log-slave-updates
binlog-format=ROW
wsrep_sst_method=rsync
[mysqld.1]
gtid-domain-id=1
[mysqld.2]
gtid-domain-id=2
wsrep_gtid_mode=1
wsrep_gtid_domain_id=2
[mysqld.3]
gtid-domain-id=2
wsrep_gtid_mode=1
wsrep_gtid_domain_id=2

View File

@ -0,0 +1,207 @@
#
# Test Galera as a slave to a MariaDB master using GTIDs
#
# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
#
# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
#
--source include/big_test.inc
--source include/have_innodb.inc
# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--source include/galera_cluster.inc
--echo #Connection 2
--connection node_2
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1,master_use_gtid=slave_pos;
--enable_query_log
START SLAVE;
--sleep 1
--echo #Connection 1
--connection node_1
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
INSERT INTO t2 VALUES(1,11);
INSERT INTO t2 VALUES(2,22);
INSERT INTO t2 VALUES(3,33);
SELECT @@global.gtid_binlog_state;
--source include/save_master_gtid.inc
--echo #Connection 2
--connection node_2
--source include/sync_with_master_gtid.inc
SELECT @@global.gtid_binlog_state;
INSERT INTO t2 VALUES(4,44);
INSERT INTO t2 VALUES(5,55);
INSERT INTO t2 VALUES(6,66);
SELECT @@global.gtid_binlog_state;
--echo #Connection 3
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't2';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 6 FROM t2;
--source include/wait_condition.inc
INSERT INTO t2 VALUES(7,77);
INSERT INTO t2 VALUES(8,88);
SELECT @@global.gtid_binlog_state;
#Perform SST
--echo #Connection 1
--connection node_1
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
COMMIT;
--source include/save_master_gtid.inc
--echo #Connection 2
--connection node_2
--source include/sync_with_master_gtid.inc
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node2_committed_before');
INSERT INTO t1 VALUES ('node2_committed_before');
COMMIT;
--echo #Connection 3
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
--let $node_1= node_2
--let $node_2= node_3
--source include/auto_increment_offset_save.inc
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--echo #Connection 2
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_during');
INSERT INTO t1 VALUES ('node1_committed_during');
COMMIT;
--echo #Connection 3
--connection node_3
--echo Starting server ...
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
--source include/auto_increment_offset_restore.inc
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node3_committed_after');
INSERT INTO t1 VALUES ('node3_committed_after');
COMMIT;
--echo #Connection 2
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
--source include/wait_condition.inc
Select * from t1 order by f1;
--echo #Connection 3
--connection node_3
Select * from t1 order by f1;
#SST Done
--sleep 1
--echo #Connection 2
--connection node_2
SELECT @@global.gtid_binlog_state;
--echo #Connection 3
--connection node_3
SELECT @@global.gtid_binlog_state;
--echo #Connection 1
--connection node_1
SET AUTOCOMMIT=ON;
#drop table t1;
#CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
--echo #Connection 2
--connection node_2
SET AUTOCOMMIT=ON;
--echo #Connection 3
--connection node_3
SET AUTOCOMMIT=ON;
#
#stop slave on node 2
--echo #Connection 2
--connection node_2
STOP slave;
--sleep 1
INSERT INTO t1 VALUES ('node2_slave_stoped');
--echo #Connection 1
--connection node_1
INSERT INTO t1 VALUES ('node1_normal_entry');
--source include/save_master_gtid.inc
#start slave
--echo #Connection 2
--connection node_2
INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
start slave;
--source include/sync_with_master_gtid.inc
INSERT INTO t1 VALUES ('node2_slave_started');
SELECT count(*) from t1;
SELECT @@global.gtid_binlog_state;
--echo #Connection 3
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 12 FROM t1;
--source include/wait_condition.inc
SELECT count(*) from t1;
SELECT @@global.gtid_binlog_state;
--echo #Connection 1
--connection node_1
DROP TABLE t2,t1;
# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
# warning is also reported by MTR, which is also weird.
#
--sleep 3
--echo #Connection 2
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
--source include/wait_condition.inc
--echo #Connection 3
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--echo #Connection 2
--connection node_2
STOP SLAVE;
RESET SLAVE ALL;
reset master;
--echo #Connection 3
--connection node_3
reset master;
--echo #Connection 1
--connection node_1
reset master;

View File

@ -448,6 +448,7 @@ select * from t1;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
insert delayed into t1 values (4);
--sleep 5 # Wait for insert delayed to be executed.
select a from t1;
@ -474,6 +475,7 @@ show status like "Qcache_hits";
--connection node_1
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# Test of min result data unit size changing
@ -497,8 +499,9 @@ select * from t1;
select * from t1;
select * from t2;
select * from t2;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
--echo # On node-2
--connection node_2
@ -506,13 +509,14 @@ select * from t1;
select * from t1;
select * from t2;
select * from t2;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop table t1;
select a from t2;
select a from t2;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@ -520,8 +524,9 @@ show global variables like "query_cache_min_res_unit";
--connection node_1
select a from t2;
select a from t2;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
drop table t2;
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@ -537,6 +542,7 @@ select "aaa" from t1;
select "AAA" from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
--echo # On node-2
--connection node_2
@ -544,6 +550,7 @@ select "aaa" from t1;
select "AAA" from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
drop table t1;
#
@ -728,9 +735,9 @@ select count(*) from t1;
drop table t1;
#
# INTO OUTFILE/DUMPFILE test
#
--echo #
--echo # INTO OUTFILE/DUMPFILE test
--echo #
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@ -743,14 +750,15 @@ select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
drop table t1;
let $datadir=`select @@datadir`;
--remove_file $datadir/test/query_cache.dump.file
--remove_file $datadir/test/query_cache.out.file
#
# Test of SQL_SELECT_LIMIT
#
--echo #
--echo # Test of SQL_SELECT_LIMIT
--echo #
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@ -762,6 +770,7 @@ SET SQL_SELECT_LIMIT=1;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
SET SQL_SELECT_LIMIT=DEFAULT;
--echo # On node-2
@ -777,9 +786,9 @@ SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
#
# WRITE LOCK & QC
#
--echo #
--echo # WRITE LOCK & QC
--echo #
--echo # On node-1
--connection node_1
create table t1 (a int not null) engine=innodb;
@ -791,6 +800,7 @@ select * from t1;
select * from t2;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
@ -802,6 +812,7 @@ show status like "Qcache_hits";
lock table v1 write;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
@ -825,15 +836,16 @@ show status like "Qcache_hits";
lock table v1 write;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
#
# Hiding real table stored in query cache by temporary table
#
--echo #
--echo # Hiding real table stored in query cache by temporary table
--echo #
--echo # On node-1
--connection node_1
create table t1 (id int primary key) engine=innodb;
@ -866,66 +878,76 @@ INSERT INTO t1 VALUES (_koi8r 0xc3),(_koi8r 0xc3);
# Run select
#
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
SET NAMES default;
--echo # On node-2
--connection node_2
#
# Run select
#
--echo #
--echo # Run select
--echo #
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
#
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_inserts";
drop table t1;
#
# Comments before command
#
--echo #
--echo # Comments before command
--echo #
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@ -951,9 +973,10 @@ show status like "Qcache_hits";
drop table t1;
#
# Information schema & query cache test
#
--echo #
--echo # Information schema & query cache test
--echo #
--echo # On node-1
--connection node_1
set session query_cache_type = 2;

View File

@ -0,0 +1,122 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
log-bin
log-slave-updates
binlog-format=row
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep_gtid_mode=1
gtid_ignore_duplicates
wsrep-on=1
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
# wsrep-causal-reads=ON
# wsrep-sync-wait=15
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-cluster-address='gcomm://'
wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
[mysqld.2]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[mysqld.3]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
[mysqld.4]
wsrep_cluster_name=cluster2
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-cluster-address='gcomm://'
wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
[mysqld.5]
wsrep_cluster_name=cluster2
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
wsrep_provider_options='base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.5.#sst_port'
[mysqld.6]
wsrep_cluster_name=cluster2
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
wsrep_provider_options='base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_MYPORT_5= @mysqld.5.port
NODE_MYSOCK_5= @mysqld.5.socket
NODE_MYPORT_6= @mysqld.6.port
NODE_MYSOCK_6= @mysqld.6.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_GALERAPORT_4= @mysqld.4.#galera_port
NODE_GALERAPORT_5= @mysqld.5.#galera_port
NODE_GALERAPORT_6= @mysqld.6.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
NODE_SSTPORT_4= @mysqld.4.#sst_port
NODE_SSTPORT_5= @mysqld.5.#sst_port
NODE_SSTPORT_6= @mysqld.6.#sst_port

View File

@ -0,0 +1,231 @@
cluster 1 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
cluster 1 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
cluster 1 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
cluster 2 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
cluster 2 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
cluster 2 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
start slave;
include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
@@gtid_binlog_state
select @@gtid_slave_pos;
@@gtid_slave_pos
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
start slave;
include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
@@gtid_binlog_state
select @@gtid_slave_pos;
@@gtid_slave_pos
cluster 1 node 1
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 1
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
insert into t1 values (2, 21, 1);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
select * from t1;
cluster_domain_id node_server_id seq_no
1 11 2
2 21 1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 2
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
insert into t1 values (1, 12, 3);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 3
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
insert into t1 values (1, 13, 4);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 2
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
insert into t1 values (2, 22, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
#wait for sync cluster 2 and 1
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 3
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
insert into t1 values (2, 23, 3);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
#wait for sync cluster 2 and 1
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 1
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
drop table t1;
stop slave;
reset slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
cluster 2 node 1
stop slave;
reset slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
reset master;
reset master;
reset master;
reset master;
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
start slave;
include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
@@gtid_binlog_state
select @@gtid_slave_pos;
@@gtid_slave_pos
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
start slave;
include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
@@gtid_binlog_state
select @@gtid_slave_pos;
@@gtid_slave_pos
cluster 1 node 1
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 1
insert into t1 values (2, 21, 1);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
select * from t1;
cluster_domain_id node_server_id seq_no
1 11 2
2 21 1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 2
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
insert into t1 values (1, 12, 3);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 3
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
insert into t1 values (1, 13, 4);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
#wait for sync cluster 1 and 2
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 2
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
insert into t1 values (2, 22, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
#wait for sync cluster 2 and 1
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 2 node 3
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
insert into t1 values (2, 23, 3);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
#wait for sync cluster 2 and 1
include/save_master_gtid.inc
include/sync_with_master_gtid.inc
cluster 1 node 1
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
drop table t1;
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
cluster 2 node 1
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
reset master;
reset master;
reset master;
reset master;

View File

@ -0,0 +1,28 @@
# We need a dedicated .cnf file, even if empty, in order to force this test to run
# alone on a freshly started cluster. Otherwise there are adverse interactions with
# following tests such as galera_3nodes.galera_var_dirty_reads2
!include ../galera_2x3nodes.cnf
[mysqld.1]
wsrep_gtid_domain_id=1
server-id=11
[mysqld.2]
wsrep_gtid_domain_id=1
server-id=12
[mysqld.3]
wsrep_gtid_domain_id=1
server-id=13
[mysqld.4]
wsrep_gtid_domain_id=2
server-id=21
[mysqld.5]
wsrep_gtid_domain_id=2
server-id=22
[mysqld.6]
wsrep_gtid_domain_id=2
server-id=23

View File

@ -0,0 +1,292 @@
#
# This test creates 2x 3 nodes galera cluster.
# The whole test case
# A <-> B <-> C {Galera cluster 1}
# | {Circular Async replication}
# D <-> E <-> F {Galera cluster 2}
# We will write on any random node to see if gtid is consitent or not
# Then we will kill node D and set up the replication between A and E
# To see whether fail over works or not.
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
--echo cluster 1 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
--connection node_2
--echo cluster 1 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
--echo cluster 1 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
--connection node_4
--echo cluster 2 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
--connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5
--connection node_5
--echo cluster 2 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
--connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6
--connection node_6
--echo cluster 2 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
#--disable_parsing
--connection node_1
--replace_result $NODE_MYPORT_4 NODE_MYPORT_4
--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);
start slave;
--source include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
select @@gtid_slave_pos;
#--query_vertical SHOW SLAVE STATUS;
--connection node_4
--replace_result $NODE_MYPORT_1 NODE_MYPORT_1
--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);
start slave;
--source include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
select @@gtid_slave_pos;
#--query_vertical SHOW SLAVE STATUS;
--echo cluster 1 node 1
--connection node_1
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 2 node 1
--connection node_4
select @@gtid_binlog_state;
insert into t1 values (2, 21, 1);
select @@gtid_binlog_state;
select * from t1;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 2
--connection node_2
select @@gtid_binlog_state;
insert into t1 values (1, 12, 3);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 3
--connection node_3
select @@gtid_binlog_state;
insert into t1 values (1, 13, 4);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 2 node 2
--connection node_5
select @@gtid_binlog_state;
insert into t1 values (2, 22, 2);
select @@gtid_binlog_state;
--echo #wait for sync cluster 2 and 1
--connection node_4
--source include/save_master_gtid.inc
--connection node_1
--source include/sync_with_master_gtid.inc
--echo cluster 2 node 3
--connection node_6
select @@gtid_binlog_state;
insert into t1 values (2, 23, 3);
select @@gtid_binlog_state;
--echo #wait for sync cluster 2 and 1
--connection node_4
--source include/save_master_gtid.inc
--connection node_1
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 1
--connection node_1
select @@gtid_binlog_state;
drop table t1;
stop slave;
reset slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
--sleep 2
--echo cluster 2 node 1
--connection node_4
stop slave;
reset slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
--connection node_2
reset master;
--connection node_3
reset master;
--connection node_5
reset master;
--connection node_6
reset master;
#--enable_parsing
#
# This test creates 2x 3 nodes galera cluster.
# The whole test case
# A <-> B <-> C {Galera cluster 1}
# \ /
# \ /
# / {C->D, F->A , Async normal slave repl}
# / \
# | \
# D <-> E <-> F {Galera cluster 2}
# We will write on any random node to see if gtid is consitent or not
# Then we will kill node D and set up the replication between A and E
# To see whether fail over works or not.
--connection node_1
--replace_result $NODE_MYPORT_6 NODE_MYPORT_6
--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);
start slave;
--source include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
select @@gtid_slave_pos;
#--query_vertical SHOW SLAVE STATUS;
--connection node_4
--replace_result $NODE_MYPORT_3 NODE_MYPORT_3
--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);
start slave;
--source include/wait_for_slave_to_start.inc
select @@gtid_binlog_state;
select @@gtid_slave_pos;
#--query_vertical SHOW SLAVE STATUS;
--echo cluster 1 node 1
--connection node_1
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--sleep 2
--echo cluster 2 node 1
--connection node_4
insert into t1 values (2, 21, 1);
select @@gtid_binlog_state;
select * from t1;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 2
--connection node_2
select @@gtid_binlog_state;
insert into t1 values (1, 12, 3);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 3
--connection node_3
select @@gtid_binlog_state;
insert into t1 values (1, 13, 4);
select @@gtid_binlog_state;
--echo #wait for sync cluster 1 and 2
--connection node_1
--source include/save_master_gtid.inc
--connection node_4
--source include/sync_with_master_gtid.inc
--echo cluster 2 node 2
--connection node_5
select @@gtid_binlog_state;
insert into t1 values (2, 22, 2);
select @@gtid_binlog_state;
--echo #wait for sync cluster 2 and 1
--connection node_4
--source include/save_master_gtid.inc
--connection node_1
--source include/sync_with_master_gtid.inc
--echo cluster 2 node 3
--connection node_6
select @@gtid_binlog_state;
insert into t1 values (2, 23, 3);
select @@gtid_binlog_state;
--echo #wait for sync cluster 2 and 1
--connection node_4
--source include/save_master_gtid.inc
--connection node_1
--source include/sync_with_master_gtid.inc
--echo cluster 1 node 1
--connection node_1
select @@gtid_binlog_state;
drop table t1;
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
--echo cluster 2 node 1
--connection node_4
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
reset master;
set global GTID_SLAVE_POS="";
--connection node_2
reset master;
--connection node_3
reset master;
--connection node_5
reset master;
--connection node_6
reset master;

View File

@ -1 +0,0 @@
innodb_virtual_debug_purge : MDEV-13568 should purge yield to LOCK TABLES?

View File

@ -143,20 +143,15 @@ connect prevent_purge, localhost, root;
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
connect con1, localhost, root;
connect lock_table, localhost, root;
lock table t write;
disconnect prevent_purge;
connection default;
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
0
disconnect con1;
InnoDB 0 transactions not purged
disconnect lock_table;
start transaction with consistent snapshot;
commit;
InnoDB 0 transactions not purged
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
0
set global debug_dbug=@old_dbug;
drop table t;
set debug_sync=reset;

View File

@ -1,3 +1,5 @@
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
#
# Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
# THE NUMBER OF VIRTUAL COLUMNS
@ -86,6 +88,7 @@ DISTINCT I1.c14 AS y
FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
InnoDB 0 transactions not purged
DROP TABLE t1, t2, t3;
#
# Bug 22650296 - ASSERTION IN INNOBASE_BUILD_COL_MAP, ALTER
@ -194,3 +197,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -182,16 +182,15 @@ connect(prevent_purge, localhost, root);
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
connect(con1, localhost, root);
connect(lock_table, localhost, root);
lock table t write;
disconnect prevent_purge;
connection default;
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
disconnect con1;
--source ../../innodb/include/wait_all_purged.inc
disconnect lock_table;
start transaction with consistent snapshot;
commit;
--source ../../innodb/include/wait_all_purged.inc
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
set global debug_dbug=@old_dbug;
drop table t;

View File

@ -1,5 +1,9 @@
--source include/have_innodb.inc
# Ensure that the history list length will actually be decremented by purge.
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
--echo #
--echo # Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
--echo # THE NUMBER OF VIRTUAL COLUMNS
@ -96,6 +100,7 @@ FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1, t2, t3;
@ -218,3 +223,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -1363,3 +1363,9 @@ SELECT * FROM t1;
c1
1e19
DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (-1);
SELECT * FROM t1;
a
-1
DROP TABLE t1;

View File

@ -112,6 +112,35 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=latin1
drop table t1;
drop table t480;
#
# MDEV-12827 Assertion failure when reporting duplicate key error
# in online table rebuild
#
CREATE TABLE t1 (j INT UNIQUE, i INT UNIQUE) ENGINE=InnoDB;
connect con1,localhost,root,,test;
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built WAIT_FOR log';
ALTER TABLE t1 DROP j, FORCE;
connection default;
SET DEBUG_SYNC='now WAIT_FOR built';
INSERT INTO t1 (i) VALUES (0),(0);
ERROR 23000: Duplicate entry '0' for key 'i'
SET DEBUG_SYNC='now SIGNAL log';
connection con1;
ERROR 23000: Duplicate entry '0' for key 'i'
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built2 WAIT_FOR log2';
ALTER TABLE t1 DROP j, FORCE;
connection default;
SET DEBUG_SYNC='now WAIT_FOR built2';
INSERT INTO t1 (i) VALUES (0),(1);
UPDATE t1 SET i=0;
ERROR 23000: Duplicate entry '0' for key 'i'
SET DEBUG_SYNC='now SIGNAL log2';
connection con1;
ERROR 23000: Duplicate entry '0' for key 'i'
disconnect con1;
connection default;
SET DEBUG_SYNC='RESET';
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
#
# BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP

View File

@ -3299,3 +3299,83 @@ show status like "handler_read_key";
Variable_name Value
Handler_read_key 0
drop table t1;
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (c1 INT) ENGINE=InnoDB;
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(0);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
ROLLBACK;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1
START TRANSACTION READ ONLY;
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
INSERT INTO t2 VALUES(1);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
COMMIT;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1
1
3
DROP TABLE t2;
CREATE TEMPORARY TABLE t2 (
c1 INT AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
ROLLBACK;
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1 c2
START TRANSACTION READ ONLY;
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
INSERT INTO t1 VALUES(0);
ERROR 25006: Cannot execute statement in a READ ONLY transaction
COMMIT;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
SELECT * FROM t1;
c1
SELECT * FROM t2;
c1 c2
4 1
7 1
5 2
8 2
6 3
9 3
DROP TABLE t1;
DROP TABLE t2;

View File

@ -0,0 +1,148 @@
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (
a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
453 -684,451 -679,453 -677,458 -681,463 -681,468 -678,470 -676,470 -678,
468 -675,472 -675,472 -675,474 -674,479 -676,477 -675,473 -676,475 1324,
479 1319,484 1322,483 1323,486 1323,491 1328,492 1325,496 1325,498 1325,
501 1330,498 1331,500 1331,504 1330,508 1329,512 1332,513 1337,518 1339,
518 1339,513 1344,513 1344,512 1346,514 1351,515 1353,519 1358,518 1362,
522 1365,525 1360,526 1362,527 1362,528 1367,525 1371,528 1366,532 1369,
536 1374,539 1377,543 1379,539 1381,541 1382,543 1383,546 1388,549 1393,
554 1393,554 1395,554 1392,550 1394,550 1392,546 1394,549 1397,550 1393,
549 1394,554 1390,554 1391,549 1396,551 1396,547 1400,547 1402,551 1407,
554 1412,554 1415,558 1418,463 -681,465 -677,465 -675,470 -670,470 -665,
470 -660,470 -659,473 -656,476 -656,481 -655,482 -652,486 -654,486 -652,
486 -648,491 -646,490 -651,494 -646,493 -644,493 -644,490 -644,491 2356,
495 2359,495 2364,500 2359,503 5359,504 5364,509 5368,504 5367,499 5368,
498 5371,498 5369,500 5370,504 5370,508 5370,511 5370,507 5374,508 5378,
511 5382,507 5387,509 5389,512 5388,515 5393,520 5396,517 5397,517 5402,
515 5404,520 5402,521 5405,525 5405,526 5408,530 7408,535 7413,533 7415,
529 7412,532 7416,4532 7416,4534 7421,4533 7417,4536 7413,4536 7418,
4540 3418,4545 3418,4549 3415,4551 3419,4554 3421,4559 3423,4559 3426,
4557 3424,4561 3428,4558 3428,4563 3431,4565 3435,4569 3439,4569 3439,
4569 3444,4567 3444,4572 3446,4577 3447,4581 3444,4581 3448,4584 3448,
4579 3447,4580 3450,4583 3449,4583 3453,4587 3455,4588 3458,4593 3463,
4598 3465,4601 3468,4598 3464,4598 3460,4593 5460,4595 5461,4600 5464,
4600 5465,4601 5466,4606 5466,4608 5466,4605 5464,4608 5467,4607 5468,
4609 5465,4614 5461,4618 5463,4621 5467,4623 5470,4622 5470,4622 5470,
4625 6470,4627 6471,4627 6472,4627 6473,6627 6474,6625 6474,6628 6477,
6633 6481,6633 6480,6637 6475,7637 6479,7638 6482,7643 6487,7644 6492,
7647 6492,7648 6495,7646 6498,7650 6499,7646 6494,7644 6499,7644 6497,
7644 6499,7647 6502,7649 6504,7650 6501,7647 6503,7649 6504,7650 6508,
7651 6503,7652 6508,7655 6508,7650 6511,7655 6515,7658 6513,7663 6513,
7665 6514,7669 6512,7667 6510,7664 6510,472 -675,477 -670,479 -666,
482 -663,484 -668,484 -666,485 -664,481 -664,479 -659,482 -659,484 -658,
483 -659,488 2341,493 2339,489 2338,491 2342,491 2346,494 2346,490 2348,
493 2348,498 2349,498 2350,499 2349,502 2350,503 2348,506 2348,506 2348,
507 2353,507 2355,504 2359,504 2364,504 2361,499 2365,502 2360,502 2358,
503 2357,504 2353,504 2357,500 2356,497 2355,498 2355,500 2359,502 2361,
505 2364,508 2364,506 2368,506 2370,504 2373,499 2373,496 2372,493 2377,
497 2380,495 2383,496 7383,493 7386,497 7391,494 7387,495 7389,498 7392,
498 7392,495 7395,493 7398,498 7401,498 7403,503 7400,498 8400,501 8401,
503 8401,503 8401,501 10401,496 10396,491 10401,492 10399,493 10403,
496 10403,491 10403,493 10407,489 10410,493 10407,489 10403,498 7403,
497 7399,496 7403,500 7405,500 7407,503 7411,508 7415,511 7415,511 7420,
515 7420,520 7423,523 7423,520 7427,523 7427,523 7427,522 7432,525 4432,
527 4434,530 4437,534 4441,529 4446,529 4441,534 4436,537 4436,535 4437,
532 4437,534 4432,535 4429,538 4430,542 4427,542 4431,538 4431,541 4431,
541 4433,543 4433,545 4432,549 4428,552 4426,556 4427,557 4423,560 4427,
561 4428,558 4430,559 4434,559 4432,561 4434,561 4437,563 4435,559 4430,
561 4435,4561 4437,4566 4441,4568 4446,4568 4450,4569 4455,4565 4458,
4561 4463,4561 9463,4564 9463,4565 9461,9565 9463,9560 9467,9560 9466,
9555 9469,9555 9471,9559 9469,9557 9473,9553 9478,9555 9480,9557 9481,
9557 9481,9557 9483,9562 9487,9558 9487,9558 9490,9561 9493,9562 9493,
9557 9493,9560 9496,9555 9501,9553 9503,9553 9506,9557 9510,9558 9511,
9561 9514,9563 9512,9568 9514,9567 9514,9567 13514,9570 13517,9566 13521,
9571 13521,9571 13526,9573 13521,9571 13521,9576 10521,9580 10526,9582 10525,
9584 10528,9584 10531,9584 10533,9589 10533,9588 10537,9588 10541,9589 10542,
9593 10544,9595 10540,9597 10541,9600 10545,9601 15545,9603 15549,9605 15553,
9601 15558,9601 15553,9605 15551,9605 15550,9605 15554,9607 15556,9605 15556,
9604 15561,9607 15559,9603 15559,9603 15562,9604 15563,9608 15566,9612 15570,
9617 15565,9622 15568,9627 15566,9628 15564,9629 15564,9633 15569,9636 15569,
9634 15571,9634 15572,9636 15574,9634 15570,9629 15570,9631 15567,9629 15570,
9626 15574,9626 15575,498 7401,502 7401,506 7397,506 7395,502 7398,497 7401,
502 7402,505 7397,508 7400,504 7404,3504 7409,3505 7405,3508 7410,3511 7413,
3511 7416,3511 7419,3511 7419,3513 7421,3517 7424,3519 7426,3520 11426,
3523 11421,3527 11418,3530 11415,3530 11416,3533 11418,7533 11415,7531 11415,
7531 11417,7536 11420,7541 11424,7543 11425,7543 11427,7543 11429,7540 11429,
7542 11425,7541 11420,7542 11421,7542 11422,7540 11424,7540 11423,7543 11422,
7546 11426,7550 11431,7553 11436,7555 16436,7553 16438,7558 16438,7559 16438,
7560 16439,7565 16437,7560 16435,7563 16435,7566 16440,7566 16444,7564 16447,
7559 16443,7561 16443,7566 16448,7570 16451,7574 16456,7578 16459,
12578 16459,12578 20459,12577 20456,12581 20454,12585 20456,12585 20456,
12585 20456,12583 20456,12579 20459,12580 20461,12580 20462,12580 20460,
12585 20465,12586 20467,12590 20470,12590 20470,12589 20471,12584 20471,
12589 20471,9589 20472,9594 20472,9595 20472,9596 20477,9598 20482,
9603 20480,9608 20484,9613 20484,9610 20486,9608 20488,9608 20489,9610 20489,
9614 20486,9619 20481,9620 20481,9618 21481,9621 21483,9626 21483,9628 21485,
9623 21487,9622 21490,9626 21493,9621 21495,9626 21498,9622 21499,9624 21504,
9625 21499,9629 21501,9633 21498,9637 21495,9639 21498,9644 21501,9557 9481,
9560 9485,9561 9490,9563 9488,9560 9486,9558 9488,9561 9492,9563 9495,
9567 9492,9567 9488,9564 9490,9559 9495,9559 9498,9557 9502,9562 9506,
9564 9509,9569 9512,9569 9516,9569 9518,9569 9515,9571 9513,9571 9512,
9573 9513,9578 9516,9581 9516,9585 11516,9585 11521,9590 10521,9586 10524,
9589 10529,9589 10527,9589 10527,9594 10532,9594 10534,9598 10536,9598 10540,
9600 10542,9604 10538,9607 10538,9609 10543,9613 10538,9613 10533,9613 10537,
9610 10537,9614 10542,9609 10542,9610 10543,9610 10548,9611 10553,9616 7553,
9620 7553,9621 7557,9618 7559,9618 7554,9622 7557,9622 7561,9622 7556,
9622 7560,9619 7560,9620 7565,9622 7563,9627 7566,9630 7570,9630 7571,
9632 7573,9637 7576,9639 7578,9640 7576,9640 7579,9640 7575,9642 7570,
9646 7570,9651 7574,9653 7577,9652 7572,9653 7576,9653 7576,9651 7581,
9656 7585,9660 7586,9659 7591,9657 7594,9661 7598,9664 7602,9668 12602,
9673 12604,9676 12606,9679 12602,9682 12605,9677 12610,9674 12606,9674 12601,
9674 12603,9672 9603,9668 9605,9671 9606,9668 9611,9668 9606,9671 9611,
9675 9615,9677 9620,9678 9622,9679 9624,9684 9626,9685 9627,9685 9622,
9685 9626,9689 9628,9694 9633,9699 9637,9699 9637,9704 9636,9708 9637,
9709 9638,9707 9639,9705 9642,9707 9647,9710 9649,9711 9653,9716 9649,
9716 9648,9720 9650,9721 9648,9723 9648,9726 4648,12726 4653,12731 4655,
12734 4660,12730 4661,12733 4664,12733 4665,12735 4670,12737 4674,12741 4674,
12738 4675,12740 4675,12737 4675,12742 4678,12743 4681,12746 4677)'),
INDEX(b,c), SPATIAL INDEX(l)
) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 () VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
SELECT LENGTH(l) FROM t1;
LENGTH(l)
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
11197
INSERT INTO t1 (a) SELECT NULL FROM t1;
INSERT INTO t1 (a) SELECT NULL FROM t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
UPDATE t1 SET c=true, l=ST_linefromtext('linestring(0 0,1 1,2 2)');
DELETE FROM t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
InnoDB 0 transactions not purged
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SELECT OTHER_INDEX_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE NAME='test/t1';
OTHER_INDEX_SIZE
1
# Note: The OTHER_INDEX_SIZE does not cover any SPATIAL INDEX.
# To test that all indexes were emptied, replace DROP TABLE
# with the following, and examine the root pages in t1.ibd:
# FLUSH TABLES t1 FOR EXPORT;
# UNLOCK TABLES;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -695,3 +695,8 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (-1);
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -114,6 +114,45 @@ connection default;
show create table t1;
drop table t1;
drop table t480;
--echo #
--echo # MDEV-12827 Assertion failure when reporting duplicate key error
--echo # in online table rebuild
--echo #
CREATE TABLE t1 (j INT UNIQUE, i INT UNIQUE) ENGINE=InnoDB;
--connect (con1,localhost,root,,test)
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built WAIT_FOR log';
--send
ALTER TABLE t1 DROP j, FORCE;
--connection default
SET DEBUG_SYNC='now WAIT_FOR built';
--error ER_DUP_ENTRY
INSERT INTO t1 (i) VALUES (0),(0);
SET DEBUG_SYNC='now SIGNAL log';
--connection con1
--error ER_DUP_ENTRY
reap;
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built2 WAIT_FOR log2';
--send
ALTER TABLE t1 DROP j, FORCE;
--connection default
SET DEBUG_SYNC='now WAIT_FOR built2';
INSERT INTO t1 (i) VALUES (0),(1);
--error ER_DUP_ENTRY
UPDATE t1 SET i=0;
SET DEBUG_SYNC='now SIGNAL log2';
--connection con1
--error ER_DUP_ENTRY
reap;
--disconnect con1
--connection default
SET DEBUG_SYNC='RESET';
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
--source include/wait_until_count_sessions.inc

View File

@ -2583,6 +2583,76 @@ select f1 from t1;
show status like "handler_read_key";
drop table t1;
#
# Test handling of writes to TEMPORARY tables for read-only transactions
#
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (c1 INT) ENGINE=InnoDB;
# Check that the rollback works
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(0);
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
ROLLBACK;
SELECT * FROM t1;
SELECT * FROM t2;
START TRANSACTION READ ONLY;
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
INSERT INTO t2 VALUES(1);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(3);
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
COMMIT;
SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t2;
# This time with some indexes
CREATE TEMPORARY TABLE t2 (
c1 INT AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
SHOW CREATE TABLE t2;
# Check that the rollback works
START TRANSACTION READ ONLY;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
ROLLBACK;
SELECT * FROM t1;
SELECT * FROM t2;
START TRANSACTION READ ONLY;
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
COMMIT;
SET TRANSACTION READ ONLY;
START TRANSACTION;
INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
INSERT INTO t1 VALUES(0);
COMMIT;
SHOW CREATE TABLE t2;
SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #

View File

@ -0,0 +1 @@
--innodb-sys-tablestats

View File

@ -0,0 +1,131 @@
--source include/have_innodb.inc
# Ensure that the history list length will actually be decremented by purge.
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (
a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
453 -684,451 -679,453 -677,458 -681,463 -681,468 -678,470 -676,470 -678,
468 -675,472 -675,472 -675,474 -674,479 -676,477 -675,473 -676,475 1324,
479 1319,484 1322,483 1323,486 1323,491 1328,492 1325,496 1325,498 1325,
501 1330,498 1331,500 1331,504 1330,508 1329,512 1332,513 1337,518 1339,
518 1339,513 1344,513 1344,512 1346,514 1351,515 1353,519 1358,518 1362,
522 1365,525 1360,526 1362,527 1362,528 1367,525 1371,528 1366,532 1369,
536 1374,539 1377,543 1379,539 1381,541 1382,543 1383,546 1388,549 1393,
554 1393,554 1395,554 1392,550 1394,550 1392,546 1394,549 1397,550 1393,
549 1394,554 1390,554 1391,549 1396,551 1396,547 1400,547 1402,551 1407,
554 1412,554 1415,558 1418,463 -681,465 -677,465 -675,470 -670,470 -665,
470 -660,470 -659,473 -656,476 -656,481 -655,482 -652,486 -654,486 -652,
486 -648,491 -646,490 -651,494 -646,493 -644,493 -644,490 -644,491 2356,
495 2359,495 2364,500 2359,503 5359,504 5364,509 5368,504 5367,499 5368,
498 5371,498 5369,500 5370,504 5370,508 5370,511 5370,507 5374,508 5378,
511 5382,507 5387,509 5389,512 5388,515 5393,520 5396,517 5397,517 5402,
515 5404,520 5402,521 5405,525 5405,526 5408,530 7408,535 7413,533 7415,
529 7412,532 7416,4532 7416,4534 7421,4533 7417,4536 7413,4536 7418,
4540 3418,4545 3418,4549 3415,4551 3419,4554 3421,4559 3423,4559 3426,
4557 3424,4561 3428,4558 3428,4563 3431,4565 3435,4569 3439,4569 3439,
4569 3444,4567 3444,4572 3446,4577 3447,4581 3444,4581 3448,4584 3448,
4579 3447,4580 3450,4583 3449,4583 3453,4587 3455,4588 3458,4593 3463,
4598 3465,4601 3468,4598 3464,4598 3460,4593 5460,4595 5461,4600 5464,
4600 5465,4601 5466,4606 5466,4608 5466,4605 5464,4608 5467,4607 5468,
4609 5465,4614 5461,4618 5463,4621 5467,4623 5470,4622 5470,4622 5470,
4625 6470,4627 6471,4627 6472,4627 6473,6627 6474,6625 6474,6628 6477,
6633 6481,6633 6480,6637 6475,7637 6479,7638 6482,7643 6487,7644 6492,
7647 6492,7648 6495,7646 6498,7650 6499,7646 6494,7644 6499,7644 6497,
7644 6499,7647 6502,7649 6504,7650 6501,7647 6503,7649 6504,7650 6508,
7651 6503,7652 6508,7655 6508,7650 6511,7655 6515,7658 6513,7663 6513,
7665 6514,7669 6512,7667 6510,7664 6510,472 -675,477 -670,479 -666,
482 -663,484 -668,484 -666,485 -664,481 -664,479 -659,482 -659,484 -658,
483 -659,488 2341,493 2339,489 2338,491 2342,491 2346,494 2346,490 2348,
493 2348,498 2349,498 2350,499 2349,502 2350,503 2348,506 2348,506 2348,
507 2353,507 2355,504 2359,504 2364,504 2361,499 2365,502 2360,502 2358,
503 2357,504 2353,504 2357,500 2356,497 2355,498 2355,500 2359,502 2361,
505 2364,508 2364,506 2368,506 2370,504 2373,499 2373,496 2372,493 2377,
497 2380,495 2383,496 7383,493 7386,497 7391,494 7387,495 7389,498 7392,
498 7392,495 7395,493 7398,498 7401,498 7403,503 7400,498 8400,501 8401,
503 8401,503 8401,501 10401,496 10396,491 10401,492 10399,493 10403,
496 10403,491 10403,493 10407,489 10410,493 10407,489 10403,498 7403,
497 7399,496 7403,500 7405,500 7407,503 7411,508 7415,511 7415,511 7420,
515 7420,520 7423,523 7423,520 7427,523 7427,523 7427,522 7432,525 4432,
527 4434,530 4437,534 4441,529 4446,529 4441,534 4436,537 4436,535 4437,
532 4437,534 4432,535 4429,538 4430,542 4427,542 4431,538 4431,541 4431,
541 4433,543 4433,545 4432,549 4428,552 4426,556 4427,557 4423,560 4427,
561 4428,558 4430,559 4434,559 4432,561 4434,561 4437,563 4435,559 4430,
561 4435,4561 4437,4566 4441,4568 4446,4568 4450,4569 4455,4565 4458,
4561 4463,4561 9463,4564 9463,4565 9461,9565 9463,9560 9467,9560 9466,
9555 9469,9555 9471,9559 9469,9557 9473,9553 9478,9555 9480,9557 9481,
9557 9481,9557 9483,9562 9487,9558 9487,9558 9490,9561 9493,9562 9493,
9557 9493,9560 9496,9555 9501,9553 9503,9553 9506,9557 9510,9558 9511,
9561 9514,9563 9512,9568 9514,9567 9514,9567 13514,9570 13517,9566 13521,
9571 13521,9571 13526,9573 13521,9571 13521,9576 10521,9580 10526,9582 10525,
9584 10528,9584 10531,9584 10533,9589 10533,9588 10537,9588 10541,9589 10542,
9593 10544,9595 10540,9597 10541,9600 10545,9601 15545,9603 15549,9605 15553,
9601 15558,9601 15553,9605 15551,9605 15550,9605 15554,9607 15556,9605 15556,
9604 15561,9607 15559,9603 15559,9603 15562,9604 15563,9608 15566,9612 15570,
9617 15565,9622 15568,9627 15566,9628 15564,9629 15564,9633 15569,9636 15569,
9634 15571,9634 15572,9636 15574,9634 15570,9629 15570,9631 15567,9629 15570,
9626 15574,9626 15575,498 7401,502 7401,506 7397,506 7395,502 7398,497 7401,
502 7402,505 7397,508 7400,504 7404,3504 7409,3505 7405,3508 7410,3511 7413,
3511 7416,3511 7419,3511 7419,3513 7421,3517 7424,3519 7426,3520 11426,
3523 11421,3527 11418,3530 11415,3530 11416,3533 11418,7533 11415,7531 11415,
7531 11417,7536 11420,7541 11424,7543 11425,7543 11427,7543 11429,7540 11429,
7542 11425,7541 11420,7542 11421,7542 11422,7540 11424,7540 11423,7543 11422,
7546 11426,7550 11431,7553 11436,7555 16436,7553 16438,7558 16438,7559 16438,
7560 16439,7565 16437,7560 16435,7563 16435,7566 16440,7566 16444,7564 16447,
7559 16443,7561 16443,7566 16448,7570 16451,7574 16456,7578 16459,
12578 16459,12578 20459,12577 20456,12581 20454,12585 20456,12585 20456,
12585 20456,12583 20456,12579 20459,12580 20461,12580 20462,12580 20460,
12585 20465,12586 20467,12590 20470,12590 20470,12589 20471,12584 20471,
12589 20471,9589 20472,9594 20472,9595 20472,9596 20477,9598 20482,
9603 20480,9608 20484,9613 20484,9610 20486,9608 20488,9608 20489,9610 20489,
9614 20486,9619 20481,9620 20481,9618 21481,9621 21483,9626 21483,9628 21485,
9623 21487,9622 21490,9626 21493,9621 21495,9626 21498,9622 21499,9624 21504,
9625 21499,9629 21501,9633 21498,9637 21495,9639 21498,9644 21501,9557 9481,
9560 9485,9561 9490,9563 9488,9560 9486,9558 9488,9561 9492,9563 9495,
9567 9492,9567 9488,9564 9490,9559 9495,9559 9498,9557 9502,9562 9506,
9564 9509,9569 9512,9569 9516,9569 9518,9569 9515,9571 9513,9571 9512,
9573 9513,9578 9516,9581 9516,9585 11516,9585 11521,9590 10521,9586 10524,
9589 10529,9589 10527,9589 10527,9594 10532,9594 10534,9598 10536,9598 10540,
9600 10542,9604 10538,9607 10538,9609 10543,9613 10538,9613 10533,9613 10537,
9610 10537,9614 10542,9609 10542,9610 10543,9610 10548,9611 10553,9616 7553,
9620 7553,9621 7557,9618 7559,9618 7554,9622 7557,9622 7561,9622 7556,
9622 7560,9619 7560,9620 7565,9622 7563,9627 7566,9630 7570,9630 7571,
9632 7573,9637 7576,9639 7578,9640 7576,9640 7579,9640 7575,9642 7570,
9646 7570,9651 7574,9653 7577,9652 7572,9653 7576,9653 7576,9651 7581,
9656 7585,9660 7586,9659 7591,9657 7594,9661 7598,9664 7602,9668 12602,
9673 12604,9676 12606,9679 12602,9682 12605,9677 12610,9674 12606,9674 12601,
9674 12603,9672 9603,9668 9605,9671 9606,9668 9611,9668 9606,9671 9611,
9675 9615,9677 9620,9678 9622,9679 9624,9684 9626,9685 9627,9685 9622,
9685 9626,9689 9628,9694 9633,9699 9637,9699 9637,9704 9636,9708 9637,
9709 9638,9707 9639,9705 9642,9707 9647,9710 9649,9711 9653,9716 9649,
9716 9648,9720 9650,9721 9648,9723 9648,9726 4648,12726 4653,12731 4655,
12734 4660,12730 4661,12733 4664,12733 4665,12735 4670,12737 4674,12741 4674,
12738 4675,12740 4675,12737 4675,12742 4678,12743 4681,12746 4677)'),
INDEX(b,c), SPATIAL INDEX(l)
) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 () VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
SELECT LENGTH(l) FROM t1;
INSERT INTO t1 (a) SELECT NULL FROM t1;
INSERT INTO t1 (a) SELECT NULL FROM t1;
CHECK TABLE t1;
UPDATE t1 SET c=true, l=ST_linefromtext('linestring(0 0,1 1,2 2)');
DELETE FROM t1;
CHECK TABLE t1;
source include/wait_all_purged.inc;
ANALYZE TABLE t1;
SELECT OTHER_INDEX_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE NAME='test/t1';
--echo # Note: The OTHER_INDEX_SIZE does not cover any SPATIAL INDEX.
--echo # To test that all indexes were emptied, replace DROP TABLE
--echo # with the following, and examine the root pages in t1.ibd:
--echo # FLUSH TABLES t1 FOR EXPORT;
--echo # UNLOCK TABLES;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@ -3,6 +3,13 @@ CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(0);
COMMIT;
start transaction;
connect flush_log,localhost,root,,;
BEGIN;
DELETE FROM t LIMIT 1;
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
ROLLBACK;
disconnect flush_log;
connection default;
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
NOT FOUND /Rollback of trx with id/ in current_test

View File

@ -26,6 +26,13 @@ eval INSERT t VALUES(201-$n);
dec $n;
}
--enable_query_log
connect (flush_log,localhost,root,,);
BEGIN;
DELETE FROM t LIMIT 1;
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
ROLLBACK;
disconnect flush_log;
connection default;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;

View File

@ -0,0 +1,37 @@
--echo #
--echo # MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
--echo #
--eval CREATE TABLE t1 (i INT) ENGINE=$engine PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
--echo #
--echo # MDEV-13788 Server crash when issuing bad SQL partition syntax
--echo #
--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE))
SHOW CREATE TABLE t1;
--error ER_PARTITION_REQUIRES_VALUES_ERROR
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
DROP TABLE t1;
--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3))
SHOW CREATE TABLE t1;
--error ER_PARTITION_REQUIRES_VALUES_ERROR
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES IN (4,5,6)
);
DROP TABLE t1;

View File

@ -0,0 +1,44 @@
#
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
#
CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
#
# MDEV-13788 Server crash when issuing bad SQL partition syntax
#
CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY RANGE COLUMNS(`d`)
(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
DROP TABLE t1;
CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY LIST (`id`)
(PARTITION `p1` VALUES IN (1,2,3) ENGINE = InnoDB)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;

View File

@ -16,3 +16,47 @@ select * from t1;
pk dt
1 2017-09-28 15:12:00
drop table t1;
#
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
#
CREATE TABLE t1 (i INT) ENGINE=Aria PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
#
# MDEV-13788 Server crash when issuing bad SQL partition syntax
#
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
PARTITION BY RANGE COLUMNS(`d`)
(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = Aria)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
DROP TABLE t1;
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1
PARTITION BY LIST (`id`)
(PARTITION `p1` VALUES IN (1,2,3) ENGINE = Aria)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;

View File

@ -1,10 +1,57 @@
CREATE TABLE t1 (i INT) ENGINE=MYISAM
PARTITION BY LIST(i) (
PARTITION p0 VALUES IN (1),
PARTITION p1 VALUES IN (2)
);
#
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
#
CREATE TABLE t1 (i INT) ENGINE=MyISAM PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
#
# MDEV-13788 Server crash when issuing bad SQL partition syntax
#
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE COLUMNS(`d`)
(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES LESS THAN (MAXVALUE)
);
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
DROP TABLE t1;
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`d` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY LIST (`id`)
(PARTITION `p1` VALUES IN (1,2,3) ENGINE = MyISAM)
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
(
PARTITION p2, /* Notice no values */
PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
partition by key(c1) (
partition p01 data directory = 'MYSQL_TMP_DIR'
index directory = 'MYSQL_TMP_DIR',
partition p02 data directory = 'MYSQL_TMP_DIR'
index directory = 'MYSQL_TMP_DIR');
insert into t1 values (1, 1, repeat('a', 100));
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
alter online table t1 delay_key_write=0;
alter online table t1 delay_key_write=1;
drop table t1;

View File

@ -0,0 +1,4 @@
--source include/have_innodb.inc
--source include/have_partition.inc
--let $engine=InnoDB
--source inc/part_alter_values.inc

View File

@ -16,3 +16,6 @@ select * from t1;
alter table t1 drop partition p20181231;
select * from t1;
drop table t1;
--let $engine=Aria
--source inc/part_alter_values.inc

View File

@ -1,17 +1,24 @@
#
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
#
--source include/have_partition.inc
--let $engine=MyISAM
--source inc/part_alter_values.inc
CREATE TABLE t1 (i INT) ENGINE=MYISAM
PARTITION BY LIST(i) (
PARTITION p0 VALUES IN (1),
PARTITION p1 VALUES IN (2)
);
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
#
# MDEV-14026 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
#
# Cleanup
DROP TABLE t1;
replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
--disable_warnings
eval create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
partition by key(c1) (
partition p01 data directory = '$MYSQL_TMP_DIR'
index directory = '$MYSQL_TMP_DIR',
partition p02 data directory = '$MYSQL_TMP_DIR'
index directory = '$MYSQL_TMP_DIR');
--enable_warnings
insert into t1 values (1, 1, repeat('a', 100));
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
alter online table t1 delay_key_write=0;
alter online table t1 delay_key_write=1;
drop table t1;

View File

@ -0,0 +1,19 @@
INSTALL SONAME "simple_password_check";
SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME='simple_password_check';
PLUGIN_NAME
simple_password_check
#
# MDEV-14031 Password policy causes replication failure
#
CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
ERROR HY000: Your password does not satisfy the current policy requirements
DROP USER user1@localhost;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP USER user1@localhost
UNINSTALL PLUGIN simple_password_check;

View File

@ -0,0 +1,31 @@
--source include/not_embedded.inc
--source include/have_binlog_format_statement.inc
if (!$SIMPLE_PASSWORD_CHECK_SO) {
skip No SIMPLE_PASSWORD_CHECK plugin;
}
INSTALL SONAME "simple_password_check";
SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME='simple_password_check';
--echo #
--echo # MDEV-14031 Password policy causes replication failure
--echo #
--disable_query_log
RESET MASTER; # get rid of previous tests binlog
--enable_query_log
CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
--error ER_NOT_VALID_PASSWORD
CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
DROP USER user1@localhost;
--let $binlog_file = LAST
source include/show_binlog_events.inc;
UNINSTALL PLUGIN simple_password_check;

View File

@ -0,0 +1,543 @@
#
# MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles
#
# This testcase contains a user, who is granted a master role
# operations_cluster. operations_cluster is granted 8 different roles
# who in turn each have 4 different roles granted to them.
#
# Only the leaf roles contain privileges to access databases.
# Make sure the user has access to all databases if the master role
# is granted to him.
#
CREATE USER u;
CREATE ROLE operations_cluster;
GRANT operations_cluster TO u;
CREATE DATABASE bob_live_sg;
CREATE TABLE bob_live_sg.a (i INT(10));
CREATE TABLE bob_live_sg.b (i INT(10));
CREATE TABLE bob_live_sg.c (i INT(10));
CREATE TABLE bob_live_sg.d (i INT(10));
CREATE DATABASE oms_live_sg;
CREATE TABLE oms_live_sg.a (i INT(10));
CREATE TABLE oms_live_sg.b (i INT(10));
CREATE TABLE oms_live_sg.c (i INT(10));
CREATE TABLE oms_live_sg.d (i INT(10));
CREATE DATABASE bob_live_ph;
CREATE TABLE bob_live_ph.a (i INT(10));
CREATE TABLE bob_live_ph.b (i INT(10));
CREATE TABLE bob_live_ph.c (i INT(10));
CREATE TABLE bob_live_ph.d (i INT(10));
CREATE DATABASE oms_live_ph;
CREATE TABLE oms_live_ph.a (i INT(10));
CREATE TABLE oms_live_ph.b (i INT(10));
CREATE TABLE oms_live_ph.c (i INT(10));
CREATE TABLE oms_live_ph.d (i INT(10));
CREATE DATABASE bob_live_id;
CREATE TABLE bob_live_id.a (i INT(10));
CREATE TABLE bob_live_id.b (i INT(10));
CREATE TABLE bob_live_id.c (i INT(10));
CREATE TABLE bob_live_id.d (i INT(10));
CREATE DATABASE oms_live_id;
CREATE TABLE oms_live_id.a (i INT(10));
CREATE TABLE oms_live_id.b (i INT(10));
CREATE TABLE oms_live_id.c (i INT(10));
CREATE TABLE oms_live_id.d (i INT(10));
CREATE DATABASE bob_live_hk;
CREATE TABLE bob_live_hk.a (i INT(10));
CREATE TABLE bob_live_hk.b (i INT(10));
CREATE TABLE bob_live_hk.c (i INT(10));
CREATE TABLE bob_live_hk.d (i INT(10));
CREATE DATABASE oms_live_hk;
CREATE TABLE oms_live_hk.a (i INT(10));
CREATE TABLE oms_live_hk.b (i INT(10));
CREATE TABLE oms_live_hk.c (i INT(10));
CREATE TABLE oms_live_hk.d (i INT(10));
CREATE DATABASE bob_live_vn;
CREATE TABLE bob_live_vn.a (i INT(10));
CREATE TABLE bob_live_vn.b (i INT(10));
CREATE TABLE bob_live_vn.c (i INT(10));
CREATE TABLE bob_live_vn.d (i INT(10));
CREATE DATABASE oms_live_vn;
CREATE TABLE oms_live_vn.a (i INT(10));
CREATE TABLE oms_live_vn.b (i INT(10));
CREATE TABLE oms_live_vn.c (i INT(10));
CREATE TABLE oms_live_vn.d (i INT(10));
CREATE DATABASE bob_live_tw;
CREATE TABLE bob_live_tw.a (i INT(10));
CREATE TABLE bob_live_tw.b (i INT(10));
CREATE TABLE bob_live_tw.c (i INT(10));
CREATE TABLE bob_live_tw.d (i INT(10));
CREATE DATABASE oms_live_tw;
CREATE TABLE oms_live_tw.a (i INT(10));
CREATE TABLE oms_live_tw.b (i INT(10));
CREATE TABLE oms_live_tw.c (i INT(10));
CREATE TABLE oms_live_tw.d (i INT(10));
CREATE DATABASE bob_live_my;
CREATE TABLE bob_live_my.a (i INT(10));
CREATE TABLE bob_live_my.b (i INT(10));
CREATE TABLE bob_live_my.c (i INT(10));
CREATE TABLE bob_live_my.d (i INT(10));
CREATE DATABASE oms_live_my;
CREATE TABLE oms_live_my.a (i INT(10));
CREATE TABLE oms_live_my.b (i INT(10));
CREATE TABLE oms_live_my.c (i INT(10));
CREATE TABLE oms_live_my.d (i INT(10));
CREATE DATABASE bob_live_th;
CREATE TABLE bob_live_th.a (i INT(10));
CREATE TABLE bob_live_th.b (i INT(10));
CREATE TABLE bob_live_th.c (i INT(10));
CREATE TABLE bob_live_th.d (i INT(10));
CREATE DATABASE oms_live_th;
CREATE TABLE oms_live_th.a (i INT(10));
CREATE TABLE oms_live_th.b (i INT(10));
CREATE TABLE oms_live_th.c (i INT(10));
CREATE TABLE oms_live_th.d (i INT(10));
CREATE ROLE a_sg;
CREATE ROLE b_sg;
CREATE ROLE c_sg;
CREATE ROLE d_sg;
CREATE ROLE operations_sg;
GRANT a_sg TO operations_sg;
GRANT b_sg TO operations_sg;
GRANT c_sg TO operations_sg;
GRANT d_sg TO operations_sg;
GRANT SELECT ON bob_live_sg.a TO a_sg;
GRANT SELECT ON bob_live_sg.b TO b_sg;
GRANT SELECT ON bob_live_sg.c TO c_sg;
GRANT SELECT ON bob_live_sg.d TO d_sg;
GRANT SELECT ON oms_live_sg.a TO a_sg;
GRANT SELECT ON oms_live_sg.b TO b_sg;
GRANT SELECT ON oms_live_sg.c TO c_sg;
GRANT SELECT ON oms_live_sg.d TO d_sg;
CREATE ROLE a_ph;
CREATE ROLE b_ph;
CREATE ROLE c_ph;
CREATE ROLE d_ph;
CREATE ROLE operations_ph;
GRANT a_ph TO operations_ph;
GRANT b_ph TO operations_ph;
GRANT c_ph TO operations_ph;
GRANT d_ph TO operations_ph;
GRANT SELECT ON bob_live_ph.a TO a_ph;
GRANT SELECT ON bob_live_ph.b TO b_ph;
GRANT SELECT ON bob_live_ph.c TO c_ph;
GRANT SELECT ON bob_live_ph.d TO d_ph;
GRANT SELECT ON oms_live_ph.a TO a_ph;
GRANT SELECT ON oms_live_ph.b TO b_ph;
GRANT SELECT ON oms_live_ph.c TO c_ph;
GRANT SELECT ON oms_live_ph.d TO d_ph;
CREATE ROLE a_id;
CREATE ROLE b_id;
CREATE ROLE c_id;
CREATE ROLE d_id;
CREATE ROLE operations_id;
GRANT a_id TO operations_id;
GRANT b_id TO operations_id;
GRANT c_id TO operations_id;
GRANT d_id TO operations_id;
GRANT SELECT ON bob_live_id.a TO a_id;
GRANT SELECT ON bob_live_id.b TO b_id;
GRANT SELECT ON bob_live_id.c TO c_id;
GRANT SELECT ON bob_live_id.d TO d_id;
GRANT SELECT ON oms_live_id.a TO a_id;
GRANT SELECT ON oms_live_id.b TO b_id;
GRANT SELECT ON oms_live_id.c TO c_id;
GRANT SELECT ON oms_live_id.d TO d_id;
CREATE ROLE a_hk;
CREATE ROLE b_hk;
CREATE ROLE c_hk;
CREATE ROLE d_hk;
CREATE ROLE operations_hk;
GRANT a_hk TO operations_hk;
GRANT b_hk TO operations_hk;
GRANT c_hk TO operations_hk;
GRANT d_hk TO operations_hk;
GRANT SELECT ON bob_live_hk.a TO a_hk;
GRANT SELECT ON bob_live_hk.b TO b_hk;
GRANT SELECT ON bob_live_hk.c TO c_hk;
GRANT SELECT ON bob_live_hk.d TO d_hk;
GRANT SELECT ON oms_live_hk.a TO a_hk;
GRANT SELECT ON oms_live_hk.b TO b_hk;
GRANT SELECT ON oms_live_hk.c TO c_hk;
GRANT SELECT ON oms_live_hk.d TO d_hk;
CREATE ROLE a_vn;
CREATE ROLE b_vn;
CREATE ROLE c_vn;
CREATE ROLE d_vn;
CREATE ROLE operations_vn;
GRANT a_vn TO operations_vn;
GRANT b_vn TO operations_vn;
GRANT c_vn TO operations_vn;
GRANT d_vn TO operations_vn;
GRANT SELECT ON bob_live_vn.a TO a_vn;
GRANT SELECT ON bob_live_vn.b TO b_vn;
GRANT SELECT ON bob_live_vn.c TO c_vn;
GRANT SELECT ON bob_live_vn.d TO d_vn;
GRANT SELECT ON oms_live_vn.a TO a_vn;
GRANT SELECT ON oms_live_vn.b TO b_vn;
GRANT SELECT ON oms_live_vn.c TO c_vn;
GRANT SELECT ON oms_live_vn.d TO d_vn;
CREATE ROLE a_tw;
CREATE ROLE b_tw;
CREATE ROLE c_tw;
CREATE ROLE d_tw;
CREATE ROLE operations_tw;
GRANT a_tw TO operations_tw;
GRANT b_tw TO operations_tw;
GRANT c_tw TO operations_tw;
GRANT d_tw TO operations_tw;
GRANT SELECT ON bob_live_tw.a TO a_tw;
GRANT SELECT ON bob_live_tw.b TO b_tw;
GRANT SELECT ON bob_live_tw.c TO c_tw;
GRANT SELECT ON bob_live_tw.d TO d_tw;
GRANT SELECT ON oms_live_tw.a TO a_tw;
GRANT SELECT ON oms_live_tw.b TO b_tw;
GRANT SELECT ON oms_live_tw.c TO c_tw;
GRANT SELECT ON oms_live_tw.d TO d_tw;
CREATE ROLE a_my;
CREATE ROLE b_my;
CREATE ROLE c_my;
CREATE ROLE d_my;
CREATE ROLE operations_my;
GRANT a_my TO operations_my;
GRANT b_my TO operations_my;
GRANT c_my TO operations_my;
GRANT d_my TO operations_my;
GRANT SELECT ON bob_live_my.a TO a_my;
GRANT SELECT ON bob_live_my.b TO b_my;
GRANT SELECT ON bob_live_my.c TO c_my;
GRANT SELECT ON bob_live_my.d TO d_my;
GRANT SELECT ON oms_live_my.a TO a_my;
GRANT SELECT ON oms_live_my.b TO b_my;
GRANT SELECT ON oms_live_my.c TO c_my;
GRANT SELECT ON oms_live_my.d TO d_my;
CREATE ROLE a_th;
CREATE ROLE b_th;
CREATE ROLE c_th;
CREATE ROLE d_th;
CREATE ROLE operations_th;
GRANT a_th TO operations_th;
GRANT b_th TO operations_th;
GRANT c_th TO operations_th;
GRANT d_th TO operations_th;
GRANT SELECT ON bob_live_th.a TO a_th;
GRANT SELECT ON bob_live_th.b TO b_th;
GRANT SELECT ON bob_live_th.c TO c_th;
GRANT SELECT ON bob_live_th.d TO d_th;
GRANT SELECT ON oms_live_th.a TO a_th;
GRANT SELECT ON oms_live_th.b TO b_th;
GRANT SELECT ON oms_live_th.c TO c_th;
GRANT SELECT ON oms_live_th.d TO d_th;
GRANT operations_sg TO operations_cluster;
GRANT operations_ph TO operations_cluster;
GRANT operations_id TO operations_cluster;
GRANT operations_hk TO operations_cluster;
GRANT operations_vn TO operations_cluster;
GRANT operations_tw TO operations_cluster;
GRANT operations_my TO operations_cluster;
GRANT operations_th TO operations_cluster;
connect con1,localhost,u,,;
SHOW DATABASES;
Database
information_schema
test
SET ROLE operations_cluster;
SHOW DATABASES;
Database
bob_live_hk
bob_live_id
bob_live_my
bob_live_ph
bob_live_sg
bob_live_th
bob_live_tw
bob_live_vn
information_schema
oms_live_hk
oms_live_id
oms_live_my
oms_live_ph
oms_live_sg
oms_live_th
oms_live_tw
oms_live_vn
test
SELECT COUNT(1) FROM oms_live_sg.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.d;
COUNT(1)
0
connect con2,localhost,root,,;
FLUSH PRIVILEGES;
connect con3,localhost,u,,;
SHOW DATABASES;
Database
information_schema
test
SET ROLE operations_cluster;
SHOW DATABASES;
Database
bob_live_hk
bob_live_id
bob_live_my
bob_live_ph
bob_live_sg
bob_live_th
bob_live_tw
bob_live_vn
information_schema
oms_live_hk
oms_live_id
oms_live_my
oms_live_ph
oms_live_sg
oms_live_th
oms_live_tw
oms_live_vn
test
SELECT COUNT(1) FROM oms_live_sg.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_sg.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_ph.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_id.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_hk.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_vn.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_tw.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_my.d;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.a;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.b;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.c;
COUNT(1)
0
SELECT COUNT(1) FROM oms_live_th.d;
COUNT(1)
0
connect con4,localhost,root,,;
DROP DATABASE bob_live_sg;
DROP DATABASE oms_live_sg;
DROP DATABASE bob_live_ph;
DROP DATABASE oms_live_ph;
DROP DATABASE bob_live_id;
DROP DATABASE oms_live_id;
DROP DATABASE bob_live_hk;
DROP DATABASE oms_live_hk;
DROP DATABASE bob_live_vn;
DROP DATABASE oms_live_vn;
DROP DATABASE bob_live_tw;
DROP DATABASE oms_live_tw;
DROP DATABASE bob_live_my;
DROP DATABASE oms_live_my;
DROP DATABASE bob_live_th;
DROP DATABASE oms_live_th;
DROP ROLE operations_sg;
DROP ROLE a_sg;
DROP ROLE b_sg;
DROP ROLE c_sg;
DROP ROLE d_sg;
DROP ROLE operations_ph;
DROP ROLE a_ph;
DROP ROLE b_ph;
DROP ROLE c_ph;
DROP ROLE d_ph;
DROP ROLE operations_id;
DROP ROLE a_id;
DROP ROLE b_id;
DROP ROLE c_id;
DROP ROLE d_id;
DROP ROLE operations_hk;
DROP ROLE a_hk;
DROP ROLE b_hk;
DROP ROLE c_hk;
DROP ROLE d_hk;
DROP ROLE operations_vn;
DROP ROLE a_vn;
DROP ROLE b_vn;
DROP ROLE c_vn;
DROP ROLE d_vn;
DROP ROLE operations_tw;
DROP ROLE a_tw;
DROP ROLE b_tw;
DROP ROLE c_tw;
DROP ROLE d_tw;
DROP ROLE operations_my;
DROP ROLE a_my;
DROP ROLE b_my;
DROP ROLE c_my;
DROP ROLE d_my;
DROP ROLE operations_th;
DROP ROLE a_th;
DROP ROLE b_th;
DROP ROLE c_th;
DROP ROLE d_th;
DROP USER u;
DROP ROLE operations_cluster;

View File

@ -0,0 +1,379 @@
--source include/not_embedded.inc
--echo #
--echo # MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles
--echo #
--echo # This testcase contains a user, who is granted a master role
--echo # operations_cluster. operations_cluster is granted 8 different roles
--echo # who in turn each have 4 different roles granted to them.
--echo #
--echo # Only the leaf roles contain privileges to access databases.
--echo # Make sure the user has access to all databases if the master role
--echo # is granted to him.
--echo #
CREATE USER u;
CREATE ROLE operations_cluster;
GRANT operations_cluster TO u;
CREATE DATABASE bob_live_sg;
CREATE TABLE bob_live_sg.a (i INT(10));
CREATE TABLE bob_live_sg.b (i INT(10));
CREATE TABLE bob_live_sg.c (i INT(10));
CREATE TABLE bob_live_sg.d (i INT(10));
CREATE DATABASE oms_live_sg;
CREATE TABLE oms_live_sg.a (i INT(10));
CREATE TABLE oms_live_sg.b (i INT(10));
CREATE TABLE oms_live_sg.c (i INT(10));
CREATE TABLE oms_live_sg.d (i INT(10));
CREATE DATABASE bob_live_ph;
CREATE TABLE bob_live_ph.a (i INT(10));
CREATE TABLE bob_live_ph.b (i INT(10));
CREATE TABLE bob_live_ph.c (i INT(10));
CREATE TABLE bob_live_ph.d (i INT(10));
CREATE DATABASE oms_live_ph;
CREATE TABLE oms_live_ph.a (i INT(10));
CREATE TABLE oms_live_ph.b (i INT(10));
CREATE TABLE oms_live_ph.c (i INT(10));
CREATE TABLE oms_live_ph.d (i INT(10));
CREATE DATABASE bob_live_id;
CREATE TABLE bob_live_id.a (i INT(10));
CREATE TABLE bob_live_id.b (i INT(10));
CREATE TABLE bob_live_id.c (i INT(10));
CREATE TABLE bob_live_id.d (i INT(10));
CREATE DATABASE oms_live_id;
CREATE TABLE oms_live_id.a (i INT(10));
CREATE TABLE oms_live_id.b (i INT(10));
CREATE TABLE oms_live_id.c (i INT(10));
CREATE TABLE oms_live_id.d (i INT(10));
CREATE DATABASE bob_live_hk;
CREATE TABLE bob_live_hk.a (i INT(10));
CREATE TABLE bob_live_hk.b (i INT(10));
CREATE TABLE bob_live_hk.c (i INT(10));
CREATE TABLE bob_live_hk.d (i INT(10));
CREATE DATABASE oms_live_hk;
CREATE TABLE oms_live_hk.a (i INT(10));
CREATE TABLE oms_live_hk.b (i INT(10));
CREATE TABLE oms_live_hk.c (i INT(10));
CREATE TABLE oms_live_hk.d (i INT(10));
CREATE DATABASE bob_live_vn;
CREATE TABLE bob_live_vn.a (i INT(10));
CREATE TABLE bob_live_vn.b (i INT(10));
CREATE TABLE bob_live_vn.c (i INT(10));
CREATE TABLE bob_live_vn.d (i INT(10));
CREATE DATABASE oms_live_vn;
CREATE TABLE oms_live_vn.a (i INT(10));
CREATE TABLE oms_live_vn.b (i INT(10));
CREATE TABLE oms_live_vn.c (i INT(10));
CREATE TABLE oms_live_vn.d (i INT(10));
CREATE DATABASE bob_live_tw;
CREATE TABLE bob_live_tw.a (i INT(10));
CREATE TABLE bob_live_tw.b (i INT(10));
CREATE TABLE bob_live_tw.c (i INT(10));
CREATE TABLE bob_live_tw.d (i INT(10));
CREATE DATABASE oms_live_tw;
CREATE TABLE oms_live_tw.a (i INT(10));
CREATE TABLE oms_live_tw.b (i INT(10));
CREATE TABLE oms_live_tw.c (i INT(10));
CREATE TABLE oms_live_tw.d (i INT(10));
CREATE DATABASE bob_live_my;
CREATE TABLE bob_live_my.a (i INT(10));
CREATE TABLE bob_live_my.b (i INT(10));
CREATE TABLE bob_live_my.c (i INT(10));
CREATE TABLE bob_live_my.d (i INT(10));
CREATE DATABASE oms_live_my;
CREATE TABLE oms_live_my.a (i INT(10));
CREATE TABLE oms_live_my.b (i INT(10));
CREATE TABLE oms_live_my.c (i INT(10));
CREATE TABLE oms_live_my.d (i INT(10));
CREATE DATABASE bob_live_th;
CREATE TABLE bob_live_th.a (i INT(10));
CREATE TABLE bob_live_th.b (i INT(10));
CREATE TABLE bob_live_th.c (i INT(10));
CREATE TABLE bob_live_th.d (i INT(10));
CREATE DATABASE oms_live_th;
CREATE TABLE oms_live_th.a (i INT(10));
CREATE TABLE oms_live_th.b (i INT(10));
CREATE TABLE oms_live_th.c (i INT(10));
CREATE TABLE oms_live_th.d (i INT(10));
CREATE ROLE a_sg;
CREATE ROLE b_sg;
CREATE ROLE c_sg;
CREATE ROLE d_sg;
CREATE ROLE operations_sg;
GRANT a_sg TO operations_sg;
GRANT b_sg TO operations_sg;
GRANT c_sg TO operations_sg;
GRANT d_sg TO operations_sg;
GRANT SELECT ON bob_live_sg.a TO a_sg;
GRANT SELECT ON bob_live_sg.b TO b_sg;
GRANT SELECT ON bob_live_sg.c TO c_sg;
GRANT SELECT ON bob_live_sg.d TO d_sg;
GRANT SELECT ON oms_live_sg.a TO a_sg;
GRANT SELECT ON oms_live_sg.b TO b_sg;
GRANT SELECT ON oms_live_sg.c TO c_sg;
GRANT SELECT ON oms_live_sg.d TO d_sg;
CREATE ROLE a_ph;
CREATE ROLE b_ph;
CREATE ROLE c_ph;
CREATE ROLE d_ph;
CREATE ROLE operations_ph;
GRANT a_ph TO operations_ph;
GRANT b_ph TO operations_ph;
GRANT c_ph TO operations_ph;
GRANT d_ph TO operations_ph;
GRANT SELECT ON bob_live_ph.a TO a_ph;
GRANT SELECT ON bob_live_ph.b TO b_ph;
GRANT SELECT ON bob_live_ph.c TO c_ph;
GRANT SELECT ON bob_live_ph.d TO d_ph;
GRANT SELECT ON oms_live_ph.a TO a_ph;
GRANT SELECT ON oms_live_ph.b TO b_ph;
GRANT SELECT ON oms_live_ph.c TO c_ph;
GRANT SELECT ON oms_live_ph.d TO d_ph;
CREATE ROLE a_id;
CREATE ROLE b_id;
CREATE ROLE c_id;
CREATE ROLE d_id;
CREATE ROLE operations_id;
GRANT a_id TO operations_id;
GRANT b_id TO operations_id;
GRANT c_id TO operations_id;
GRANT d_id TO operations_id;
GRANT SELECT ON bob_live_id.a TO a_id;
GRANT SELECT ON bob_live_id.b TO b_id;
GRANT SELECT ON bob_live_id.c TO c_id;
GRANT SELECT ON bob_live_id.d TO d_id;
GRANT SELECT ON oms_live_id.a TO a_id;
GRANT SELECT ON oms_live_id.b TO b_id;
GRANT SELECT ON oms_live_id.c TO c_id;
GRANT SELECT ON oms_live_id.d TO d_id;
CREATE ROLE a_hk;
CREATE ROLE b_hk;
CREATE ROLE c_hk;
CREATE ROLE d_hk;
CREATE ROLE operations_hk;
GRANT a_hk TO operations_hk;
GRANT b_hk TO operations_hk;
GRANT c_hk TO operations_hk;
GRANT d_hk TO operations_hk;
GRANT SELECT ON bob_live_hk.a TO a_hk;
GRANT SELECT ON bob_live_hk.b TO b_hk;
GRANT SELECT ON bob_live_hk.c TO c_hk;
GRANT SELECT ON bob_live_hk.d TO d_hk;
GRANT SELECT ON oms_live_hk.a TO a_hk;
GRANT SELECT ON oms_live_hk.b TO b_hk;
GRANT SELECT ON oms_live_hk.c TO c_hk;
GRANT SELECT ON oms_live_hk.d TO d_hk;
CREATE ROLE a_vn;
CREATE ROLE b_vn;
CREATE ROLE c_vn;
CREATE ROLE d_vn;
CREATE ROLE operations_vn;
GRANT a_vn TO operations_vn;
GRANT b_vn TO operations_vn;
GRANT c_vn TO operations_vn;
GRANT d_vn TO operations_vn;
GRANT SELECT ON bob_live_vn.a TO a_vn;
GRANT SELECT ON bob_live_vn.b TO b_vn;
GRANT SELECT ON bob_live_vn.c TO c_vn;
GRANT SELECT ON bob_live_vn.d TO d_vn;
GRANT SELECT ON oms_live_vn.a TO a_vn;
GRANT SELECT ON oms_live_vn.b TO b_vn;
GRANT SELECT ON oms_live_vn.c TO c_vn;
GRANT SELECT ON oms_live_vn.d TO d_vn;
CREATE ROLE a_tw;
CREATE ROLE b_tw;
CREATE ROLE c_tw;
CREATE ROLE d_tw;
CREATE ROLE operations_tw;
GRANT a_tw TO operations_tw;
GRANT b_tw TO operations_tw;
GRANT c_tw TO operations_tw;
GRANT d_tw TO operations_tw;
GRANT SELECT ON bob_live_tw.a TO a_tw;
GRANT SELECT ON bob_live_tw.b TO b_tw;
GRANT SELECT ON bob_live_tw.c TO c_tw;
GRANT SELECT ON bob_live_tw.d TO d_tw;
GRANT SELECT ON oms_live_tw.a TO a_tw;
GRANT SELECT ON oms_live_tw.b TO b_tw;
GRANT SELECT ON oms_live_tw.c TO c_tw;
GRANT SELECT ON oms_live_tw.d TO d_tw;
CREATE ROLE a_my;
CREATE ROLE b_my;
CREATE ROLE c_my;
CREATE ROLE d_my;
CREATE ROLE operations_my;
GRANT a_my TO operations_my;
GRANT b_my TO operations_my;
GRANT c_my TO operations_my;
GRANT d_my TO operations_my;
GRANT SELECT ON bob_live_my.a TO a_my;
GRANT SELECT ON bob_live_my.b TO b_my;
GRANT SELECT ON bob_live_my.c TO c_my;
GRANT SELECT ON bob_live_my.d TO d_my;
GRANT SELECT ON oms_live_my.a TO a_my;
GRANT SELECT ON oms_live_my.b TO b_my;
GRANT SELECT ON oms_live_my.c TO c_my;
GRANT SELECT ON oms_live_my.d TO d_my;
CREATE ROLE a_th;
CREATE ROLE b_th;
CREATE ROLE c_th;
CREATE ROLE d_th;
CREATE ROLE operations_th;
GRANT a_th TO operations_th;
GRANT b_th TO operations_th;
GRANT c_th TO operations_th;
GRANT d_th TO operations_th;
GRANT SELECT ON bob_live_th.a TO a_th;
GRANT SELECT ON bob_live_th.b TO b_th;
GRANT SELECT ON bob_live_th.c TO c_th;
GRANT SELECT ON bob_live_th.d TO d_th;
GRANT SELECT ON oms_live_th.a TO a_th;
GRANT SELECT ON oms_live_th.b TO b_th;
GRANT SELECT ON oms_live_th.c TO c_th;
GRANT SELECT ON oms_live_th.d TO d_th;
GRANT operations_sg TO operations_cluster;
GRANT operations_ph TO operations_cluster;
GRANT operations_id TO operations_cluster;
GRANT operations_hk TO operations_cluster;
GRANT operations_vn TO operations_cluster;
GRANT operations_tw TO operations_cluster;
GRANT operations_my TO operations_cluster;
GRANT operations_th TO operations_cluster;
connect(con1,localhost,u,,);
SHOW DATABASES;
SET ROLE operations_cluster;
SHOW DATABASES;
SELECT COUNT(1) FROM oms_live_sg.a;
SELECT COUNT(1) FROM oms_live_sg.b;
SELECT COUNT(1) FROM oms_live_sg.c;
SELECT COUNT(1) FROM oms_live_sg.d;
SELECT COUNT(1) FROM oms_live_ph.a;
SELECT COUNT(1) FROM oms_live_ph.b;
SELECT COUNT(1) FROM oms_live_ph.c;
SELECT COUNT(1) FROM oms_live_ph.d;
SELECT COUNT(1) FROM oms_live_id.a;
SELECT COUNT(1) FROM oms_live_id.b;
SELECT COUNT(1) FROM oms_live_id.c;
SELECT COUNT(1) FROM oms_live_id.d;
SELECT COUNT(1) FROM oms_live_hk.a;
SELECT COUNT(1) FROM oms_live_hk.b;
SELECT COUNT(1) FROM oms_live_hk.c;
SELECT COUNT(1) FROM oms_live_hk.d;
SELECT COUNT(1) FROM oms_live_vn.a;
SELECT COUNT(1) FROM oms_live_vn.b;
SELECT COUNT(1) FROM oms_live_vn.c;
SELECT COUNT(1) FROM oms_live_vn.d;
SELECT COUNT(1) FROM oms_live_tw.a;
SELECT COUNT(1) FROM oms_live_tw.b;
SELECT COUNT(1) FROM oms_live_tw.c;
SELECT COUNT(1) FROM oms_live_tw.d;
SELECT COUNT(1) FROM oms_live_my.a;
SELECT COUNT(1) FROM oms_live_my.b;
SELECT COUNT(1) FROM oms_live_my.c;
SELECT COUNT(1) FROM oms_live_my.d;
SELECT COUNT(1) FROM oms_live_th.a;
SELECT COUNT(1) FROM oms_live_th.b;
SELECT COUNT(1) FROM oms_live_th.c;
SELECT COUNT(1) FROM oms_live_th.d;
connect(con2,localhost,root,,);
FLUSH PRIVILEGES;
connect(con3,localhost,u,,);
SHOW DATABASES;
SET ROLE operations_cluster;
SHOW DATABASES;
SELECT COUNT(1) FROM oms_live_sg.a;
SELECT COUNT(1) FROM oms_live_sg.b;
SELECT COUNT(1) FROM oms_live_sg.c;
SELECT COUNT(1) FROM oms_live_sg.d;
SELECT COUNT(1) FROM oms_live_ph.a;
SELECT COUNT(1) FROM oms_live_ph.b;
SELECT COUNT(1) FROM oms_live_ph.c;
SELECT COUNT(1) FROM oms_live_ph.d;
SELECT COUNT(1) FROM oms_live_id.a;
SELECT COUNT(1) FROM oms_live_id.b;
SELECT COUNT(1) FROM oms_live_id.c;
SELECT COUNT(1) FROM oms_live_id.d;
SELECT COUNT(1) FROM oms_live_hk.a;
SELECT COUNT(1) FROM oms_live_hk.b;
SELECT COUNT(1) FROM oms_live_hk.c;
SELECT COUNT(1) FROM oms_live_hk.d;
SELECT COUNT(1) FROM oms_live_vn.a;
SELECT COUNT(1) FROM oms_live_vn.b;
SELECT COUNT(1) FROM oms_live_vn.c;
SELECT COUNT(1) FROM oms_live_vn.d;
SELECT COUNT(1) FROM oms_live_tw.a;
SELECT COUNT(1) FROM oms_live_tw.b;
SELECT COUNT(1) FROM oms_live_tw.c;
SELECT COUNT(1) FROM oms_live_tw.d;
SELECT COUNT(1) FROM oms_live_my.a;
SELECT COUNT(1) FROM oms_live_my.b;
SELECT COUNT(1) FROM oms_live_my.c;
SELECT COUNT(1) FROM oms_live_my.d;
SELECT COUNT(1) FROM oms_live_th.a;
SELECT COUNT(1) FROM oms_live_th.b;
SELECT COUNT(1) FROM oms_live_th.c;
SELECT COUNT(1) FROM oms_live_th.d;
connect(con4,localhost,root,,);
DROP DATABASE bob_live_sg;
DROP DATABASE oms_live_sg;
DROP DATABASE bob_live_ph;
DROP DATABASE oms_live_ph;
DROP DATABASE bob_live_id;
DROP DATABASE oms_live_id;
DROP DATABASE bob_live_hk;
DROP DATABASE oms_live_hk;
DROP DATABASE bob_live_vn;
DROP DATABASE oms_live_vn;
DROP DATABASE bob_live_tw;
DROP DATABASE oms_live_tw;
DROP DATABASE bob_live_my;
DROP DATABASE oms_live_my;
DROP DATABASE bob_live_th;
DROP DATABASE oms_live_th;
DROP ROLE operations_sg;
DROP ROLE a_sg;
DROP ROLE b_sg;
DROP ROLE c_sg;
DROP ROLE d_sg;
DROP ROLE operations_ph;
DROP ROLE a_ph;
DROP ROLE b_ph;
DROP ROLE c_ph;
DROP ROLE d_ph;
DROP ROLE operations_id;
DROP ROLE a_id;
DROP ROLE b_id;
DROP ROLE c_id;
DROP ROLE d_id;
DROP ROLE operations_hk;
DROP ROLE a_hk;
DROP ROLE b_hk;
DROP ROLE c_hk;
DROP ROLE d_hk;
DROP ROLE operations_vn;
DROP ROLE a_vn;
DROP ROLE b_vn;
DROP ROLE c_vn;
DROP ROLE d_vn;
DROP ROLE operations_tw;
DROP ROLE a_tw;
DROP ROLE b_tw;
DROP ROLE c_tw;
DROP ROLE d_tw;
DROP ROLE operations_my;
DROP ROLE a_my;
DROP ROLE b_my;
DROP ROLE c_my;
DROP ROLE d_my;
DROP ROLE operations_th;
DROP ROLE a_th;
DROP ROLE b_th;
DROP ROLE c_th;
DROP ROLE d_th;
DROP USER u;
DROP ROLE operations_cluster;

View File

@ -0,0 +1,52 @@
#
# MDEV-13655: SET ROLE does not properly grant privileges.
#
# We must test that if aditional db privileges get granted to a role
# which previously inherited privileges from another granted role
# keep the internal memory structures intact.
#
create role simple;
#
# First we create an entry with privileges for databases for the simple role.
#
grant select, insert, update, delete, lock tables, execute on t.* to simple;
create role admin;
#
# Now we grant the simple role to admin. This means that db privileges
# should propagate to admin.
#
grant simple to admin;
show grants for admin;
Grants for admin
GRANT simple TO 'admin'
GRANT USAGE ON *.* TO 'admin'
GRANT USAGE ON *.* TO 'simple'
GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
#
# Finally, we give the admin all the available privileges for the db.
#
grant all on t.* to admin;
#
# Create a user to test out the new roles;
#
create user foo;
grant admin to foo;
connect foo,localhost,foo,,,,,;
create database t;
ERROR 42000: Access denied for user 'foo'@'%' to database 't'
set role admin;
show grants;
Grants for foo@%
GRANT admin TO 'foo'@'%'
GRANT USAGE ON *.* TO 'foo'@'%'
GRANT simple TO 'admin'
GRANT USAGE ON *.* TO 'admin'
GRANT ALL PRIVILEGES ON `t`.* TO 'admin'
GRANT USAGE ON *.* TO 'simple'
GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
create database t;
drop database t;
connection default;
drop role simple;
drop role admin;
drop user foo;

View File

@ -0,0 +1,49 @@
source include/not_embedded.inc;
--echo #
--echo # MDEV-13655: SET ROLE does not properly grant privileges.
--echo #
--echo # We must test that if aditional db privileges get granted to a role
--echo # which previously inherited privileges from another granted role
--echo # keep the internal memory structures intact.
--echo #
create role simple;
--echo #
--echo # First we create an entry with privileges for databases for the simple role.
--echo #
grant select, insert, update, delete, lock tables, execute on t.* to simple;
create role admin;
--echo #
--echo # Now we grant the simple role to admin. This means that db privileges
--echo # should propagate to admin.
--echo #
grant simple to admin;
show grants for admin;
--echo #
--echo # Finally, we give the admin all the available privileges for the db.
--echo #
grant all on t.* to admin;
--echo #
--echo # Create a user to test out the new roles;
--echo #
create user foo;
grant admin to foo;
connect (foo,localhost,foo,,,,,);
--error ER_DBACCESS_DENIED_ERROR
create database t;
set role admin;
show grants;
create database t;
drop database t;
connection default;
drop role simple;
drop role admin;
drop user foo;

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