Skip to content

Commit 20b818f

Browse files
committed
Merge branch '10.6' into 10.11
2 parents 7d9660e + a135551 commit 20b818f

40 files changed

+446
-115
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,11 +1787,6 @@ uint xb_client_options_count = array_elements(xb_client_options);
17871787
static const char *dbug_option;
17881788
#endif
17891789

1790-
#ifdef HAVE_URING
1791-
extern const char *io_uring_may_be_unsafe;
1792-
bool innodb_use_native_aio_default();
1793-
#endif
1794-
17951790
static my_bool innodb_log_checkpoint_now;
17961791

17971792
struct my_option xb_server_options[] =
@@ -1929,12 +1924,7 @@ struct my_option xb_server_options[] =
19291924
"Use native AIO if supported on this platform.",
19301925
(G_PTR*) &srv_use_native_aio,
19311926
(G_PTR*) &srv_use_native_aio, 0, GET_BOOL, NO_ARG,
1932-
#ifdef HAVE_URING
1933-
innodb_use_native_aio_default(),
1934-
#else
1935-
TRUE,
1936-
#endif
1937-
0, 0, 0, 0, 0},
1927+
TRUE, 0, 0, 0, 0, 0},
19381928
{"innodb_page_size", OPT_INNODB_PAGE_SIZE,
19391929
"The universal page size of the database.",
19401930
(G_PTR*) &innobase_page_size, (G_PTR*) &innobase_page_size, 0,
@@ -2539,12 +2529,8 @@ static bool innodb_init_param()
25392529
msg("InnoDB: Using Linux native AIO");
25402530
}
25412531
#elif defined(HAVE_URING)
2542-
if (!srv_use_native_aio) {
2543-
} else if (io_uring_may_be_unsafe) {
2544-
msg("InnoDB: Using liburing on this kernel %s may cause hangs;"
2545-
" see https://jira.mariadb.org/browse/MDEV-26674",
2546-
io_uring_may_be_unsafe);
2547-
} else {
2532+
2533+
if (srv_use_native_aio) {
25482534
msg("InnoDB: Using liburing");
25492535
}
25502536
#else

include/my_stack_alloc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static inline void *my_get_stack_pointer(void *default_stack)
3838
#if defined(__GNUC__) || defined(__clang__) /* GCC and Clang compilers */
3939
#if defined(__i386__) /* Intel x86 (32-bit) */
4040
__asm__ volatile ("movl %%esp, %0" : "=r" (stack_ptr));
41+
#elif defined(__x86_64__) && defined (__ILP32__) /* Intel x86-64 (64-bit), X32 ABI */
42+
__asm__ volatile ("movl %%esp, %0" : "=r" (stack_ptr));
4143
#elif defined(__x86_64__) /* Intel x86-64 (64-bit) */
4244
__asm__ volatile ("movq %%rsp, %0" : "=r" (stack_ptr));
4345
#elif defined(__powerpc__) /* PowerPC (32-bit) */

libmariadb

mysql-test/main/sp-no-valgrind.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--source include/not_msan.inc
2-
--source include/not_valgrind_build.inc
2+
--source include/not_valgrind.inc
33

44
--echo # MDEV-20699 do not cache SP in SHOW CREATE
55
--echo # Warmup round, this might allocate some memory for session variable

mysql-test/main/view_grant.result

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,52 @@ connection default;
19821982
DROP VIEW v1;
19831983
DROP USER foo;
19841984
DROP USER FOO;
1985+
#
1986+
# MDEV-36380: User has unauthorized access to a sequence through
1987+
# a view with security invoker
1988+
#
1989+
create database db;
1990+
use db;
1991+
create sequence s;
1992+
create sql security invoker view vin as select nextval(s);
1993+
create sql security definer view vdn as select nextval(s);
1994+
create sql security invoker view vil as select lastval(s);
1995+
create sql security definer view vdl as select lastval(s);
1996+
create sql security invoker view vis as select setval(s,20);
1997+
create sql security definer view vds as select setval(s,30);
1998+
create user u@localhost;
1999+
grant select on db.vin to u@localhost;
2000+
grant select on db.vdn to u@localhost;
2001+
grant select on db.vil to u@localhost;
2002+
grant select on db.vdl to u@localhost;
2003+
grant select on db.vis to u@localhost;
2004+
grant select on db.vds to u@localhost;
2005+
connect con1,localhost,u,,db;
2006+
select nextval(s);
2007+
ERROR 42000: SELECT, INSERT command denied to user 'u'@'localhost' for table `db`.`s`
2008+
select * from vin;
2009+
ERROR HY000: View 'db.vin' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
2010+
select * from vdn;
2011+
nextval(s)
2012+
1
2013+
select lastval(s);
2014+
ERROR 42000: SELECT command denied to user 'u'@'localhost' for table `db`.`s`
2015+
select * from vil;
2016+
ERROR HY000: View 'db.vil' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
2017+
select * from vdl;
2018+
lastval(s)
2019+
1
2020+
select setval(s,10);
2021+
ERROR 42000: INSERT command denied to user 'u'@'localhost' for table `db`.`s`
2022+
select * from vis;
2023+
ERROR HY000: View 'db.vis' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
2024+
select * from vds;
2025+
setval(s,30)
2026+
30
2027+
disconnect con1;
2028+
connection default;
2029+
drop database db;
2030+
drop user u@localhost;
19852031
# End of 10.5 tests
19862032
# Check that a user without access to the schema 'foo' cannot query
19872033
# a JSON_TABLE view in that schema.

mysql-test/main/view_grant.test

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,53 @@ DROP VIEW v1;
22372237
DROP USER foo;
22382238
DROP USER FOO;
22392239

2240+
--echo #
2241+
--echo # MDEV-36380: User has unauthorized access to a sequence through
2242+
--echo # a view with security invoker
2243+
--echo #
2244+
create database db;
2245+
use db;
2246+
create sequence s;
2247+
create sql security invoker view vin as select nextval(s);
2248+
create sql security definer view vdn as select nextval(s);
2249+
create sql security invoker view vil as select lastval(s);
2250+
create sql security definer view vdl as select lastval(s);
2251+
create sql security invoker view vis as select setval(s,20);
2252+
create sql security definer view vds as select setval(s,30);
2253+
create user u@localhost;
2254+
grant select on db.vin to u@localhost;
2255+
grant select on db.vdn to u@localhost;
2256+
grant select on db.vil to u@localhost;
2257+
grant select on db.vdl to u@localhost;
2258+
grant select on db.vis to u@localhost;
2259+
grant select on db.vds to u@localhost;
2260+
2261+
--connect (con1,localhost,u,,db)
2262+
--error ER_TABLEACCESS_DENIED_ERROR
2263+
select nextval(s);
2264+
--error ER_VIEW_INVALID
2265+
select * from vin;
2266+
--disable_ps2_protocol
2267+
select * from vdn;
2268+
--enable_ps2_protocol
2269+
2270+
--error ER_TABLEACCESS_DENIED_ERROR
2271+
select lastval(s);
2272+
--error ER_VIEW_INVALID
2273+
select * from vil;
2274+
select * from vdl;
2275+
2276+
--error ER_TABLEACCESS_DENIED_ERROR
2277+
select setval(s,10);
2278+
--error ER_VIEW_INVALID
2279+
select * from vis;
2280+
select * from vds;
2281+
2282+
--disconnect con1
2283+
--connection default
2284+
drop database db;
2285+
drop user u@localhost;
2286+
22402287
--echo # End of 10.5 tests
22412288

22422289
--echo # Check that a user without access to the schema 'foo' cannot query

mysql-test/suite/gcol/r/innodb_virtual_basic.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ delete from t where a =13;
8686
DROP INDEX idx1 ON t;
8787
DROP INDEX idx2 ON t;
8888
DROP TABLE t;
89+
# restart
90+
set default_storage_engine=innodb;
8991
/* Test large BLOB data */
9092
CREATE TABLE `t` (
9193
`a` BLOB,

mysql-test/suite/gcol/t/innodb_virtual_basic.test

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--source include/have_innodb.inc
22
--source include/have_partition.inc
3-
--source include/big_test.inc
3+
--source include/not_embedded.inc
44

55
call mtr.add_suppression("\\[Warning\\] InnoDB: Compute virtual");
66

@@ -66,6 +66,41 @@ DROP INDEX idx1 ON t;
6666
DROP INDEX idx2 ON t;
6767
DROP TABLE t;
6868

69+
let MYSQLD_DATADIR=`select @@datadir`;
70+
let PAGE_SIZE=`select @@innodb_page_size`;
71+
--source include/shutdown_mysqld.inc
72+
perl;
73+
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
74+
my $file = "$ENV{MYSQLD_DATADIR}/ibdata1";
75+
open(FILE, "+<$file") || die "Unable to open $file";
76+
binmode FILE;
77+
my $ps= $ENV{PAGE_SIZE};
78+
my $page;
79+
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
80+
my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
81+
sysseek(FILE, 7*$ps, 0) || die "Unable to seek $file\n";
82+
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
83+
substr($page,54,4)=pack("N",0xc001cafe); # 32 MSB of 64-bit DICT_HDR_INDEX_ID
84+
my $polynomial = 0x82f63b78; # CRC-32C
85+
if ($full_crc32)
86+
{
87+
my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
88+
substr($page, $ps-4, 4) = pack("N", $ck);
89+
}
90+
else
91+
{
92+
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
93+
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
94+
substr($page,0,4)=$ck;
95+
substr($page,$ps-8,4)=$ck;
96+
}
97+
sysseek(FILE, 7*$ps, 0) || die "Unable to rewind $file\n";
98+
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
99+
close(FILE) || die "Unable to close $file";
100+
EOF
101+
--source include/start_mysqld.inc
102+
set default_storage_engine=innodb;
103+
69104
/* Test large BLOB data */
70105
CREATE TABLE `t` (
71106
`a` BLOB,

mysql-test/suite/plugins/r/server_audit.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ set global server_audit_file_path=null;
2020
set global server_audit_incl_users=null;
2121
set global server_audit_file_path='server_audit.log';
2222
set global server_audit_output_type=file;
23+
set global server_audit_file_path=REPEAT(REPEAT('new_file_name', 50), 50);
24+
Warnings:
25+
Warning 1 server_audit_file_path can't exceed FN_LEN characters.
2326
set global server_audit_logging=on;
2427
set global server_audit_incl_users= repeat("'root',", 10000);
2528
ERROR 42000: Variable 'server_audit_incl_users' can't be set to the value of ''root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','root','...'

mysql-test/suite/plugins/t/server_audit.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set global server_audit_file_path=null;
2020
set global server_audit_incl_users=null;
2121
set global server_audit_file_path='server_audit.log';
2222
set global server_audit_output_type=file;
23+
24+
--replace_regex /[1-9][0-9][0-9]+/FN_LEN/
25+
set global server_audit_file_path=REPEAT(REPEAT('new_file_name', 50), 50);
26+
2327
set global server_audit_logging=on;
2428

2529
--error ER_WRONG_VALUE_FOR_VAR

0 commit comments

Comments
 (0)