Skip to content

Commit

Permalink
Merge branch '10.3' into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Feb 11, 2020
2 parents c1eaa38 + 58b70dc commit 646d1ec
Show file tree
Hide file tree
Showing 164 changed files with 2,854 additions and 2,282 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp
support-files/sysusers.conf
support-files/tmpfiles.conf
support-files/mariadb.pp
tags
tests/async_queries
Expand Down
2 changes: 2 additions & 0 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ SET(ignored
"%ignore /etc/systemd/system"
"%ignore /lib"
"%ignore /lib/security"
"%ignore /lib64"
"%ignore /lib64/security"
"%ignore ${CMAKE_INSTALL_PREFIX}"
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
Expand Down
2 changes: 1 addition & 1 deletion cmake/install_layout.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
SET(INSTALL_PAMDIR_RPM "/lib/security")
SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")

#
# DEB layout
Expand Down
11 changes: 6 additions & 5 deletions man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012, Monty Program Ab
# Copyright (c) 2012, 2020, MariaDB
#
# 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
Expand All @@ -21,11 +21,11 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
mysql_secure_installation.1 mysql_setpermission.1
mysql_tzinfo_to_sql.1 mysql_upgrade.1
mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1
mysqltest.1 perror.1 replace.1 resolve_stack_dump.1
perror.1 replace.1 resolve_stack_dump.1
resolveip.1 mariadb-service-convert.1
mysqld_safe_helper.1 tokuftdump.1 wsrep_sst_common.1
mysqld_safe_helper.1 wsrep_sst_common.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
galera_recovery.1 galera_new_cluster.1 tokuft_logprint.1
galera_recovery.1 galera_new_cluster.1
mysql_ldb.1
wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1
wsrep_sst_rsync_wan.1)
Expand All @@ -36,7 +36,8 @@ SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysql_plugin.1 mysql_embedded.1)
SET(MAN1_DEVEL mysql_config.1)
SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1)
mysqltest.1 mysqltest_embedded.1 mysql_client_test_embedded.1
my_safe_process.1)

INSTALL(FILES ${MAN1_SERVER} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesServer)
INSTALL(FILES ${MAN8_SERVER} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPagesServer)
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/connect.result
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ update mysql.user set plugin="", authentication_string="", password=old_password
flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
connect con10,localhost,test,gambling2,;
connect con5,localhost,test,gambling2,mysql;
set password="";
Expand Down
89 changes: 89 additions & 0 deletions mysql-test/main/derived_cond_pushdown.result
Original file line number Diff line number Diff line change
Expand Up @@ -16823,6 +16823,95 @@ id username id userid logindate
2 user2 3 2 2017-06-19 12:17:02
set join_cache_level=default;
DROP TABLE t1,t2;
#
# MDEV-21614: potentially splittable materialized derived/view
# within materialized semi-join
#
create table t1 (
id int not null auto_increment primary key,
a int not null
) engine=myisam;
create table t2 (
id int not null auto_increment primary key,
ro_id int not null,
flag int not null, key (ro_id)
) engine=myisam;
insert into t1(a) select seq+100 from seq_1_to_20;
insert into t2(ro_id,flag) select seq, 1 from seq_1_to_20;
insert into t2(ro_id,flag) select seq, 0 from seq_1_to_20;
create view v1 as
select t1.* from t1 left join t2 on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id;
select id, a from t1 where id in (select id from v1);
id a
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
10 110
11 111
12 112
13 113
14 114
15 115
16 116
17 117
18 118
19 119
20 120
explain extended select id, a from t1 where id in (select id from v1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id`
select id, a from t1
where id in (select id
from (select t1.* from t1 left join t2
on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id) dt);
id a
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
10 110
11 111
12 112
13 113
14 114
15 115
16 116
17 117
18 118
19 119
20 120
explain extended select id, a from t1
where id in (select id
from (select t1.* from t1 left join t2
on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id) dt);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where `test`.`t1`.`id` = `test`.`t1`.`id` group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
drop view v1;
drop table t1,t2;
# End of 10.3 tests
#
# MDEV-18679: materialized view with SELECT S containing materialized
Expand Down
43 changes: 43 additions & 0 deletions mysql-test/main/derived_cond_pushdown.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--source include/have_sequence.inc
--source include/default_optimizer_switch.inc
let $no_pushdown= set statement optimizer_switch='condition_pushdown_for_derived=off' for;
set @@join_buffer_size=256*1024;
Expand Down Expand Up @@ -3328,6 +3329,48 @@ set join_cache_level=default;

DROP TABLE t1,t2;


--echo #
--echo # MDEV-21614: potentially splittable materialized derived/view
--echo # within materialized semi-join
--echo #

create table t1 (
id int not null auto_increment primary key,
a int not null
) engine=myisam;

create table t2 (
id int not null auto_increment primary key,
ro_id int not null,
flag int not null, key (ro_id)
) engine=myisam;

insert into t1(a) select seq+100 from seq_1_to_20;
insert into t2(ro_id,flag) select seq, 1 from seq_1_to_20;
insert into t2(ro_id,flag) select seq, 0 from seq_1_to_20;

create view v1 as
select t1.* from t1 left join t2 on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id;

let $q1=
select id, a from t1 where id in (select id from v1);
eval $q1;
eval explain extended $q1;

let $q2=
select id, a from t1
where id in (select id
from (select t1.* from t1 left join t2
on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id) dt);
eval $q2;
eval explain extended $q2;

drop view v1;
drop table t1,t2;

--echo # End of 10.3 tests

--echo #
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/main/events_bugs.result
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
CREATE TABLE events_test.event_log
Expand All @@ -632,9 +632,9 @@ GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
GRANT select,insert ON test.* TO evtest1@localhost;
SHOW GRANTS FOR evtest1@localhost;
Grants for evtest1@localhost
GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
GRANT USAGE ON *.* TO `evtest1`@`localhost` IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
GRANT SELECT, INSERT ON `test`.* TO `evtest1`@`localhost`
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO `evtest1`@`localhost`
connect e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/events_grant.result
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ USER() DATABASE()
ev_test@localhost events_test2
SHOW GRANTS;
Grants for ev_test@localhost
GRANT USAGE ON *.* TO 'ev_test'@'localhost'
GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO 'ev_test'@'localhost'
GRANT USAGE ON *.* TO `ev_test`@`localhost`
GRANT ALL PRIVILEGES ON `events_test`.* TO `ev_test`@`localhost`
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO `ev_test`@`localhost`
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
Expand Down
16 changes: 8 additions & 8 deletions mysql-test/main/fix_priv_tables.result
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ SELECT * FROM testdb.t1;
GRANT CREATE VIEW, SHOW VIEW ON testdb.v1 TO 'show_view_tbl'@'localhost';
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`

GRANT SELECT(c1) on testdb.v1 to 'select_only_c1'@localhost;
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`

"after fix privs"
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Grants for show_view_tbl@localhost
GRANT USAGE ON *.* TO 'show_view_tbl'@'localhost'
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO 'show_view_tbl'@'localhost'
GRANT USAGE ON *.* TO `show_view_tbl`@`localhost`
GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`

SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO 'select_only_c1'@'localhost'
GRANT SELECT (c1) ON `testdb`.`v1` TO 'select_only_c1'@'localhost'
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`

DROP USER 'show_view_tbl'@'localhost';
DROP USER 'select_only_c1'@'localhost';
Expand Down
Loading

0 comments on commit 646d1ec

Please sign in to comment.