Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
268aa888
Commit
268aa888
authored
Mar 11, 2011
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
merge from 5.5 main
parents
06fe4a35
70fd1334
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1015 additions
and
91 deletions
+1015
-91
mysql-test/collections/default.daily
mysql-test/collections/default.daily
+13
-13
mysql-test/collections/default.weekly
mysql-test/collections/default.weekly
+7
-7
mysql-test/r/grant.result
mysql-test/r/grant.result
+193
-4
mysql-test/r/partition.result
mysql-test/r/partition.result
+38
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+30
-0
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+0
-1
mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+0
-2
mysql-test/suite/funcs_1/r/memory_storedproc_06.result
mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+0
-2
mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+0
-2
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
+0
-4
mysql-test/suite/perfschema/r/relaylog.result
mysql-test/suite/perfschema/r/relaylog.result
+161
-0
mysql-test/suite/perfschema/t/relaylog.test
mysql-test/suite/perfschema/t/relaylog.test
+159
-0
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+1
-0
mysql-test/t/grant.test
mysql-test/t/grant.test
+177
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+43
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+41
-0
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+0
-4
sql/ha_partition.cc
sql/ha_partition.cc
+1
-0
sql/log.cc
sql/log.cc
+7
-9
sql/log.h
sql/log.h
+23
-0
sql/mysqld.cc
sql/mysqld.cc
+19
-0
sql/mysqld.h
sql/mysqld.h
+3
-0
sql/rpl_rli.cc
sql/rpl_rli.cc
+8
-1
sql/sql_acl.cc
sql/sql_acl.cc
+84
-42
sql/sql_trigger.cc
sql/sql_trigger.cc
+7
-0
No files found.
mysql-test/collections/default.daily
View file @
268aa888
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --
skip-test-list=collections/disabled-daily.list --
unit-tests
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist
--skip-test-list=collections/disabled-daily.list
perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-ps_nist --suite=nist --ps-protocol
mysql-test/collections/default.weekly
View file @
268aa888
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row
--skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed
--skip-test-list=collections/disabled-weekly.list
mysql-test/r/grant.result
View file @
268aa888
...
...
@@ -1452,6 +1452,199 @@ DROP DATABASE mysqltest2;
DROP USER testuser@localhost;
use test;
#
# Test for bug #36544 "DROP USER does not remove stored function
# privileges".
#
create database mysqltest1;
create function mysqltest1.f1() returns int return 0;
create procedure mysqltest1.p1() begin end;
#
# 1) Check that DROP USER properly removes privileges on both
# stored procedures and functions.
#
create user mysqluser1@localhost;
grant execute on function mysqltest1.f1 to mysqluser1@localhost;
grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
# Quick test that granted privileges are properly reflected
# in privilege tables and in in-memory structures.
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
mysqltest1 p1 PROCEDURE Execute
#
# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
0
#
# Switch to connection 'default'.
drop user mysqluser1@localhost;
#
# Test that dropping of user is properly reflected in
# both privilege tables and in in-memory structures.
#
# Switch to connection 'bug36544_con1'.
# The connection cold be alive but should not be able to
# access to any of the stored routines.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
#
# Switch to connection 'default'.
#
# Now create user with the same name and check that he
# has not inherited privileges.
create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
#
# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
# Newly created user should not be able to access any of the routines.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
#
# Switch to connection 'default'.
#
# 2) Check that RENAME USER properly updates privileges on both
# stored procedures and functions.
#
grant execute on function mysqltest1.f1 to mysqluser1@localhost;
grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
#
# Create one more user to make in-memory hashes non-trivial.
# User names 'mysqluser11' and 'mysqluser10' were selected
# to trigger bug discovered during code inspection.
create user mysqluser11@localhost;
grant execute on function mysqltest1.f1 to mysqluser11@localhost;
grant execute on procedure mysqltest1.p1 to mysqluser11@localhost;
# Also create a couple of tables to test for another bug
# discovered during code inspection (again table names were
# chosen especially to trigger the bug).
create table mysqltest1.t11 (i int);
create table mysqltest1.t22 (i int);
grant select on mysqltest1.t22 to mysqluser1@localhost;
grant select on mysqltest1.t11 to mysqluser1@localhost;
# Quick test that granted privileges are properly reflected
# in privilege tables and in in-memory structures.
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost'
GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost'
GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
mysqltest1 p1 PROCEDURE Execute
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
db table_name table_priv
mysqltest1 t11 Select
mysqltest1 t22 Select
#
# Switch to connection 'bug36544_con2'.
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
0
select * from mysqltest1.t11;
i
select * from mysqltest1.t22;
i
#
# Switch to connection 'default'.
rename user mysqluser1@localhost to mysqluser10@localhost;
#
# Test that there are no privileges left for mysqluser1.
#
# Switch to connection 'bug36544_con2'.
# The connection cold be alive but should not be able to
# access to any of the stored routines or tables.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
select * from mysqltest1.t11;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
select * from mysqltest1.t22;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
#
# Switch to connection 'default'.
#
# Now create user with the old name and check that he
# has not inherited privileges.
create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
Grants for mysqluser1@localhost
GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
db table_name table_priv
#
# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
# Newly created user should not be able to access to any of the
# stored routines or tables.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
select * from mysqltest1.t11;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
select * from mysqltest1.t22;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
#
# Switch to connection 'default'.
#
# Now check that privileges became associated with a new user
# name - mysqluser10.
#
show grants for mysqluser10@localhost;
Grants for mysqluser10@localhost
GRANT USAGE ON *.* TO 'mysqluser10'@'localhost'
GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost'
GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost'
GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost'
GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost';
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
mysqltest1 p1 PROCEDURE Execute
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost';
db table_name table_priv
mysqltest1 t11 Select
mysqltest1 t22 Select
#
# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
0
select * from mysqltest1.t11;
i
select * from mysqltest1.t22;
i
#
# Switch to connection 'default'.
#
# Clean-up.
drop user mysqluser1@localhost;
drop user mysqluser10@localhost;
drop user mysqluser11@localhost;
drop database mysqltest1;
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
...
...
@@ -1546,11 +1739,7 @@ fn2()
2
DROP USER 'userbug33464'@'localhost';
DROP FUNCTION fn1;
Warnings:
Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
DROP FUNCTION fn2;
Warnings:
Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
DROP PROCEDURE sp3;
DROP USER 'userbug33464'@'localhost';
USE test;
...
...
mysql-test/r/partition.result
View file @
268aa888
drop table if exists t1, t2;
#
# Bug#59297: Can't find record in 'tablename' on update inner join
#
CREATE TABLE t1 (
a char(2) NOT NULL,
b char(2) NOT NULL,
c int(10) unsigned NOT NULL,
d varchar(255) DEFAULT NULL,
e varchar(1000) DEFAULT NULL,
PRIMARY KEY (a, b, c),
KEY (a),
KEY (a, b)
)
/*!50100 PARTITION BY KEY (a)
PARTITIONS 20 */;
INSERT INTO t1 (a, b, c, d, e) VALUES
('07', '03', 343, '1', '07_03_343'),
('01', '04', 343, '2', '01_04_343'),
('01', '06', 343, '3', '01_06_343'),
('01', '07', 343, '4', '01_07_343'),
('01', '08', 343, '5', '01_08_343'),
('01', '09', 343, '6', '01_09_343'),
('03', '03', 343, '7', '03_03_343'),
('03', '06', 343, '8', '03_06_343'),
('03', '07', 343, '9', '03_07_343'),
('04', '03', 343, '10', '04_03_343'),
('04', '06', 343, '11', '04_06_343'),
('05', '03', 343, '12', '05_03_343'),
('11', '03', 343, '13', '11_03_343'),
('11', '04', 343, '14', '11_04_343')
;
UPDATE t1 AS A,
(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B
SET A.e = B.d
WHERE A.a = '03'
AND A.b = '06'
AND A.c = 343;
DROP TABLE t1;
#
# Bug#57778: failed primary key add to partitioned innodb table
# inconsistent and crashes
#
...
...
mysql-test/r/sp.result
View file @
268aa888
...
...
@@ -7452,4 +7452,34 @@ c1
# Cleanup
drop table t1;
drop procedure p1;
# --
# -- Bug 11765684 - 58674: SP-cache does not detect changes in
# -- pre-locking list caused by triggers
# ---
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP PROCEDURE IF EXISTS p1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
CREATE TABLE t3(a INT);
CREATE PROCEDURE p1()
INSERT INTO t1(a) VALUES (1);
CREATE TRIGGER t1_ai AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2(a) VALUES (new.a);
CALL p1();
CREATE TRIGGER t1_bi BEFORE INSERT ON t1
FOR EACH ROW
INSERT INTO t3(a) VALUES (new.a);
CALL p1();
DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
# End of 5.5 test
mysql-test/r/trigger.result
View file @
268aa888
...
...
@@ -821,7 +821,6 @@ drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
call p1();
ERROR 42S02: Table 'test.t3' doesn't exist
deallocate prepare stmt1;
drop procedure p1;
drop table t1, t2, t3;
...
...
mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
View file @
268aa888
...
...
@@ -128,8 +128,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
Warnings:
Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
...
...
mysql-test/suite/funcs_1/r/memory_storedproc_06.result
View file @
268aa888
...
...
@@ -129,8 +129,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
Warnings:
Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
...
...
mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
View file @
268aa888
...
...
@@ -129,8 +129,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
Warnings:
Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
...
...
mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
View file @
268aa888
...
...
@@ -149,10 +149,6 @@ USE db_storedproc_1;
drop
user
'user_1'
@
'localhost'
;
DROP
PROCEDURE
sp3
;
# This drop function shouldn't generated a warning as the
# privileges should have been removed when the user was
# dropped. Reported as Bug#36544 DROP USER does not remove
# stored function privileges
DROP
FUNCTION
fn1
;
...
...
mysql-test/suite/perfschema/r/relaylog.result
0 → 100644
View file @
268aa888
include/master-slave.inc
[connection master]
drop table if exists test.t1;
reset master;
create table test.t1(a int);
drop table test.t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; create table test.t1(a int)
slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
"============ Performance schema on master ============"
select
substring(file_name, locate("master-", file_name)) as FILE_NAME,
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
select * from performance_schema.file_summary_by_instance
where file_name like "%slave-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
"Expect a master binlog + binlog_index"
select
substring(file_name, locate("master-", file_name)) as FILE_NAME,
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_instance
where event_name like "%binlog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_event_name
where event_name like "%binlog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/binlog MANY MANY MANY MANY
wait/io/file/sql/binlog_index NONE MANY NONE MANY
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
where event_name like "%MYSQL_BIN_LOG%" order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect no slave relay log"
select * from performance_schema.file_summary_by_instance
where event_name like "%relaylog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
select * from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/relaylog 0 0 0 0
wait/io/file/sql/relaylog_index 0 0 0 0
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_instance
where file_name like "%slave-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
"Expect a slave binlog + binlog_index"
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_instance
where event_name like "%binlog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_event_name
where event_name like "%binlog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/binlog MANY MANY MANY MANY
wait/io/file/sql/binlog_index NONE MANY NONE MANY
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
where event_name like "%MYSQL_BIN_LOG%" order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect a slave relay log"
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_instance
where event_name like "%relaylog%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
select
EVENT_NAME,
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
wait/io/file/sql/relaylog MANY MANY MANY MANY
wait/io/file/sql/relaylog_index MANY MANY MANY MANY
select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
mysql-test/suite/perfschema/t/relaylog.test
0 → 100644
View file @
268aa888
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
--
source
include
/
have_log_bin
.
inc
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_perfschema
.
inc
--
source
include
/
master
-
slave
.
inc
--
disable_warnings
drop
table
if
exists
test
.
t1
;
--
sync_slave_with_master
reset
master
;
--
enable_warnings
create
table
test
.
t1
(
a
int
);
drop
table
test
.
t1
;
--
source
include
/
show_binlog_events
.
inc
connection
master
;
--
echo
"============ Performance schema on master ============"
select
substring
(
file_name
,
locate
(
"master-"
,
file_name
))
as
FILE_NAME
,
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_instance
where
file_name
like
"%master-%"
order
by
file_name
;
select
*
from
performance_schema
.
file_summary_by_instance
where
file_name
like
"%slave-%"
order
by
file_name
;
--
echo
"Expect a master binlog + binlog_index"
select
substring
(
file_name
,
locate
(
"master-"
,
file_name
))
as
FILE_NAME
,
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_instance
where
event_name
like
"%binlog%"
order
by
file_name
;
select
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_event_name
where
event_name
like
"%binlog%"
order
by
event_name
;
select
EVENT_NAME
,
if
(
count_star
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_STAR
from
performance_schema
.
events_waits_summary_global_by_event_name
where
event_name
like
"%MYSQL_BIN_LOG%"
order
by
event_name
;
--
echo
"Expect no slave relay log"
select
*
from
performance_schema
.
file_summary_by_instance
where
event_name
like
"%relaylog%"
order
by
file_name
;
select
*
from
performance_schema
.
file_summary_by_event_name
where
event_name
like
"%relaylog%"
order
by
event_name
;
select
*
from
performance_schema
.
events_waits_summary_global_by_event_name
where
event_name
like
"%MYSQL_RELAY_LOG%"
order
by
event_name
;
sync_slave_with_master
;
--
echo
"============ Performance schema on slave ============"
select
*
from
performance_schema
.
file_summary_by_instance
where
file_name
like
"%master-%"
order
by
file_name
;
select
substring
(
file_name
,
locate
(
"slave-"
,
file_name
))
as
FILE_NAME
,
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_instance
where
file_name
like
"%slave-%"
order
by
file_name
;
--
echo
"Expect a slave binlog + binlog_index"
select
substring
(
file_name
,
locate
(
"slave-"
,
file_name
))
as
FILE_NAME
,
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_instance
where
event_name
like
"%binlog%"
order
by
file_name
;
select
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_event_name
where
event_name
like
"%binlog%"
order
by
event_name
;
select
EVENT_NAME
,
if
(
count_star
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_STAR
from
performance_schema
.
events_waits_summary_global_by_event_name
where
event_name
like
"%MYSQL_BIN_LOG%"
order
by
event_name
;
--
echo
"Expect a slave relay log"
select
substring
(
file_name
,
locate
(
"slave-"
,
file_name
))
as
FILE_NAME
,
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_instance
where
event_name
like
"%relaylog%"
order
by
file_name
;
select
EVENT_NAME
,
if
(
count_read
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_READ
,
if
(
count_write
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_WRITE
,
if
(
sum_number_of_bytes_read
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_READ
,
if
(
sum_number_of_bytes_write
>
0
,
"MANY"
,
"NONE"
)
as
SUM_NUMBER_OF_BYTES_WRITE
from
performance_schema
.
file_summary_by_event_name
where
event_name
like
"%relaylog%"
order
by
event_name
;
select
EVENT_NAME
,
if
(
count_star
>
0
,
"MANY"
,
"NONE"
)
as
COUNT_STAR
from
performance_schema
.
events_waits_summary_global_by_event_name
where
event_name
like
"%MYSQL_RELAY_LOG%"
order
by
event_name
;
--
source
include
/
stop_slave
.
inc
mysql-test/t/disabled.def
View file @
268aa888
...
...
@@ -16,3 +16,4 @@ read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists
sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested
create-big : Bug#37248 2010-11-15 mattiasj was not tested
archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
mysql-test/t/grant.test
View file @
268aa888
...
...
@@ -1396,6 +1396,183 @@ DROP USER testuser@localhost;
use
test
;
--
echo
--
echo
#
--
echo
# Test for bug #36544 "DROP USER does not remove stored function
--
echo
# privileges".
--
echo
#
create
database
mysqltest1
;
create
function
mysqltest1
.
f1
()
returns
int
return
0
;
create
procedure
mysqltest1
.
p1
()
begin
end
;
--
echo
#
--
echo
# 1) Check that DROP USER properly removes privileges on both
--
echo
# stored procedures and functions.
--
echo
#
create
user
mysqluser1
@
localhost
;
grant
execute
on
function
mysqltest1
.
f1
to
mysqluser1
@
localhost
;
grant
execute
on
procedure
mysqltest1
.
p1
to
mysqluser1
@
localhost
;
--
echo
# Quick test that granted privileges are properly reflected
--
echo
# in privilege tables and in in-memory structures.
show
grants
for
mysqluser1
@
localhost
;
select
db
,
routine_name
,
routine_type
,
proc_priv
from
mysql
.
procs_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
--
echo
#
--
echo
# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
--
connect
(
bug36544_con1
,
localhost
,
mysqluser1
,,)
call
mysqltest1
.
p1
();
select
mysqltest1
.
f1
();
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
drop
user
mysqluser1
@
localhost
;
--
echo
#
--
echo
# Test that dropping of user is properly reflected in
--
echo
# both privilege tables and in in-memory structures.
--
echo
#
--
echo
# Switch to connection 'bug36544_con1'.
--
connection
bug36544_con1
--
echo
# The connection cold be alive but should not be able to
--
echo
# access to any of the stored routines.
--
error
ER_PROCACCESS_DENIED_ERROR
call
mysqltest1
.
p1
();
--
error
ER_PROCACCESS_DENIED_ERROR
select
mysqltest1
.
f1
();
--
disconnect
bug36544_con1
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
--
echo
#
--
echo
# Now create user with the same name and check that he
--
echo
# has not inherited privileges.
create
user
mysqluser1
@
localhost
;
show
grants
for
mysqluser1
@
localhost
;
select
db
,
routine_name
,
routine_type
,
proc_priv
from
mysql
.
procs_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
--
echo
#
--
echo
# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
--
connect
(
bug36544_con2
,
localhost
,
mysqluser1
,,)
--
echo
# Newly created user should not be able to access any of the routines.
--
error
ER_PROCACCESS_DENIED_ERROR
call
mysqltest1
.
p1
();
--
error
ER_PROCACCESS_DENIED_ERROR
select
mysqltest1
.
f1
();
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
--
echo
#
--
echo
# 2) Check that RENAME USER properly updates privileges on both
--
echo
# stored procedures and functions.
--
echo
#
grant
execute
on
function
mysqltest1
.
f1
to
mysqluser1
@
localhost
;
grant
execute
on
procedure
mysqltest1
.
p1
to
mysqluser1
@
localhost
;
--
echo
#
--
echo
# Create one more user to make in-memory hashes non-trivial.
--
echo
# User names 'mysqluser11' and 'mysqluser10' were selected
--
echo
# to trigger bug discovered during code inspection.
create
user
mysqluser11
@
localhost
;
grant
execute
on
function
mysqltest1
.
f1
to
mysqluser11
@
localhost
;
grant
execute
on
procedure
mysqltest1
.
p1
to
mysqluser11
@
localhost
;
--
echo
# Also create a couple of tables to test for another bug
--
echo
# discovered during code inspection (again table names were
--
echo
# chosen especially to trigger the bug).
create
table
mysqltest1
.
t11
(
i
int
);
create
table
mysqltest1
.
t22
(
i
int
);
grant
select
on
mysqltest1
.
t22
to
mysqluser1
@
localhost
;
grant
select
on
mysqltest1
.
t11
to
mysqluser1
@
localhost
;
--
echo
# Quick test that granted privileges are properly reflected
--
echo
# in privilege tables and in in-memory structures.
show
grants
for
mysqluser1
@
localhost
;
select
db
,
routine_name
,
routine_type
,
proc_priv
from
mysql
.
procs_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
select
db
,
table_name
,
table_priv
from
mysql
.
tables_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
--
echo
#
--
echo
# Switch to connection 'bug36544_con2'.
--
connection
bug36544_con2
call
mysqltest1
.
p1
();
select
mysqltest1
.
f1
();
select
*
from
mysqltest1
.
t11
;
select
*
from
mysqltest1
.
t22
;
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
rename
user
mysqluser1
@
localhost
to
mysqluser10
@
localhost
;
--
echo
#
--
echo
# Test that there are no privileges left for mysqluser1.
--
echo
#
--
echo
# Switch to connection 'bug36544_con2'.
--
connection
bug36544_con2
--
echo
# The connection cold be alive but should not be able to
--
echo
# access to any of the stored routines or tables.
--
error
ER_PROCACCESS_DENIED_ERROR
call
mysqltest1
.
p1
();
--
error
ER_PROCACCESS_DENIED_ERROR
select
mysqltest1
.
f1
();
--
error
ER_TABLEACCESS_DENIED_ERROR
select
*
from
mysqltest1
.
t11
;
--
error
ER_TABLEACCESS_DENIED_ERROR
select
*
from
mysqltest1
.
t22
;
--
disconnect
bug36544_con2
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
--
echo
#
--
echo
# Now create user with the old name and check that he
--
echo
# has not inherited privileges.
create
user
mysqluser1
@
localhost
;
show
grants
for
mysqluser1
@
localhost
;
select
db
,
routine_name
,
routine_type
,
proc_priv
from
mysql
.
procs_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
select
db
,
table_name
,
table_priv
from
mysql
.
tables_priv
where
user
=
'mysqluser1'
and
host
=
'localhost'
;
--
echo
#
--
echo
# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
--
connect
(
bug36544_con3
,
localhost
,
mysqluser1
,,)
--
echo
# Newly created user should not be able to access to any of the
--
echo
# stored routines or tables.
--
error
ER_PROCACCESS_DENIED_ERROR
call
mysqltest1
.
p1
();
--
error
ER_PROCACCESS_DENIED_ERROR
select
mysqltest1
.
f1
();
--
error
ER_TABLEACCESS_DENIED_ERROR
select
*
from
mysqltest1
.
t11
;
--
error
ER_TABLEACCESS_DENIED_ERROR
select
*
from
mysqltest1
.
t22
;
--
disconnect
bug36544_con3
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
--
echo
#
--
echo
# Now check that privileges became associated with a new user
--
echo
# name - mysqluser10.
--
echo
#
show
grants
for
mysqluser10
@
localhost
;
select
db
,
routine_name
,
routine_type
,
proc_priv
from
mysql
.
procs_priv
where
user
=
'mysqluser10'
and
host
=
'localhost'
;
select
db
,
table_name
,
table_priv
from
mysql
.
tables_priv
where
user
=
'mysqluser10'
and
host
=
'localhost'
;
--
echo
#
--
echo
# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
--
connect
(
bug36544_con4
,
localhost
,
mysqluser10
,,)
call
mysqltest1
.
p1
();
select
mysqltest1
.
f1
();
select
*
from
mysqltest1
.
t11
;
select
*
from
mysqltest1
.
t22
;
--
disconnect
bug36544_con4
--
echo
#
--
echo
# Switch to connection 'default'.
--
connection
default
--
echo
#
--
echo
# Clean-up.
drop
user
mysqluser1
@
localhost
;
drop
user
mysqluser10
@
localhost
;
drop
user
mysqluser11
@
localhost
;
drop
database
mysqltest1
;
--
echo
End
of
5.0
tests
#
...
...
mysql-test/t/partition.test
View file @
268aa888
...
...
@@ -14,6 +14,49 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
--
echo
#
--
echo
# Bug#59297: Can't find record in 'tablename' on update inner join
--
echo
#
CREATE
TABLE
t1
(
a
char
(
2
)
NOT
NULL
,
b
char
(
2
)
NOT
NULL
,
c
int
(
10
)
unsigned
NOT
NULL
,
d
varchar
(
255
)
DEFAULT
NULL
,
e
varchar
(
1000
)
DEFAULT
NULL
,
PRIMARY
KEY
(
a
,
b
,
c
),
KEY
(
a
),
KEY
(
a
,
b
)
)
/*!50100 PARTITION BY KEY (a)
PARTITIONS 20 */
;
INSERT
INTO
t1
(
a
,
b
,
c
,
d
,
e
)
VALUES
(
'07'
,
'03'
,
343
,
'1'
,
'07_03_343'
),
(
'01'
,
'04'
,
343
,
'2'
,
'01_04_343'
),
(
'01'
,
'06'
,
343
,
'3'
,
'01_06_343'
),
(
'01'
,
'07'
,
343
,
'4'
,
'01_07_343'
),
(
'01'
,
'08'
,
343
,
'5'
,
'01_08_343'
),
(
'01'
,
'09'
,
343
,
'6'
,
'01_09_343'
),
(
'03'
,
'03'
,
343
,
'7'
,
'03_03_343'
),
(
'03'
,
'06'
,
343
,
'8'
,
'03_06_343'
),
(
'03'
,
'07'
,
343
,
'9'
,
'03_07_343'
),
(
'04'
,
'03'
,
343
,
'10'
,
'04_03_343'
),
(
'04'
,
'06'
,
343
,
'11'
,
'04_06_343'
),
(
'05'
,
'03'
,
343
,
'12'
,
'05_03_343'
),
(
'11'
,
'03'
,
343
,
'13'
,
'11_03_343'
),
(
'11'
,
'04'
,
343
,
'14'
,
'11_04_343'
)
;
UPDATE
t1
AS
A
,
(
SELECT
'03'
AS
a
,
'06'
AS
b
,
343
AS
c
,
'last'
AS
d
)
AS
B
SET
A
.
e
=
B
.
d
WHERE
A
.
a
=
'03'
AND
A
.
b
=
'06'
AND
A
.
c
=
343
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#57778: failed primary key add to partitioned innodb table
--
echo
# inconsistent and crashes
...
...
mysql-test/t/sp.test
View file @
268aa888
...
...
@@ -8713,4 +8713,45 @@ call p1(3, 2);
drop
table
t1
;
drop
procedure
p1
;
--
echo
--
echo
# --
--
echo
# -- Bug 11765684 - 58674: SP-cache does not detect changes in
--
echo
# -- pre-locking list caused by triggers
--
echo
# ---
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t2
;
DROP
TABLE
IF
EXISTS
t3
;
DROP
PROCEDURE
IF
EXISTS
p1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
);
CREATE
TABLE
t3
(
a
INT
);
CREATE
PROCEDURE
p1
()
INSERT
INTO
t1
(
a
)
VALUES
(
1
);
--
echo
CREATE
TRIGGER
t1_ai
AFTER
INSERT
ON
t1
FOR
EACH
ROW
INSERT
INTO
t2
(
a
)
VALUES
(
new
.
a
);
--
echo
CALL
p1
();
--
echo
CREATE
TRIGGER
t1_bi
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
INSERT
INTO
t3
(
a
)
VALUES
(
new
.
a
);
--
echo
CALL
p1
();
--
echo
DROP
TABLE
t1
,
t2
,
t3
;
DROP
PROCEDURE
p1
;
--
echo
--
echo
# End of 5.5 test
mysql-test/t/trigger.test
View file @
268aa888
...
...
@@ -998,10 +998,6 @@ call p1();
drop
trigger
t1_bi
;
create
trigger
t1_bi
after
insert
on
t1
for
each
row
insert
into
t3
values
(
new
.
id
);
execute
stmt1
;
# Until we implement proper mechanism for invalidation of SP statements
# invoked whenever a table used in SP changes, this statement will fail with
# 'Table ... does not exist' error.
--
error
ER_NO_SUCH_TABLE
call
p1
();
deallocate
prepare
stmt1
;
drop
procedure
p1
;
...
...
sql/ha_partition.cc
View file @
268aa888
...
...
@@ -4448,6 +4448,7 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
break
;
}
}
m_last_part
=
part
;
}
else
{
...
...
sql/log.cc
View file @
268aa888
...
...
@@ -2861,11 +2861,9 @@ void MYSQL_BIN_LOG::init(bool no_auto_events_arg, ulong max_size_arg)
void
MYSQL_BIN_LOG
::
init_pthread_objects
()
{
DBUG_ASSERT
(
inited
==
0
);
inited
=
1
;
mysql_mutex_init
(
key_LOG_LOCK_log
,
&
LOCK_log
,
MY_MUTEX_INIT_SLOW
);
mysql_mutex_init
(
key_BINLOG_LOCK_index
,
&
LOCK_index
,
MY_MUTEX_INIT_SLOW
);
mysql_cond_init
(
key_BINLOG_update_cond
,
&
update_cond
,
0
);
MYSQL_LOG
::
init_pthread_objects
();
mysql_mutex_init
(
m_key_LOCK_index
,
&
LOCK_index
,
MY_MUTEX_INIT_SLOW
);
mysql_cond_init
(
m_key_update_cond
,
&
update_cond
,
0
);
}
...
...
@@ -2888,7 +2886,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
}
fn_format
(
index_file_name
,
index_file_name_arg
,
mysql_data_home
,
".index"
,
opt
);
if
((
index_file_nr
=
mysql_file_open
(
key_file_bin
log_index
,
if
((
index_file_nr
=
mysql_file_open
(
m_key_file_
log_index
,
index_file_name
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
MYF
(
MY_WME
)))
<
0
||
...
...
@@ -3004,7 +3002,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
/* open the main log file */
if
(
MYSQL_LOG
::
open
(
#ifdef HAVE_PSI_INTERFACE
key_file_bin
log
,
m_key_file_
log
,
#endif
log_name
,
log_type_arg
,
new_name
,
io_cache_type_arg
))
{
...
...
@@ -3874,7 +3872,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space,
/* Get rid of the trailing '\n' */
log_info
.
log_file_name
[
length
-
1
]
=
0
;
if
(
!
mysql_file_stat
(
key_file_bin
log
,
log_info
.
log_file_name
,
&
s
,
MYF
(
0
)))
if
(
!
mysql_file_stat
(
m_key_file_
log
,
log_info
.
log_file_name
,
&
s
,
MYF
(
0
)))
{
if
(
my_errno
==
ENOENT
)
{
...
...
@@ -4049,7 +4047,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
!
is_active
(
log_info
.
log_file_name
)
&&
!
log_in_use
(
log_info
.
log_file_name
))
{
if
(
!
mysql_file_stat
(
key_file_bin
log
,
if
(
!
mysql_file_stat
(
m_key_file_
log
,
log_info
.
log_file_name
,
&
stat_area
,
MYF
(
0
)))
{
if
(
my_errno
==
ENOENT
)
...
...
sql/log.h
View file @
268aa888
...
...
@@ -274,6 +274,16 @@ private:
class
MYSQL_BIN_LOG
:
public
TC_LOG
,
private
MYSQL_LOG
{
private:
#ifdef HAVE_PSI_INTERFACE
/** The instrumentation key to use for @ LOCK_index. */
PSI_mutex_key
m_key_LOCK_index
;
/** The instrumentation key to use for @ update_cond. */
PSI_cond_key
m_key_update_cond
;
/** The instrumentation key to use for opening the log file. */
PSI_file_key
m_key_file_log
;
/** The instrumentation key to use for opening the log index file. */
PSI_file_key
m_key_file_log_index
;
#endif
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
mysql_mutex_t
LOCK_index
;
mysql_mutex_t
LOCK_prep_xids
;
...
...
@@ -362,6 +372,19 @@ public:
on exit() - but only during the correct shutdown process
*/
#ifdef HAVE_PSI_INTERFACE
void
set_psi_keys
(
PSI_mutex_key
key_LOCK_index
,
PSI_cond_key
key_update_cond
,
PSI_file_key
key_file_log
,
PSI_file_key
key_file_log_index
)
{
m_key_LOCK_index
=
key_LOCK_index
;
m_key_update_cond
=
key_update_cond
;
m_key_file_log
=
key_file_log
;
m_key_file_log_index
=
key_file_log_index
;
}
#endif
int
open
(
const
char
*
opt_name
);
void
close
();
int
log_xid
(
THD
*
thd
,
my_xid
xid
);
...
...
sql/mysqld.cc
View file @
268aa888
...
...
@@ -3125,6 +3125,18 @@ static int init_common_variables()
*/
global_system_variables
.
time_zone
=
my_tz_SYSTEM
;
#ifdef HAVE_PSI_INTERFACE
/*
Complete the mysql_bin_log initialization.
Instrumentation keys are known only after the performance schema initialization,
and can not be set in the MYSQL_BIN_LOG constructor (called before main()).
*/
mysql_bin_log
.
set_psi_keys
(
key_BINLOG_LOCK_index
,
key_BINLOG_update_cond
,
key_file_binlog
,
key_file_binlog_index
);
#endif
/*
Init mutexes for the global MYSQL_BIN_LOG objects.
As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
...
...
@@ -7701,6 +7713,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_structure_guard_mutex
,
key_TABLE_SHARE_LOCK_ha_data
,
key_LOCK_error_messages
,
key_LOG_INFO_lock
,
key_LOCK_thread_count
,
key_PARTITION_LOCK_auto_inc
;
PSI_mutex_key
key_RELAYLOG_LOCK_index
;
static
PSI_mutex_info
all_server_mutexes
[]
=
{
...
...
@@ -7717,6 +7730,7 @@ static PSI_mutex_info all_server_mutexes[]=
{
&
key_BINLOG_LOCK_index
,
"MYSQL_BIN_LOG::LOCK_index"
,
0
},
{
&
key_BINLOG_LOCK_prep_xids
,
"MYSQL_BIN_LOG::LOCK_prep_xids"
,
0
},
{
&
key_RELAYLOG_LOCK_index
,
"MYSQL_RELAY_LOG::LOCK_index"
,
0
},
{
&
key_delayed_insert_mutex
,
"Delayed_insert::mutex"
,
0
},
{
&
key_hash_filo_lock
,
"hash_filo::lock"
,
0
},
{
&
key_LOCK_active_mi
,
"LOCK_active_mi"
,
PSI_FLAG_GLOBAL
},
...
...
@@ -7784,6 +7798,7 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_relay_log_info_start_cond
,
key_relay_log_info_stop_cond
,
key_TABLE_SHARE_cond
,
key_user_level_lock_cond
,
key_COND_thread_count
,
key_COND_thread_cache
,
key_COND_flush_thread_cache
;
PSI_cond_key
key_RELAYLOG_update_cond
;
static
PSI_cond_info
all_server_conds
[]
=
{
...
...
@@ -7797,6 +7812,7 @@ static PSI_cond_info all_server_conds[]=
#endif
/* HAVE_MMAP */
{
&
key_BINLOG_COND_prep_xids
,
"MYSQL_BIN_LOG::COND_prep_xids"
,
0
},
{
&
key_BINLOG_update_cond
,
"MYSQL_BIN_LOG::update_cond"
,
0
},
{
&
key_RELAYLOG_update_cond
,
"MYSQL_RELAY_LOG::update_cond"
,
0
},
{
&
key_COND_cache_status_changed
,
"Query_cache::COND_cache_status_changed"
,
0
},
{
&
key_COND_manager
,
"COND_manager"
,
PSI_FLAG_GLOBAL
},
{
&
key_COND_rpl_status
,
"COND_rpl_status"
,
PSI_FLAG_GLOBAL
},
...
...
@@ -7860,6 +7876,7 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_pid
,
key_file_relay_log_info
,
key_file_send_file
,
key_file_tclog
,
key_file_trg
,
key_file_trn
,
key_file_init
;
PSI_file_key
key_file_query_log
,
key_file_slow_log
;
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
;
static
PSI_file_info
all_server_files
[]
=
{
...
...
@@ -7868,6 +7885,8 @@ static PSI_file_info all_server_files[]=
#endif
/* HAVE_MMAP */
{
&
key_file_binlog
,
"binlog"
,
0
},
{
&
key_file_binlog_index
,
"binlog_index"
,
0
},
{
&
key_file_relaylog
,
"relaylog"
,
0
},
{
&
key_file_relaylog_index
,
"relaylog_index"
,
0
},
{
&
key_file_casetest
,
"casetest"
,
0
},
{
&
key_file_dbopt
,
"dbopt"
,
0
},
{
&
key_file_des_key_file
,
"des_key_file"
,
0
},
...
...
sql/mysqld.h
View file @
268aa888
...
...
@@ -241,6 +241,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_relay_log_info_log_space_lock
,
key_relay_log_info_run_lock
,
key_structure_guard_mutex
,
key_TABLE_SHARE_LOCK_ha_data
,
key_LOCK_error_messages
,
key_LOCK_thread_count
,
key_PARTITION_LOCK_auto_inc
;
extern
PSI_mutex_key
key_RELAYLOG_LOCK_index
;
extern
PSI_rwlock_key
key_rwlock_LOCK_grant
,
key_rwlock_LOCK_logger
,
key_rwlock_LOCK_sys_init_connect
,
key_rwlock_LOCK_sys_init_slave
,
...
...
@@ -260,6 +261,7 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_relay_log_info_start_cond
,
key_relay_log_info_stop_cond
,
key_TABLE_SHARE_cond
,
key_user_level_lock_cond
,
key_COND_thread_count
,
key_COND_thread_cache
,
key_COND_flush_thread_cache
;
extern
PSI_cond_key
key_RELAYLOG_update_cond
;
extern
PSI_thread_key
key_thread_bootstrap
,
key_thread_delayed_insert
,
key_thread_handle_manager
,
key_thread_kill_server
,
key_thread_main
,
...
...
@@ -277,6 +279,7 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_pid
,
key_file_relay_log_info
,
key_file_send_file
,
key_file_tclog
,
key_file_trg
,
key_file_trn
,
key_file_init
;
extern
PSI_file_key
key_file_query_log
,
key_file_slow_log
;
extern
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
;
void
init_server_psi_keys
();
#endif
/* HAVE_PSI_INTERFACE */
...
...
sql/rpl_rli.cc
View file @
268aa888
...
...
@@ -54,6 +54,13 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
{
DBUG_ENTER
(
"Relay_log_info::Relay_log_info"
);
#ifdef HAVE_PSI_INTERFACE
relay_log
.
set_psi_keys
(
key_RELAYLOG_LOCK_index
,
key_RELAYLOG_update_cond
,
key_file_relaylog
,
key_file_relaylog_index
);
#endif
group_relay_log_name
[
0
]
=
event_relay_log_name
[
0
]
=
group_master_log_name
[
0
]
=
0
;
until_log_name
[
0
]
=
ign_master_log_name_end
[
0
]
=
0
;
...
...
@@ -356,7 +363,7 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo)
{
MY_STAT
s
;
DBUG_ENTER
(
"add_relay_log"
);
if
(
!
mysql_file_stat
(
key_file_
bin
log
,
if
(
!
mysql_file_stat
(
key_file_
relay
log
,
linfo
->
log_file_name
,
&
s
,
MYF
(
0
)))
{
sql_print_error
(
"log %s listed in the index, but failed to stat"
,
...
...
sql/sql_acl.cc
View file @
268aa888
/* Copyright (
C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
/* Copyright (
c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -5982,18 +5982,15 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
}
/*
/*
*
Handle an in-memory privilege structure.
SYNOPSIS
handle_grant_struct()
struct_no The number of the structure to handle (0..3).
drop If user_from is to be dropped.
user_from The the user to be searched/dropped/renamed.
user_to The new name for the user if to be renamed,
NULL otherwise.
@param struct_no The number of the structure to handle (0..5).
@param drop If user_from is to be dropped.
@param user_from The the user to be searched/dropped/renamed.
@param user_to The new name for the user if to be renamed, NULL otherwise.
DESCRIPTION
@note
Scan through all elements in an in-memory grant structure and apply
the requested operation.
Delete from grant structure if drop is true.
...
...
@@ -6003,12 +6000,13 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
0 acl_users
1 acl_dbs
2 column_priv_hash
3 procs_priv_hash
3 proc_priv_hash
4 func_priv_hash
5 acl_proxy_users
RETURN
> 0 At least one element matched.
0 OK, but no element matched.
-1 Wrong arguments to function
@retval > 0 At least one element matched.
@retval 0 OK, but no element matched.
@retval -1 Wrong arguments to function.
*/
static
int
handle_grant_struct
(
uint
struct_no
,
bool
drop
,
...
...
@@ -6023,6 +6021,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
ACL_DB
*
acl_db
=
NULL
;
ACL_PROXY_USER
*
acl_proxy_user
=
NULL
;
GRANT_NAME
*
grant_name
=
NULL
;
HASH
*
grant_name_hash
=
NULL
;
DBUG_ENTER
(
"handle_grant_struct"
);
DBUG_PRINT
(
"info"
,(
"scan struct: %u search: '%s'@'%s'"
,
struct_no
,
user_from
->
user
.
str
,
user_from
->
host
.
str
));
...
...
@@ -6042,9 +6041,15 @@ static int handle_grant_struct(uint struct_no, bool drop,
break
;
case
2
:
elements
=
column_priv_hash
.
records
;
grant_name_hash
=
&
column_priv_hash
;
break
;
case
3
:
elements
=
proc_priv_hash
.
records
;
grant_name_hash
=
&
proc_priv_hash
;
break
;
case
4
:
elements
=
func_priv_hash
.
records
;
grant_name_hash
=
&
func_priv_hash
;
break
;
case
5
:
elements
=
acl_proxy_users
.
elements
;
...
...
@@ -6077,21 +6082,19 @@ static int handle_grant_struct(uint struct_no, bool drop,
break
;
case
2
:
grant_name
=
(
GRANT_NAME
*
)
my_hash_element
(
&
column_priv_hash
,
idx
);
user
=
grant_name
->
user
;
host
=
grant_name
->
host
.
hostname
;
break
;
case
3
:
grant_name
=
(
GRANT_NAME
*
)
my_hash_element
(
&
proc_priv_hash
,
idx
);
case
4
:
grant_name
=
(
GRANT_NAME
*
)
my_hash_element
(
grant_name_hash
,
idx
);
user
=
grant_name
->
user
;
host
=
grant_name
->
host
.
hostname
;
break
;
case
5
:
acl_proxy_user
=
dynamic_element
(
&
acl_proxy_users
,
idx
,
ACL_PROXY_USER
*
);
user
=
acl_proxy_user
->
get_user
();
host
=
acl_proxy_user
->
get_host
();
break
;
default:
MY_ASSERT_UNREACHABLE
();
}
...
...
@@ -6121,11 +6124,9 @@ static int handle_grant_struct(uint struct_no, bool drop,
break
;
case
2
:
my_hash_delete
(
&
column_priv_hash
,
(
uchar
*
)
grant_name
);
break
;
case
3
:
my_hash_delete
(
&
proc_priv_hash
,
(
uchar
*
)
grant_name
);
case
4
:
my_hash_delete
(
grant_name_hash
,
(
uchar
*
)
grant_name
);
break
;
case
5
:
...
...
@@ -6134,6 +6135,19 @@ static int handle_grant_struct(uint struct_no, bool drop,
}
elements
--
;
/*
- If we are iterating through an array then we just have moved all
elements after the current element one position closer to its head.
This means that we have to take another look at the element at
current position as it is a new element from the array's tail.
- If we are iterating through a hash the current element was replaced
with one of elements from the tail. So we also have to take a look
at the new element in current position.
Note that in our HASH implementation hash_delete() won't move any
elements with position after current one to position before the
current (i.e. from the tail to the head), so it is safe to continue
iteration without re-starting.
*/
idx
--
;
}
else
if
(
user_to
)
...
...
@@ -6151,22 +6165,41 @@ static int handle_grant_struct(uint struct_no, bool drop,
case
2
:
case
3
:
/*
Update the grant structure with the new user name and
host name
*/
grant_name
->
set_user_details
(
user_to
->
host
.
str
,
grant_name
->
db
,
user_to
->
user
.
str
,
grant_name
->
tname
,
TRUE
);
/*
Since username is part of the hash key, when the user name
is renamed, the hash key is changed. Update the hash to
ensure that the position matches the new hash key value
*/
my_hash_update
(
&
column_priv_hash
,
(
uchar
*
)
grant_name
,
(
uchar
*
)
grant_name
->
hash_key
,
grant_name
->
key_length
);
break
;
case
4
:
{
/*
Save old hash key and its length to be able properly update
element position in hash.
*/
char
*
old_key
=
grant_name
->
hash_key
;
size_t
old_key_length
=
grant_name
->
key_length
;
/*
Update the grant structure with the new user name and host name.
*/
grant_name
->
set_user_details
(
user_to
->
host
.
str
,
grant_name
->
db
,
user_to
->
user
.
str
,
grant_name
->
tname
,
TRUE
);
/*
Since username is part of the hash key, when the user name
is renamed, the hash key is changed. Update the hash to
ensure that the position matches the new hash key value
*/
my_hash_update
(
grant_name_hash
,
(
uchar
*
)
grant_name
,
(
uchar
*
)
old_key
,
old_key_length
);
/*
hash_update() operation could have moved element from the tail
of the hash to the current position. So we need to take a look
at the element in current position once again.
Thanks to the fact that hash_update() for our HASH implementation
won't move any elements from the tail of the hash to the positions
before the current one (a.k.a. head) it is safe to continue
iteration without restarting.
*/
idx
--
;
break
;
}
case
5
:
acl_proxy_user
->
set_user
(
&
mem
,
user_to
->
user
.
str
);
...
...
@@ -6258,7 +6291,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
}
}
/* Handle
procedur
es table. */
/* Handle
stored routin
es table. */
if
((
found
=
handle_grant_table
(
tables
,
4
,
drop
,
user_from
,
user_to
))
<
0
)
{
/* Handle of table failed, don't touch in-memory array. */
...
...
@@ -6275,6 +6308,15 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
if
(
!
drop
&&
!
user_to
)
goto
end
;
}
/* Handle funcs array. */
if
(((
handle_grant_struct
(
4
,
drop
,
user_from
,
user_to
)
&&
!
result
)
||
found
)
&&
!
result
)
{
result
=
1
;
/* At least one record/element found. */
/* If search is requested, we do not need to search further. */
if
(
!
drop
&&
!
user_to
)
goto
end
;
}
}
/* Handle tables table. */
...
...
sql/sql_trigger.cc
View file @
268aa888
...
...
@@ -30,6 +30,7 @@
#include "sql_db.h" // get_default_db_collation
#include "sql_acl.h" // *_ACL, is_acl_user
#include "sql_handler.h" // mysql_ha_rm_tables
#include "sp_cache.h" // sp_invalidate_cache
/*************************************************************************/
...
...
@@ -517,6 +518,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
*/
thd
->
locked_tables_list
.
reopen_tables
(
thd
);
/*
Invalidate SP-cache. That's needed because triggers may change list of
pre-locking tables.
*/
sp_cache_invalidate
();
end:
if
(
!
result
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment