Skip to content

Commit 1ecf173

Browse files
committed
Merge 10.8 into 10.9
2 parents 66b5b92 + 9f5a3e5 commit 1ecf173

Some content is hidden

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

61 files changed

+789
-261
lines changed

include/my_valgrind.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2010, 2020, MariaDB Corporation.
1+
/* Copyright (C) 2010, 2022, MariaDB Corporation.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -37,6 +37,11 @@
3737
# define MEM_GET_VBITS(a,b,len) __msan_copy_shadow(b,a,len)
3838
# define MEM_SET_VBITS(a,b,len) __msan_copy_shadow(a,b,len)
3939
# define REDZONE_SIZE 8
40+
# ifdef __linux__
41+
# define MSAN_STAT_WORKAROUND(st) MEM_MAKE_DEFINED(st, sizeof(*st))
42+
# else
43+
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
44+
# endif
4045
#elif defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind)
4146
# include <valgrind/memcheck.h>
4247
# define HAVE_MEM_CHECK
@@ -49,6 +54,7 @@
4954
# define MEM_GET_VBITS(a,b,len) VALGRIND_GET_VBITS(a,b,len)
5055
# define MEM_SET_VBITS(a,b,len) VALGRIND_SET_VBITS(a,b,len)
5156
# define REDZONE_SIZE 8
57+
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
5258
#elif defined(__SANITIZE_ADDRESS__) && (!defined(_MSC_VER) || defined (__clang__))
5359
# include <sanitizer/asan_interface.h>
5460
/* How to do manual poisoning:
@@ -62,6 +68,7 @@
6268
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
6369
# define MEM_GET_VBITS(a,b,len) ((void) 0)
6470
# define MEM_SET_VBITS(a,b,len) ((void) 0)
71+
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
6572
# define REDZONE_SIZE 8
6673
#else
6774
# define MEM_UNDEFINED(a,len) ((void) 0)
@@ -73,6 +80,7 @@
7380
# define MEM_GET_VBITS(a,b,len) ((void) 0)
7481
# define MEM_SET_VBITS(a,b,len) ((void) 0)
7582
# define REDZONE_SIZE 0
83+
# define MSAN_STAT_WORKAROUND(st) ((void) 0)
7684
#endif /* __has_feature(memory_sanitizer) */
7785

7886
#ifdef HAVE_valgrind

mysql-test/lib/mtr_cases.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ sub get_tags_from_file($$) {
10371037
}
10381038

10391039
# Check for a sourced include file.
1040-
if ($line =~ /^(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/)
1040+
if ($line =~ /^[[:space:]]*(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/)
10411041
{
10421042
my $include= $2;
10431043
# The rules below must match open_file() function of mysqltest.cc
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
#
2+
# MDEV-14429 sql_safe_updates in my.cnf not work
3+
#
14
select @@sql_safe_updates;
25
@@sql_safe_updates
36
1
7+
#
8+
# MDEV-18304 sql_safe_updates does not work with OR clauses
9+
#
10+
create table t1 (a int, b int, primary key (a), key (b));
11+
update t1 set b=2 where a=1 or b=2;
12+
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
13+
explain update t1 set b=2 where a=1 or b=2;
14+
id select_type table type possible_keys key key_len ref rows Extra
15+
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
16+
delete from t1 where a=1 or b=2;
17+
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
18+
explain delete from t1 where a=1 or b=2;
19+
id select_type table type possible_keys key key_len ref rows Extra
20+
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
21+
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
22+
update t1 set b=2 where a=1 or b=2;
23+
delete from t1 where a=1 or b=2;
24+
drop table t1;
25+
#
26+
# End of 10.3 tests
27+
#

mysql-test/main/sql_safe_updates.test

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
#
2-
# MDEV-14429 sql_safe_updates in my.cnf not work
3-
#
1+
--echo #
2+
--echo # MDEV-14429 sql_safe_updates in my.cnf not work
3+
--echo #
44
select @@sql_safe_updates;
5+
6+
--echo #
7+
--echo # MDEV-18304 sql_safe_updates does not work with OR clauses
8+
--echo #
9+
create table t1 (a int, b int, primary key (a), key (b));
10+
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
11+
update t1 set b=2 where a=1 or b=2;
12+
explain update t1 set b=2 where a=1 or b=2;
13+
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
14+
delete from t1 where a=1 or b=2;
15+
explain delete from t1 where a=1 or b=2;
16+
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
17+
update t1 set b=2 where a=1 or b=2;
18+
delete from t1 where a=1 or b=2;
19+
drop table t1;
20+
21+
--echo #
22+
--echo # End of 10.3 tests
23+
--echo #
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
========= Set server_id to 99 and prepare test table.
2+
SET GLOBAL server_id= 99;
3+
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
4+
========= Crash the server.
5+
SET SESSION debug_dbug="+d,crash_commit_after_log";
6+
INSERT INTO t1 VALUES (1, NULL);
7+
Got one of the listed errors
8+
========= Restart the server with default config file in which server_id= 1.
9+
========= Check that recover succeeds and server is up.
10+
connection default;
11+
========= Check that all transactions are recovered.
12+
SELECT a FROM t1 ORDER BY a;
13+
a
14+
1
15+
========= Cleanup.
16+
connection default;
17+
DROP TABLE t1;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This test verifies attempt to xa recover using a new server id that
2+
# different from the transaction's original server_id.
3+
#
4+
5+
--source include/have_innodb.inc
6+
--source include/have_debug.inc
7+
--source include/have_binlog_format_row.inc
8+
# Valgrind does not work well with test that crashes the server
9+
--source include/not_valgrind.inc
10+
11+
12+
--echo ========= Set server_id to 99 and prepare test table.
13+
SET GLOBAL server_id= 99;
14+
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
15+
16+
17+
--echo ========= Crash the server.
18+
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
19+
wait-binlog_xa_recover_using_new_server_id.test
20+
EOF
21+
SET SESSION debug_dbug="+d,crash_commit_after_log";
22+
--error 2006,2013
23+
INSERT INTO t1 VALUES (1, NULL);
24+
25+
26+
--echo ========= Restart the server with default config file in which server_id= 1.
27+
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
28+
restart-binlog_xa_recover_using_new_server_id.test
29+
EOF
30+
31+
32+
--echo ========= Check that recover succeeds and server is up.
33+
connection default;
34+
--enable_reconnect
35+
--source include/wait_until_connected_again.inc
36+
37+
38+
--echo ========= Check that all transactions are recovered.
39+
SELECT a FROM t1 ORDER BY a;
40+
41+
42+
--echo ========= Cleanup.
43+
connection default;
44+
DROP TABLE t1;

mysql-test/suite/innodb/r/instant_alter_bugs.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,13 @@ ALTER TABLE t ADD d INT;
451451
affected rows: 0
452452
info: Records: 0 Duplicates: 0 Warnings: 0
453453
DROP TABLE t;
454+
#
455+
# MDEV-28060 Online DDL fails while checking for instant
456+
# alter condition
457+
#
458+
CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
459+
ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL,
460+
f4 INT NOT NULL, f5 INT NOT NULL),
461+
CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL;
462+
DROP TABLE t1;
454463
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;

mysql-test/suite/innodb/r/undo_truncate.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ connection con2;
2828
commit;
2929
disconnect con2;
3030
connection default;
31+
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
32+
SET GLOBAL innodb_max_purge_lag_wait=0;
3133
set global innodb_fast_shutdown=0;
3234
# restart
3335
drop table t1, t2;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,4 +473,13 @@ ALTER TABLE t ADD d INT;
473473
--disable_info
474474
DROP TABLE t;
475475

476+
--echo #
477+
--echo # MDEV-28060 Online DDL fails while checking for instant
478+
--echo # alter condition
479+
--echo #
480+
CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
481+
ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL,
482+
f4 INT NOT NULL, f5 INT NOT NULL),
483+
CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL;
484+
DROP TABLE t1;
476485
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ connection default;
4646
let $trx_before= `SHOW ENGINE INNODB STATUS`;
4747
let $trx_before= `select substr('$trx_before',9)+2`;
4848

49+
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
50+
SET GLOBAL innodb_max_purge_lag_wait=0;
4951
set global innodb_fast_shutdown=0;
5052
--source include/restart_mysqld.inc
5153
--replace_regex /.*Trx id counter ([0-9]+).*/\1/

0 commit comments

Comments
 (0)