Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov 2017-02-02 08:21:42 +04:00
commit d333e3ad9c
437 changed files with 18371 additions and 18964 deletions

View file

@ -183,18 +183,18 @@ INCLUDE(check_compiler_flag)
OPTION(WITH_ASAN "Enable address sanitizer" OFF)
IF (WITH_ASAN)
# gcc 4.8.1 and new versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -O1 -Wno-error -fPIC"
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FSANITIZE ${HAVE_C__fsanitize_address__O1__Wno_error__fPIC})
SET(HAVE_CXX_FSANITIZE ${HAVE_CXX__fsanitize_address__O1__Wno_error__fPIC})
SET(HAVE_C_FSANITIZE ${have_C__fsanitize_address__fPIC})
SET(HAVE_CXX_FSANITIZE ${have_CXX__fsanitize_address__fPIC})
IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE)
SET(WITH_ASAN_OK 1)
ELSE()
# older versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -O1 -fPIC"
MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FADDRESS ${HAVE_C__faddress_sanitizer__O1__fPIC})
SET(HAVE_CXX_FADDRESS ${HAVE_CXX__faddress_sanitizer__O1__fPIC})
SET(HAVE_C_FADDRESS ${have_C__faddress_sanitizer__fPIC})
SET(HAVE_CXX_FADDRESS ${have_CXX__faddress_sanitizer__fPIC})
IF(HAVE_C_FADDRESS AND HAVE_CXX_FADDRESS)
SET(WITH_ASAN_OK 1)
ENDIF()

View file

@ -66,6 +66,10 @@ enum options_client
OPT_MYSQLDUMP_SLAVE_APPLY,
OPT_MYSQLDUMP_SLAVE_DATA,
OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
#ifdef WHEN_FLASHBACK_REVIEW_READY
OPT_REVIEW,
OPT_REVIEW_DBNAME, OPT_REVIEW_TABLENAME,
#endif
OPT_SLAP_CSV, OPT_SLAP_CREATE_STRING,
OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
OPT_SLAP_AUTO_GENERATE_ADD_AUTO,

View file

@ -66,6 +66,10 @@ Rpl_filter *binlog_filter= 0;
/* Needed for Rpl_filter */
CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci;
/* Needed for Flashback */
DYNAMIC_ARRAY binlog_events; // Storing the events output string
String stop_event_string; // Storing the STOP_EVENT output string
char server_version[SERVER_VERSION_LENGTH];
ulong server_id = 0;
@ -89,7 +93,7 @@ static const char *load_groups[]=
static void error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool one_database=0, one_table=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0, opt_version= 0;
const char *base64_output_mode_names[]=
{"NEVER", "AUTO", "ALWAYS", "UNSPEC", "DECODE-ROWS", NullS};
@ -99,6 +103,7 @@ TYPELIB base64_output_mode_typelib=
static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC;
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 debug_info_flag, debug_check_flag;
static my_bool force_if_open_opt= 1;
@ -132,6 +137,12 @@ static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0;
static bool opt_skip_annotate_row_events= 0;
static my_bool opt_flashback;
#ifdef WHEN_FLASHBACK_REVIEW_READY
static my_bool opt_flashback_review;
static char *flashback_review_dbname, *flashback_review_tablename;
#endif
/**
Pointer to the Format_description_log_event of the currently active binlog.
@ -790,6 +801,23 @@ print_skip_replication_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
pinfo->skip_replication= cur_val;
}
/**
Indicates whether the given table should be filtered out,
according to the --table=X option.
@param log_tblname Name of table.
@return nonzero if the table with the given name should be
filtered out, 0 otherwise.
*/
static bool shall_skip_table(const char *log_tblname)
{
return one_table &&
(log_tblname != NULL) &&
strcmp(log_tblname, table);
}
/**
Prints the given event in base64 format.
@ -952,6 +980,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
/* Bypass flashback settings to event */
ev->is_flashback= opt_flashback;
#ifdef WHEN_FLASHBACK_REVIEW_READY
ev->need_flashback_review= opt_flashback_review;
#endif
/*
Format events are not concerned by --offset and such, we always need to
read them to be able to process the wanted events.
@ -988,7 +1022,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
retval= OK_STOP;
goto end;
}
if (!short_form)
if (!short_form && !opt_flashback)
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
if (!opt_hexdump)
@ -1214,12 +1248,128 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case TABLE_MAP_EVENT:
{
Table_map_log_event *map= ((Table_map_log_event *)ev);
if (shall_skip_database(map->get_db_name()))
if (shall_skip_database(map->get_db_name()) ||
shall_skip_table(map->get_table_name()))
{
print_event_info->m_table_map_ignored.set_table(map->get_table_id(), map);
destroy_evt= FALSE;
goto end;
}
#ifdef WHEN_FLASHBACK_REVIEW_READY
/* Create review table for Flashback */
if (opt_flashback_review)
{
// Check if the table was already created?
Table_map_log_event *exist_table;
exist_table= print_event_info->m_table_map.get_table(map->get_table_id());
if (!exist_table)
{
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char tmp_sql[8096];
int tmp_sql_offset;
conn = mysql_init(NULL);
if (!mysql_real_connect(conn, host, user, pass,
map->get_db_name(), port, sock, 0))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
if (mysql_query(conn, "SET group_concat_max_len=10000;"))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
memset(tmp_sql, 0, sizeof(tmp_sql));
sprintf(tmp_sql, " "
"SELECT Group_concat(cols) "
"FROM (SELECT 'op_type char(1)' cols "
" UNION ALL "
" SELECT Concat('`', column_name, '_old` ', column_type, ' ', "
" IF(character_set_name IS NOT NULL, "
" Concat('character set ', character_set_name, ' '), ' '), "
" IF(collation_name IS NOT NULL, "
" Concat('collate ', collation_name, ' '), ' ')) cols "
" FROM information_schema.columns "
" WHERE table_schema = '%s' "
" AND table_name = '%s' "
" UNION ALL "
" SELECT Concat('`', column_name, '_new` ', column_type, ' ', "
" IF(character_set_name IS NOT NULL, "
" Concat('character set ', character_set_name, ' '), ' '), "
" IF(collation_name IS NOT NULL, "
" Concat('collate ', collation_name, ' '), ' ')) cols "
" FROM information_schema.columns "
" WHERE table_schema = '%s' "
" AND table_name = '%s') tmp;",
map->get_db_name(), map->get_table_name(),
map->get_db_name(), map->get_table_name());
if (mysql_query(conn, tmp_sql))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
res = mysql_use_result(conn);
if ((row = mysql_fetch_row(res)) != NULL) // only one row
{
if (flashback_review_dbname)
{
ev->set_flashback_review_dbname(flashback_review_dbname);
}
else
{
ev->set_flashback_review_dbname(map->get_db_name());
}
if (flashback_review_tablename)
{
ev->set_flashback_review_tablename(flashback_review_tablename);
}
else
{
memset(tmp_sql, 0, sizeof(tmp_sql));
sprintf(tmp_sql, "__%s", map->get_table_name());
ev->set_flashback_review_tablename(tmp_sql);
}
memset(tmp_sql, 0, sizeof(tmp_sql));
tmp_sql_offset= sprintf(tmp_sql, "CREATE TABLE IF NOT EXISTS");
tmp_sql_offset+= sprintf(tmp_sql + tmp_sql_offset, " `%s`.`%s` (%s) %s",
ev->get_flashback_review_dbname(),
ev->get_flashback_review_tablename(),
row[0],
print_event_info->delimiter);
}
fprintf(result_file, "%s\n", tmp_sql);
mysql_free_result(res);
mysql_close(conn);
}
else
{
char tmp_str[128];
if (flashback_review_dbname)
ev->set_flashback_review_dbname(flashback_review_dbname);
else
ev->set_flashback_review_dbname(map->get_db_name());
if (flashback_review_tablename)
ev->set_flashback_review_tablename(flashback_review_tablename);
else
{
memset(tmp_str, 0, sizeof(tmp_str));
sprintf(tmp_str, "__%s", map->get_table_name());
ev->set_flashback_review_tablename(tmp_str);
}
}
}
#endif
/*
The Table map is to be printed, so it's just the time when we may
print the kept Annotate event (if there is any).
@ -1294,6 +1444,38 @@ end:
*/
if (ev)
{
/* Holding event output if needed */
if (!ev->output_buf.is_empty())
{
LEX_STRING tmp_str;
tmp_str.length= ev->output_buf.length();
tmp_str.str= ev->output_buf.release();
if (opt_flashback)
{
if (ev_type == STOP_EVENT)
stop_event_string.reset(tmp_str.str, tmp_str.length, tmp_str.length,
&my_charset_bin);
else
{
if (push_dynamic(&binlog_events, (uchar *) &tmp_str))
{
error("Out of memory: can't allocate memory to store the flashback events.");
exit(1);
}
}
}
else
{
my_fwrite(result_file, (const uchar *) tmp_str.str, tmp_str.length,
MYF(MY_NABP));
my_free(tmp_str.str);
}
}
if (remote_opt)
ev->temp_buf= 0;
if (destroy_evt) /* destroy it later if not set (ignored table map) */
delete ev;
}
@ -1352,6 +1534,13 @@ static struct my_option my_options[] =
"already have. NOTE: you will need a SUPER privilege to use this option.",
&disable_log_bin, &disable_log_bin, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"flashback", 'B', "Flashback feature can rollback you committed data to a special time point.",
#ifdef WHEN_FLASHBACK_REVIEW_READY
"before Flashback feature writing a row, original row can insert to review-dbname.review-tablename,"
"and mysqlbinlog will login mysql by user(-u) and password(-p) and host(-h).",
#endif
&opt_flashback, &opt_flashback, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"force-if-open", 'F', "Force if binlog was not closed properly.",
&force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
@ -1395,6 +1584,19 @@ static struct my_option my_options[] =
"prefix for the file names.",
&result_file_name, &result_file_name, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef WHEN_FLASHBACK_REVIEW_READY
{"review", opt_flashback_review, "Print review sql in output file.",
&opt_flashback_review, &opt_flashback_review, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"review-dbname", opt_flashback_flashback_review_dbname,
"Writing flashback original row data into this db",
&flashback_review_dbname, &flashback_review_dbname,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"review-tablename", opt_flashback_flashback_review_tablename,
"Writing flashback original row data into this table",
&flashback_review_tablename, &flashback_review_tablename,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"server-id", 0,
"Extract only binlog entries created by the server having the given id.",
&server_id, &server_id, 0, GET_ULONG,
@ -1458,6 +1660,9 @@ static struct my_option my_options[] =
&stop_position, &stop_position, 0, GET_ULL,
REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0},
{"table", 'T', "List entries for just this table (local log only).",
&table, &table, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \
binlog of the MySQL server. If you send the output to the same MySQL server, \
@ -1567,6 +1772,7 @@ static void cleanup()
{
my_free(pass);
my_free(database);
my_free(table);
my_free(host);
my_free(user);
my_free(const_cast<char*>(dirname_for_local_load));
@ -1637,6 +1843,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
#endif
#include <sslopt-case.h>
case 'B':
opt_flashback= 1;
break;
case 'd':
one_database = 1;
break;
@ -1658,10 +1867,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'R':
remote_opt= 1;
break;
case 'T':
one_table= 1;
break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
case opt_flashback_review:
opt_flashback_review= 1;
break;
#endif
case OPT_START_DATETIME:
start_datetime= convert_str_to_timestamp(start_datetime_str);
break;
@ -1862,7 +2079,7 @@ static Exit_status dump_log_entries(const char* logname)
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
if (!opt_raw_mode)
if (!opt_raw_mode && !opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
strmov(print_event_info.delimiter, ";");
return rc;
@ -2697,6 +2914,10 @@ int main(int argc, char** argv)
my_set_max_open_files(open_files_limit);
if (opt_flashback)
my_init_dynamic_array(&binlog_events, sizeof(LEX_STRING), 1024, 1024,
MYF(0));
if (opt_stop_never)
to_last_remote_log= TRUE;
@ -2795,6 +3016,29 @@ int main(int argc, char** argv)
start_position= BIN_LOG_HEADER_SIZE;
}
/*
If enable flashback, need to print the events from the end to the
beginning
*/
if (opt_flashback)
{
for (uint i= binlog_events.elements; i > 0; --i)
{
LEX_STRING *event_str= dynamic_element(&binlog_events, i - 1,
LEX_STRING*);
fprintf(result_file, "%s", event_str->str);
my_free(event_str->str);
}
fprintf(result_file, "COMMIT\n/*!*/;\n");
delete_dynamic(&binlog_events);
}
/* 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 (!opt_raw_mode)
{
/*

View file

@ -19,9 +19,13 @@ MACRO (MYSQL_CHECK_LZ4)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(lz4)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@ -35,9 +39,13 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
CHECK_LIBRARY_EXISTS(liblz3.a LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
IF (HAVE_LZ4_COMPRESS_DEFAULT)
ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
ENDIF()
LINK_LIBRARIES(liblz4.a)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@ -45,4 +53,4 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
ENDMACRO()

View file

@ -58,13 +58,13 @@ IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
ADD_CUSTOM_COMMAND(OUTPUT user.ps
DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC}
COMMAND ${GROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.ps || touch user.ps)
ADD_CUSTOM_TARGET(user.ps ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.ps)
ADD_CUSTOM_TARGET(user_ps ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.ps)
ENDIF(GROFF)
IF(NROFF)
ADD_CUSTOM_COMMAND(OUTPUT user.t
DEPENDS user.r ${OUTPUT_INC} ${SOURCE_INC}
COMMAND ${NROFF} -mm ${CMAKE_CURRENT_SOURCE_DIR}/user.r > user.t || touch user.t)
ADD_CUSTOM_TARGET(user.t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.t)
ADD_CUSTOM_TARGET(user_t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/user.t)
ENDIF(NROFF)
ENDIF()

View file

@ -1346,10 +1346,8 @@ static struct my_option innochecksum_options[] = {
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Verbose (prints progress every 5 seconds).",
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Output debug log. See " REFMAN "dbug-package.html",
&dbug_setting, &dbug_setting, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif /* !DBUG_OFF */
{"count", 'c', "Print the count of pages in the file and exits.",
&just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"start_page", 's', "Start on this page number (0 based).",
@ -1381,7 +1379,7 @@ static struct my_option innochecksum_options[] = {
{"log", 'l', "log output.",
&log_filename, &log_filename, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"leaf", 'l', "Examine leaf index pages",
{"leaf", 'e', "Examine leaf index pages",
&do_leaf, &do_leaf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"merge", 'm', "leaf page count if merge given number of consecutive pages",
&n_merge, &n_merge, 0, GET_ULONG, REQUIRED_ARG, 0, 0, (longlong)10L, 0, 1, 0},
@ -1411,7 +1409,7 @@ static void usage(void)
printf("Usage: %s [-c] [-s <start page>] [-e <end page>] "
"[-p <page>] [-v] [-a <allow mismatches>] [-n] "
"[-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] "
"[-l <log>] <filename or [-]>\n", my_progname);
"[-l <log>] [-e] <filename or [-]>\n", my_progname);
printf("See " REFMAN "innochecksum.html for usage hints.\n");
my_print_help(innochecksum_options);
my_print_variables(innochecksum_options);

View file

@ -219,7 +219,7 @@ typedef struct st_json_engine_t
/* string constants. */
int stack[JSON_DEPTH_LIMIT]; /* Keeps the stack of nested JSON structures. */
int *stack_p; /* The 'stack' pointer. */
int stack_p; /* The 'stack' pointer. */
} json_engine_t;
@ -308,7 +308,7 @@ typedef const int *json_level_t;
*/
#define json_get_level(j) (j->stack_p)
int json_skip_to_level(json_engine_t *j, json_level_t level);
int json_skip_to_level(json_engine_t *j, int level);
/*
json_skip_level() works as above with just current structre.
@ -391,6 +391,27 @@ int json_append_ascii(CHARSET_INFO *json_cs,
uchar *json, uchar *json_end,
const uchar *ascii, const uchar *ascii_end);
/*
Scan the JSON and return paths met one-by-one.
json_get_path_start(&p)
while (json_get_path_next(&p))
{
handle_the_next_path();
}
*/
int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs,
const uchar *str, const uchar *end,
json_path_t *p);
int json_get_path_next(json_engine_t *je, json_path_t *p);
int json_path_compare(const json_path_t *a, const json_path_t *b);
#ifdef __cplusplus
}
#endif

View file

@ -71,7 +71,7 @@ source include/binlog_inject_error.inc;
let $query= DROP VIEW v1;
source include/binlog_inject_error.inc;
let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
let $query= CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
source include/binlog_inject_error.inc;
let $query= DROP PROCEDURE p1;

View file

@ -0,0 +1,3 @@
#
# empty. the real check happens in suite.pm
#

View file

@ -182,6 +182,7 @@ my @DEFAULT_SUITES= qw(
innodb_fts-
innodb_gis-
innodb_zip-
json-
maria-
multi_source-
optimizer_unfixed_bugs-

View file

@ -583,7 +583,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`cast(1 as unsigned)` int(1) unsigned NOT NULL,
`cast(1 as signed)` int(1) NOT NULL,
`cast(1 as signed)` int(2) NOT NULL,
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL,
`cast("A" as binary)` varbinary(1) NOT NULL,
@ -822,3 +822,74 @@ utf8_bin
select collation(cast("a" as char(10) binary ascii));
collation(cast("a" as char(10) binary ascii))
latin1_bin
#
# MDEV-11030 Assertion `precision > 0' failed in decimal_bin_size
#
SELECT * FROM (SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL)) sq;
IFNULL(CONVERT(NULL, UNSIGNED), NULL)
NULL
CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`IFNULL(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT COALESCE(CONVERT(NULL, UNSIGNED), NULL);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`COALESCE(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL,SIGNED),CONVERT(NULL,UNSIGNED)) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
-1,
CONVERT(NULL,SIGNED),
CONCAT(CONVERT(NULL,SIGNED)),
1,
CONVERT(NULL,UNSIGNED),
CONCAT(CONVERT(NULL,UNSIGNED));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`-1` int(2) NOT NULL,
`CONVERT(NULL,SIGNED)` int(2) DEFAULT NULL,
`CONCAT(CONVERT(NULL,SIGNED))` varchar(2) DEFAULT NULL,
`1` int(1) NOT NULL,
`CONVERT(NULL,UNSIGNED)` int(1) unsigned DEFAULT NULL,
`CONCAT(CONVERT(NULL,UNSIGNED))` varchar(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT
CONVERT('',SIGNED),
CONCAT(CONVERT('',SIGNED)),
CONVERT('',UNSIGNED),
CONCAT(CONVERT('',UNSIGNED));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CONVERT('',SIGNED)` int(2) NOT NULL,
`CONCAT(CONVERT('',SIGNED))` varchar(2) NOT NULL,
`CONVERT('',UNSIGNED)` int(1) unsigned NOT NULL,
`CONCAT(CONVERT('',UNSIGNED))` varchar(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;

View file

@ -927,3 +927,15 @@ Sergei Golubchik Development DE
Claudio Nanni Support ES
Sergei Petrunia Development RU
drop table employees;
#
# MDEV-11818: EXPLAIN EXTENDED for a query with optimized away CTE table
#
CREATE TABLE t1 (i INT, c VARCHAR(3));
INSERT INTO t1 VALUES (1,'foo');
EXPLAIN EXTENDED
WITH cte AS ( SELECT * FROM t1 ) SELECT i FROM cte;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 with cte as (select `test`.`t1`.`i` AS `i`,`test`.`t1`.`c` AS `c` from `test`.`t1`)select 1 AS `i` from dual
DROP TABLE t1;

View file

@ -2343,3 +2343,68 @@ select id + 1, uuid() from data_generator where id < 150000
select * from data_generator
) as a;
drop table t1;
#
# MDEV-10773: ANALYZE for query with recursive CTE
#
analyze format=json
with recursive src(counter) as
(select 1
union
select counter+1 from src where counter<10
) select * from src;
ANALYZE
{
"query_block": {
"select_id": 1,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 1,
"rows": 2,
"r_rows": 10,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 100,
"materialized": {
"query_block": {
"recursive_union": {
"table_name": "<union2,3>",
"access_type": "ALL",
"r_loops": 0,
"r_rows": null,
"query_specifications": [
{
"query_block": {
"select_id": 2,
"table": {
"message": "No tables used"
}
}
},
{
"query_block": {
"select_id": 3,
"r_loops": 10,
"r_total_time_ms": "REPLACED",
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"r_loops": 10,
"rows": 2,
"r_rows": 1,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 90,
"attached_condition": "src.counter < 10"
}
}
}
]
}
}
}
}
}
}

View file

@ -3269,6 +3269,44 @@ INSERT INTO t1 VALUES (1),(2),(3);
EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE ?+a<=>?+a' USING DEFAULT,DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t1;
#
# MDEV-11134 Assertion `fixed' failed in Item::const_charset_converter(THD*, CHARSET_INFO*, bool, const char*)
#
SET NAMES utf8;
PREPARE stmt FROM "CREATE OR REPLACE TABLE t1 (c CHAR(8) DEFAULT ?)";
SET @a='';
EXECUTE stmt USING @a;
EXECUTE stmt USING @a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` char(8) DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @a='A';
EXECUTE stmt USING @a;
EXECUTE stmt USING @a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` char(8) DEFAULT 'A'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @a=_utf8 0xC380;
EXECUTE stmt USING @a;
EXECUTE stmt USING @a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` char(8) DEFAULT 'À'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @a=_utf8 0xD18F;
EXECUTE stmt USING @a;
ERROR 42000: Invalid default value for 'c'
EXECUTE stmt USING @a;
ERROR 42000: Invalid default value for 'c'
DEALLOCATE PREPARE stmt;
# end of 10.2 test
set sql_mode=ansi_quotes;
create table t1 (a int, b int default (a+1));

View file

@ -8241,3 +8241,112 @@ SELECT * FROM v1 WHERE v1.d IN ( SELECT MIN(d) FROM t2 WHERE 0 );
d
DROP VIEW v1;
DROP TABLE t1,t2;
#
# MDEV-11820: second execution of PS for query
# with false subquery predicate in WHERE
#
CREATE TABLE t1 (c VARCHAR(3)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('foo'),('bar');
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES (3), (4);
PREPARE stmt1 FROM
" SELECT * FROM v1 WHERE 1 IN (SELECT a FROM t2) OR c = 'foo'";
PREPARE stmt2 FROM
"EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE 1 IN (SELECT a FROM t2) OR c = 'foo'";
EXECUTE stmt1;
c
foo
EXECUTE stmt2;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "v1.c = 'foo'",
"materialized": {
"query_block": {
"select_id": 3,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "t1.c = 'foo'"
}
}
}
},
"subqueries": [
{
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "1 = t2.a"
}
}
}
]
}
}
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
EXECUTE stmt1;
c
foo
EXECUTE stmt2;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "<in_optimizer>(1,<exists>(subquery#2)) or v1.c = 'foo'",
"materialized": {
"query_block": {
"select_id": 3,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
}
},
"subqueries": [
{
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 128,
"filtered": 100,
"attached_condition": "1 = t2.a"
}
}
}
]
}
}
DEALLOCATE PREPARE stmt1;
DEALLOCATE PREPARE stmt2;
DROP VIEW v1;
DROP TABLE t1,t2;

View file

@ -212,6 +212,12 @@ json_extract('1', '$')
select json_extract('[10, 20, [30, 40], 1, 10]', '$[1]');
json_extract('[10, 20, [30, 40], 1, 10]', '$[1]')
20
select json_extract('[10, 20, [30, 40], 1, 10]', '$[1]', '$[25]');
json_extract('[10, 20, [30, 40], 1, 10]', '$[1]', '$[25]')
[20]
select json_extract( '[{"a": [3, 4]}, {"b": 2}]', '$[0].a', '$[1].a');
json_extract( '[{"a": [3, 4]}, {"b": 2}]', '$[0].a', '$[1].a')
[[3, 4]]
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word');
json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word')
{"a":1, "b":{"c":1, "k1":"word"}, "d":[1, 2]}
@ -438,3 +444,53 @@ json CREATE TABLE `json` (
`j` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table json;
select json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2]' );
json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2]' )
1
select json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0]' );
json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0]' )
1
select json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0][0]' );
json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0][0]' )
1
select json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0][0][0]' );
json_length( '[ 1, [ 2, 3, 4 ], 5 ]', '$[2][0][0][0]' )
1
select json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2]' );
json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2]' )
2
select json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0]' );
json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0]' )
2
select json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0][0]' );
json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0][0]' )
2
select json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0][0][0]' );
json_length( '[ 1, [ 2, 3, 4 ], {"a":5, "b":6} ]', '$[2][0][0][0]' )
2
select json_length( '{"a":{"b":{"d":1}}, "a":{"c":{"d":1, "j":2}}}', '$.a[0][0][0].c' );
json_length( '{"a":{"b":{"d":1}}, "a":{"c":{"d":1, "j":2}}}', '$.a[0][0][0].c' )
2
select json_set('1', '$[0]', 100);
json_set('1', '$[0]', 100)
100
select json_set('1', '$[0][0]', 100);
json_set('1', '$[0][0]', 100)
100
select json_set('1', '$[1]', 100);
json_set('1', '$[1]', 100)
[1, 100]
select json_set('{"a":12}', '$[0]', 100);
json_set('{"a":12}', '$[0]', 100)
100
select json_set('{"a":12}', '$[0].a', 100);
json_set('{"a":12}', '$[0].a', 100)
{"a":100}
select json_set('{"a":12}', '$[0][0].a', 100);
json_set('{"a":12}', '$[0][0].a', 100)
{"a":100}
select json_set('{"a":12}', '$[0][1].a', 100);
json_set('{"a":12}', '$[0][1].a', 100)
NULL
Warnings:
Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_set'

View file

@ -0,0 +1,66 @@
select st_asgeojson(geomfromtext('POINT(1 1)'));
st_asgeojson(geomfromtext('POINT(1 1)'))
{"type": "Point", "coordinates": [1, 1]}
select st_asgeojson(geomfromtext('LINESTRING(10 10,20 10,20 20,10 20,10 10)'));
st_asgeojson(geomfromtext('LINESTRING(10 10,20 10,20 20,10 20,10 10)'))
{"type": "LineString", "coordinates": [[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]}
select st_asgeojson(geomfromtext('POLYGON((10 10,20 10,20 20,10 20,10 10))'));
st_asgeojson(geomfromtext('POLYGON((10 10,20 10,20 20,10 20,10 10))'))
{"type": "Polygon", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}
select st_asgeojson(geomfromtext('MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10)))'));
st_asgeojson(geomfromtext('MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10)))'))
{"type": "MultiPolygon", "coordinates": [[[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]]}
select st_asgeojson(geomfromtext('multilinestring((10 10,20 10,20 20,10 20,10 10))'));
st_asgeojson(geomfromtext('multilinestring((10 10,20 10,20 20,10 20,10 10))'))
{"type": "MultiLineString", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}
select st_asgeojson(geomfromtext('multipoint(10 10,20 10,20 20,10 20,10 10)'));
st_asgeojson(geomfromtext('multipoint(10 10,20 10,20 20,10 20,10 10)'))
{"type": "MultiPoint", "coordinates": [[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]}
select st_asgeojson(st_geomfromtext('GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))'));
st_asgeojson(st_geomfromtext('GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))'))
{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [100, 0]}, {"type": "LineString", "coordinates": [[101, 0], [102, 1]]}]}
SELECT st_astext(st_geomfromgeojson('{"type":"point","coordinates":[1,2]}'));
st_astext(st_geomfromgeojson('{"type":"point","coordinates":[1,2]}'))
POINT(1 2)
SELECT st_astext(st_geomfromgeojson('{"type":"LineString","coordinates":[[1,2],[4,5],[7,8]]}'));
st_astext(st_geomfromgeojson('{"type":"LineString","coordinates":[[1,2],[4,5],[7,8]]}'))
LINESTRING(1 2,4 5,7 8)
SELECT st_astext(st_geomfromgeojson('{"type": "polygon", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}'));
st_astext(st_geomfromgeojson('{"type": "polygon", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}'))
POLYGON((10 10,20 10,20 20,10 20,10 10))
SELECT st_astext(st_geomfromgeojson('{"type":"multipoint","coordinates":[[1,2],[4,5],[7,8]]}'));
st_astext(st_geomfromgeojson('{"type":"multipoint","coordinates":[[1,2],[4,5],[7,8]]}'))
MULTIPOINT(1 2,4 5,7 8)
SELECT st_astext(st_geomfromgeojson('{"type": "multilinestring", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}'));
st_astext(st_geomfromgeojson('{"type": "multilinestring", "coordinates": [[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]}'))
MULTILINESTRING((10 10,20 10,20 20,10 20,10 10))
SELECT st_astext(st_geomfromgeojson('{"type": "multipolygon", "coordinates": [[[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]]}'));
st_astext(st_geomfromgeojson('{"type": "multipolygon", "coordinates": [[[[10, 10], [20, 10], [20, 20], [10, 20], [10, 10]]]]}'))
MULTIPOLYGON(((10 10,20 10,20 20,10 20,10 10)))
SELECT st_astext(st_geomfromgeojson('{"type": "GeometryCollection", "geometries": [{"type": "Point","coordinates": [100.0, 0.0]}, {"type": "LineString","coordinates": [[101.0, 0.0],[102.0, 1.0]]}]}'));
st_astext(st_geomfromgeojson('{"type": "GeometryCollection", "geometries": [{"type": "Point","coordinates": [100.0, 0.0]}, {"type": "LineString","coordinates": [[101.0, 0.0],[102.0, 1.0]]}]}'))
GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101 0,102 1))
SELECT st_astext(st_geomfromgeojson('{"type":"point"}'));
st_astext(st_geomfromgeojson('{"type":"point"}'))
NULL
Warnings:
Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
SELECT st_astext(st_geomfromgeojson('{"type":"point"'));
st_astext(st_geomfromgeojson('{"type":"point"'))
NULL
Warnings:
Warning 4037 Unexpected end of JSON text in argument 1 to function 'st_geomfromgeojson'
SELECT st_astext(st_geomfromgeojson('{"type""point"}'));
st_astext(st_geomfromgeojson('{"type""point"}'))
NULL
Warnings:
Warning 4038 Syntax error in JSON text in argument 1 to function 'st_geomfromgeojson' at position 7
SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'));
st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'))
POINT(102 0.5)
SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'));
st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'))
GEOMETRYCOLLECTION(POINT(102 0.5))
#
# End of 10.2 tests
#

View file

@ -276,6 +276,57 @@ ERROR HY000: Unknown system variable 'option'
set option option=1;
ERROR HY000: Unknown system variable 'option'
#
# MDEV-9979 Keywords UNBOUNDED, PRECEDING, FOLLOWING, TIES, OTHERS should be non-reserved
#
CREATE TABLE EXCLUDE (EXCLUDE INT);
SELECT EXCLUDE FROM EXCLUDE;
EXCLUDE
SELECT EXCLUDE EXCLUDE FROM EXCLUDE;
EXCLUDE
SELECT EXCLUDE AS EXCLUDE FROM EXCLUDE;
EXCLUDE
DROP TABLE EXCLUDE;
CREATE TABLE UNBOUNDED (UNBOUNDED INT);
SELECT UNBOUNDED FROM UNBOUNDED;
UNBOUNDED
SELECT UNBOUNDED UNBOUNDEX FROM UNBOUNDED;
UNBOUNDEX
SELECT UNBOUNDED AS UNBOUNDEX FROM UNBOUNDED;
UNBOUNDEX
DROP TABLE UNBOUNDED;
CREATE TABLE PRECEDING (PRECEDING INT);
SELECT PRECEDING FROM PRECEDING;
PRECEDING
SELECT PRECEDING PRECEDING FROM PRECEDING;
PRECEDING
SELECT PRECEDING AS PRECEDING FROM PRECEDING;
PRECEDING
DROP TABLE PRECEDING;
CREATE TABLE FOLLOWING (FOLLOWING INT);
SELECT FOLLOWING FROM FOLLOWING;
FOLLOWING
SELECT FOLLOWING FOLLOWING FROM FOLLOWING;
FOLLOWING
SELECT FOLLOWING AS FOLLOWING FROM FOLLOWING;
FOLLOWING
DROP TABLE FOLLOWING;
CREATE TABLE TIES (TIES INT);
SELECT TIES FROM TIES;
TIES
SELECT TIES TIES FROM TIES;
TIES
SELECT TIES AS TIES FROM TIES;
TIES
DROP TABLE TIES;
CREATE TABLE OTHERS (OTHERS INT);
SELECT OTHERS FROM OTHERS;
OTHERS
SELECT OTHERS OTHERS FROM OTHERS;
OTHERS
SELECT OTHERS AS OTHERS FROM OTHERS;
OTHERS
DROP TABLE OTHERS;
#
# MDEV-10585 EXECUTE IMMEDIATE statement
#
CREATE TABLE immediate (immediate int);

View file

@ -1,5 +1,5 @@
--- mysqld--help.result 2016-09-21 13:50:58.682767100 +0000
+++ mysqld--help,win.reject 2016-09-21 13:57:57.494626000 +0000
--- mysqld--help.result 2016-11-04 13:35:06.665881700 +0000
+++ mysqld--help,win.reject 2016-11-04 13:58:39.030512500 +0000
@@ -318,7 +318,6 @@
The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
@ -8,7 +8,7 @@
--lc-messages=name Set the language used for the error messages.
-L, --lc-messages-dir=name
Directory where error messages are
@@ -517,6 +516,7 @@
@@ -521,6 +520,7 @@
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
@ -16,7 +16,7 @@
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
@@ -924,6 +924,9 @@
@@ -931,6 +931,9 @@
characteristics (isolation level, read only/read
write,snapshot - but not any work done / data modified
within the transaction).
@ -26,7 +26,7 @@
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
@@ -1036,6 +1039,10 @@
@@ -1043,6 +1046,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
@ -37,7 +37,7 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
@@ -1054,6 +1061,7 @@
@@ -1061,6 +1068,7 @@
NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
@ -45,7 +45,7 @@
--standards-compliant-cte
Allow only standards compiant CTE
(Defaults to on; use --skip-standards-compliant-cte to disable.)
@@ -1102,6 +1110,11 @@
@@ -1109,6 +1117,11 @@
--thread-pool-max-threads=#
Maximum allowed number of worker threads in the thread
pool
@ -57,7 +57,7 @@
--thread-pool-oversubscribe=#
How many additional active worker threads in a group are
allowed.
@@ -1132,8 +1145,8 @@
@@ -1139,8 +1152,8 @@
size, MySQL will automatically convert it to an on-disk
MyISAM or Aria table
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
@ -68,7 +68,7 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
@@ -1257,7 +1270,6 @@
@@ -1264,7 +1277,6 @@
key-cache-division-limit 100
key-cache-file-hash-size 512
key-cache-segments 0
@ -76,7 +76,7 @@
lc-messages en_US
lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
@@ -1324,6 +1336,7 @@
@@ -1333,6 +1345,7 @@
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
@ -84,7 +84,7 @@
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
@@ -1424,6 +1437,8 @@
@@ -1434,6 +1447,8 @@
session-track-state-change FALSE
session-track-system-variables
session-track-transaction-info OFF
@ -93,7 +93,7 @@
show-slave-auth-info FALSE
silent-startup FALSE
skip-grant-tables TRUE
@@ -1448,6 +1463,7 @@
@@ -1458,6 +1473,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
@ -101,7 +101,7 @@
sort-buffer-size 2097152
sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
@@ -1461,14 +1477,16 @@
@@ -1471,14 +1487,16 @@
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
@ -114,7 +114,7 @@
tc-heuristic-recover OFF
thread-cache-size 151
thread-pool-idle-timeout 60
thread-pool-max-threads 1000
thread-pool-max-threads 65536
+thread-pool-min-threads 1
+thread-pool-mode windows
thread-pool-oversubscribe 3

View file

@ -208,6 +208,9 @@ The following options may be given as the first argument:
--extra-port=# Extra port number to use for tcp connections in a
one-thread-per-connection manner. 0 means don't use
another port
--flashback Setup the server to use flashback. This enables binary
log in row mode and will enable extra logging for DDL's
needed by flashback feature
--flush Flush MyISAM tables to disk between SQL commands
--flush-time=# A dedicated thread is created to flush all tables at the
given interval
@ -461,6 +464,10 @@ The following options may be given as the first argument:
--max-seeks-for-key=#
Limit assumed max number of seeks when looking up rows
based on a key
--max-session-mem-used=#
Amount of memory a single user session is allowed to
allocate. This limits the value of the session variable
MEM_USED
--max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
values (only the first max_sort_length bytes of each
value are used; the rest are ignored)
@ -1229,6 +1236,7 @@ explicit-defaults-for-timestamp FALSE
external-locking FALSE
extra-max-connections 1
extra-port 0
flashback FALSE
flush FALSE
flush-time 0
ft-boolean-syntax + -><()~*:""&|
@ -1311,6 +1319,7 @@ max-prepared-stmt-count 16382
max-recursive-iterations 18446744073709551615
max-relay-log-size 1073741824
max-seeks-for-key 18446744073709551615
max-session-mem-used 9223372036854775807
max-sort-length 1024
max-sp-recursion-depth 0
max-statement-time 0
@ -1478,7 +1487,7 @@ table-open-cache-instances 8
tc-heuristic-recover OFF
thread-cache-size 151
thread-pool-idle-timeout 60
thread-pool-max-threads 1000
thread-pool-max-threads 65536
thread-pool-oversubscribe 3
thread-pool-prio-kickup-timer 1000
thread-pool-priority auto

View file

@ -37,14 +37,10 @@ call mtr.add_suppression("InnoDB: Error: table `test`.`t1` .* InnoDB internal");
#
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
#
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
SET @@global.innodb_file_format = Barracuda,
@@global.innodb_file_per_table = ON,
SET @@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
connect con1,localhost,root,,;
CREATE TABLE t1 (id INT NOT NULL
PRIMARY KEY,
@ -106,9 +102,6 @@ DROP TABLE t1;
disconnect con2;
connection default;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
@ -160,4 +153,3 @@ ROLLBACK;
disconnect con1;
connection default;
DROP TABLE `t``\""e`;
SET NAMES DEFAULT;

View file

@ -4747,3 +4747,26 @@ INSERT INTO t1 VALUES (1),(2),(3);
EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE ?+a<=>?+a' USING DEFAULT,DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t1;
#
# MDEV-11780 Crash with PREPARE + SP out parameter + literal
#
CREATE OR REPLACE PROCEDURE p1(OUT a INT)
BEGIN
SET a=10;
END;
$$
PREPARE stmt FROM 'CALL p1(?)';
EXECUTE stmt USING 10;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
EXECUTE stmt USING DEFAULT;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
EXECUTE stmt USING IGNORE;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
DEALLOCATE PREPARE stmt;
EXECUTE IMMEDIATE 'CALL p1(?)' USING 10;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
EXECUTE IMMEDIATE 'CALL p1(?)' USING DEFAULT;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
EXECUTE IMMEDIATE 'CALL p1(?)' USING IGNORE;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
DROP PROCEDURE p1;

View file

@ -652,7 +652,9 @@ v1 v2
3 4
ALTER TABLE t1 ADD COLUMN v3 int;
execute stmt;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.* FROM t1' at line 1
v1 v2 v3
1 2 NULL
3 4 NULL
ALTER TABLE t1 drop COLUMN v3;
deallocate prepare stmt;
''
@ -670,7 +672,9 @@ v1 v2
3 4
ALTER TABLE t1 ADD COLUMN v3 int;
execute stmt;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.* FROM t1' at line 1
v1 v2 v3
1 2 NULL
3 4 NULL
ALTER TABLE t1 drop COLUMN v3;
deallocate prepare stmt;
SELECT @@sql_mode;

View file

@ -742,3 +742,20 @@ DROP FUNCTION test_function;
SET @@sql_mode= @org_mode;
#End of Test for Bug#12601974
#
# MDEV-11848 Automatic statement repreparation changes query semantics
#
SET sql_mode=DEFAULT;
CREATE OR REPLACE TABLE t1 (a TEXT);
PREPARE stmt FROM 'INSERT INTO t1 (a) VALUES (2||3)';
EXECUTE stmt;
SET sql_mode=ORACLE;
EXECUTE stmt;
ALTER TABLE t1 ADD b INT;
EXECUTE stmt;
SELECT * FROM t1;
a b
1 NULL
1 NULL
1 NULL
DROP TABLE t1;

View file

@ -1318,5 +1318,18 @@ id
1
2
drop table t1,t2,t3;
#
# MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB;
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
SELECT * FROM t1, t2
WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ;
a pk b
DROP TABLE t1,t2,t3;
DROP VIEW v3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;

View file

@ -1333,6 +1333,19 @@ id
1
2
drop table t1,t2,t3;
#
# MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB;
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
SELECT * FROM t1, t2
WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ;
a pk b
DROP TABLE t1,t2,t3;
DROP VIEW v3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
#

View file

@ -1320,6 +1320,19 @@ id
1
2
drop table t1,t2,t3;
#
# MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB;
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
SELECT * FROM t1, t2
WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ;
a pk b
DROP TABLE t1,t2,t3;
DROP VIEW v3;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;

View file

@ -354,3 +354,13 @@ show columns from t1;
Field Type Null Key Default Extra
a int(11) NO PRI NULL
drop table t1;
create table t1 (
pk int primary key,
i int,
v1 int as (i) virtual,
v2 int as (i) virtual
);
create trigger tr before update on t1 for each row set @a = 1;
insert into t1 (pk, i) values (null, null);
ERROR 23000: Column 'pk' cannot be null
drop table t1;

View file

@ -2382,3 +2382,81 @@ pk c CNT
10 2 0.5000
drop view v1,v2,v3,v4;
drop table t0,t1;
#
# MDEV-10875: window function in subquery
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (3),(1);
CREATE TABLE t2 (c VARCHAR(8));
INSERT INTO t2 VALUES ('foo'),('bar'),('foo');
SELECT COUNT(*) OVER (PARTITION BY c) FROM t2;
COUNT(*) OVER (PARTITION BY c)
2
1
2
SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 );
i
1
DROP TABLE t1, t2;
#
# MDEV-9976: window function without PARTITION BY and ORDER BY
#
CREATE TABLE t1 (id int, a int);
INSERT INTO t1 VALUES
(1,1000), (2,1100), (3,1800), (4,1500), (5,1700), (6,1200),
(7,2000), (8,2100), (9,1600);
SELECT id, sum(a) OVER (PARTITION BY id
ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
FROM t1;
id sum(a) OVER (PARTITION BY id
1 1000
2 1100
3 1800
4 1500
5 1700
6 1200
7 2000
8 2100
9 1600
ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
SELECT id, sum(a) OVER (ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
FROM t1;
id sum(a) OVER (ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
1 14000
2 13000
3 5900
4 10700
5 7600
6 11900
7 4100
8 2100
9 9200
DROP TABLE t1;
#
# MDEV-11867: window function with aggregation
# over the result of grouping
#
create table t1 (
username varchar(32),
amount int
);
insert into t1 values
('user1',1),
('user1',5),
('user1',3),
('user2',10),
('user2',20),
('user2',30);
select username, sum(amount) as s, avg(sum(amount)) over (order by s desc)
from t1
group by username;
username s avg(sum(amount)) over (order by s desc)
user1 9 34.5000
user2 60 60.0000
select username, sum(amount), avg(sum(amount)) over (order by sum(amount) desc)
from t1
group by username;
username sum(amount) avg(sum(amount)) over (order by sum(amount) desc)
user1 9 34.5000
user2 60 60.0000
drop table t1;

View file

@ -68,6 +68,8 @@ sub skip_combinations {
unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
and $1 ge "1.0.1d";
$skip{'include/have_unzip.inc'} = 'no unzip executable' unless `unzip`;
%skip;
}

View file

@ -59,8 +59,8 @@ DROP VIEW v1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
SET GLOBAL debug_dbug='';
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
SET GLOBAL debug_dbug='';
SET GLOBAL debug_dbug='d,injecting_fault_writing';

View file

@ -0,0 +1,480 @@
#
# Preparatory cleanup.
#
DROP TABLE IF EXISTS t1;
#
# We need a fixed timestamp to avoid varying results.
#
SET timestamp=1000000000;
#
# Delete all existing binary logs.
#
RESET MASTER;
CREATE TABLE t1 (
c01 tinyint,
c02 smallint,
c03 mediumint,
c04 int,
c05 bigint,
c06 char(10),
c07 varchar(20),
c08 TEXT
) ENGINE=InnoDB;
#
# Insert data to t1
#
INSERT INTO t1 VALUES(0,0,0,0,0,'','','');
INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz");
INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 255));
#
# Update t1
#
UPDATE t1 SET c01=100 WHERE c02=0 OR c03=3;
#
# Clear t1
#
DELETE FROM t1;
FLUSH LOGS;
#
# Show mysqlbinlog result without -B
#
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 9:46:40 at startup
ROLLBACK/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list []
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000001
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-1 ddl
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
c01 tinyint,
c02 smallint,
c03 mediumint,
c04 int,
c05 bigint,
c06 char(10),
c07 varchar(20),
c08 TEXT
) ENGINE=InnoDB
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-2 trans
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
BEGIN
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=0 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-3 trans
/*!100001 SET @@session.gtid_seq_no=3*//*!*/;
BEGIN
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-4 trans
/*!100001 SET @@session.gtid_seq_no=4*//*!*/;
BEGIN
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=32767 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=8388607 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=2147483647 /* INT meta=0 nullable=1 is_null=0 */
### @5=9223372036854775807 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-5 trans
/*!100001 SET @@session.gtid_seq_no=5*//*!*/;
BEGIN
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
### @1=0 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### SET
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### UPDATE `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### SET
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-6 trans
/*!100001 SET @@session.gtid_seq_no=6*//*!*/;
BEGIN
/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### DELETE FROM `test`.`t1`
### WHERE
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### DELETE FROM `test`.`t1`
### WHERE
### @1=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=32767 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=8388607 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=2147483647 /* INT meta=0 nullable=1 is_null=0 */
### @5=9223372036854775807 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
#
# Show mysqlbinlog result with -B
#
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 9:46:40 at startup
ROLLBACK/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list []
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000001
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
#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/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=32767 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=8388607 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=2147483647 /* INT meta=0 nullable=1 is_null=0 */
### @5=9223372036854775807 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### INSERT INTO `test`.`t1`
### SET
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### INSERT INTO `test`.`t1`
### SET
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Update_rows: table id # flags: STMT_END_F
### UPDATE `test`.`t1`
### WHERE
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### UPDATE `test`.`t1`
### WHERE
### @1=100 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
### SET
### @1=0 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=32767 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=8388607 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=2147483647 /* INT meta=0 nullable=1 is_null=0 */
### @5=9223372036854775807 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=3 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=4 /* INT meta=0 nullable=1 is_null=0 */
### @5=5 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Delete_rows: table id # flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=0 /* TINYINT meta=0 nullable=1 is_null=0 */
### @2=0 /* SHORTINT meta=0 nullable=1 is_null=0 */
### @3=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### @4=0 /* INT meta=0 nullable=1 is_null=0 */
### @5=0 /* LONGINT meta=0 nullable=1 is_null=0 */
### @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 */
COMMIT
/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
COMMIT
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
#
# Insert data to t1
#
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES(0,0,0,0,0,'','','');
INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz");
INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 60));
#
# Delete all existing binary logs.
#
RESET MASTER;
SELECT * FROM t1;
c01 c02 c03 c04 c05 c06 c07 c08
0 0 0 0 0
1 2 3 4 5 abc abcdefg abcedfghijklmnopqrstuvwxyz
127 32767 8388607 2147483647 9223372036854775807 aaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
#
# Operate some data
#
UPDATE t1 SET c01=20;
UPDATE t1 SET c02=200;
UPDATE t1 SET c03=2000;
DELETE FROM t1;
FLUSH LOGS;
#
# Flashback & Check the result
#
SELECT * FROM t1;
c01 c02 c03 c04 c05 c06 c07 c08
127 32767 8388607 2147483647 9223372036854775807 aaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1 2 3 4 5 abc abcdefg abcedfghijklmnopqrstuvwxyz
0 0 0 0 0
RESET MASTER;
#
# UPDATE multi-rows in one event
#
BEGIN;
UPDATE t1 SET c01=10 WHERE c01=0;
UPDATE t1 SET c01=20 WHERE c01=10;
COMMIT;
FLUSH LOGS;
#
# Flashback & Check the result
#
SELECT * FROM t1;
c01 c02 c03 c04 c05 c06 c07 c08
127 32767 8388607 2147483647 9223372036854775807 aaaaaaaaaa aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1 2 3 4 5 abc abcdefg abcedfghijklmnopqrstuvwxyz
0 0 0 0 0
DROP TABLE t1;
#
# Self-referencing foreign keys
#
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, FOREIGN KEY my_fk(b) REFERENCES t1(a)) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (2, 1), (3, 2), (4, 3);
COMMIT;
SELECT * FROM t1;
a b
1 NULL
2 1
3 2
4 3
RESET MASTER;
DELETE FROM t1 ORDER BY a DESC;
FLUSH LOGS;
#
# Flashback & Check the result
#
SELECT * FROM t1;
a b
1 NULL
2 1
3 2
4 3
DROP TABLE t1;

View file

@ -0,0 +1,2 @@
--flashback
--timezone=GMT-8

View file

@ -0,0 +1,163 @@
--source include/have_log_bin.inc
--source include/have_innodb.inc
--echo #
--echo # Preparatory cleanup.
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo #
--echo # We need a fixed timestamp to avoid varying results.
--echo #
SET timestamp=1000000000;
--echo #
--echo # Delete all existing binary logs.
--echo #
RESET MASTER;
CREATE TABLE t1 (
c01 tinyint,
c02 smallint,
c03 mediumint,
c04 int,
c05 bigint,
c06 char(10),
c07 varchar(20),
c08 TEXT
) ENGINE=InnoDB;
--echo #
--echo # Insert data to t1
--echo #
INSERT INTO t1 VALUES(0,0,0,0,0,'','','');
INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz");
INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 255));
--echo #
--echo # Update t1
--echo #
UPDATE t1 SET c01=100 WHERE c02=0 OR c03=3;
--echo #
--echo # Clear t1
--echo #
DELETE FROM t1;
FLUSH LOGS;
--echo #
--echo # Show mysqlbinlog result without -B
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--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 #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Show mysqlbinlog result with -B
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--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 #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG -B --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo # Insert data to t1
--echo #
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES(0,0,0,0,0,'','','');
INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz");
INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 60));
--echo #
--echo # Delete all existing binary logs.
--echo #
RESET MASTER;
SELECT * FROM t1;
--echo #
--echo # Operate some data
--echo #
UPDATE t1 SET c01=20;
UPDATE t1 SET c02=200;
UPDATE t1 SET c03=2000;
DELETE FROM t1;
FLUSH LOGS;
--echo #
--echo # Flashback & Check the result
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG -B -vv $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_1.sql
--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_1.sql;"
SELECT * FROM t1;
RESET MASTER;
--echo #
--echo # UPDATE multi-rows in one event
--echo #
BEGIN;
UPDATE t1 SET c01=10 WHERE c01=0;
UPDATE t1 SET c01=20 WHERE c01=10;
COMMIT;
FLUSH LOGS;
--echo #
--echo # Flashback & Check the result
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG -B -vv $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_2.sql
--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_2.sql;"
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Self-referencing foreign keys
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, FOREIGN KEY my_fk(b) REFERENCES t1(a)) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1, NULL);
INSERT INTO t1 VALUES (2, 1), (3, 2), (4, 3);
COMMIT;
SELECT * FROM t1;
# New binlog
RESET MASTER;
DELETE FROM t1 ORDER BY a DESC;
FLUSH LOGS;
--echo #
--echo # Flashback & Check the result
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG -B -vv $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_3.sql
--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_3.sql;"
SELECT * FROM t1;
DROP TABLE t1;

View file

@ -0,0 +1,6 @@
[cmpr]
log-bin-compress=1
log-bin-compress-min-len=10
[ncmpr]
log-bin-compress=0

View file

@ -59,8 +59,8 @@ DROP VIEW v1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
SET GLOBAL debug_dbug='';
SET GLOBAL debug_dbug='d,injecting_fault_writing';
CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1;
ERROR HY000: Error writing file 'master-bin' ((errno: #)
SET GLOBAL debug_dbug='';
SET GLOBAL debug_dbug='d,injecting_fault_writing';

View file

@ -0,0 +1,6 @@
[cmpr]
log-bin-compress=1
log-bin-compress-min-len=10
[ncmpr]
log-bin-compress=0

View file

@ -0,0 +1,6 @@
[cmpr]
log-bin-compress=1
log-bin-compress-min-len=10
[ncmpr]
log-bin-compress=0

View file

@ -10,5 +10,5 @@
#
##############################################################################
innodb_scrub_background : MDEV-8139 background scrubbing does not work reliably
innodb_scrub : MDEV-8139 occasional corruption of delete_3.ibd page 2
innodb_scrub : MDEV-8139 scrubbing does not work reliably
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
# Create and populate a tables
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
@ -23,5 +19,3 @@ CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_CO
# Write file to make mysql-test-run.pl start up the server again
# Cleanup
DROP TABLE t1, t2, t3, t4, t5;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -11,10 +11,6 @@ call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption s
call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index id is .*");
# Start server with keys2.txt
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
ALTER TABLE t1 ADD COLUMN c2 INT;

View file

@ -1,7 +1,5 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
SHOW WARNINGS;
@ -23,8 +21,6 @@ backup: t1
UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
SHOW CREATE TABLE t1;

View file

@ -4,16 +4,8 @@ call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop th
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Warning Table test/t1 in tablespace # is encrypted but encryption service or used key_id is not available. Can't continue reading table.
@ -22,5 +14,3 @@ test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
DROP TABLE t1;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -4,16 +4,8 @@ call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop th
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize Warning Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue checking table.
@ -30,5 +22,3 @@ Level Code Message
Warning 192 Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue reading table.
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
DROP TABLE t1;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,6 +1,4 @@
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_compression_algorithm = 1;
create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
create table t2(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;

View file

@ -1,7 +1,5 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_compression_algorithm = 1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
show warnings;

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4;
@ -53,5 +49,3 @@ Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
set innodb_default_encryption_key_id = 1;
drop table t1,t2;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
@ -44,5 +40,3 @@ select * from t5;
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
drop table t1;
drop table t5;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,9 +1,14 @@
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 140 InnoDB: ENCRYPTION_KEY_ID 3 not available
Error 1005 Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
show create table innodb_compact;
Table Create Table
@ -16,7 +21,7 @@ Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=3
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
@ -72,9 +77,6 @@ innodb_compact CREATE TABLE `innodb_compact` (
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
Level Code Message
@ -122,10 +118,6 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
@ -201,10 +193,6 @@ innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
@ -281,5 +269,3 @@ drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
drop table innodb_defkey;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
show warnings;
@ -76,10 +72,6 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
variable_value >= 0
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
@ -132,10 +124,6 @@ innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_normal;
Table Create Table
innodb_normal CREATE TABLE `innodb_normal` (
@ -188,5 +176,3 @@ drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,10 +1,6 @@
call mtr.add_suppression("KeyID 0 not found or with error. Check the key and the log*");
call mtr.add_suppression("Disabling redo log encryp*");
call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key version*");
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
Level Code Message
@ -101,10 +97,6 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
@ -172,10 +164,6 @@ innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
@ -253,5 +241,3 @@ pk
1
2
DROP TABLE t1;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encryption_threads = 4;
SET GLOBAL innodb_encrypt_tables = on;
set global innodb_compression_algorithm = 1;
@ -264,5 +260,3 @@ drop table innodb_page_compressed6;
drop table innodb_page_compressed7;
drop table innodb_page_compressed8;
drop table innodb_page_compressed9;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,5 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;

View file

@ -1,8 +1,4 @@
call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
@ -65,7 +61,5 @@ COUNT(1)
SELECT COUNT(1) FROM t5;
COUNT(1)
400
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
drop table t1,t2,t3,t4, t5;
set GLOBAL innodb_default_encryption_key_id=1;

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
@ -14,5 +10,3 @@ NAME ENCRYPTION_SCHEME MIN_KEY_VERSION CURRENT_KEY_VERSION CURRENT_KEY_ID
test/t1 1 1 1 1
test/t2 1 1 1 2
DROP TABLE t1, t2;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
@ -27,10 +23,6 @@ NOT FOUND /private/ in innodb_compressed2.ibd
NOT FOUND /private/ in innodb_compressed3.ibd
# t4 yes on expecting NOT FOUND
NOT FOUND /private/ in innodb_compressed4.ibd
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
select * from innodb_compressed1 where d = 20;
c1 d a b
1 20 private evenmoreprivate
@ -155,5 +147,3 @@ drop table innodb_compressed1;
drop table innodb_compressed2;
drop table innodb_compressed3;
drop table innodb_compressed4;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
@ -105,10 +101,6 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
@ -163,5 +155,3 @@ drop table innodb_compact;
drop table innodb_dynamic;
drop table innodb_compressed;
drop table innodb_redundant;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -86,47 +86,47 @@ Innodb_pages0_read 3
# Restart Success!
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
use test;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
use innodb_encrypted_1;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
use innodb_encrypted_2;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
use innodb_encrypted_3;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
use innodb_encrypted_1;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 1
Innodb_pages0_read 303
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 101
Innodb_pages0_read 303
use innodb_encrypted_2;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 101
Innodb_pages0_read 303
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 201
Innodb_pages0_read 303
use innodb_encrypted_3;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 201
Innodb_pages0_read 303
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 301
Innodb_pages0_read 303
SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%';
COUNT(*)
100

View file

@ -1,7 +1,3 @@
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
CREATE TABLE t3 (id INT, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
@ -176,5 +172,3 @@ NOT FOUND /mangled/ in t6.ibd
NOT FOUND /mysql/ in t7.ibd
DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3, t4, t5, t6, t7;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -1,8 +1,4 @@
# Restart mysqld --loose-file-key-management-filename=keys2.txt
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
Level Code Message
@ -106,10 +102,6 @@ variable_value >= 0
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value >= 0
1
SET GLOBAL innodb_file_format = `Barracuda`;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
SET GLOBAL innodb_file_per_table = ON;
alter table innodb_compact engine=innodb encryption_key_id = 2;
alter table innodb_compressed engine=innodb encryption_key_id = 3;
alter table innodb_dynamic engine=innodb encryption_key_id = 4;
@ -155,5 +147,3 @@ drop table innodb_compact;
drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html

View file

@ -15,13 +15,9 @@ if (!$INNOCHECKSUM) {
--disable_query_log
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let MYSQLD_DATADIR= `SELECT @@datadir`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
@ -97,6 +93,4 @@ DROP TABLE t1, t2, t3, t4, t5;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -29,14 +29,6 @@ call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
ALTER TABLE t1 ADD COLUMN c2 INT;

View file

@ -12,11 +12,6 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
--let SEARCH_RANGE = 10000000
@ -34,11 +29,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
--enable_warnings
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
SHOW WARNINGS;
@ -76,11 +67,6 @@ EOF
--source include/wait_until_connected_again.inc
--source include/restart_mysqld.inc
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--enable_warnings
--error ER_GET_ERRMSG
ALTER TABLE t1 IMPORT TABLESPACE;
SHOW CREATE TABLE t1;
@ -109,12 +95,6 @@ EOF
DROP TABLE t1;
# reset system
--disable_warnings
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
--enable_warnings
--remove_file $MYSQLTEST_VARDIR/keys1.txt
--remove_file $MYSQLTEST_VARDIR/keys2.txt

View file

@ -32,14 +32,6 @@ EOF
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
@ -56,9 +48,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--replace_regex /tablespace [0-9]*/tablespace #/
CHECK TABLE t1;
SHOW WARNINGS;
@ -82,9 +71,3 @@ EOF
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/keys1.txt
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -32,14 +32,6 @@ EOF
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
@ -56,9 +48,6 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
OPTIMIZE TABLE t1;
SHOW WARNINGS;
@ -80,9 +69,3 @@ EOF
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/keys1.txt
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -6,17 +6,9 @@
call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`;
--enable_query_log
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_compression_algorithm = 1;
--enable_warnings
create table t1(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=4;
create table t2(c1 bigint not null primary key auto_increment, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
@ -121,11 +113,6 @@ SELECT COUNT(*) FROM t5;
DROP TABLE t1,t2,t3,t4,t5,t6;
# reset system
--disable_warnings
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
--enable_query_log
--enable_warnings

View file

@ -13,17 +13,8 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`;
--enable_query_log
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_compression_algorithm = 1;
--enable_warnings
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
@ -126,10 +117,6 @@ DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1,t2,t3,t4;
# reset system
--disable_warnings
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
--enable_query_log
--enable_warnings

View file

@ -5,15 +5,9 @@
# MDEV-8817: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID
#
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
let $threads = `SELECT @@innodb_encryption_threads`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4;
@ -91,8 +85,6 @@ drop table t1,t2;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
EVAL SET GLOBAL innodb_encryption_threads = $threads;
--enable_query_log

View file

@ -6,14 +6,6 @@
-- source include/not_crashrep.inc
-- source filekeys_plugin_exists.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
#
# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
#
@ -93,9 +85,4 @@ select * from t5;
drop table t1;
drop table t5;
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
--remove_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt

View file

@ -7,18 +7,12 @@
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
--disable_query_log
# These values can change during the test
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
--error ER_CANT_CREATE_TABLE
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
show warnings;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
show create table innodb_compact;
@ -88,9 +82,3 @@ drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
drop table innodb_redundant;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -1,14 +1,6 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
@ -85,9 +77,6 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
@ -124,9 +113,6 @@ show create table innodb_redundant;
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
show create table innodb_compressed;
show create table innodb_dynamic;
@ -161,9 +147,3 @@ drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
drop table innodb_defkey;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -5,15 +5,9 @@
# Test heavy not tested on valgrind
-- source include/not_valgrind.inc
--disable_query_log
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $encryption = `SELECT @@innodb_encrypt_tables`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
@ -67,8 +61,6 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
@ -97,9 +89,6 @@ show create table innodb_dynamic;
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_normal;
show create table innodb_compact;
show create table innodb_dynamic;
@ -128,7 +117,5 @@ drop table innodb_dynamic;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_encrypt_tables = $encryption;
--enable_query_log

View file

@ -2,18 +2,10 @@
-- source include/not_embedded.inc
-- source include/have_file_key_management_plugin.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
call mtr.add_suppression("KeyID 0 not found or with error. Check the key and the log*");
call mtr.add_suppression("Disabling redo log encryp*");
call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key version*");
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
@ -77,9 +69,6 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
@ -112,9 +101,6 @@ show create table innodb_redundant;
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
show create table innodb_compact;
show create table innodb_compressed;
show create table innodb_dynamic;
@ -160,9 +146,3 @@ INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1;
DROP TABLE t1;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -4,16 +4,10 @@
# embedded does not support restart
-- source include/not_embedded.inc
--disable_query_log
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`;
let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encryption_threads = 4;
SET GLOBAL innodb_encrypt_tables = on;
@ -161,9 +155,6 @@ drop table innodb_page_compressed9;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_encrypt_tables = $innodb_encrypt_tables_orig;
EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig;
--enable_query_log

View file

@ -15,16 +15,6 @@ let $MYSQLD_DATADIR = `SELECT @@datadir`;
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
--disable_warnings
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--enable_warnings
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB row_format=compressed encrypted=yes;
@ -154,11 +144,3 @@ SELECT COUNT(1) FROM t3;
DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3;
# reset system
--disable_warnings
--disable_query_log
eval SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
eval SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
--enable_warnings

View file

@ -5,15 +5,9 @@
call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
let $threads = `SELECT @@innodb_encryption_threads`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4;
@ -133,8 +127,6 @@ SELECT COUNT(1) FROM t5;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
EVAL SET GLOBAL innodb_encryption_threads = $threads;
--enable_query_log
@ -142,4 +134,3 @@ EVAL SET GLOBAL innodb_encryption_threads = $threads;
drop table t1,t2,t3,t4, t5;
set GLOBAL innodb_default_encryption_key_id=1;

View file

@ -1,14 +1,6 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
@ -23,9 +15,3 @@ FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
DROP TABLE t1, t2;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -2,14 +2,6 @@
-- source include/have_file_key_management_plugin.inc
-- source include/not_embedded.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
@ -52,9 +44,6 @@ insert into innodb_compressed4 select * from innodb_compressed1;
-- let SEARCH_FILE=$t4_IBD
-- source include/search_pattern_in_file.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
select * from innodb_compressed1 where d = 20;
select * from innodb_compressed1 where d = 30;
select * from innodb_compressed2 where d = 20;
@ -117,9 +106,3 @@ drop table innodb_compressed1;
drop table innodb_compressed2;
drop table innodb_compressed3;
drop table innodb_compressed4;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -2,14 +2,6 @@
-- source include/have_example_key_management_plugin.inc
-- source include/not_embedded.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
@ -73,9 +65,6 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
--source include/restart_mysqld.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
update innodb_normal set c1 = c1 + 1;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
@ -106,9 +95,3 @@ drop table innodb_compact;
drop table innodb_dynamic;
drop table innodb_compressed;
drop table innodb_redundant;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -4,14 +4,6 @@
-- source include/not_embedded.inc
-- source include/not_windows.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
--let $MYSQLD_DATADIR=`select @@datadir`
--let SEARCH_RANGE = 10000000
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
@ -183,9 +175,3 @@ select count(1) from t7;
DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3, t4, t5, t6, t7;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -7,14 +7,6 @@
-- let $restart_parameters=--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=2;
@ -65,9 +57,6 @@ select * from innodb_redundant;
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
alter table innodb_compact engine=innodb encryption_key_id = 2;
alter table innodb_compressed engine=innodb encryption_key_id = 3;
alter table innodb_dynamic engine=innodb encryption_key_id = 4;
@ -88,9 +77,3 @@ drop table innodb_compact;
drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View file

@ -2,8 +2,6 @@
--innodb-background-scrub-data-uncompressed=OFF
--innodb-encrypt-tables=OFF
--innodb-encryption-threads=0
--innodb-file-format=Barracuda
--innodb-file-per-table=1
--innodb-immediate-scrub-data-uncompressed=ON
--loose-innodb-debug-force-scrubbing=ON
--innodb-tablespaces-scrubbing

View file

@ -1,5 +1,3 @@
--innodb-file-per-table=1
--innodb-file-format=Barracuda
--innodb-immediate-scrub-data-uncompressed=OFF
--innodb-background-scrub-data-uncompressed=ON
--innodb-background-scrub-data-compressed=ON

View file

@ -41,3 +41,6 @@ galera_sst_xtrabackup-v2-options : TODO: Fix test case
galera_sst_xtrabackup-v2 : MDEV-11208
galera_sst_xtrabackup-v2_encrypt_with_key : MDEV-11208
mysql-wsrep#33 : TODO: investigate
galera_var_innodb_disallow_writes : MDEV-10949
galera_many_tables_pk : MDEV-11927
galera_many_tables_nopk : MDEV-11927

View file

@ -7,6 +7,8 @@ SHOW VARIABLES LIKE '%log%bin%';
Variable_name Value
log_bin OFF
log_bin_basename
log_bin_compress OFF
log_bin_compress_min_len 256
log_bin_index
log_bin_trust_function_creators ON
sql_log_bin ON

View file

@ -2,12 +2,12 @@ connection node_1;
RESET MASTER;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256;
Log_name Pos Event_type Server_id End_log_pos Info

View file

@ -11,7 +11,7 @@ SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%';
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock';
COUNT(*) = 1
1
SELECT COUNT(*) = 0 FROM t1;

View file

@ -19,7 +19,8 @@ COUNT(*) = 30000
SELECT COUNT(DISTINCT f1) = 30000 FROM t1;
COUNT(DISTINCT f1) = 30000
1
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = 5
1
connection default;

View file

@ -1,12 +1,12 @@
connection node_1;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT COUNT(*) = 2 FROM t1;

View file

@ -1,12 +1,12 @@
connection node_1;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT COUNT(*) = 2 FROM t1;

View file

@ -12,7 +12,8 @@ SELECT @@wsrep_slave_threads = 1;
@@wsrep_slave_threads = 1
1
SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = 2
1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
@ -25,7 +26,8 @@ connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = @@wsrep_slave_threads + 1
1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
@ -101,7 +103,8 @@ connection node_2;
SELECT COUNT(*) = 64 FROM t2;
COUNT(*) = 64
1
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = @@wsrep_slave_threads + 1
1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';

View file

@ -7,7 +7,7 @@
--connection node_1
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1`
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND NOT STATE <=> 'wsrep aborter idle' AND NOT STATE <=> 'InnoDB background thread' LIMIT 1`
--disable_query_log
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR

View file

@ -33,7 +33,7 @@ INSERT INTO t2 VALUES (1);
--sleep 1
SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock';
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 0 FROM t2;

View file

@ -39,7 +39,8 @@ SET GLOBAL wsrep_slave_threads = 4;
--reap
SELECT COUNT(*) = 30000 FROM t1;
SELECT COUNT(DISTINCT f1) = 30000 FROM t1;
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
--disable_query_log
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;

View file

@ -22,7 +22,8 @@ SELECT @@wsrep_slave_threads = 1;
SET GLOBAL wsrep_slave_threads = 1;
# There is a separate wsrep_aborter thread at all times
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
#
@ -38,7 +39,8 @@ INSERT INTO t1 VALUES (1);
--connection node_2
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
#
@ -60,7 +62,8 @@ while ($count)
--connection node_2
SELECT COUNT(*) = 64 FROM t2;
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';

View file

@ -209,7 +209,7 @@ CREATE TABLE t1(a INT);
CREATE INDEX idx ON t1(a);
CREATE TABLE t3(a INT, b INT , INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a));
CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b), CONSTRAINT x FOREIGN KEY(b) REFERENCES t1(a));
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
CREATE TABLE t2(a INT, b INT generated always as (a+1) virtual, INDEX(b));
DROP TABLE t3;
DROP TABLE t2;

View file

@ -0,0 +1,82 @@
delimiter |;
create procedure populate_t1()
begin
declare i int default 1;
while (i <= 200) do
insert into t1 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
create procedure populate_t1_small()
begin
declare i int default 1;
while (i <= 20) do
insert into t1 values (i, 'c', 'd');
set i = i + 1;
end while;
end|
create procedure populate_t1_small2()
begin
declare i int default 30;
while (i <= 50) do
insert into t1 values (i, 'e', 'f');
set i = i + 1;
end while;
end|
delimiter ;|
#
begin;
select count(*) from t1;
call populate_t1();
select count(*) from t1;
select * from t1 limit 10;
rollback;
select count(*) from t1;
#
begin;
call populate_t1();
select count(*) from t1;
commit;
select count(*) from t1;
#
truncate table t1;
select count(*) from t1;
#
call populate_t1_small();
select count(*) from t1;
rollback;
select count(*) from t1;
truncate table t1;
#
call populate_t1();
select count(*) from t1;
delete from t1 where keyc <= 60;
select count(*) from t1;
call populate_t1_small();
select count(*) from t1;
select * from t1 limit 10;
begin;
call populate_t1_small2();
select count(*) from t1;
select * from t1 where keyc > 30 limit 10;
rollback;
select count(*) from t1;
select * from t1 where keyc > 30 limit 10;
#
update t1 set keyc = keyc + 2000;
select * from t1 limit 10;
rollback;
begin;
update t1 set keyc = keyc + 2000;
select * from t1 limit 10;
rollback;
select * from t1 limit 10;
commit;
select * from t1 limit 10;
#
insert into t2 select * from t1 where keyc < 2101;
select count(*) from t2;
#
drop procedure populate_t1;
drop procedure populate_t1_small;
drop procedure populate_t1_small2;

View file

@ -0,0 +1,4 @@
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_punch_hole' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with fallocate(FALLOC_PUNCH_HOLE| FALLOC_KEEP_SIZE)
}

View file

@ -0,0 +1,25 @@
#!/usr/bin/perl
# Convert tablespace flags to the format understood by MariaDB 10.1.0..10.1.20,
# with the assumption that the flags were correct.
sub convert_to_mariadb_101
{
my ($file, $page_size) = @_;
open(FILE, "+<", $file) or die "Unable to open $file\n";
sysread(FILE, $_, $page_size)==$page_size||die "Unable to read $file\n";
sysseek(FILE, 0, 0)||die "Unable to seek $file\n";
# FIL_PAGE_DATA + FSP_SPACE_FLAGS = 38 + 16 = 54 bytes from the start
my($flags) = unpack "x[54]N", $_;
my $badflags = ($flags & 0x3f);
my $compression_level=6;
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
$badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
substr ($_, 54, 4) = pack("N", $badflags);
# Replace the innodb_checksum_algorithm=none checksum
substr ($_, 0, 4) = pack("N", 0xdeadbeef);
substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
close(FILE);
}

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