Commit fe949504 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into bb-10.2-ext

parents ca906fb2 72c838b9
......@@ -594,7 +594,6 @@ trim_dotslash(const char *path)
/************************************************************************
Check if string ends with given suffix.
@return true if string ends with given suffix. */
static
bool
ends_with(const char *str, const char *suffix)
{
......
......@@ -55,6 +55,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "encryption_plugin.h"
#include <sstream>
#include <sql_error.h>
#include <ut0ut.h>
char *tool_name;
......@@ -1665,38 +1666,28 @@ static void check_mdl_lock_works(const char *table_name)
free(query);
}
#endif
extern void
dict_fs2utf8(const char*, char*, size_t, char*, size_t);
void
mdl_lock_table(ulint space_id)
{
static const char q[] = "SELECT NAME "
std::ostringstream oss;
oss << "SELECT NAME "
"FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES "
"WHERE SPACE = " ULINTPF " AND NAME LIKE '%%/%%'";
char query[22 + sizeof q];
snprintf(query, sizeof query, q, space_id);
"WHERE SPACE = " << space_id << " AND NAME LIKE '%%/%%'";
pthread_mutex_lock(&mdl_lock_con_mutex);
MYSQL_RES *mysql_result = xb_mysql_query(mdl_con, query, true, true);
while (MYSQL_ROW row = mysql_fetch_row(mysql_result)) {
char full_table_name[2*FN_REFLEN +2];
char db_utf8[FN_REFLEN];
char table_utf8[FN_REFLEN];
static const char lq[] = "SELECT * FROM %s LIMIT 0";
char lock_query[sizeof full_table_name + sizeof lq];
MYSQL_RES *mysql_result = xb_mysql_query(mdl_con, oss.str().c_str(), true, true);
dict_fs2utf8(row[0], db_utf8, sizeof db_utf8,table_utf8,sizeof table_utf8);
snprintf(full_table_name,sizeof(full_table_name),"`%s`.`%s`",db_utf8,table_utf8);
msg_ts("Locking MDL for %s\n", full_table_name);
snprintf(lock_query, sizeof lock_query, lq, full_table_name);
while (MYSQL_ROW row = mysql_fetch_row(mysql_result)) {
std::string full_table_name = ut_get_name(0,row[0]);
std::ostringstream lock_query;
lock_query << "SELECT * FROM " << full_table_name << " LIMIT 0";
xb_mysql_query(mdl_con, lock_query, false, false);
msg_ts("Locking MDL for %s\n", full_table_name.c_str());
xb_mysql_query(mdl_con, lock_query.str().c_str(), false, false);
DBUG_EXECUTE_IF("check_mdl_lock_works",
check_mdl_lock_works(full_table_name););
check_mdl_lock_works(full_table_name.c_str()););
}
pthread_mutex_unlock(&mdl_lock_con_mutex);
......
......@@ -1148,17 +1148,12 @@ static void append_export_table(const char *dbname, const char *tablename, bool
if(dbname && tablename && !is_remote)
{
char buf[3*FN_REFLEN];
char db_utf8[FN_REFLEN];
char table_utf8[FN_REFLEN];
snprintf(buf,sizeof(buf),"%s/%s",dbname, tablename);
// trim .ibd
char *p=strrchr(buf, '.');
if (p) *p=0;
dict_fs2utf8(buf, db_utf8, sizeof(db_utf8),table_utf8,sizeof(table_utf8));
snprintf(buf,sizeof(buf),"`%s`.`%s`",db_utf8,table_utf8);
tables_for_export.push_back(buf);
tables_for_export.push_back(ut_get_name(0,buf));
}
}
......@@ -2753,6 +2748,7 @@ static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback)
os_file_stat_t dbinfo;
os_file_stat_t fileinfo;
dberr_t err = DB_SUCCESS;
size_t len;
/* The datadir of MySQL is always the default directory of mysqld */
......@@ -2771,14 +2767,12 @@ static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback)
ret = fil_file_readdir_next_file(&err, fil_path_to_mysql_datadir, dir,
&dbinfo);
while (ret == 0) {
size_t len = strlen(dbinfo.name);
/* General tablespaces are always at the first level of the
data home dir */
if (dbinfo.type == OS_FILE_TYPE_FILE && len > 4) {
bool is_isl = !strcmp(dbinfo.name + len - 4, ".isl");
bool is_ibd = !is_isl
&& !strcmp(dbinfo.name + len - 4, ".ibd");
if (dbinfo.type == OS_FILE_TYPE_FILE) {
bool is_isl = ends_with(dbinfo.name, ".isl");
bool is_ibd = !is_isl && ends_with(dbinfo.name,".ibd");
if (is_isl || is_ibd) {
(*callback)(NULL, dbinfo.name, is_isl);
......@@ -2834,19 +2828,17 @@ static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback)
continue;
}
size_t len = strlen(fileinfo.name);
/* We found a symlink or a file */
if (len > 4
&& !strcmp(fileinfo.name + len - 4,
".ibd")) {
(*callback)(dbinfo.name, fileinfo.name, false);
if (strlen(fileinfo.name) > 4) {
bool is_isl= false;
if (ends_with(fileinfo.name, ".ibd") || ((is_isl = ends_with(fileinfo.name, ".ibd"))))
(*callback)(dbinfo.name, fileinfo.name, is_isl);
}
}
if (0 != os_file_closedir(dbdir)) {
fprintf(stderr, "InnoDB: Warning: could not"
" close database directory %s\n",
" close database directory %s\n",
dbpath);
err = DB_ERROR;
......
......@@ -196,5 +196,5 @@ xb_get_copy_action(const char *dflt = "Copying");
void mdl_lock_init();
void mdl_lock_table(ulint space_id);
void mdl_unlock_all();
bool ends_with(const char *str, const char *suffix);
#endif /* XB_XTRABACKUP_H */
[crypt]
innodb_encrypt_log=ON
innodb_encryption_rotate_key_age=1
plugin_load_add=$DEBUG_KEY_MANAGEMENT_SO
[clear]
skip_innodb_encrypt_log
# The goal of including this file is to enable innodb_encrypt_log combinations
# (see include/innodb_encrypt_log.combinations)
--source include/have_innodb.inc
This diff is collapsed.
......@@ -281,7 +281,7 @@ chr upper lower utf8 roundtrip issafe
95 95 95 E280A2 95
96 96 96 E28093 96
97 97 97 E28094 97
98 98 98 NULL NULL Round trip unsafe
98 98 98 3F 3F Round trip unsafe
99 99 99 E284A2 99
9A 9A 9A D199 9A
9B 9B 9B E280BA 9B
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1666,7 +1666,7 @@ CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
1
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
c
NULL
0000003F0000003F0000003F0000003F
Warnings:
Warning 1300 Invalid utf32 character string: '\xFF\xFF\x00\x00'
#
......
......@@ -1925,7 +1925,7 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
NULL
??
Warnings:
Warning 1300 Invalid utf8 character string: '\xFF\x8F'
set sql_mode=traditional;
......@@ -1951,7 +1951,7 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FD'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
NULL
??
Warnings:
Warning 1300 Invalid utf8 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8));
......@@ -2120,7 +2120,7 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
3F
Warnings:
Warning 1300 Invalid utf8 character string: '\xFF'
select hex(_utf8 0x616263FF);
......@@ -2139,7 +2139,7 @@ Warnings:
Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
3F
Warnings:
Warning 1300 Invalid utf8 character string: '\xFF'
select hex(_utf8 0x616263FF);
......@@ -10479,6 +10479,31 @@ END
DROP PROCEDURE p1;
SET @@SQL_MODE=default;
#
# MDEV-10191 non convertible chars convert() resulted in Null instead "?" on Windows
#
SET sql_mode='STRICT_TRANS_TABLES';
SELECT CONVERT(_utf8 0xC499 USING latin1);
CONVERT(_utf8 0xC499 USING latin1)
?
Warnings:
Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1)
?
Warnings:
Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
SET sql_mode=default;
SELECT CONVERT(_utf8 0xC499 USING latin1);
CONVERT(_utf8 0xC499 USING latin1)
?
Warnings:
Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
SELECT CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1);
CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1)
?
Warnings:
Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
#
# End of 10.1 tests
#
#
......
......@@ -1950,7 +1950,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
......@@ -1976,7 +1976,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
......@@ -2145,7 +2145,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......@@ -2164,7 +2164,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......
......@@ -1782,7 +1782,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
......@@ -1808,7 +1808,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
......@@ -1977,7 +1977,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......@@ -1996,7 +1996,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......
......@@ -1910,7 +1910,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
......@@ -1936,7 +1936,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
......@@ -2105,7 +2105,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......@@ -2124,7 +2124,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......
......@@ -1910,7 +1910,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF8F'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
set sql_mode=traditional;
......@@ -1936,7 +1936,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FD'
select convert(char(0xff,0x8f) using utf8mb4);
convert(char(0xff,0x8f) using utf8mb4)
NULL
??
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF\x8F'
select hex(convert(char(2557 using latin1) using utf8mb4));
......@@ -2105,7 +2105,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......@@ -2124,7 +2124,7 @@ Warnings:
Warning 1300 Invalid utf8mb4 character string: 'FF'
select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
3F
Warnings:
Warning 1300 Invalid utf8mb4 character string: '\xFF'
select hex(_utf8mb4 0x616263FF);
......
This diff is collapsed.
--- innodb-index-online.result
+++ innodb-index-online,crypt.reject
@@ -301,7 +301,7 @@
@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
@rowlog_encrypt_1>@rowlog_encrypt_0;
sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
-0 0 0 0
+0 0 0 1
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
connection con1;
ERROR HY000: Creating index 'c2e' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again
@@ -423,7 +423,7 @@
@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
sort_encrypted sort_decrypted log_encrypted log_decrypted
-0 0 0 0
+0 0 1 1
connection con1;
SELECT COUNT(c22f) FROM t1;
COUNT(c22f)
......@@ -214,6 +214,17 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`),
KEY `c2d` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1
connection default;
SET @merge_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
connection con1;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2e_created WAIT_FOR dml2_done';
SET lock_wait_timeout = 10;
ALTER TABLE t1 DROP INDEX c2d, ADD INDEX c2e(c2),
......@@ -246,6 +257,22 @@ BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
BEGIN;
DELETE FROM t1;
ROLLBACK;
UPDATE t1 SET c2 = c2 + 1;
BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
BEGIN;
DELETE FROM t1;
ROLLBACK;
UPDATE t1 SET c2 = c2 + 1;
BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
ddl_background_drop_indexes 0
......@@ -253,12 +280,28 @@ ddl_background_drop_tables 0
ddl_online_create_index 1
ddl_pending_alter_table 1
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 1
SELECT sf.name, sf.pos FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES si
INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_FIELDS sf
ON si.index_id = sf.index_id WHERE si.name = '?c2e';
name pos
c2 0
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SELECT
(@merge_encrypt_1-@merge_encrypt_0)-
(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
@rowlog_encrypt_1>@rowlog_encrypt_0;
sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
0 0 0 0
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
connection con1;
ERROR HY000: Creating index 'c2e' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again
......@@ -269,7 +312,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 1
SELECT sf.name, sf.pos FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES si
INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_FIELDS sf
ON si.index_id = sf.index_id WHERE si.name = 'c2e';
......@@ -281,7 +324,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 1
connection default;
ALTER TABLE t1 COMMENT 'testing if c2e will be dropped';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
......@@ -291,7 +334,19 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 1
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
connection con1;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
ALTER TABLE t1 ADD INDEX c2f(c2);
......@@ -304,7 +359,15 @@ ddl_background_drop_tables 0
ddl_online_create_index 1
ddl_pending_alter_table 1
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 1
BEGIN;
INSERT INTO t1 SELECT 320 + c1, c2, c3 FROM t1 WHERE c1 > 160;
DELETE FROM t1 WHERE c1 > 320;
ROLLBACK;
BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
BEGIN;
INSERT INTO t1 SELECT 320 + c1, c2, c3 FROM t1 WHERE c1 > 160;
DELETE FROM t1 WHERE c1 > 320;
......@@ -320,7 +383,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 1
ddl_pending_alter_table 1
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 2
SET DEBUG_SYNC = 'now SIGNAL dml3_done';
connection con1;
Warnings:
......@@ -333,7 +396,35 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 2
connection default;
SET @merge_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SELECT
(@merge_encrypt_2-@merge_encrypt_1)-
(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
(@rowlog_encrypt_2-@rowlog_encrypt_1)-
(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
sort_balance log_balance
0 0
SELECT
@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
sort_encrypted sort_decrypted log_encrypted log_decrypted
0 0 0 0
connection con1;
SELECT COUNT(c22f) FROM t1;
COUNT(c22f)
320
......@@ -369,7 +460,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 2
connection default;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
......@@ -378,7 +469,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 2
connection con1;
disconnect con1;
connection default;
......@@ -400,7 +491,7 @@ ddl_background_drop_tables 0
ddl_online_create_index 0
ddl_pending_alter_table 0
ddl_sort_file_alter_table 0
ddl_log_file_alter_table 0
ddl_log_file_alter_table 2
ALTER TABLE t1 ADD INDEX c2h(c22f), ALGORITHM = INPLACE;
ALTER TABLE t1 ADD INDEX c2h(c22f), ALGORITHM = COPY;
ERROR 42000: Duplicate key name 'c2h'
......
--- innodb-table-online.result
+++ innodb-table-online,crypt.reject
@@ -291,7 +291,7 @@
@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
@rowlog_encrypt_1>@rowlog_encrypt_0;
sort_balance @merge_encrypt_1>@merge_encrypt_0 @merge_decrypt_1>@merge_decrypt_0 @rowlog_encrypt_1>@rowlog_encrypt_0
-0 0 0 0
+0 0 0 1
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
# session con1
connection con1;
@@ -393,7 +393,7 @@
@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
sort_encrypted sort_decrypted log_encrypted log_decrypted
-0 0 0 0
+1 1 1 1
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
ERROR 23000: Duplicate entry '' for key 'PRIMARY'
UPDATE t1 SET c3 = NULL WHERE c3 = '';
-- source include/have_debug.inc
-- source include/have_innodb.inc
-- source include/count_sessions.inc
-- source include/have_debug_sync.inc
let $MYSQLD_DATADIR= `select @@datadir`;
......@@ -42,13 +44,10 @@ SET DEBUG_DBUG = @saved_debug_dbug;
DROP TABLE bug13861218;
--echo #
--echo # Bug #21762319 ADDING INDEXES ON EMPTY TABLE IS SLOW
--echo # WITH LARGE INNODB_SORT_BUFFER_SIZE.
call mtr.add_suppression("InnoDB: Cannot create temporary merge file");
# Table with large data which is greater than sort buffer
--echo # Bug #17657223 EXCESSIVE TEMPORARY FILE USAGE IN ALTER TABLE
--echo #
# Error during file creation in alter operation
create table t480(a serial)engine=innodb;
insert into t480
values(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
......@@ -57,14 +56,74 @@ insert into t480 select 0 from t480;
insert into t480 select 0 from t480;
insert into t480 select 0 from t480;
insert into t480 select 0 from t480;
# Error during file write in alter operation.
create table t1(f1 int auto_increment not null,
f2 char(200) not null, f3 char(200) not null,
f4 char(200) not null,primary key(f1))engine=innodb;
insert into t1 select NULL,'aaa','bbb','ccc' from t480;
insert into t1 select NULL,'aaaa','bbbb','cccc' from t480;
insert into t1 select NULL,'aaaaa','bbbbb','ccccc' from t480;
insert into t1 select NULL,'aaaaaa','bbbbbb','cccccc' from t480;
insert into t1 select NULL,'aaaaaaa','bbbbbbb','ccccccc' from t480;
insert into t1 select NULL,'aaaaaaaa','bbbbbbbb','cccccccc' from t480;
select count(*) from t1;
drop table t1, t480;
primary key(f1,f2,f3), key(f1))engine=innodb;
insert into t1 select NULL,'aaa','bbb' from t480;
insert into t1 select NULL,'aaaa','bbbb' from t480;
insert into t1 select NULL,'aaaaa','bbbbb' from t480;
insert into t1 select NULL,'aaaaaa','bbbbbb' from t480;
SET DEBUG_DBUG = '+d,row_merge_write_failure';
--error ER_TEMP_FILE_WRITE_FAILURE
alter table t1 drop primary key,add primary key(f2,f1);
SET DEBUG_DBUG = @saved_debug_dbug;
drop table t1;
# Optimize table via inplace algorithm
connect (con1,localhost,root);
create table t1(k1 int auto_increment primary key,
k2 char(200),k3 char(200))engine=innodb;
insert into t1 values(NULL,'a','b'), (NULL,'aa','bb');
SET DEBUG_SYNC= 'row_merge_after_scan
SIGNAL opened WAIT_FOR flushed';
send optimize table t1;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
SET DEBUG_SYNC= 'now SIGNAL flushed';
connection con1;
--enable_info
--echo /*con1 reap*/ Optimize table t1;
reap;
--disable_info
SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
drop table t1;
# Log file creation failure.
create table t1(k1 int auto_increment primary key,
k2 char(200),k3 char(200))engine=innodb;
SET DEBUG_SYNC= 'row_merge_after_scan
SIGNAL opened WAIT_FOR flushed';
send ALTER TABLE t1 ADD COLUMN k4 int;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET debug = '+d,row_log_tmpfile_fail';
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
INSERT INTO t1 select NULL,'aaaa','bbbb' from t480;
SET DEBUG_SYNC= 'now SIGNAL flushed';
SET DEBUG_DBUG = @saved_debug_dbug;
connection con1;
--echo /*con1 reap*/ ALTER TABLE t1 ADD COLUMN k4 int;
--error ER_OUT_OF_RESOURCES
reap;
SELECT COUNT(k1),k2,k3 FROM t1 GROUP BY k2,k3;
disconnect con1;
connection default;
show create table t1;
drop table t1;
drop table t480;
SET DEBUG_SYNC='RESET';
--source include/wait_until_count_sessions.inc
--echo #
--echo # BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP
--echo # LAST COLUMN OF OLD PK
--echo #
SET DEBUG_DBUG = '+d,innodb_alter_table_pk_assert_no_sort';
--source suite/innodb/include/alter_table_pk_no_sort.inc
SET DEBUG_DBUG = @saved_debug_dbug;
--loose-innodb-sort-buffer-size=64k
--loose-innodb-online-alter-log-max-size=64k
--loose-innodb-online-alter-log-max-size=128k
--loose-innodb-buffer-pool-size=5M
--loose-innodb-log-buffer-size=256k
--loose-innodb-sys-indexes
......
--source include/innodb_page_size_small.inc
--source include/innodb_encrypt_log.inc
--source include/have_debug_sync.inc
let $innodb_metrics_select=
......@@ -200,6 +201,18 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
SHOW CREATE TABLE t1;
connection default;
SET @merge_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
connection con1;
# Exceed the configured innodb_online_alter_log_max_size.
# The actual limit is a multiple of innodb_sort_buf_size,
# because that is the size of the in-memory log buffers.
......@@ -223,7 +236,7 @@ SET DEBUG_SYNC = 'now WAIT_FOR c2e_created';
# At this point, the clustered index scan must have completed,
# but the modification log keeps accumulating due to the DEBUG_SYNC.
eval $innodb_metrics_select;
let $c= 2;
let $c= 4;
while ($c)
{
BEGIN;
......@@ -243,6 +256,22 @@ SELECT sf.name, sf.pos FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES si
INNER JOIN INFORMATION_SCHEMA.INNODB_SYS_FIELDS sf
ON si.index_id = sf.index_id WHERE si.name = '?c2e';
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SELECT
(@merge_encrypt_1-@merge_encrypt_0)-
(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
@rowlog_encrypt_1>@rowlog_encrypt_0;
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
......@@ -270,6 +299,19 @@ ALTER TABLE t1 COMMENT 'testing if c2e will be dropped';
# Check that the 'zombie' index c2e was dropped.
eval $innodb_metrics_select;
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
connection con1;
# Accumulate and apply some modification log.
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
......@@ -282,6 +324,9 @@ connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
# Generate some log (delete-mark, delete-unmark, insert etc.)
eval $innodb_metrics_select;
let $c= 2;
while ($c)
{
BEGIN;
INSERT INTO t1 SELECT 320 + c1, c2, c3 FROM t1 WHERE c1 > 160;
DELETE FROM t1 WHERE c1 > 320;
......@@ -290,6 +335,8 @@ BEGIN;
UPDATE t1 SET c2 = c2 + 1;
DELETE FROM t1;
ROLLBACK;
dec $c;
}
eval $innodb_metrics_select;
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml3_done';
......@@ -300,6 +347,34 @@ reap;
ALTER TABLE t1 CHANGE c2 c22f INT;
eval $innodb_metrics_select;
connection default;
SET @merge_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SELECT
(@merge_encrypt_2-@merge_encrypt_1)-
(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
(@rowlog_encrypt_2-@rowlog_encrypt_1)-
(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
SELECT
@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
connection con1;
SELECT COUNT(c22f) FROM t1;
CHECK TABLE t1;
......
This diff is collapsed.
--innodb-sort-buffer-size=64k --innodb-online-alter-log-max-size=64k --innodb-buffer-pool-size=5M --innodb-log-buffer-size=256k
--innodb-sort-buffer-size=64k --innodb-online-alter-log-max-size=512k --innodb-buffer-pool-size=5M --innodb-log-buffer-size=256k
--source include/innodb_page_size_small.inc
--source include/innodb_encrypt_log.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
......@@ -17,7 +18,7 @@ SET GLOBAL innodb_file_per_table = on;
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 TEXT NOT NULL)
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 CHAR(255) NOT NULL)
ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
......@@ -183,10 +184,20 @@ INSERT INTO t1 SELECT 10 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 20 + c1, c2, c3 FROM t1;
INSERT INTO t1 SELECT 40 + c1, c2, c3 FROM t1;
# Purge may or may not have cleaned up the DELETE FROM t1 WHERE c1 = 7;
--replace_result 81 80
--replace_column 9 ROWS
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
ANALYZE TABLE t1;
SET @merge_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
--echo # session con1
connection con1;
SHOW CREATE TABLE t1;
......@@ -228,6 +239,22 @@ while ($c)
# Temporary table should exist until the DDL thread notices the overflow.
eval $innodb_metrics_select;
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SELECT
(@merge_encrypt_1-@merge_encrypt_0)-
(@merge_decrypt_1-@merge_decrypt_0) as sort_balance,
@merge_encrypt_1>@merge_encrypt_0, @merge_decrypt_1>@merge_decrypt_0,
@rowlog_encrypt_1>@rowlog_encrypt_0;
# Release con1.
SET DEBUG_SYNC = 'now SIGNAL dml2_done';
......@@ -241,6 +268,19 @@ reap;
# when the above error was noticed.
eval $innodb_metrics_select;
SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_1=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
# Accumulate and apply some modification log.
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt3 WAIT_FOR dml3_done';
--error ER_MULTIPLE_PRI_KEY
......@@ -248,9 +288,9 @@ ALTER TABLE t1 ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
--error ER_DUP_ENTRY
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
--send
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c22f,c4(5)),
CHANGE c2 c22f INT, CHANGE c3 c3 TEXT NULL, CHANGE c1 c1 INT AFTER c22f,
ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online';
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c22f,c1,c4(5)),
CHANGE c2 c22f INT, CHANGE c3 c3 CHAR(255) NULL, CHANGE c1 c1 INT AFTER c22f,
ADD COLUMN c4 VARCHAR(6) DEFAULT 'Online', LOCK=NONE;
--echo # session default
connection default;
......@@ -276,6 +316,30 @@ eval $innodb_metrics_select;
SELECT COUNT(c22f) FROM t1;
CHECK TABLE t1;
SET @merge_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_2=
(SELECT variable_value FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SELECT
(@merge_encrypt_2-@merge_encrypt_1)-
(@merge_decrypt_2-@merge_decrypt_1) as sort_balance,
(@rowlog_encrypt_2-@rowlog_encrypt_1)-
(@rowlog_decrypt_2-@rowlog_decrypt_1) as log_balance;
SELECT
@merge_encrypt_2-@merge_encrypt_1>0 as sort_encrypted,
@merge_decrypt_2-@merge_decrypt_1>0 as sort_decrypted,
@rowlog_encrypt_2-@rowlog_encrypt_1>0 as log_encrypted,
@rowlog_decrypt_2-@rowlog_decrypt_1>0 as log_decrypted;
# Create a column prefix index.
--error ER_DUP_ENTRY
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
......@@ -292,15 +356,15 @@ ALTER TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
--error ER_INVALID_USE_OF_NULL
ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET @@sql_mode = @old_sql_mode;
UPDATE t1 SET c3=CONCAT(c1,REPEAT('foo',c1)) WHERE c3 IS NULL;
UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
SET @@sql_mode = 'STRICT_TRANS_TABLES';
--send
ALTER TABLE t1 MODIFY c3 TEXT NOT NULL, DROP COLUMN c22f,
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)),
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
......@@ -325,7 +389,7 @@ ROLLBACK;
--echo # session con1
connection con1;
ALTER TABLE t1 MODIFY c3 TEXT NOT NULL;
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created WAIT_FOR ins_done';
--send
ALTER TABLE t1 DROP PRIMARY KEY, DROP COLUMN c22f,
......
......@@ -153,13 +153,13 @@ SELECT `
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`;
C1 CONVERT(`C1` using sjis)
・˛˚~΄΅・・・・・・・・¡¦¿・・・ NULL
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 NULL
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 NULL
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 NULL
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 NULL
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 NULL
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 NULL
・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・??~??・・・・・・・・???・・・
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・???????????????????
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 ????????????????????
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ????????????????????
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ????????????????????
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 ????????????????????
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 ????????????????????
Warnings:
Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
Warning 1977 Cannot convert 'ucs2' character 0x9EF8 to 'sjis'
......@@ -236,13 +236,13 @@ SELECT `
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T6`;
C1 CONVERT(`C1` using sjis)
・˛˚~΄΅・・・・・・・・¡¦¿・・・ NULL
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 NULL
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 NULL
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 NULL
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 NULL
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 NULL
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 NULL
・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・??~??・・・・・・・・???・・・
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・???????????????????
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 ????????????????????
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ????????????????????
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ????????????????????
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 ????????????????????
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 ????????????????????
Warnings:
Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
Warning 1977 Cannot convert 'ucs2' character 0x9EF8 to 'sjis'
......@@ -319,13 +319,13 @@ SELECT `
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒
SELECT `C1`, CONVERT(`C1` using sjis) FROM `T9`;
C1 CONVERT(`C1` using sjis)
・˛˚~΄΅・・・・・・・・¡¦¿・・・ NULL
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 NULL
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 NULL
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 NULL
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 NULL
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 NULL
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 NULL
・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・??~??・・・・・・・・???・・・
乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠 ????????????????????
仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ????????????????????
伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ????????????????????
・黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・???????????????????
鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃齄齅齆齇齓齕齖 ????????????????????
齗齘齚齝齞齨齩齭齮齯齰齱齳齵齺齽龏龐龑龒 ????????????????????
Warnings:
Warning 1977 Cannot convert 'ucs2' character 0x02DB to 'sjis'
Warning 1977 Cannot convert 'ucs2' character 0x4E5A to 'sjis'
......
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(0);
COMMIT;
start transaction;
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
commit;
SELECT count(*) FROM t;
count(*)
201
# Restore and check results
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT COUNT(*) FROM t;
COUNT(*)
1
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT COUNT(*) FROM t;
COUNT(*)
201
SELECT * FROM t;
a
0
DROP TABLE t;
--source include/have_innodb.inc
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(0);
COMMIT;
start transaction;
--disable_query_log
let $n=100;
while ($n) {
eval INSERT t VALUES(101-$n);
dec $n;
}
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
let $n=100;
while ($n) {
eval INSERT t VALUES(201-$n);
dec $n;
}
--enable_query_log
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ;
--enable_result_log
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
--let SEARCH_PATTERN= Rollback of trx with id
--source include/search_pattern_in_file.inc
--echo # expect NOT FOUND
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
--source include/search_pattern_in_file.inc
--echo # expect NOT FOUND
commit;
SELECT count(*) FROM t;
echo # Restore and check results;
--let $targetdir=$basedir
--let $restart_parameters= --innodb-force-recovery=3
--source include/restart_and_restore.inc
rmdir $basedir;
rmdir $incremental_dir;
SELECT COUNT(*) FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT COUNT(*) FROM t;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;
DROP TABLE t;
This diff is collapsed.
This diff is collapsed.
--innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda --innodb-sys-tables
\ No newline at end of file
--innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda --innodb-sys-tables --partition
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment