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

Merge 10.2 into 10.3

parents a75dbfd7 662217a5
...@@ -5212,6 +5212,7 @@ xb_process_datadir( ...@@ -5212,6 +5212,7 @@ xb_process_datadir(
path, NULL, path, NULL,
fileinfo.name, NULL)) fileinfo.name, NULL))
{ {
os_file_closedir(dbdir);
return(FALSE); return(FALSE);
} }
} }
...@@ -5273,6 +5274,7 @@ xb_process_datadir( ...@@ -5273,6 +5274,7 @@ xb_process_datadir(
dbinfo.name, dbinfo.name,
fileinfo.name, NULL)) fileinfo.name, NULL))
{ {
os_file_closedir(dbdir);
return(FALSE); return(FALSE);
} }
} }
...@@ -5453,6 +5455,14 @@ xtrabackup_prepare_func(char** argv) ...@@ -5453,6 +5455,14 @@ xtrabackup_prepare_func(char** argv)
fil_path_to_mysql_datadir = "."; fil_path_to_mysql_datadir = ".";
/* Fix DDL for prepare. Process .del,.ren, and .new files.
The order in which files are processed, is important
(see MDEV-18185, MDEV-18201)
*/
xb_process_datadir(xtrabackup_incremental_dir ? xtrabackup_incremental_dir : ".",
".del", prepare_handle_del_files);
xb_process_datadir(xtrabackup_incremental_dir? xtrabackup_incremental_dir:".",
".ren", prepare_handle_ren_files);
if (xtrabackup_incremental_dir) { if (xtrabackup_incremental_dir) {
xb_process_datadir(xtrabackup_incremental_dir, ".new.meta", prepare_handle_new_files); xb_process_datadir(xtrabackup_incremental_dir, ".new.meta", prepare_handle_new_files);
xb_process_datadir(xtrabackup_incremental_dir, ".new.delta", prepare_handle_new_files); xb_process_datadir(xtrabackup_incremental_dir, ".new.delta", prepare_handle_new_files);
...@@ -5460,11 +5470,6 @@ xtrabackup_prepare_func(char** argv) ...@@ -5460,11 +5470,6 @@ xtrabackup_prepare_func(char** argv)
else { else {
xb_process_datadir(".", ".new", prepare_handle_new_files); xb_process_datadir(".", ".new", prepare_handle_new_files);
} }
xb_process_datadir(xtrabackup_incremental_dir? xtrabackup_incremental_dir:".",
".ren", prepare_handle_ren_files);
xb_process_datadir(xtrabackup_incremental_dir ? xtrabackup_incremental_dir : ".",
".del", prepare_handle_del_files);
int argc; for (argc = 0; argv[argc]; argc++) {} int argc; for (argc = 0; argv[argc]; argc++) {}
encryption_plugin_prepare_init(argc, argv); encryption_plugin_prepare_init(argc, argv);
......
...@@ -20,9 +20,6 @@ galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB ...@@ -20,9 +20,6 @@ galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
GAL-419 : MDEV-13549 Galera test failures GAL-419 : MDEV-13549 Galera test failures
galera_var_notify_cmd : MDEV-13549 Galera test failures galera_var_notify_cmd : MDEV-13549 Galera test failures
galera_as_slave_replication_bundle : MDEV-13549 Galera test failures galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
galera_gcache_recover : MDEV-13549 Galera test failures
galera_gcache_recover_full_gcache : MDEV-13549 Galera test failures
galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
galera_ssl_upgrade : MDEV-13549 Galera test failures galera_ssl_upgrade : MDEV-13549 Galera test failures
MW-329 : wsrep_local_replays not stable MW-329 : wsrep_local_replays not stable
MW-416 : MDEV-13549 Galera test failures MW-416 : MDEV-13549 Galera test failures
...@@ -51,3 +48,4 @@ MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C] ...@@ -51,3 +48,4 @@ MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C] MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C] MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C]
query_cache : MDEV-18137: Galera test failure on query_cache query_cache : MDEV-18137: Galera test failure on query_cache
galera_gcache_recover_manytrx : MDEV-15740
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = 0;
connection node_2;
SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = 0;
Killing server ... Killing server ...
connection node_1;
INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (2);
Killing server ... Killing server ...
connection node_1;
Performing --wsrep-recover ... Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ... Using --wsrep-start-position when starting mysqld ...
INSERT INTO t1 VALUES (3); INSERT INTO t1 VALUES (3);
connection node_2;
Performing --wsrep-recover ... Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ... Using --wsrep-start-position when starting mysqld ...
connection node_1;
include/diff_servers.inc [servers=1 2] include/diff_servers.inc [servers=1 2]
connection node_1;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve] include/assert_grep.inc [async IST sender starting to serve]
connection node_2;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence] include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
DROP TABLE t1; DROP TABLE t1;
SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
connection node_2;
SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = 0;
Killing server ... Killing server ...
connection node_1;
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
Killing server ... Killing server ...
connection node_1;
Performing --wsrep-recover ... Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ... Using --wsrep-start-position when starting mysqld ...
connection node_2;
Performing --wsrep-recover ... Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ... Using --wsrep-start-position when starting mysqld ...
connection node_1;
include/diff_servers.inc [servers=1 2] include/diff_servers.inc [servers=1 2]
connection node_1;
DROP TABLE t1; DROP TABLE t1;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST] include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST]
connection node_2;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
...@@ -1892,3 +1892,19 @@ f1 ...@@ -1892,3 +1892,19 @@ f1
SELECT * FROM t2; SELECT * FROM t2;
f1 f1
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# MDEV-18186 assertion failure on missing InnoDB index
#
CREATE TABLE t (a INT, INDEX i1 (a)) ENGINE=INNODB;
DROP TABLE t;
CREATE TABLE t (a INT) ENGINE=INNODB;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL,
KEY `i1` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Warnings:
Warning 1082 InnoDB: Table test/t contains 0 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB
Warning 1082 InnoDB: Table test/t contains 0 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MariaDB
DROP TABLE t;
...@@ -1151,6 +1151,28 @@ SELECT * FROM t2; ...@@ -1151,6 +1151,28 @@ SELECT * FROM t2;
DROP TABLE t1, t2; DROP TABLE t1, t2;
--echo #
--echo # MDEV-18186 assertion failure on missing InnoDB index
--echo #
--disable_query_log
call mtr.add_suppression("Cannot find index i1 in InnoDB index dictionary");
call mtr.add_suppression("InnoDB indexes are inconsistent with what defined");
call mtr.add_suppression("Table test/t contains 0 indexes");
call mtr.add_suppression("InnoDB could not find key no");
--enable_query_log
# Test an attempt to rename a nonexistent index inside InnoDB
-- let $MYSQL_DATA_DIR = `SELECT @@datadir`
CREATE TABLE t (a INT, INDEX i1 (a)) ENGINE=INNODB;
-- copy_file $MYSQL_DATA_DIR/test/t.frm $MYSQL_DATA_DIR/test/t.fr_
DROP TABLE t;
CREATE TABLE t (a INT) ENGINE=INNODB;
-- remove_file $MYSQL_DATA_DIR/test/t.frm
-- move_file $MYSQL_DATA_DIR/test/t.fr_ $MYSQL_DATA_DIR/test/t.frm
SHOW CREATE TABLE t;
DROP TABLE t;
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd."); call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd.");
......
CREATE TABLE t1 (i int) ENGINE=INNODB; CREATE TABLE t1 (i int) ENGINE=INNODB;
CREATE TABLE t2 (i int) ENGINE=INNODB; CREATE TABLE t2 (i int) ENGINE=INNODB;
CREATE TABLE t3 (i int) ENGINE=INNODB; CREATE TABLE t3 (i int) ENGINE=INNODB;
CREATE TABLE t4 (i int) ENGINE=INNODB;
CREATE TABLE t5 (i int) ENGINE=INNODB;
# xtrabackup prepare # xtrabackup prepare
# shutdown server # shutdown server
# remove datadir # remove datadir
...@@ -11,3 +13,6 @@ DROP TABLE t1; ...@@ -11,3 +13,6 @@ DROP TABLE t1;
CREATE TABLE t2(i int); CREATE TABLE t2(i int);
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
CREATE TABLE t4(i int);
DROP TABLE t4;
DROP TABLE t5;
...@@ -3,8 +3,14 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; ...@@ -3,8 +3,14 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
CREATE TABLE t1 (i int) ENGINE=INNODB; CREATE TABLE t1 (i int) ENGINE=INNODB;
CREATE TABLE t2 (i int) ENGINE=INNODB; CREATE TABLE t2 (i int) ENGINE=INNODB;
CREATE TABLE t3 (i int) ENGINE=INNODB; CREATE TABLE t3 (i int) ENGINE=INNODB;
CREATE TABLE t4 (i int) ENGINE=INNODB;
CREATE TABLE t5 (i int) ENGINE=INNODB;
--let before_copy_test_t1=DROP TABLE test.t1 --let before_copy_test_t1=DROP TABLE test.t1
--let after_copy_test_t2=DROP TABLE test.t2; --let after_copy_test_t2=DROP TABLE test.t2;
# MDEV-18185, drop + rename combination
--let after_copy_test_t5=BEGIN NOT ATOMIC DROP TABLE test.t5; RENAME TABLE test.t4 TO test.t5; END
--disable_result_log --disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
--enable_result_log --enable_result_log
...@@ -21,4 +27,7 @@ DROP TABLE t1; ...@@ -21,4 +27,7 @@ DROP TABLE t1;
CREATE TABLE t2(i int); CREATE TABLE t2(i int);
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
CREATE TABLE t4(i int);
DROP TABLE t4;
DROP TABLE t5;
rmdir $targetdir; rmdir $targetdir;
...@@ -4,6 +4,8 @@ CREATE TABLE t2(i int) ENGINE INNODB; ...@@ -4,6 +4,8 @@ CREATE TABLE t2(i int) ENGINE INNODB;
INSERT INTO t2 values(2); INSERT INTO t2 values(2);
CREATE TABLE t3(i int) ENGINE INNODB; CREATE TABLE t3(i int) ENGINE INNODB;
CREATE TABLE t4(i int) ENGINE INNODB; CREATE TABLE t4(i int) ENGINE INNODB;
CREATE TABLE t5(i int) ENGINE INNODB;
INSERT INTO t5 VALUES(5);
CREATE TABLE a(a int) ENGINE INNODB; CREATE TABLE a(a int) ENGINE INNODB;
INSERT INTO a values(1); INSERT INTO a values(1);
CREATE TABLE b(b CHAR(1)) ENGINE INNODB; CREATE TABLE b(b CHAR(1)) ENGINE INNODB;
...@@ -51,3 +53,10 @@ SELECT * FROM b1; ...@@ -51,3 +53,10 @@ SELECT * FROM b1;
a1 a1
1 1
DROP TABLE a,b,a1,b1; DROP TABLE a,b,a1,b1;
SELECT * from t5;
i
DROP TABLE t5;
SELECT * from t6;
i
5
DROP TABLE t6;
...@@ -10,6 +10,8 @@ INSERT INTO t2 values(2); ...@@ -10,6 +10,8 @@ INSERT INTO t2 values(2);
CREATE TABLE t3(i int) ENGINE INNODB; CREATE TABLE t3(i int) ENGINE INNODB;
CREATE TABLE t4(i int) ENGINE INNODB; CREATE TABLE t4(i int) ENGINE INNODB;
CREATE TABLE t5(i int) ENGINE INNODB;
INSERT INTO t5 VALUES(5);
CREATE TABLE a(a int) ENGINE INNODB; CREATE TABLE a(a int) ENGINE INNODB;
INSERT INTO a values(1); INSERT INTO a values(1);
...@@ -28,6 +30,7 @@ INSERT INTO b1 VALUES('b1'); ...@@ -28,6 +30,7 @@ INSERT INTO b1 VALUES('b1');
--let after_copy_test_t3=BEGIN NOT ATOMIC RENAME TABLE test.t3 TO test.t3_tmp; INSERT INTO test.t3_tmp VALUES(3); RENAME TABLE test.t3_tmp TO test.t3; END --let after_copy_test_t3=BEGIN NOT ATOMIC RENAME TABLE test.t3 TO test.t3_tmp; INSERT INTO test.t3_tmp VALUES(3); RENAME TABLE test.t3_tmp TO test.t3; END
--let before_copy_test_t4=RENAME TABLE test.t4 TO test.t4_tmp --let before_copy_test_t4=RENAME TABLE test.t4 TO test.t4_tmp
--let after_copy_test_t4=RENAME TABLE test.t4_tmp TO test.t4 --let after_copy_test_t4=RENAME TABLE test.t4_tmp TO test.t4
--let after_copy_test_t5=BEGIN NOT ATOMIC RENAME TABLE test.t5 TO test.t6; CREATE TABLE test.t5(i int) ENGINE INNODB; END
# Test circular renames # Test circular renames
--let before_copy_test_b=RENAME TABLE test.a to test.tmp, test.b to test.a, test.tmp to test.b --let before_copy_test_b=RENAME TABLE test.a to test.tmp, test.b to test.a, test.tmp to test.b
...@@ -81,6 +84,10 @@ SELECT * FROM a1; ...@@ -81,6 +84,10 @@ SELECT * FROM a1;
SELECT * FROM b1; SELECT * FROM b1;
DROP TABLE a,b,a1,b1; DROP TABLE a,b,a1,b1;
SELECT * from t5;
DROP TABLE t5;
SELECT * from t6;
DROP TABLE t6;
rmdir $targetdir; rmdir $targetdir;
...@@ -31,6 +31,13 @@ Host User ...@@ -31,6 +31,13 @@ Host User
fakehost barbar fakehost barbar
fakehost foofoo fakehost foofoo
connection master; connection master;
alter user 'foofoo'@'fakehost' identified by 'foo';
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'barbar'@'fakehost' identified by 'bar';
ERROR HY000: Operation ALTER USER failed for 'non_exist_user1'@'fakehost'
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'non_exist_user2'@'fakehost' identified by 'bar';
ERROR HY000: Operation ALTER USER failed for 'non_exist_user1'@'fakehost','non_exist_user2'@'fakehost'
connection slave;
connection master;
drop user 'foofoo'@'fakehost'; drop user 'foofoo'@'fakehost';
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost' ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost'
...@@ -51,6 +58,10 @@ master-bin.000001 # Query # # use `test`; rename user 'foo'@'fakehost' to 'foofo ...@@ -51,6 +58,10 @@ master-bin.000001 # Query # # use `test`; rename user 'foo'@'fakehost' to 'foofo
master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost' master-bin.000001 # Query # # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost'
master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; alter user 'foofoo'@'fakehost' identified by 'foo'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'barbar'@'fakehost' identified by 'bar'
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop user 'foofoo'@'fakehost' master-bin.000001 # Query # # use `test`; drop user 'foofoo'@'fakehost'
master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost' master-bin.000001 # Query # # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'
......
...@@ -41,6 +41,17 @@ rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user ...@@ -41,6 +41,17 @@ rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user
sync_slave_with_master; sync_slave_with_master;
select Host,User from mysql.user where Host='fakehost'; select Host,User from mysql.user where Host='fakehost';
#
# Test alter user
#
connection master;
alter user 'foofoo'@'fakehost' identified by 'foo';
--error ER_CANNOT_USER
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'barbar'@'fakehost' identified by 'bar';
--error ER_CANNOT_USER
alter user 'non_exist_user1'@'fakehost' identified by 'foo', 'non_exist_user2'@'fakehost' identified by 'bar';
sync_slave_with_master;
# #
# Test drop user # Test drop user
# #
......
...@@ -10507,6 +10507,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list) ...@@ -10507,6 +10507,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
DBUG_ENTER("mysql_alter_user"); DBUG_ENTER("mysql_alter_user");
int result= 0; int result= 0;
String wrong_users; String wrong_users;
bool some_users_altered= false;
/* The only table we're altering is the user table. */ /* The only table we're altering is the user table. */
Grant_tables tables(Table_user, TL_WRITE); Grant_tables tables(Table_user, TL_WRITE);
...@@ -10532,6 +10533,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list) ...@@ -10532,6 +10533,7 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
result= TRUE; result= TRUE;
continue; continue;
} }
some_users_altered= true;
} }
/* Unlock ACL data structures. */ /* Unlock ACL data structures. */
...@@ -10556,6 +10558,10 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list) ...@@ -10556,6 +10558,10 @@ int mysql_alter_user(THD* thd, List<LEX_USER> &users_list)
wrong_users.c_ptr_safe()); wrong_users.c_ptr_safe());
} }
} }
if (some_users_altered)
result|= write_bin_log(thd, FALSE, thd->query(),
thd->query_length());
DBUG_RETURN(result); DBUG_RETURN(result);
} }
......
...@@ -833,6 +833,7 @@ BtrBulk::insert( ...@@ -833,6 +833,7 @@ BtrBulk::insert(
level, m_flush_observer)); level, m_flush_observer));
err = new_page_bulk->init(); err = new_page_bulk->init();
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
UT_DELETE(new_page_bulk);
return(err); return(err);
} }
......
...@@ -9370,7 +9370,6 @@ ha_innobase::innobase_get_index( ...@@ -9370,7 +9370,6 @@ ha_innobase::innobase_get_index(
if (keynr != MAX_KEY && table->s->keys > 0) { if (keynr != MAX_KEY && table->s->keys > 0) {
key = &table->key_info[keynr]; key = &table->key_info[keynr];
index = dict_table_get_index_on_name(ib_table, key->name.str); index = dict_table_get_index_on_name(ib_table, key->name.str);
ut_ad(index);
} else { } else {
index = dict_table_get_first_index(ib_table); index = dict_table_get_first_index(ib_table);
} }
......
...@@ -568,11 +568,6 @@ struct log_t{ ...@@ -568,11 +568,6 @@ struct log_t{
/** the byte offset of the above lsn */ /** the byte offset of the above lsn */
lsn_t lsn_offset; lsn_t lsn_offset;
/** unaligned buffers */
byte* file_header_bufs_ptr;
/** buffers for each file header in the group */
byte* file_header_bufs[SRV_N_LOG_FILES_MAX];
/** used only in recovery: recovery scan succeeded up to this /** used only in recovery: recovery scan succeeded up to this
lsn in this log group */ lsn in this log group */
lsn_t scanned_lsn; lsn_t scanned_lsn;
...@@ -607,10 +602,7 @@ struct log_t{ ...@@ -607,10 +602,7 @@ struct log_t{
/** Close the redo log buffer. */ /** Close the redo log buffer. */
void close() void close()
{ {
ut_free(file_header_bufs_ptr);
n_files = 0; n_files = 0;
file_header_bufs_ptr = NULL;
memset(file_header_bufs, 0, sizeof file_header_bufs);
} }
} log; } log;
......
...@@ -674,16 +674,6 @@ void log_t::files::create(ulint n_files) ...@@ -674,16 +674,6 @@ void log_t::files::create(ulint n_files)
file_size= srv_log_file_size; file_size= srv_log_file_size;
lsn= LOG_START_LSN; lsn= LOG_START_LSN;
lsn_offset= LOG_FILE_HDR_SIZE; lsn_offset= LOG_FILE_HDR_SIZE;
byte* ptr= static_cast<byte*>(ut_zalloc_nokey(LOG_FILE_HDR_SIZE * n_files
+ OS_FILE_LOG_BLOCK_SIZE));
file_header_bufs_ptr= ptr;
ptr= static_cast<byte*>(ut_align(ptr, OS_FILE_LOG_BLOCK_SIZE));
memset(file_header_bufs, 0, sizeof file_header_bufs);
for (ulint i = 0; i < n_files; i++, ptr += LOG_FILE_HDR_SIZE)
file_header_bufs[i] = ptr;
} }
/******************************************************//** /******************************************************//**
...@@ -696,7 +686,6 @@ log_file_header_flush( ...@@ -696,7 +686,6 @@ log_file_header_flush(
lsn_t start_lsn) /*!< in: log file data starts at this lsn_t start_lsn) /*!< in: log file data starts at this
lsn */ lsn */
{ {
byte* buf;
lsn_t dest_offset; lsn_t dest_offset;
ut_ad(log_write_mutex_own()); ut_ad(log_write_mutex_own());
...@@ -705,9 +694,10 @@ log_file_header_flush( ...@@ -705,9 +694,10 @@ log_file_header_flush(
ut_ad((log_sys.log.format & ~LOG_HEADER_FORMAT_ENCRYPTED) ut_ad((log_sys.log.format & ~LOG_HEADER_FORMAT_ENCRYPTED)
== LOG_HEADER_FORMAT_CURRENT); == LOG_HEADER_FORMAT_CURRENT);
buf = log_sys.log.file_header_bufs[nth_file]; // man 2 open suggests this buffer to be aligned by 512 for O_DIRECT
MY_ALIGNED(OS_FILE_LOG_BLOCK_SIZE)
byte buf[OS_FILE_LOG_BLOCK_SIZE] = {0};
memset(buf, 0, OS_FILE_LOG_BLOCK_SIZE);
mach_write_to_4(buf + LOG_HEADER_FORMAT, log_sys.log.format); mach_write_to_4(buf + LOG_HEADER_FORMAT, log_sys.log.format);
mach_write_to_4(buf + LOG_HEADER_SUBFORMAT, log_sys.log.subformat); mach_write_to_4(buf + LOG_HEADER_SUBFORMAT, log_sys.log.subformat);
mach_write_to_8(buf + LOG_HEADER_START_LSN, start_lsn); mach_write_to_8(buf + LOG_HEADER_START_LSN, start_lsn);
......
...@@ -2105,6 +2105,12 @@ static my_bool trx_get_trx_by_xid_callback(rw_trx_hash_element_t *element, ...@@ -2105,6 +2105,12 @@ static my_bool trx_get_trx_by_xid_callback(rw_trx_hash_element_t *element,
if (trx->is_recovered && trx_state_eq(trx, TRX_STATE_PREPARED) && if (trx->is_recovered && trx_state_eq(trx, TRX_STATE_PREPARED) &&
arg->xid->eq(reinterpret_cast<XID*>(trx->xid))) arg->xid->eq(reinterpret_cast<XID*>(trx->xid)))
{ {
#ifdef WITH_WSREP
/* The commit of a prepared recovered Galera
transaction needs a valid trx->xid for
invoking trx_sys_update_wsrep_checkpoint(). */
if (!wsrep_is_wsrep_xid(trx->xid))
#endif
/* Invalidate the XID, so that subsequent calls will not find it. */ /* Invalidate the XID, so that subsequent calls will not find it. */
trx->xid->null(); trx->xid->null();
arg->trx= trx; arg->trx= trx;
......
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