mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@ -1159,6 +1159,8 @@ static int install_used_plugin_data_types(void)
|
|||||||
DYNAMIC_STRING ds_result;
|
DYNAMIC_STRING ds_result;
|
||||||
const char *query = "SELECT table_comment FROM information_schema.tables"
|
const char *query = "SELECT table_comment FROM information_schema.tables"
|
||||||
" WHERE table_comment LIKE 'Unknown data type: %'";
|
" WHERE table_comment LIKE 'Unknown data type: %'";
|
||||||
|
if (opt_systables_only)
|
||||||
|
return 0;
|
||||||
if (init_dynamic_string(&ds_result, "", 512, 512))
|
if (init_dynamic_string(&ds_result, "", 512, 512))
|
||||||
die("Out of memory");
|
die("Out of memory");
|
||||||
run_query(query, &ds_result, TRUE);
|
run_query(query, &ds_result, TRUE);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Remove anonymous users added by add_anonymous_users.inc
|
# Remove anonymous users added by add_anonymous_users.inc
|
||||||
disable_warnings;
|
disable_warnings;
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
DELETE FROM mysql.user where host='localhost' and user='';
|
DELETE FROM mysql.global_priv where host='localhost' and user='';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
enable_warnings;
|
enable_warnings;
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
#
|
||||||
|
# MDEV-32462: mysql_upgrade -s still checks for non system tables
|
||||||
|
#
|
||||||
|
call mtr.add_suppression("Table rebuild required");
|
||||||
|
SET NAMES utf8;
|
||||||
|
# mariadb_upgrade on system and user table
|
||||||
|
show tables from mysql like '%json%';
|
||||||
|
Tables_in_mysql (%json%)
|
||||||
|
mysql_json_test
|
||||||
|
use mysql;
|
||||||
|
show create table mysql.mysql_json_test;
|
||||||
|
ERROR HY000: Unknown data type: 'MYSQL_JSON'
|
||||||
|
show create table test.mysql_json_test;
|
||||||
|
ERROR HY000: Unknown data type: 'MYSQL_JSON'
|
||||||
|
SET @old_general_log= @@global.general_log;
|
||||||
|
SET @old_log_output= @@global.log_output;
|
||||||
|
SET @@global.general_log = ON;
|
||||||
|
SET @@global.log_output = "TABLE";
|
||||||
|
The --upgrade-system-tables option was used, user tables won't be touched.
|
||||||
|
Phase 1/8: Checking and upgrading mysql database
|
||||||
|
Processing databases
|
||||||
|
mysql
|
||||||
|
mysql.column_stats OK
|
||||||
|
mysql.columns_priv OK
|
||||||
|
mysql.db OK
|
||||||
|
mysql.event OK
|
||||||
|
mysql.func OK
|
||||||
|
mysql.global_priv OK
|
||||||
|
mysql.gtid_slave_pos OK
|
||||||
|
mysql.help_category OK
|
||||||
|
mysql.help_keyword OK
|
||||||
|
mysql.help_relation OK
|
||||||
|
mysql.help_topic OK
|
||||||
|
mysql.index_stats OK
|
||||||
|
mysql.innodb_index_stats
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.innodb_table_stats
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.mysql_json_test
|
||||||
|
Error : Unknown data type: 'MYSQL_JSON'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.plugin OK
|
||||||
|
mysql.proc OK
|
||||||
|
mysql.procs_priv OK
|
||||||
|
mysql.proxies_priv OK
|
||||||
|
mysql.roles_mapping OK
|
||||||
|
mysql.servers OK
|
||||||
|
mysql.table_stats OK
|
||||||
|
mysql.tables_priv OK
|
||||||
|
mysql.time_zone OK
|
||||||
|
mysql.time_zone_leap_second OK
|
||||||
|
mysql.time_zone_name OK
|
||||||
|
mysql.time_zone_transition OK
|
||||||
|
mysql.time_zone_transition_type OK
|
||||||
|
mysql.transaction_registry
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
|
||||||
|
Repairing tables
|
||||||
|
mysql.innodb_index_stats
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.innodb_table_stats
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.mysql_json_test
|
||||||
|
Error : Unknown data type: 'MYSQL_JSON'
|
||||||
|
error : Corrupt
|
||||||
|
mysql.transaction_registry
|
||||||
|
Error : Unknown storage engine 'InnoDB'
|
||||||
|
error : Corrupt
|
||||||
|
Phase 2/8: Installing used storage engines... Skipped
|
||||||
|
Phase 3/8: Running 'mysql_fix_privilege_tables'
|
||||||
|
Phase 4/8: Fixing views... Skipped
|
||||||
|
Phase 5/8: Fixing table and database names ... Skipped
|
||||||
|
Phase 6/8: Checking and upgrading tables... Skipped
|
||||||
|
Phase 7/8: uninstalling plugins
|
||||||
|
Phase 8/8: Running 'FLUSH PRIVILEGES'
|
||||||
|
OK
|
||||||
|
SET @@global.general_log = @old_general_log;
|
||||||
|
SET @@global.log_output = @old_log_output;
|
||||||
|
select command_type, argument from mysql.general_log where argument like "%SELECT table_comment FROM information_schema.tables%";
|
||||||
|
command_type argument
|
||||||
|
show create table mysql.mysql_json_test;
|
||||||
|
ERROR HY000: Unknown data type: 'MYSQL_JSON'
|
||||||
|
show create table test.mysql_json_test;
|
||||||
|
ERROR HY000: Unknown data type: 'MYSQL_JSON'
|
||||||
|
drop table mysql.mysql_json_test;
|
||||||
|
drop table test.mysql_json_test;
|
||||||
|
#
|
||||||
|
# End of 10.5 tests
|
||||||
|
#
|
52
mysql-test/main/mysql_upgrade_mysql_json_system_tables.test
Normal file
52
mysql-test/main/mysql_upgrade_mysql_json_system_tables.test
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # MDEV-32462: mysql_upgrade -s still checks for non system tables
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
# Let's now load plugin first
|
||||||
|
--source include/have_utf8.inc
|
||||||
|
--source include/not_embedded.inc
|
||||||
|
|
||||||
|
--source include/mysql_upgrade_preparation.inc
|
||||||
|
call mtr.add_suppression("Table rebuild required");
|
||||||
|
|
||||||
|
SET NAMES utf8;
|
||||||
|
|
||||||
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||||
|
|
||||||
|
--echo # mariadb_upgrade on system and user table
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.frm $MYSQLD_DATADIR/mysql/mysql_json_test.frm
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.MYI $MYSQLD_DATADIR/mysql/mysql_json_test.MYI
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.MYD $MYSQLD_DATADIR/mysql/mysql_json_test.MYD
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.frm $MYSQLD_DATADIR/test/mysql_json_test.frm
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.MYI $MYSQLD_DATADIR/test/mysql_json_test.MYI
|
||||||
|
--copy_file std_data/mysql_json/mysql_json_test.MYD $MYSQLD_DATADIR/test/mysql_json_test.MYD
|
||||||
|
|
||||||
|
show tables from mysql like '%json%';
|
||||||
|
use mysql;
|
||||||
|
--error ER_UNKNOWN_DATA_TYPE
|
||||||
|
show create table mysql.mysql_json_test;
|
||||||
|
--error ER_UNKNOWN_DATA_TYPE
|
||||||
|
show create table test.mysql_json_test;
|
||||||
|
|
||||||
|
SET @old_general_log= @@global.general_log;
|
||||||
|
SET @old_log_output= @@global.log_output;
|
||||||
|
SET @@global.general_log = ON;
|
||||||
|
SET @@global.log_output = "TABLE";
|
||||||
|
--exec $MYSQL_UPGRADE -s --force 2>&1
|
||||||
|
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
|
||||||
|
SET @@global.general_log = @old_general_log;
|
||||||
|
SET @@global.log_output = @old_log_output;
|
||||||
|
|
||||||
|
select command_type, argument from mysql.general_log where argument like "%SELECT table_comment FROM information_schema.tables%";
|
||||||
|
|
||||||
|
# User table is not upgraded in `mysql\test` DB, so we cannot see it.
|
||||||
|
--error ER_UNKNOWN_DATA_TYPE
|
||||||
|
show create table mysql.mysql_json_test;
|
||||||
|
--error ER_UNKNOWN_DATA_TYPE
|
||||||
|
show create table test.mysql_json_test;
|
||||||
|
drop table mysql.mysql_json_test;
|
||||||
|
drop table test.mysql_json_test;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.5 tests
|
||||||
|
--echo #
|
@ -17,6 +17,12 @@ galera_var_node_address : MDEV-20485 Galera test failure
|
|||||||
galera_bf_kill_debug : timeout after 900 seconds
|
galera_bf_kill_debug : timeout after 900 seconds
|
||||||
galera_ssl_upgrade : [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 130: Incorrect file format 'gtid_slave_pos'
|
galera_ssl_upgrade : [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 130: Incorrect file format 'gtid_slave_pos'
|
||||||
galera_insert_bulk : MDEV-30536 no expected deadlock in galera_insert_bulk test
|
galera_insert_bulk : MDEV-30536 no expected deadlock in galera_insert_bulk test
|
||||||
|
galera_sequences : MDEV-32561 WSREP FSM failure: no such a transition REPLICATING -> COMMITTED
|
||||||
|
galera_shutdown_nonprim : MDEV-32635 galera_shutdown_nonprim: mysql_shutdown failed
|
||||||
versioning_trx_id : MDEV-18590 : galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
|
versioning_trx_id : MDEV-18590 : galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
|
||||||
galera_sequences : MDEV-32024
|
galera_concurrent_ctas : MDEV-32779 galera_concurrent_ctas: assertion in the galera::ReplicatorSMM::finish_cert()
|
||||||
|
galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
|
||||||
|
galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
|
||||||
|
galera_bf_lock_wait : MDEV-32781 galera_bf_lock_wait test failed
|
||||||
|
galera_sst_mysqldump_with_key : MDEV-32782 galera_sst_mysqldump_with_key test failed
|
||||||
mdev-31285 : MDEV-25089 Assertion `error.len > 0' failed in galera::ReplicatorSMM::handle_apply_error()
|
mdev-31285 : MDEV-25089 Assertion `error.len > 0' failed in galera::ReplicatorSMM::handle_apply_error()
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
#
|
#
|
||||||
# The galera/galera_2node_slave.cnf describes the setup of the nodes
|
# The galera/galera_2node_slave.cnf describes the setup of the nodes
|
||||||
#
|
#
|
||||||
--source include/big_test.inc
|
|
||||||
--source include/force_restart.inc
|
--source include/force_restart.inc
|
||||||
--source include/galera_cluster.inc
|
--source include/galera_cluster.inc
|
||||||
|
--source include/have_innodb.inc
|
||||||
--source include/have_sequence.inc
|
--source include/have_sequence.inc
|
||||||
|
|
||||||
# As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it
|
# As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
galera_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
|
galera_2_cluster : MDEV-32631 galera_2_cluster: before_rollback(): Assertion `0' failed
|
||||||
galera_gtid_2_cluster : MDEV-29877 Galera test failure on galera_2_cluster
|
galera_gtid_2_cluster : MDEV-32633 galera_gtid_2_cluster: Assertion `thd->wsrep_next_trx_id() != (0x7fffffffffffffffLL * 2ULL + 1)'
|
||||||
galera_vote_rejoin_mysqldump : MDEV-24481: galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
|
galera_vote_rejoin_mysqldump : MDEV-24481: galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
|
||||||
galera_ssl_reload : MDEV-30172 At line 50: mysql_shutdown failed
|
galera_ssl_reload : MDEV-32778 galera_ssl_reload failed with warning message
|
||||||
# Opensuse/suse/rocky9/rocky84/rhel9/rhel8-ppc64le .. - all same IPv6 isn't configured right or skipping or galera
|
# Opensuse/suse/rocky9/rocky84/rhel9/rhel8-ppc64le .. - all same IPv6 isn't configured right or skipping or galera
|
||||||
galera_ipv6_rsync : Can't connect to server on '::1' (115)
|
galera_ipv6_rsync : Can't connect to server on '::1' (115)
|
||||||
galera_ipv6_rsync_section : Can't connect to server on '::1' (115)
|
galera_ipv6_rsync_section : Can't connect to server on '::1' (115)
|
||||||
|
@ -10,6 +10,5 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
GCF-1060 : MDEV-26528 wrong usage of mutex LOCK_thd_kill and LOCK_thd_kill
|
GCF-1060 : MDEV-32160 GCF-1060 test failure due to wsrep MDL conflict
|
||||||
galera_sr_cc_master : MDEV-29882 Galera test failure on galera_sr_cc_master
|
galera_sr_cc_master : MDEV-29882 Galera test failure on galera_sr_cc_master
|
||||||
mysql-wsrep-features#138 : At line 25: query 'DROP TABLE t1' failed: 2013: Lost connection to MySQL server during query
|
|
||||||
|
@ -172,6 +172,8 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
|||||||
call mtr.add_suppression("Plugin 'InnoDB' \(init function returned error\|registration as a STORAGE ENGINE failed\)");
|
call mtr.add_suppression("Plugin 'InnoDB' \(init function returned error\|registration as a STORAGE ENGINE failed\)");
|
||||||
call mtr.add_suppression("InnoDB: Table test/u[123] in the InnoDB data dictionary has tablespace id [1-9][0-9]*, but tablespace with that id or name does not exist\\. Have you deleted or moved \\.ibd files\\?");
|
call mtr.add_suppression("InnoDB: Table test/u[123] in the InnoDB data dictionary has tablespace id [1-9][0-9]*, but tablespace with that id or name does not exist\\. Have you deleted or moved \\.ibd files\\?");
|
||||||
call mtr.add_suppression("InnoDB: Cannot replay rename of tablespace.*");
|
call mtr.add_suppression("InnoDB: Cannot replay rename of tablespace.*");
|
||||||
|
call mtr.add_suppression("InnoDB: Attempted to open a previously opened tablespace");
|
||||||
|
call mtr.add_suppression("InnoDB: Recovery cannot access file");
|
||||||
FLUSH TABLES;
|
FLUSH TABLES;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# restart
|
||||||
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
|
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
|
||||||
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
|
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
|
||||||
WHERE name in ('wait/io/table/sql/handler',
|
WHERE name in ('wait/io/table/sql/handler',
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
--source include/have_perfschema.inc
|
--source include/have_perfschema.inc
|
||||||
# This test fails very frequently on a Windows builder.
|
# This test needs a fresh restart. The table performance_schema.table_handles
|
||||||
--source include/not_windows.inc
|
# can otherwise contain extra rows left from previous testcases.
|
||||||
|
# For example the test case main.long_unique_delayed, which uses
|
||||||
|
# INSERT DELAYED, will leave extra rows in this table if run just before this
|
||||||
|
# test, causing .result diff failure.
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
|
||||||
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
|
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ set default role role_a for user_a@localhost;
|
|||||||
set default role invalid_role for user_a@localhost;
|
set default role invalid_role for user_a@localhost;
|
||||||
ERROR OP000: Invalid role specification `invalid_role`
|
ERROR OP000: Invalid role specification `invalid_role`
|
||||||
set default role role_b for user_a@localhost;
|
set default role role_b for user_a@localhost;
|
||||||
ERROR OP000: User `root`@`localhost` has not been granted role `role_b`
|
ERROR OP000: User `user_a`@`localhost` has not been granted role `role_b`
|
||||||
set default role role_b for user_b@localhost;
|
set default role role_b for user_b@localhost;
|
||||||
show grants;
|
show grants;
|
||||||
Grants for user_a@localhost
|
Grants for user_a@localhost
|
||||||
|
@ -48,7 +48,7 @@ CREATE USER b;
|
|||||||
CREATE ROLE r1;
|
CREATE ROLE r1;
|
||||||
CREATE ROLE r2;
|
CREATE ROLE r2;
|
||||||
SET DEFAULT ROLE r1 FOR a;
|
SET DEFAULT ROLE r1 FOR a;
|
||||||
ERROR OP000: User `root`@`localhost` has not been granted role `r1`
|
ERROR OP000: User `a`@`%` has not been granted role `r1`
|
||||||
GRANT r1 TO b;
|
GRANT r1 TO b;
|
||||||
GRANT r2 TO b;
|
GRANT r2 TO b;
|
||||||
SET DEFAULT ROLE r1 FOR b;
|
SET DEFAULT ROLE r1 FOR b;
|
||||||
@ -100,7 +100,7 @@ GRANT USAGE ON *.* TO `b`@`%`
|
|||||||
GRANT SELECT, UPDATE ON `mysql`.* TO `b`@`%`
|
GRANT SELECT, UPDATE ON `mysql`.* TO `b`@`%`
|
||||||
SET DEFAULT ROLE `r2` FOR `b`@`%`
|
SET DEFAULT ROLE `r2` FOR `b`@`%`
|
||||||
SET DEFAULT ROLE r1 FOR a;
|
SET DEFAULT ROLE r1 FOR a;
|
||||||
ERROR OP000: User `b`@`%` has not been granted role `r1`
|
ERROR OP000: User `a`@`%` has not been granted role `r1`
|
||||||
SET DEFAULT ROLE invalid_role;
|
SET DEFAULT ROLE invalid_role;
|
||||||
ERROR OP000: Invalid role specification `invalid_role`
|
ERROR OP000: Invalid role specification `invalid_role`
|
||||||
SET DEFAULT ROLE invalid_role FOR a;
|
SET DEFAULT ROLE invalid_role FOR a;
|
||||||
@ -117,7 +117,7 @@ SET DEFAULT ROLE None;
|
|||||||
# Change user b (session 3: role granted to user a)
|
# Change user b (session 3: role granted to user a)
|
||||||
SET DEFAULT ROLE r1 FOR a;
|
SET DEFAULT ROLE r1 FOR a;
|
||||||
SET DEFAULT ROLE r2 FOR a;
|
SET DEFAULT ROLE r2 FOR a;
|
||||||
ERROR OP000: User `b`@`%` has not been granted role `r2`
|
ERROR OP000: User `a`@`%` has not been granted role `r2`
|
||||||
SET DEFAULT ROLE invalid_role;
|
SET DEFAULT ROLE invalid_role;
|
||||||
ERROR OP000: Invalid role specification `invalid_role`
|
ERROR OP000: Invalid role specification `invalid_role`
|
||||||
SET DEFAULT ROLE invalid_role FOR a;
|
SET DEFAULT ROLE invalid_role FOR a;
|
||||||
|
@ -70,7 +70,6 @@ CREATE USER a;
|
|||||||
CREATE USER b;
|
CREATE USER b;
|
||||||
CREATE ROLE r1;
|
CREATE ROLE r1;
|
||||||
CREATE ROLE r2;
|
CREATE ROLE r2;
|
||||||
# Role has not been granted to user a, but the role is visible to current_user
|
|
||||||
--error ER_INVALID_ROLE
|
--error ER_INVALID_ROLE
|
||||||
SET DEFAULT ROLE r1 FOR a;
|
SET DEFAULT ROLE r1 FOR a;
|
||||||
# Granting roles to user b
|
# Granting roles to user b
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
--skip-name-resolve
|
@ -0,0 +1,85 @@
|
|||||||
|
#
|
||||||
|
# MDEV-26875: Wrong user in SET DEFAULT ROLE error
|
||||||
|
#
|
||||||
|
create user test_user;
|
||||||
|
create role test_role;
|
||||||
|
show grants for test_user;
|
||||||
|
Grants for test_user@%
|
||||||
|
GRANT USAGE ON *.* TO `test_user`@`%`
|
||||||
|
set default role test_role for test_user;
|
||||||
|
ERROR OP000: User `test_user`@`%` has not been granted role `test_role`
|
||||||
|
grant test_role to test_user;
|
||||||
|
set default role test_role for test_user;
|
||||||
|
show grants for test_user;
|
||||||
|
Grants for test_user@%
|
||||||
|
GRANT `test_role` TO `test_user`@`%`
|
||||||
|
GRANT USAGE ON *.* TO `test_user`@`%`
|
||||||
|
SET DEFAULT ROLE `test_role` FOR `test_user`@`%`
|
||||||
|
set default role none for test_user;
|
||||||
|
#
|
||||||
|
# Try to set default role to role(`test_role`).
|
||||||
|
--------------------------------------------------------------
|
||||||
|
show grants for test_role;
|
||||||
|
Grants for test_role
|
||||||
|
GRANT USAGE ON *.* TO `test_role`
|
||||||
|
create role new_role;
|
||||||
|
grant new_role to test_role;
|
||||||
|
show grants for test_role;
|
||||||
|
Grants for test_role
|
||||||
|
GRANT `new_role` TO `test_role`
|
||||||
|
GRANT USAGE ON *.* TO `test_role`
|
||||||
|
GRANT USAGE ON *.* TO `new_role`
|
||||||
|
set default role new_role for test_role;
|
||||||
|
ERROR OP000: User `test_role`@`%` has not been granted role `new_role`
|
||||||
|
#
|
||||||
|
# Test of errors, where hostname cannot be resolved `test_user`
|
||||||
|
--------------------------------------------------------------
|
||||||
|
grant test_role to test_user@'%';
|
||||||
|
set default role test_role for test_user@'%';
|
||||||
|
connect con_test_user,127.0.0.1,test_user,,,$MASTER_MYPORT;
|
||||||
|
show grants;
|
||||||
|
Grants for test_user@%
|
||||||
|
GRANT `test_role` TO `test_user`@`%`
|
||||||
|
GRANT USAGE ON *.* TO `test_user`@`%`
|
||||||
|
GRANT `new_role` TO `test_role`
|
||||||
|
GRANT USAGE ON *.* TO `test_role`
|
||||||
|
GRANT USAGE ON *.* TO `new_role`
|
||||||
|
SET DEFAULT ROLE `test_role` FOR `test_user`@`%`
|
||||||
|
select current_role;
|
||||||
|
current_role
|
||||||
|
test_role
|
||||||
|
set role `new_role`;
|
||||||
|
ERROR OP000: User `test_user`@`%` has not been granted role `new_role`
|
||||||
|
connection default;
|
||||||
|
set default role none for test_user;
|
||||||
|
disconnect con_test_user;
|
||||||
|
connect con_test_user,127.0.0.1,test_user,,,$MASTER_MYPORT;
|
||||||
|
select current_role;
|
||||||
|
current_role
|
||||||
|
NULL
|
||||||
|
set role `new_role`;
|
||||||
|
ERROR OP000: User `test_user`@`%` has not been granted role `new_role`
|
||||||
|
connection default;
|
||||||
|
disconnect con_test_user;
|
||||||
|
#
|
||||||
|
# Test of anonymous user connection
|
||||||
|
--------------------------------------------------------------
|
||||||
|
grant test_role to ''@localhost;
|
||||||
|
connect con1,localhost,'',,,$MASTER_MYPORT;
|
||||||
|
SELECT CURRENT_ROLE;
|
||||||
|
CURRENT_ROLE
|
||||||
|
NULL
|
||||||
|
SET role test_role;
|
||||||
|
SELECT CURRENT_ROLE;
|
||||||
|
CURRENT_ROLE
|
||||||
|
test_role
|
||||||
|
SET role new_role;
|
||||||
|
ERROR OP000: User ``@`localhost` has not been granted role `new_role`
|
||||||
|
set default role test_role for ''@localhost;
|
||||||
|
ERROR 42000: You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings
|
||||||
|
connection default;
|
||||||
|
disconnect con1;
|
||||||
|
REVOKE all privileges, grant option from ''@localhost;
|
||||||
|
drop role new_role;
|
||||||
|
drop role test_role;
|
||||||
|
drop user test_user;
|
@ -0,0 +1,78 @@
|
|||||||
|
source include/not_embedded.inc;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-26875: Wrong user in SET DEFAULT ROLE error
|
||||||
|
--echo #
|
||||||
|
create user test_user;
|
||||||
|
create role test_role;
|
||||||
|
show grants for test_user;
|
||||||
|
--error ER_INVALID_ROLE
|
||||||
|
set default role test_role for test_user;
|
||||||
|
grant test_role to test_user;
|
||||||
|
set default role test_role for test_user;
|
||||||
|
show grants for test_user;
|
||||||
|
set default role none for test_user;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Try to set default role to role(`test_role`).
|
||||||
|
--echo --------------------------------------------------------------
|
||||||
|
show grants for test_role;
|
||||||
|
create role new_role;
|
||||||
|
grant new_role to test_role;
|
||||||
|
show grants for test_role;
|
||||||
|
# One can not set role to a role
|
||||||
|
--error ER_INVALID_ROLE
|
||||||
|
set default role new_role for test_role;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Test of errors, where hostname cannot be resolved `test_user`
|
||||||
|
--echo --------------------------------------------------------------
|
||||||
|
# `new_role` is granted to `test_role`
|
||||||
|
grant test_role to test_user@'%';
|
||||||
|
set default role test_role for test_user@'%';
|
||||||
|
|
||||||
|
connect con_test_user,127.0.0.1,test_user,,,$MASTER_MYPORT;
|
||||||
|
show grants;
|
||||||
|
select current_role;
|
||||||
|
# `test_user` indirectly granted `new_role`
|
||||||
|
--error ER_INVALID_ROLE
|
||||||
|
set role `new_role`;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
set default role none for test_user;
|
||||||
|
disconnect con_test_user;
|
||||||
|
|
||||||
|
connect con_test_user,127.0.0.1,test_user,,,$MASTER_MYPORT;
|
||||||
|
select current_role;
|
||||||
|
--error ER_INVALID_ROLE
|
||||||
|
set role `new_role`;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
disconnect con_test_user;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Test of anonymous user connection
|
||||||
|
--echo --------------------------------------------------------------
|
||||||
|
--source include/add_anonymous_users.inc
|
||||||
|
# Skip windows, since it uses current user `Administrator` in buildbot.
|
||||||
|
--source include/not_windows.inc
|
||||||
|
grant test_role to ''@localhost;
|
||||||
|
|
||||||
|
connect(con1,localhost,'',,,$MASTER_MYPORT);
|
||||||
|
SELECT CURRENT_ROLE;
|
||||||
|
SET role test_role;
|
||||||
|
SELECT CURRENT_ROLE;
|
||||||
|
# user cannot set subset role, since it is not granted explicitly
|
||||||
|
--error ER_INVALID_ROLE
|
||||||
|
SET role new_role;
|
||||||
|
--error ER_PASSWORD_ANONYMOUS_USER
|
||||||
|
set default role test_role for ''@localhost;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
disconnect con1;
|
||||||
|
REVOKE all privileges, grant option from ''@localhost;
|
||||||
|
--source include/delete_anonymous_users.inc
|
||||||
|
|
||||||
|
drop role new_role;
|
||||||
|
drop role test_role;
|
||||||
|
drop user test_user;
|
@ -8597,13 +8597,10 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
|
|||||||
|
|
||||||
DEBUG_SYNC(leader->thd, "commit_loop_entry_commit_ordered");
|
DEBUG_SYNC(leader->thd, "commit_loop_entry_commit_ordered");
|
||||||
++num_commits;
|
++num_commits;
|
||||||
|
set_current_thd(current->thd);
|
||||||
if (current->cache_mngr->using_xa && likely(!current->error) &&
|
if (current->cache_mngr->using_xa && likely(!current->error) &&
|
||||||
DBUG_EVALUATE_IF("skip_commit_ordered", 0, 1))
|
DBUG_EVALUATE_IF("skip_commit_ordered", 0, 1))
|
||||||
{
|
|
||||||
mysql_mutex_lock(¤t->thd->LOCK_thd_data);
|
|
||||||
run_commit_ordered(current->thd, current->all);
|
run_commit_ordered(current->thd, current->all);
|
||||||
mysql_mutex_unlock(¤t->thd->LOCK_thd_data);
|
|
||||||
}
|
|
||||||
current->thd->wakeup_subsequent_commits(current->error);
|
current->thd->wakeup_subsequent_commits(current->error);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -8620,6 +8617,7 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
|
|||||||
}
|
}
|
||||||
current= next;
|
current= next;
|
||||||
}
|
}
|
||||||
|
set_current_thd(leader->thd);
|
||||||
DEBUG_SYNC(leader->thd, "commit_after_group_run_commit_ordered");
|
DEBUG_SYNC(leader->thd, "commit_after_group_run_commit_ordered");
|
||||||
mysql_mutex_unlock(&LOCK_commit_ordered);
|
mysql_mutex_unlock(&LOCK_commit_ordered);
|
||||||
DEBUG_SYNC(leader->thd, "commit_after_group_release_commit_ordered");
|
DEBUG_SYNC(leader->thd, "commit_after_group_release_commit_ordered");
|
||||||
|
@ -703,6 +703,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
|
|||||||
if (WSREP_ON_ && wsrep_thd_is_local(thd))
|
if (WSREP_ON_ && wsrep_thd_is_local(thd))
|
||||||
{
|
{
|
||||||
thd->wsrep_ignore_table= false;
|
thd->wsrep_ignore_table= false;
|
||||||
|
table->file->row_logging= 1; // replication requires binary logging
|
||||||
wsrep_start_trx_if_not_started(thd);
|
wsrep_start_trx_if_not_started(thd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3339,10 +3339,18 @@ end:
|
|||||||
check_role_is_granted_callback,
|
check_role_is_granted_callback,
|
||||||
NULL) == -1))
|
NULL) == -1))
|
||||||
{
|
{
|
||||||
/* Role is not granted but current user can see the role */
|
/* This happens for SET ROLE case and when `--skip-name-resolve` option
|
||||||
|
is used. In that situation host can be NULL and current user is always
|
||||||
|
target user, so printing `priv_user@priv_host` is not incorrect.
|
||||||
|
*/
|
||||||
|
if (!host)
|
||||||
my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
|
my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
|
||||||
MYF(0), thd->security_ctx->priv_user,
|
MYF(0), thd->security_ctx->priv_user,
|
||||||
thd->security_ctx->priv_host, rolename);
|
thd->security_ctx->priv_host, rolename);
|
||||||
|
else
|
||||||
|
/* Role is not granted but current user can see the role */
|
||||||
|
my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
|
||||||
|
MYF(0), user, host, rolename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4091,7 +4091,6 @@ recv_group_scan_log_recs(
|
|||||||
|
|
||||||
log_sys.log.scanned_lsn = end_lsn = *contiguous_lsn =
|
log_sys.log.scanned_lsn = end_lsn = *contiguous_lsn =
|
||||||
ut_uint64_align_down(*contiguous_lsn, OS_FILE_LOG_BLOCK_SIZE);
|
ut_uint64_align_down(*contiguous_lsn, OS_FILE_LOG_BLOCK_SIZE);
|
||||||
ut_d(recv_sys.after_apply = last_phase);
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
start_lsn = ut_uint64_align_down(end_lsn,
|
start_lsn = ut_uint64_align_down(end_lsn,
|
||||||
@ -4107,6 +4106,7 @@ recv_group_scan_log_recs(
|
|||||||
DBUG_RETURN(false);
|
DBUG_RETURN(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ut_d(recv_sys.after_apply = last_phase);
|
||||||
DBUG_PRINT("ib_log", ("%s " LSN_PF " completed",
|
DBUG_PRINT("ib_log", ("%s " LSN_PF " completed",
|
||||||
last_phase ? "rescan" : "scan",
|
last_phase ? "rescan" : "scan",
|
||||||
log_sys.log.scanned_lsn));
|
log_sys.log.scanned_lsn));
|
||||||
|
@ -1973,7 +1973,7 @@ void innodb_preshutdown()
|
|||||||
better prevent any further changes from being buffered. */
|
better prevent any further changes from being buffered. */
|
||||||
innodb_change_buffering= 0;
|
innodb_change_buffering= 0;
|
||||||
|
|
||||||
if (trx_sys.is_initialised())
|
if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO && srv_was_started)
|
||||||
while (trx_sys.any_active_transactions())
|
while (trx_sys.any_active_transactions())
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user