Skip to content

Commit 191209d

Browse files
committed
Merge 10.5 into 10.6
2 parents 6066e5d + 85ecb80 commit 191209d

35 files changed

+177
-44
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5564,9 +5564,22 @@ xtrabackup_apply_delta(
55645564
buf + FSP_HEADER_OFFSET + FSP_SIZE);
55655565
if (mach_read_from_4(buf
55665566
+ FIL_PAGE_SPACE_ID)) {
5567+
#ifdef _WIN32
5568+
os_offset_t last_page =
5569+
os_file_get_size(dst_file) /
5570+
page_size;
5571+
5572+
/* os_file_set_size() would
5573+
shrink the size of the file */
5574+
if (last_page < n_pages &&
5575+
!os_file_set_size(
5576+
dst_path, dst_file,
5577+
n_pages * page_size))
5578+
#else
55675579
if (!os_file_set_size(
55685580
dst_path, dst_file,
55695581
n_pages * page_size))
5582+
#endif /* _WIN32 */
55705583
goto error;
55715584
} else if (fil_space_t* space
55725585
= fil_system.sys_space) {

mysql-test/include/long_test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# We use this --source include to mark a test as taking long to run.
22
# We can use this to schedule such test early (to not be left with
3-
# only one or two long tests running, and rests of works idle), or to
3+
# only one or two long tests running, and rests of workers idle), or to
44
# run a quick test skipping long-running test cases.
55

66
--source include/no_valgrind_without_big.inc

mysql-test/main/backup_locks.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Tests BACKUP STAGE locking
33
########################################################################
44

5+
--source include/long_test.inc
56
--source include/have_innodb.inc
67
--source include/have_metadata_lock_info.inc
78
--source include/not_embedded.inc

mysql-test/main/skip_grants.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,11 @@ drop user baz@baz;
137137
#
138138
# End of 10.3 tests
139139
#
140+
#
141+
# MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables
142+
#
143+
CREATE DEFINER=a PROCEDURE p() SELECT 1;
144+
CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100;
145+
DROP PROCEDURE p;
146+
DROP FUNCTION f;
147+
# End of 10.5 tests

mysql-test/main/skip_grants.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,14 @@ drop user baz@baz;
168168
--echo #
169169
--echo # End of 10.3 tests
170170
--echo #
171+
172+
--echo #
173+
--echo # MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables
174+
--echo #
175+
CREATE DEFINER=a PROCEDURE p() SELECT 1;
176+
CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100;
177+
178+
DROP PROCEDURE p;
179+
DROP FUNCTION f;
180+
181+
--echo # End of 10.5 tests

mysql-test/main/sp-bugs.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,5 +388,14 @@ ERROR 23000: Column 'c2' in FROM is ambiguous
388388
DROP PROCEDURE p2;
389389
DROP TABLE t1, t2;
390390
#
391+
# MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables
392+
#
393+
# This test is a duplicate of the one located in the file skip_grants.test
394+
# and placed here to check the same test case against embedded-server
395+
CREATE DEFINER=a PROCEDURE p() SELECT 1;
396+
CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100;
397+
DROP PROCEDURE p;
398+
DROP FUNCTION f;
399+
#
391400
# End of 10.5 tests
392401
#

mysql-test/main/sp-bugs.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,26 @@ CALL p2 (@a,@c);
414414
DROP PROCEDURE p2;
415415
DROP TABLE t1, t2;
416416

417+
--echo #
418+
--echo # MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables
419+
--echo #
420+
--echo # This test is a duplicate of the one located in the file skip_grants.test
421+
--echo # and placed here to check the same test case against embedded-server
422+
423+
# Disable warnings before running the following CREATE PROCEDURE/FUNCTION
424+
# statement since the warning message
425+
# "The user specified as a definer ('a'@'%') does not exist"
426+
# is output in case the test be run against a regular server
427+
# and isn't output if embedded server is used (@sa sp_process_definer()
428+
# in sql_parse.cc).
429+
--disable_warnings
430+
CREATE DEFINER=a PROCEDURE p() SELECT 1;
431+
CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100;
432+
--enable_warnings
433+
434+
DROP PROCEDURE p;
435+
DROP FUNCTION f;
436+
417437
--echo #
418438
--echo # End of 10.5 tests
419439
--echo #

mysql-test/suite/binlog_encryption/encrypted_master.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# - with annotated events, default checksums and minimal binlog row image
1919
#
2020

21+
--source include/long_test.inc
2122
# The test can take very long time with valgrind
2223
--source include/not_valgrind.inc
2324

mysql-test/suite/funcs_2/t/innodb_charset.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Checking of other prerequisites is in charset_master.test #
77
################################################################################
88

9-
--source include/no_valgrind_without_big.inc
9+
--source include/long_test.inc
1010
--source include/have_innodb.inc
1111

1212
# Starting with MariaDB 10.6, ensure that DDL recovery will have completed

mysql-test/suite/innodb/t/innodb_bug52663.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_innodb.inc
23

34
set session transaction isolation level read committed;

mysql-test/suite/innodb_gis/r/rollback.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,16 @@ update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
412412
ERROR HY000: Lost connection to server during query
413413
insert into t1 values(5, point(5,5), point(5,5), 5);
414414
drop table t1;
415+
#
416+
# MDEV-35420 Server aborts while deleting the record
417+
# in spatial index
418+
#
419+
CREATE TABLE t1 (c POINT NOT NULL, SPATIAL(c)) engine=InnoDB;
420+
CHECK TABLE t1;
421+
Table Op Msg_type Msg_text
422+
test.t1 check status OK
423+
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
424+
START TRANSACTION;
425+
INSERT INTO t1 SELECT ST_GeomFromText('POINT(114368751 656950466)') FROM seq_1_to_512;
426+
ROLLBACK;
427+
DROP TABLE t1;

mysql-test/suite/innodb_gis/t/rollback.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Avoid CrashReporter popup on Mac
99
--source include/not_crashrep.inc
1010
--source include/have_innodb_16k.inc
11+
--source include/have_sequence.inc
1112

1213
CREATE TABLE t4 (id bigint(12) unsigned NOT NULL auto_increment,
1314
c2 varchar(15) collate utf8_bin default NULL,
@@ -475,3 +476,15 @@ update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
475476
insert into t1 values(5, point(5,5), point(5,5), 5);
476477

477478
drop table t1;
479+
480+
--echo #
481+
--echo # MDEV-35420 Server aborts while deleting the record
482+
--echo # in spatial index
483+
--echo #
484+
CREATE TABLE t1 (c POINT NOT NULL, SPATIAL(c)) engine=InnoDB;
485+
CHECK TABLE t1;
486+
SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR
487+
START TRANSACTION;
488+
INSERT INTO t1 SELECT ST_GeomFromText('POINT(114368751 656950466)') FROM seq_1_to_512;
489+
ROLLBACK;
490+
DROP TABLE t1;

mysql-test/suite/mariabackup/incremental_compressed.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#
55
CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
66
ALTER TABLE t PARTITION BY KEY(pk);
7+
# Incremental backup
8+
# Prepare fullbackup
9+
# Prepare incremental backup
710
# shutdown server
811
# remove datadir
912
# xtrabackup move back

mysql-test/suite/mariabackup/incremental_compressed.test

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
1616

1717
ALTER TABLE t PARTITION BY KEY(pk);
1818

19+
--echo # Incremental backup
1920
--exec $XTRABACKUP --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root > $incremental_dir.log 2>&1
21+
--echo # Prepare fullbackup
2022
--exec $XTRABACKUP --prepare --target-dir=$basedir --user=root > $MYSQL_TMP_DIR/backup_prepare_0.log 2>&1
21-
--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --user=root > $MYSQL_TMP_DIR/backup_prepare_1.log
22-
--cat_file $MYSQL_TMP_DIR/backup_prepare_1.log
23+
--echo # Prepare incremental backup
24+
--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --user=root > $MYSQL_TMP_DIR/backup_prepare_1.log 2>&1
2325
let $targetdir=$basedir;
2426
-- source include/restart_and_restore.inc
25-
2627
SHOW CREATE TABLE t;
2728
DROP TABLE t;
29+
remove_file $incremental_dir.log;
30+
remove_file $MYSQL_TMP_DIR/backup_prepare_0.log;
31+
remove_file $MYSQL_TMP_DIR/backup_prepare_1.log;
32+
rmdir $basedir;
33+
rmdir $incremental_dir;

mysql-test/suite/mariabackup/log_page_corruption.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
--source include/long_test.inc
12
--source include/have_debug.inc
2-
--source include/no_valgrind_without_big.inc
33
--source include/innodb_undo_tablespaces.inc
44

55
--echo ########

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_innodb.inc
23
--source include/have_partition.inc
34
--source include/have_debug_sync.inc

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_partition.inc
23
--source include/have_debug_sync.inc
34

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_partition.inc
23
--source include/have_debug_sync.inc
34

mysql-test/suite/rpl/r/rpl_gtid_crash.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ INSERT INTO t1 VALUES (1, 0);
1212
connection server_2;
1313
SET sql_log_bin=0;
1414
call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
15+
call mtr.add_suppression('Slave I/O: .*Lost connection to server during query');
16+
call mtr.add_suppression("Slave I/O thread couldn't register on master");
1517
SET sql_log_bin=1;
1618
include/stop_slave.inc
1719
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--master-retry-count=100 --slave-net-timeout=10
1+
--master-retry-count=500 --slave-net-timeout=10

mysql-test/suite/rpl/t/rpl_gtid_crash.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ INSERT INTO t1 VALUES (1, 0);
2424
--sync_with_master
2525
SET sql_log_bin=0;
2626
call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
27+
call mtr.add_suppression('Slave I/O: .*Lost connection to server during query');
28+
call mtr.add_suppression("Slave I/O thread couldn't register on master");
2729
SET sql_log_bin=1;
2830
--source include/stop_slave.inc
2931
--replace_result $MASTER_MYPORT MASTER_PORT

mysql-test/suite/rpl/t/rpl_heartbeat_basic.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# * Various states of master and heartbeat
1010
# * Circular replication
1111
#############################################################
12+
--source include/long_test.inc
1213
--source include/master-slave.inc
1314
#
1415
# The test runs long and does not have any specifics to

mysql-test/suite/rpl/t/rpl_semi_sync.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Please check all dependent tests after modifying it
55
#
66

7+
source include/long_test.inc;
78
source include/not_embedded.inc;
89
source include/have_innodb.inc;
910
source include/master-slave.inc;

mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_binlog_format_statement.inc
23
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
34
source rpl_semi_sync.test;

mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--source include/long_test.inc
12
--source include/have_binlog_format_row.inc
23
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
34
source rpl_semi_sync.test;

mysql-test/suite/rpl/t/rpl_typeconv.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Please check all dependent tests after modifying it
55
#
66

7+
--source include/long_test.inc
78
--source include/have_binlog_format_row.inc
89
--source include/master-slave.inc
910

sql/filesort.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names)
673673
move_back_guard.engage();
674674
}
675675

676-
SCOPE_VALUE(table->read_set, (table->read_set && table->write_set) ?
676+
SCOPE_VALUE(table->read_set, (table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE) ?
677677
table->write_set : table->read_set);
678678

679679
output.length(0);

sql/slave.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3186,21 +3186,23 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
31863186
if (full)
31873187
protocol->store(mi->connection_name.str, mi->connection_name.length,
31883188
&my_charset_bin);
3189+
31893190
mysql_mutex_lock(&mi->run_lock);
3191+
THD *sql_thd= mi->rli.sql_driver_thd;
3192+
const char *slave_sql_running_state=
3193+
sql_thd ? sql_thd->get_proc_info() : "";
3194+
THD *io_thd= mi->io_thd;
3195+
const char *slave_io_running_state= io_thd ? io_thd->get_proc_info() : "";
3196+
mysql_mutex_unlock(&mi->run_lock);
3197+
31903198
if (full)
3191-
{
31923199
/*
31933200
Show what the sql driver replication thread is doing
31943201
This is only meaningful if there is only one slave thread.
31953202
*/
3196-
msg= (mi->rli.sql_driver_thd ?
3197-
mi->rli.sql_driver_thd->get_proc_info() : "");
3198-
protocol->store_string_or_null(msg, &my_charset_bin);
3199-
}
3200-
msg= mi->io_thd ? mi->io_thd->get_proc_info() : "";
3201-
protocol->store_string_or_null(msg, &my_charset_bin);
3203+
protocol->store_string_or_null(slave_sql_running_state, &my_charset_bin);
32023204

3203-
mysql_mutex_unlock(&mi->run_lock);
3205+
protocol->store_string_or_null(slave_io_running_state, &my_charset_bin);
32043206

32053207
mysql_mutex_lock(&mi->data_lock);
32063208
mysql_mutex_lock(&mi->rli.data_lock);
@@ -3374,10 +3376,6 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
33743376

33753377
protocol->store((uint32) mi->rli.get_sql_delay());
33763378
// SQL_Remaining_Delay
3377-
// THD::proc_info is not protected by any lock, so we read it once
3378-
// to ensure that we use the same value throughout this function.
3379-
const char *slave_sql_running_state=
3380-
mi->rli.sql_driver_thd ? mi->rli.sql_driver_thd->proc_info : "";
33813379
if (slave_sql_running_state == stage_sql_thd_waiting_until_delay.m_name)
33823380
{
33833381
time_t t= my_time(0), sql_delay_end= mi->rli.get_sql_delay_end();

sql/sql_acl.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12975,6 +12975,9 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock)
1297512975
if (is_invalid_role_name(user->user.str))
1297612976
return 0;
1297712977

12978+
if (!initialized)
12979+
return dup;
12980+
1297812981
if (lock)
1297912982
mysql_mutex_lock(&acl_cache->lock);
1298012983
if (find_acl_role(dup->user.str))

sql/sql_truncate.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref,
303303
bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
304304
bool *hton_can_recreate)
305305
{
306-
handlerton *hton;
306+
const handlerton *hton;
307307
bool versioned;
308308
bool sequence= false;
309309
TABLE *table= NULL;
@@ -374,8 +374,12 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
374374
table we need to find out default partition
375375
handlerton.
376376
*/
377-
const handlerton *ht= share->default_part_plugin ?
378-
plugin_hton(share->default_part_plugin) : hton;
377+
const handlerton* const ht=
378+
#ifdef WITH_PARTITION_STORAGE_ENGINE
379+
share->default_part_plugin ?
380+
plugin_hton(share->default_part_plugin) :
381+
#endif
382+
hton;
379383

380384
if (ht && !wsrep_should_replicate_ddl(thd, ht))
381385
{

sql/structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ struct AUTHID
235235
LEX_CSTRING user, host;
236236
void init() { memset(this, 0, sizeof(*this)); }
237237
void copy(MEM_ROOT *root, const LEX_CSTRING *usr, const LEX_CSTRING *host);
238-
bool is_role() const { return user.str[0] && !host.str[0]; }
238+
bool is_role() const { return user.str[0] && (!host.str || !host.str[0]); }
239239
void set_lex_string(LEX_CSTRING *l, char *buf)
240240
{
241241
if (is_role())

0 commit comments

Comments
 (0)