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

Merge bb-10.2-ext into 10.3

parents 3060f9af 4cfef2a5
......@@ -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);
......
......@@ -1149,17 +1149,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));
}
}
......@@ -2751,6 +2746,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 */
......@@ -2769,14 +2765,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);
......@@ -2832,19 +2826,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);
......
......@@ -1908,7 +1908,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;
......@@ -1934,7 +1934,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));
......@@ -2103,7 +2103,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);
......@@ -2122,7 +2122,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);
......
......@@ -1915,7 +1915,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;
......@@ -1941,7 +1941,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));
......@@ -2110,7 +2110,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);
......@@ -2129,7 +2129,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);
......
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
connection node_1a;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE c SET f2=1 where f1=1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
DELETE FROM p WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT * FROM p;
f1 f2
2 0
SELECT * FROM c;
f1 p_id f2
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
connection node_1a;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE c SET f2=2 where f1=1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
UPDATE p set f1=11 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT * FROM p;
f1 f2
2 0
11 0
SELECT * FROM c;
f1 p_id f2
1 11 0
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
connection node_1a;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE c SET p_id=2 where f1=1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
UPDATE p set f1=11 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT * FROM p;
f1 f2
2 0
11 0
SELECT * FROM c;
f1 p_id f2
1 11 0
connection node_1a;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p set f1=21 WHERE f1 = 11;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
UPDATE c SET p_id=2 where f1=1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT * FROM p;
f1 f2
2 0
11 0
SELECT * FROM c;
f1 p_id f2
1 2 0
DROP TABLE c;
DROP TABLE p;
connection node_1;
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1) ON DELETE CASCADE,
CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
INSERT INTO p1 VALUES (1, 0);
INSERT INTO p2 VALUES (1, 0);
INSERT INTO c VALUES (1, 1, 1, 0);
connection node_1a;
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE p2 SET f2=2 where f1=1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
DELETE FROM p1 WHERE f1 = 1;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
connection node_1;
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
connection node_2;
SELECT * FROM p1;
f1 f2
SELECT * FROM p2;
f1 f2
1 2
SELECT * FROM c;
f1 p1_id p2_id f2
DROP TABLE c,p1,p2;
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/include/galera_have_debug_sync.inc
#
# we must open connection node_1a here, MW-369.inc will use it later
#
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
#
# cascading delete operation is replicated from node2
# and this conflicts with an update for child table in node1
#
# As a result, the update should fail for certification error
#
--connection node_1
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
--let $mw_369_parent_query = UPDATE c SET f2=1 where f1=1
--let $mw_369_child_query = DELETE FROM p WHERE f1 = 1
--connection node_1a
--source MW-369.inc
# Commit fails
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
--connection node_2
SELECT * FROM p;
SELECT * FROM c;
DROP TABLE c;
DROP TABLE p;
#
# cascading update operation is replicated from node2
# and this conflicts with an update for child table in node1
#
# As a result, the update should fail for certification error
#
--connection node_1
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
--let $mw_369_parent_query = UPDATE c SET f2=2 where f1=1
--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
--connection node_1a
--source MW-369.inc
# Commit fails
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
--connection node_2
SELECT * FROM p;
SELECT * FROM c;
DROP TABLE c;
DROP TABLE p;
#
# ON UPDATE CASCADE tests
# Here we update primary key of parent table to cause cascaded update
# on child table
#
# cascading update operation is replicated from node2
# and this conflicts with an update for child table in node1
#
# As a result, the update should fail for certification error
#
--connection node_1
CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
INSERT INTO p VALUES (1, 0);
INSERT INTO p VALUES (2, 0);
INSERT INTO c VALUES (1, 1, 0);
--let $mw_369_parent_query = UPDATE c SET p_id=2 where f1=1
--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
--connection node_1a
--source MW-369.inc
# Commit fails
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
# same as previous, but statements in different order
--connection node_2
SELECT * FROM p;
SELECT * FROM c;
--let $mw_369_parent_query = UPDATE p set f1=21 WHERE f1 = 11
--let $mw_369_child_query = UPDATE c SET p_id=2 where f1=1
--connection node_1a
--source MW-369.inc
# Commit fails
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
--connection node_2
SELECT * FROM p;
SELECT * FROM c;
DROP TABLE c;
DROP TABLE p;
#
# CASCADE DELETE tests with two parent tables
# Here we cause cascaded operation on child table through
# one parent table and have other operation on the other
# parent table
#
# cascading update operation is replicated from node2
# but this does not conflict with an update for the other parent table in node1
#
# As a result, the update on p2 should succeed
#
--connection node_1
CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER, f2 INTEGER,
CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1) ON DELETE CASCADE,
CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
INSERT INTO p1 VALUES (1, 0);
INSERT INTO p2 VALUES (1, 0);
INSERT INTO c VALUES (1, 1, 1, 0);
--let $mw_369_parent_query = UPDATE p2 SET f2=2 where f1=1
--let $mw_369_child_query = DELETE FROM p1 WHERE f1 = 1
--connection node_1a
--source MW-369.inc
# Commit succeeds
--connection node_1
--reap
# same as previous, but statements in different order
--connection node_2
SELECT * FROM p1;
SELECT * FROM p2;
SELECT * FROM c;
DROP TABLE c,p1,p2;
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
......@@ -23,13 +23,13 @@ use Fcntl 'SEEK_CUR', 'SEEK_END';
my $page_size = $ENV{'INNODB_PAGE_SIZE'};
my $restart;
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}ibdata1") or die;
if ($ENV{'MYSQLD_IS_DEBUG'})
{
# It is impractical to ensure that CREATE TABLE t will extend ibdata1.
# We rely on innodb_system_tablespace_extend_debug=1
# to recover from this fault injection if no size change was redo-logged.
my $root = $ENV{'INNODB_ROOT_PAGE'};
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}ibdata1") or die;
my $size = sysseek(FILE, 0, SEEK_END) / $page_size;
seek(FILE, $page_size * ($root + 1), SEEK_SET) or die;
my $empty_tail= 1;
......@@ -39,8 +39,22 @@ if ($ENV{'MYSQLD_IS_DEBUG'})
$restart = "--innodb-data-file-size-debug=$size";
truncate(FILE, $page_size * $root);
}
close FILE;
}
# Clear the doublewrite buffer entries for our tables.
sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n";
sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n";
my($magic,$d1,$d2)=unpack "NNN", $_;
die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
# Find the pages in the doublewrite buffer
for (my $d = $d1; $d < $d2 + 64; $d++) {
sysread(FILE, $_, $page_size)==$page_size||die "Cannot read doublewrite\n";
my($space_id,$offset)=unpack "x[4]Nx[26]N",$_;
next unless $space_id && $offset > 3;
sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n";
syswrite(FILE, chr(0) x $page_size)==$page_size||die;
}
close FILE;
open(FILE, ">$ENV{MYSQLTEST_VARDIR}/log/start_mysqld.txt") || die;
print FILE "--let \$restart_parameters=$restart\n" if $restart;
print FILE "--source include/start_mysqld.inc\n";
......
......@@ -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;
This diff is collapsed.
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(a varchar(60)) ENGINE INNODB;
start transaction;
INSERT INTO t VALUES(1);
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
SELECT count(*) FROM t;
count(*)
1
DROP TABLE t;
This diff is collapsed.
--innodb --loose-changed_page_bitmaps --innodb-sys-tables
--innodb --loose-changed_page_bitmaps --innodb-sys-tables --partition
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