mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Last slice of fix for Bug#42003 tests missing the disconnect of connections <> default
+ Fix for Bug#43114 wait_until_count_sessions too restrictive, random PB failures + Removal of a lot of other weaknesses found + modifications according to review
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
# Can't test with embedded server that doesn't support grants
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
connect (con1root,localhost,root,,);
|
||||
|
||||
connection con1root;
|
||||
@@ -156,7 +159,7 @@ call db1_secret.stamp(6);
|
||||
select db1_secret.db();
|
||||
|
||||
#
|
||||
# BUG#2777
|
||||
# Bug#2777 Stored procedure doesn't observe definer's rights
|
||||
#
|
||||
|
||||
connection con1root;
|
||||
@@ -215,7 +218,7 @@ call q();
|
||||
select * from t2;
|
||||
|
||||
#
|
||||
# BUG#6030: Stored procedure has no appropriate DROP privilege
|
||||
# Bug#6030 Stored procedure has no appropriate DROP privilege
|
||||
# (or ALTER for that matter)
|
||||
|
||||
# still connection con2user1 in db2
|
||||
@@ -330,7 +333,7 @@ flush privileges;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#9503: reseting correct parameters of thread after error in SP function
|
||||
# Bug#9503 reseting correct parameters of thread after error in SP function
|
||||
#
|
||||
connect (root,localhost,root,,test);
|
||||
connection root;
|
||||
@@ -366,10 +369,12 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
|
||||
drop function bug_9503;
|
||||
use test;
|
||||
drop database mysqltest;
|
||||
connection default;
|
||||
disconnect root;
|
||||
|
||||
#
|
||||
# correct value from current_user() in function run from "security definer"
|
||||
# (BUG#7291)
|
||||
# (Bug#7291 Stored procedures: wrong CURRENT_USER value)
|
||||
#
|
||||
connection con1root;
|
||||
use test;
|
||||
@@ -398,10 +403,10 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
|
||||
drop user user1@localhost;
|
||||
|
||||
#
|
||||
# Bug #12318: Wrong error message when accessing an inaccessible stored
|
||||
# Bug#12318 Wrong error message when accessing an inaccessible stored
|
||||
# procedure in another database when the current database is
|
||||
# information_schema.
|
||||
#
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest_1;
|
||||
@@ -438,7 +443,7 @@ revoke usage on *.* from mysqltest_1@localhost;
|
||||
drop user mysqltest_1@localhost;
|
||||
|
||||
#
|
||||
# BUG#12812 create view calling a function works without execute right
|
||||
# Bug#12812 create view calling a function works without execute right
|
||||
# on function
|
||||
delimiter |;
|
||||
--disable_warnings
|
||||
@@ -464,7 +469,7 @@ delimiter ;|
|
||||
|
||||
|
||||
#
|
||||
# BUG#14834: Server denies to execute Stored Procedure
|
||||
# Bug#14834 Server denies to execute Stored Procedure
|
||||
#
|
||||
# The problem here was with '_' in the database name.
|
||||
#
|
||||
@@ -507,7 +512,7 @@ drop database db_bug14834;
|
||||
|
||||
|
||||
#
|
||||
# BUG#14533: 'desc tbl' in stored procedure causes error
|
||||
# Bug#14533 'desc tbl' in stored procedure causes error
|
||||
# ER_TABLEACCESS_DENIED_ERROR
|
||||
#
|
||||
create database db_bug14533;
|
||||
@@ -546,20 +551,20 @@ drop database db_bug14533;
|
||||
|
||||
|
||||
#
|
||||
# BUG#7787: Stored procedures: improper warning for "grant execute" statement
|
||||
# Bug#7787 Stored procedures: improper warning for "grant execute" statement
|
||||
#
|
||||
|
||||
# Prepare.
|
||||
|
||||
CREATE DATABASE db_bug7787;
|
||||
use db_bug7787;
|
||||
USE db_bug7787;
|
||||
|
||||
# Test.
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
SHOW INNODB STATUS;
|
||||
SHOW INNODB STATUS;
|
||||
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost;
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost;
|
||||
|
||||
# Cleanup.
|
||||
|
||||
@@ -569,7 +574,7 @@ use test;
|
||||
|
||||
|
||||
#
|
||||
# WL#2897: Complete definer support in the stored routines.
|
||||
# WL#2897 Complete definer support in the stored routines.
|
||||
#
|
||||
# The following cases are tested:
|
||||
# 1. check that if DEFINER-clause is not explicitly specified, stored routines
|
||||
@@ -614,7 +619,7 @@ GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
|
||||
--echo ---> connection: mysqltest_2_con
|
||||
--connection mysqltest_2_con
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
CREATE PROCEDURE wl2897_p1() SELECT 1;
|
||||
|
||||
@@ -626,7 +631,7 @@ CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
|
||||
--echo ---> connection: mysqltest_1_con
|
||||
--connection mysqltest_1_con
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
|
||||
@@ -652,7 +657,7 @@ CREATE DEFINER='a @ b @ c'@localhost FUNCTION wl2897_f3() RETURNS INT RETURN 3;
|
||||
--echo ---> connection: con1root
|
||||
--connection con1root
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
SHOW CREATE PROCEDURE wl2897_p1;
|
||||
SHOW CREATE PROCEDURE wl2897_p3;
|
||||
@@ -672,7 +677,7 @@ DROP DATABASE mysqltest;
|
||||
|
||||
|
||||
#
|
||||
# BUG#13198: SP executes if definer does not exist
|
||||
# Bug#13198 SP executes if definer does not exist
|
||||
#
|
||||
|
||||
# Prepare environment.
|
||||
@@ -702,7 +707,7 @@ GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
|
||||
--echo ---> connection: mysqltest_1_con
|
||||
--connection mysqltest_1_con
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
CREATE PROCEDURE bug13198_p1()
|
||||
SELECT 1;
|
||||
@@ -720,7 +725,7 @@ SELECT bug13198_f1();
|
||||
--echo ---> connection: mysqltest_2_con
|
||||
--connection mysqltest_2_con
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
CALL bug13198_p1();
|
||||
|
||||
@@ -742,7 +747,7 @@ DROP USER mysqltest_1@localhost;
|
||||
--echo ---> connection: mysqltest_2_con
|
||||
--connection mysqltest_2_con
|
||||
|
||||
use mysqltest;
|
||||
USE mysqltest;
|
||||
|
||||
--error ER_NO_SUCH_USER
|
||||
CALL bug13198_p1();
|
||||
@@ -764,8 +769,8 @@ DROP DATABASE mysqltest;
|
||||
|
||||
|
||||
#
|
||||
# Bug#19857 - When a user with CREATE ROUTINE priv creates a routine,
|
||||
# it results in NULL p/w
|
||||
# Bug#19857 When a user with CREATE ROUTINE priv creates a routine,
|
||||
# it results in NULL p/w
|
||||
#
|
||||
|
||||
# Can't test with embedded server that doesn't support grants
|
||||
@@ -780,7 +785,7 @@ SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
|
||||
--echo ---> connection: mysqltest_2_con
|
||||
--connection mysqltest_2_con
|
||||
|
||||
use test;
|
||||
USE test;
|
||||
|
||||
DELIMITER //;
|
||||
CREATE PROCEDURE sp19857() DETERMINISTIC
|
||||
@@ -814,7 +819,7 @@ DROP USER user19857@localhost;
|
||||
|
||||
|
||||
#
|
||||
# BUG#18630: Arguments of suid routine calculated in wrong security
|
||||
# Bug#18630 Arguments of suid routine calculated in wrong security
|
||||
# context
|
||||
#
|
||||
# Arguments of suid routines were calculated in definer's security
|
||||
@@ -886,3 +891,7 @@ DROP FUNCTION f_suid;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
# Wait till all disconnects are completed
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user