Skip to content

Commit 17810b7

Browse files
Merge branch '10.10' into 10.11
2 parents 034848c + 3b38c2f commit 17810b7

File tree

69 files changed

+1388
-776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1388
-776
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4669,7 +4669,9 @@ static bool xtrabackup_backup_func()
46694669
goto fail;
46704670
}
46714671

4672-
log_sys.create();
4672+
if (!log_sys.create()) {
4673+
goto fail;
4674+
}
46734675
/* get current checkpoint_lsn */
46744676
{
46754677
mysql_mutex_lock(&recv_sys.mutex);
@@ -6039,7 +6041,9 @@ static bool xtrabackup_prepare_func(char** argv)
60396041
}
60406042

60416043
recv_sys.create();
6042-
log_sys.create();
6044+
if (!log_sys.create()) {
6045+
goto error;
6046+
}
60436047
recv_sys.recovery_on = true;
60446048

60456049
xb_fil_io_init();

mysql-test/suite/mariabackup/data_directory.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ SELECT * FROM t;
1111
a
1212
1
1313
DROP TABLE t;
14+
#
15+
# MDEV-18200 MariaBackup full backup failed with InnoDB: Failing assertion: success
16+
#
17+
#
18+
# End of 10.4 tests
19+
#

mysql-test/suite/mariabackup/data_directory.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ rmdir $table_data_dir;
2121
SELECT * FROM t;
2222
DROP TABLE t;
2323
rmdir $targetdir;
24+
25+
--echo #
26+
--echo # MDEV-18200 MariaBackup full backup failed with InnoDB: Failing assertion: success
27+
--echo #
28+
let $DATADIR= `select @@datadir`;
29+
chmod 0000 $DATADIR/ibdata1;
30+
--disable_result_log
31+
--error 1
32+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
33+
--enable_result_log
34+
chmod 0755 $DATADIR/ibdata1;
2435
rmdir $table_data_dir;
36+
rmdir $targetdir;
37+
--echo #
38+
--echo # End of 10.4 tests
39+
--echo #

mysql-test/suite/parts/r/alter_table.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,17 @@ connection default;
344344
drop database EXISTENT;
345345
drop user alan;
346346
drop tables t1, tp1, tp2, tp4;
347+
#
348+
# MDEV-31014 Database privileges are insufficient for CONVERT TABLE TO PARTITION
349+
#
350+
create database db;
351+
create user u@localhost;
352+
grant all on db.* to u@localhost;
353+
connect con1,localhost,u,,db;
354+
create table t1 (a int) partition by range(a) (p1 values less than (100), p2 values less than (1000));
355+
alter table t1 convert partition p2 to table tp;
356+
alter table t1 convert table tp to partition p2 values less than (1000);
357+
disconnect con1;
358+
connection default;
359+
drop user u@localhost;
360+
drop database db;

mysql-test/suite/parts/t/alter_table.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,21 @@ alter table t1 convert partition p1 to table tp1;
301301
drop database EXISTENT;
302302
drop user alan;
303303
drop tables t1, tp1, tp2, tp4;
304+
305+
--echo #
306+
--echo # MDEV-31014 Database privileges are insufficient for CONVERT TABLE TO PARTITION
307+
--echo #
308+
create database db;
309+
create user u@localhost;
310+
grant all on db.* to u@localhost;
311+
312+
--connect (con1,localhost,u,,db)
313+
create table t1 (a int) partition by range(a) (p1 values less than (100), p2 values less than (1000));
314+
alter table t1 convert partition p2 to table tp;
315+
alter table t1 convert table tp to partition p2 values less than (1000);
316+
317+
# Cleanup
318+
--disconnect con1
319+
--connection default
320+
drop user u@localhost;
321+
drop database db;

sql/handler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,7 @@ int ha_commit_trans(THD *thd, bool all)
18041804
(void) trans_rollback_stmt(thd);
18051805
goto err;
18061806
}
1807+
trt.table->file->extra(HA_EXTRA_RESET_STATE);
18071808
// Here, the call will not commit inside InnoDB. It is only working
18081809
// around closing thd->transaction.stmt open by TR_table::open().
18091810
if (all)

sql/sql_alter.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,14 @@ bool Sql_cmd_alter_table::execute(THD *thd)
493493
0, 0))
494494
DBUG_RETURN(TRUE); /* purecov: inspected */
495495

496+
if ((alter_info.partition_flags & ALTER_PARTITION_CONVERT_IN))
497+
{
498+
TABLE_LIST *tl= first_table->next_local;
499+
tl->grant.privilege= first_table->grant.privilege;
500+
tl->grant.m_internal= first_table->grant.m_internal;
501+
}
502+
503+
496504
/* If it is a merge table, check privileges for merge children. */
497505
if (create_info.merge_list)
498506
{

storage/innobase/fil/fil0fil.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
334334
return node;
335335
}
336336

337+
__attribute__((warn_unused_result, nonnull))
337338
/** Open a tablespace file.
338339
@param node data file
339340
@return whether the file was successfully opened */
@@ -362,9 +363,9 @@ static bool fil_node_open_file_low(fil_node_t *node)
362363
: OS_FILE_OPEN | OS_FILE_ON_ERROR_NO_EXIT,
363364
OS_FILE_AIO, type,
364365
srv_read_only_mode, &success);
365-
if (node->is_open())
366+
367+
if (success && node->is_open())
366368
{
367-
ut_ad(success);
368369
#ifndef _WIN32
369370
if (!node->space->id && !srv_read_only_mode && my_disable_locking &&
370371
os_file_lock(node->handle, node->name))

storage/innobase/include/log0log.h

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,31 @@ typedef srw_lock log_rwlock_t;
356356
/** @return end of resize_buf */
357357
inline const byte *resize_buf_end() const noexcept
358358
{ return resize_buf + resize_target; }
359+
360+
/** Initialise the redo log subsystem. */
361+
void create_low();
362+
/** Initialise the redo log subsystem.
363+
@return whether the initialisation succeeded */
364+
bool create() { create_low(); return true; }
365+
366+
/** Attach a log file.
367+
@return whether the memory allocation succeeded */
368+
bool attach(log_file_t file, os_offset_t size);
369+
#else
370+
/** Initialise the redo log subsystem.
371+
@return whether the initialisation succeeded */
372+
bool create();
373+
/** Attach a log file. */
374+
void attach_low(log_file_t file, os_offset_t size);
375+
bool attach(log_file_t file, os_offset_t size)
376+
{ attach_low(file, size); return true; }
359377
#endif
360378

361379
#if defined __linux__ || defined _WIN32
362380
/** Try to enable or disable file system caching (update log_buffered) */
363381
void set_buffered(bool buffered);
364382
#endif
365383

366-
void attach(log_file_t file, os_offset_t size);
367-
368384
void close_file();
369385

370386
/** Calculate the checkpoint safety margins. */
@@ -421,9 +437,6 @@ typedef srw_lock log_rwlock_t;
421437
/** Make previous write_buf() durable and update flushed_to_disk_lsn. */
422438
bool flush(lsn_t lsn) noexcept;
423439

424-
/** Initialise the redo log subsystem. */
425-
void create();
426-
427440
/** Shut down the redo log subsystem. */
428441
void close();
429442

storage/innobase/include/log0recv.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,10 @@ struct recv_sys_t
254254
/** The contents of the doublewrite buffer */
255255
recv_dblwr_t dblwr;
256256

257-
inline void read(os_offset_t offset, span<byte> buf);
257+
__attribute__((warn_unused_result))
258+
inline dberr_t read(os_offset_t offset, span<byte> buf);
258259
inline size_t files_size();
259-
void close_files() { files.clear(); files.shrink_to_fit(); }
260+
void close_files();
260261

261262
/** Advance pages_it if it matches the iterator */
262263
void pages_it_invalidate(const map::iterator &p)

0 commit comments

Comments
 (0)