mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
merge
This commit is contained in:
@ -14,3 +14,18 @@ let $engine_type= InnoDB;
|
||||
let $test_foreign_keys= 1;
|
||||
|
||||
--source include/query_cache.inc
|
||||
|
||||
#
|
||||
# Bug#56452 Assertion failed: thd->transaction.stmt.is_empty() ||
|
||||
# thd->in_sub_stmt
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
ROLLBACK WORK AND CHAIN NO RELEASE;
|
||||
SELECT a FROM t1;
|
||||
ROLLBACK WORK AND CHAIN NO RELEASE;
|
||||
SELECT a FROM t1;
|
||||
ROLLBACK;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@ -554,3 +554,29 @@ DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#51099 Assertion in mysql_multi_delete_prepare()
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
DROP VIEW IF EXISTS v1, v2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(b INT);
|
||||
CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
|
||||
CREATE VIEW v2 AS SELECT a FROM v1;
|
||||
|
||||
# This is a normal delete
|
||||
--error ER_VIEW_DELETE_MERGE_VIEW
|
||||
DELETE FROM v2;
|
||||
# This is a multi table delete, check that we get the same error
|
||||
# This caused the assertion.
|
||||
--error ER_VIEW_DELETE_MERGE_VIEW
|
||||
DELETE v2 FROM v2;
|
||||
|
||||
DROP VIEW v2, v1;
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -11,8 +11,7 @@
|
||||
##############################################################################
|
||||
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
|
||||
lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
|
||||
mysqlhotcopy_myisam : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
|
||||
mysqlhotcopy_archive : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution
|
||||
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
|
||||
main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
|
||||
main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
|
||||
|
@ -466,3 +466,9 @@ SELECT 2 DIV -2;
|
||||
SELECT -(1 DIV 0);
|
||||
# Crashed the server with SIGFPE before the bugfix
|
||||
SELECT -9223372036854775808 MOD -1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #57209 valgrind + Assertion failed: dst > buf
|
||||
--echo #
|
||||
SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
|
||||
as foo;
|
||||
|
@ -833,3 +833,14 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#57039: constant subtime expression returns incorrect result.
|
||||
--echo #
|
||||
CREATE TABLE t1 (`date_date` datetime NOT NULL);
|
||||
INSERT INTO t1 VALUES ('2008-01-03 00:00:00'), ('2008-01-03 00:00:00');
|
||||
SELECT * FROM t1 WHERE date_date >= subtime(now(), "00:30:00");
|
||||
SELECT * FROM t1 WHERE date_date <= addtime(date_add("2000-1-1", INTERVAL "1:1:1" HOUR_SECOND), "00:20:00");
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
|
||||
|
@ -1419,11 +1419,6 @@ GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
|
||||
connect (connbug33464, localhost, userbug33464, , dbbug33464);
|
||||
--source suite/funcs_1/include/show_connection.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS sp3;
|
||||
DROP FUNCTION IF EXISTS fn1;
|
||||
--enable_warnings
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE sp3(v1 char(20))
|
||||
BEGIN
|
||||
@ -1578,6 +1573,16 @@ DROP TABLE db2.t1;
|
||||
DROP DATABASE db1;
|
||||
DROP DATABASE db2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #36742
|
||||
--echo #
|
||||
grant usage on Foo.* to myuser@Localhost identified by 'foo';
|
||||
grant select on Foo.* to myuser@localhost;
|
||||
select host,user from mysql.user where User='myuser';
|
||||
revoke select on Foo.* from myuser@localhost;
|
||||
delete from mysql.user where User='myuser';
|
||||
flush privileges;
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
|
@ -64,6 +64,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
|
||||
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
|
||||
|
||||
DROP USER CUser@localhost;
|
||||
--error ER_CANNOT_USER
|
||||
DROP USER CUser@LOCALHOST;
|
||||
|
||||
#### table grants
|
||||
@ -88,6 +89,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
|
||||
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
|
||||
|
||||
DROP USER CUser@localhost;
|
||||
--error ER_CANNOT_USER
|
||||
DROP USER CUser@LOCALHOST;
|
||||
|
||||
### column grants
|
||||
@ -112,6 +114,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
|
||||
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
|
||||
|
||||
DROP USER CUser@localhost;
|
||||
--error ER_CANNOT_USER
|
||||
DROP USER CUser@LOCALHOST;
|
||||
|
||||
drop table t1;
|
||||
@ -131,6 +134,7 @@ flush privileges;
|
||||
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
|
||||
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
|
||||
|
||||
--error ER_NONEXISTING_GRANT
|
||||
REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
|
||||
flush privileges;
|
||||
|
||||
@ -138,6 +142,7 @@ SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
|
||||
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
|
||||
|
||||
DROP USER CUser2@localhost;
|
||||
--error ER_CANNOT_USER
|
||||
DROP USER CUser2@LOCALHOST;
|
||||
|
||||
|
||||
|
@ -1555,3 +1555,56 @@ WHERE COLUMNS.TABLE_SCHEMA = 'test'
|
||||
AND COLUMNS.TABLE_NAME = 't1';
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # A test case for Bug#56540 "Exception (crash) in sql_show.cc
|
||||
--echo # during rqg_info_schema test on Windows"
|
||||
--echo # Ensure that we never access memory of a closed table,
|
||||
--echo # in particular, never access table->field[] array.
|
||||
--echo # Before the fix, the below test case, produced
|
||||
--echo # valgrind errors.
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
drop view if exists v1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a int, b int);
|
||||
create view v1 as select t1.a, t1.b from t1;
|
||||
alter table t1 change b c int;
|
||||
lock table t1 read;
|
||||
connect(con1, localhost, root,,);
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
send flush tables;
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "Waiting for table flush" and
|
||||
info = "flush tables";
|
||||
--source include/wait_condition.inc
|
||||
--vertical_results
|
||||
select * from information_schema.views;
|
||||
--horizontal_results
|
||||
unlock tables;
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
--echo #
|
||||
|
||||
--echo # --> connection con1
|
||||
connection con1;
|
||||
--echo # Reaping 'flush tables'
|
||||
reap;
|
||||
disconnect con1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo # --> connection default
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
@ -1023,6 +1023,61 @@ DROP EVENT e2;
|
||||
SET DEBUG_SYNC="RESET";
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55930 Assertion `thd->transaction.stmt.is_empty() ||
|
||||
--echo # thd->in_sub_stmt || (thd->state..
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT) engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
|
||||
connect (con1, localhost, root);
|
||||
connect (con2, localhost, root);
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
SET SESSION lock_wait_timeout= 1;
|
||||
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze';
|
||||
--echo # Sending:
|
||||
--send OPTIMIZE TABLE t1
|
||||
|
||||
--echo # Connection con2
|
||||
connection con2;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate';
|
||||
SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock';
|
||||
--echo # Sending:
|
||||
--send INSERT INTO t1 VALUES (3)
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR thrlock';
|
||||
SET DEBUG_SYNC= 'now SIGNAL opti_analyze';
|
||||
|
||||
--echo # Connection con1
|
||||
connection con1;
|
||||
--echo # Reaping: OPTIMIZE TABLE t1
|
||||
--reap
|
||||
SET DEBUG_SYNC= 'now SIGNAL release_thrlock';
|
||||
disconnect con1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Connection con2
|
||||
connection con2;
|
||||
--echo # Reaping: INSERT INTO t1 VALUES (3)
|
||||
--reap
|
||||
disconnect con2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--echo # Connection default
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
|
||||
# Check that all connections opened by test cases in this file are really
|
||||
# gone so execution of other tests won't be affected by their presence.
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
1
mysql-test/t/lowercase_table4-master.opt
Executable file
1
mysql-test/t/lowercase_table4-master.opt
Executable file
@ -0,0 +1 @@
|
||||
--lower-case-table-names=2
|
56
mysql-test/t/lowercase_table4.test
Executable file
56
mysql-test/t/lowercase_table4.test
Executable file
@ -0,0 +1,56 @@
|
||||
--source include/have_case_insensitive_file_system.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46941 crash with lower_case_table_names=2 and
|
||||
--echo # foreign data dictionary confusion
|
||||
--echo #
|
||||
|
||||
CREATE DATABASE XY;
|
||||
USE XY;
|
||||
|
||||
#
|
||||
# Logs are disabled, since the number of creates tables
|
||||
# and subsequent select statements may vary between
|
||||
# versions
|
||||
#
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
|
||||
let $tcs = `SELECT @@table_open_cache + 1`;
|
||||
|
||||
let $i = $tcs;
|
||||
|
||||
while ($i)
|
||||
{
|
||||
eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
|
||||
primary key(a, b), unique(b)) ENGINE=InnoDB;
|
||||
dec $i;
|
||||
}
|
||||
|
||||
eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b),
|
||||
ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
|
||||
|
||||
eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
|
||||
ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
|
||||
|
||||
let $i = $tcs;
|
||||
while ($i)
|
||||
{
|
||||
eval SELECT * FROM XY.T_$i LIMIT 1;
|
||||
dec $i;
|
||||
}
|
||||
|
||||
DROP DATABASE XY;
|
||||
CREATE DATABASE XY;
|
||||
USE XY;
|
||||
eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
|
||||
PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
|
||||
#
|
||||
# The bug causes this SELECT to err
|
||||
eval SELECT * FROM XY.T_$tcs LIMIT 1;
|
||||
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
DROP DATABASE XY;
|
||||
|
@ -3969,7 +3969,8 @@ INSERT INTO t1 VALUES (1),(2),(3);
|
||||
|
||||
--echo # Connection: con1
|
||||
connection con1;
|
||||
SET debug_sync='lock_table_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
|
||||
LOCK TABLES t1 WRITE;
|
||||
SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
|
||||
send TRUNCATE TABLE t1;
|
||||
|
||||
connection default;
|
||||
@ -3994,15 +3995,17 @@ connection default;
|
||||
--echo # Connection: default
|
||||
SET debug_sync='now WAIT_FOR parked_flush';
|
||||
SET debug_sync='now SIGNAL go_truncate';
|
||||
--echo # Ensure that truncate waits for a exclusive lock
|
||||
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
|
||||
WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
|
||||
--source include/wait_condition.inc
|
||||
SET debug_sync= 'now SIGNAL go_show';
|
||||
|
||||
connection con1;
|
||||
--echo # Connection: con1
|
||||
--echo # Connection: con1 (TRUNCATE)
|
||||
--echo # Reaping...
|
||||
reap;
|
||||
|
||||
connection default;
|
||||
--echo # Connection: default
|
||||
SET debug_sync= 'now SIGNAL go_show';
|
||||
UNLOCK TABLES;
|
||||
|
||||
connection con2;
|
||||
--echo # Connection: con2 (SHOW FIELDS FROM t1)
|
||||
|
@ -2600,11 +2600,12 @@ UNLOCK TABLES;
|
||||
DROP TABLE m1, t1;
|
||||
|
||||
--echo #
|
||||
--echo # Locking the merge table will implicitly lock children.
|
||||
--echo # Locking the merge table won't implicitly lock children.
|
||||
--echo #
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1);
|
||||
LOCK TABLE m1 WRITE;
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
ALTER TABLE t1 ADD INDEX (c1);
|
||||
LOCK TABLE m1 WRITE, t1 WRITE;
|
||||
ALTER TABLE t1 ADD INDEX (c1);
|
||||
@ -2776,6 +2777,27 @@ REPAIR TABLE t2 USE_FRM;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#57002 Assert in upgrade_shared_lock_to_exclusive()
|
||||
--echo # for ALTER TABLE + MERGE tables
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, m1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT) engine=myisam;
|
||||
CREATE TABLE m1(a INT) engine=merge UNION(t1);
|
||||
LOCK TABLES t1 READ, m1 WRITE;
|
||||
|
||||
# This caused an assert
|
||||
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
|
||||
ALTER TABLE t1 engine=myisam;
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE m1, t1;
|
||||
|
||||
|
||||
--echo End of 6.0 tests
|
||||
|
||||
--disable_result_log
|
||||
|
@ -23,10 +23,13 @@ drop database if exists client_test_db;
|
||||
# Bug #13783 mysqlcheck tries to optimize and analyze information_schema
|
||||
#
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --all-databases --analyze --optimize
|
||||
--exec $MYSQL_CHECK --all-databases --analyze
|
||||
--exec $MYSQL_CHECK --all-databases --optimize
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql
|
||||
--exec $MYSQL_CHECK --analyze --optimize information_schema schemata
|
||||
--exec $MYSQL_CHECK --analyze --databases test information_schema mysql
|
||||
--exec $MYSQL_CHECK --optimize --databases test information_schema mysql
|
||||
--exec $MYSQL_CHECK --analyze information_schema schemata
|
||||
--exec $MYSQL_CHECK --optimize information_schema schemata
|
||||
|
||||
#
|
||||
# Bug #16502: mysqlcheck tries to check views
|
||||
@ -34,9 +37,11 @@ drop database if exists client_test_db;
|
||||
create table t1 (a int);
|
||||
create view v1 as select * from t1;
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --analyze --optimize --databases test
|
||||
--exec $MYSQL_CHECK --analyze --databases test
|
||||
--exec $MYSQL_CHECK --optimize --databases test
|
||||
--replace_result 'Table is already up to date' OK
|
||||
--exec $MYSQL_CHECK --all-in-1 --analyze --optimize --databases test
|
||||
--exec $MYSQL_CHECK --all-in-1 --analyze --databases test
|
||||
--exec $MYSQL_CHECK --all-in-1 --optimize --databases test
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
@ -113,7 +118,8 @@ show tables;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm
|
||||
show tables;
|
||||
--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
|
||||
--exec $MYSQL_CHECK --check-upgrade --databases test
|
||||
--exec $MYSQL_CHECK --fix-table-names --databases test
|
||||
show tables;
|
||||
drop view v1, `v-1`;
|
||||
drop table t1;
|
||||
@ -212,3 +218,14 @@ show tables like 't1-1';
|
||||
drop table `t1-1`;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #35269: mysqlcheck behaves different depending on order of parameters
|
||||
--echo #
|
||||
|
||||
--error 13
|
||||
--exec $MYSQL_CHECK -a --fix-table-names test "#mysql50#t1-1"
|
||||
--error 1
|
||||
--exec $MYSQL_CHECK -aoc test "#mysql50#t1-1"
|
||||
|
||||
|
@ -331,7 +331,7 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
|
||||
--exec illegal_command
|
||||
--cat_file does_not_exist
|
||||
--perl
|
||||
exit(1);
|
||||
exit(2);
|
||||
EOF
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
2
mysql-test/t/plugin_auth_qa-master.opt
Normal file
2
mysql-test/t/plugin_auth_qa-master.opt
Normal file
@ -0,0 +1,2 @@
|
||||
$PLUGIN_AUTH_OPT
|
||||
$PLUGIN_AUTH_LOAD
|
338
mysql-test/t/plugin_auth_qa.test
Normal file
338
mysql-test/t/plugin_auth_qa.test
Normal file
@ -0,0 +1,338 @@
|
||||
# The numbers represent test cases of the test plan.
|
||||
|
||||
--source include/have_plugin_auth.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
CREATE DATABASE test_user_db;
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo ========== test 1.1 ======================================================
|
||||
# without '', without AS part
|
||||
CREATE USER plug IDENTIFIED WITH test_plugin_server;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
|
||||
DROP USER plug;
|
||||
# with '', without AS part
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
|
||||
DROP USER plug;
|
||||
# without '', AS part empty
|
||||
CREATE USER plug IDENTIFIED WITH test_plugin_server AS '';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS '';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
|
||||
DROP USER plug;
|
||||
# with '', AS part empty without ''
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ;
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS;
|
||||
# without '', AS part without ''
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH test_plugin_server AS plug_dest;
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS plug_dest;
|
||||
--echo ========== test 1.1 syntax errors ========================================
|
||||
# without auth_name
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH AS plug_dest;
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH AS plug_dest;
|
||||
# without auth_name and AS part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH;
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH;
|
||||
# without auth_name but AS part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED AS '';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED AS '';
|
||||
# with 2 auth_name parts
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug
|
||||
IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
|
||||
# with 2 AS parts
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' AS 'plug_dest';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug AS '' AS 'plug_dest';
|
||||
# with 2 complete WITH parts
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ''
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS ''
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
# with BY and WITH part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'
|
||||
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'
|
||||
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
# with WITH part and BY part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
USER plug_dest IDENTIFIED by 'plug_dest_pwd';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
USER plug_dest IDENTIFIED by 'plug_dest_pwd';
|
||||
# with WITH part and BY part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
plug_dest IDENTIFIED by 'plug_dest_pwd';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
plug_dest IDENTIFIED by 'plug_dest_pwd';
|
||||
# with WITH part and BY part
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
IDENTIFIED by 'plug_dest_pwd';
|
||||
--error ER_PARSE_ERROR
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
|
||||
IDENTIFIED by 'plug_dest_pwd';
|
||||
|
||||
--echo ========== test 1.1 combinations ==========================
|
||||
# CREATE...WITH/CREATE...BY
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--echo ========== test 1.1.1.6/1.1.2.5 ============================
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug, plug_dest;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_dest;
|
||||
# GRANT...WITH/CREATE...BY
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug, plug_dest;
|
||||
#
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_dest;
|
||||
# CREATE...WITH/GRANT...BY
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug, plug_dest;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_dest;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--error 1700
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--error 1700
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
|
||||
DROP USER plug;
|
||||
#
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--error ER_CANNOT_USER
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--error ER_CANNOT_USER
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
|
||||
DROP USER plug;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
#
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--error ER_CANNOT_USER
|
||||
CREATE USER plug IDENTIFIED BY 'plug_dest_passwd';
|
||||
DROP USER plug;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug,plug_dest;
|
||||
#
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug,plug_dest;
|
||||
#
|
||||
|
||||
--echo ========== test 1.1.1.1/1.1.2.1/1.1.1.5 ====================
|
||||
|
||||
SET NAMES utf8;
|
||||
#
|
||||
CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plüg;
|
||||
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plüg_dest;
|
||||
|
||||
SET NAMES ascii;
|
||||
#
|
||||
CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plüg';
|
||||
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plüg_dest';
|
||||
|
||||
SET NAMES latin1;
|
||||
#
|
||||
--echo ========== test 1.1.1.5 ====================================
|
||||
--error ER_PLUGIN_IS_NOT_LOADED
|
||||
CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
|
||||
CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plug';
|
||||
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plüg_dest';
|
||||
|
||||
SET NAMES utf8;
|
||||
#
|
||||
--error ER_PLUGIN_IS_NOT_LOADED
|
||||
CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
|
||||
CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plüg';
|
||||
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'plüg_dest';
|
||||
|
||||
CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plüg;
|
||||
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plüg_dest;
|
||||
|
||||
--echo ========== test 1.1.1.2/1.1.2.2=============================
|
||||
|
||||
SET @auth_name= 'test_plugin_server';
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH @auth_name AS 'plug_dest';
|
||||
|
||||
SET @auth_string= 'plug_dest';
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH test_plugin_server AS @auth_string;
|
||||
|
||||
--echo ========== test 1.1.1.3/1.1.2.3=============================
|
||||
|
||||
--error ER_PLUGIN_IS_NOT_LOADED
|
||||
CREATE USER plug IDENTIFIED WITH 'hh''s_test_plugin_server' AS 'plug_dest';
|
||||
|
||||
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug;
|
||||
CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER 'hh''s_plug_dest';
|
||||
|
||||
--echo ========== test 1.1.1.4 ====================================
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest';
|
||||
|
||||
--echo ========== test 1.1.3.1 ====================================
|
||||
|
||||
GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
CREATE USER plug_dest;
|
||||
DROP USER plug_dest;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER grant_user,plug_dest;
|
||||
#
|
||||
set @save_sql_mode= @@sql_mode;
|
||||
SET @@sql_mode=no_auto_create_user;
|
||||
GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
CREATE USER plug_dest;
|
||||
DROP USER plug_dest;
|
||||
--error ER_PASSWORD_NO_MATCH
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
|
||||
DROP USER grant_user;
|
||||
#
|
||||
GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_dest;
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
DROP USER grant_user,plug_dest;
|
||||
set @@sql_mode= @save_sql_mode;
|
||||
#
|
||||
DROP DATABASE test_user_db;
|
||||
--exit
|
||||
|
2
mysql-test/t/plugin_auth_qa_1-master.opt
Normal file
2
mysql-test/t/plugin_auth_qa_1-master.opt
Normal file
@ -0,0 +1,2 @@
|
||||
$PLUGIN_AUTH_OPT
|
||||
$PLUGIN_AUTH_LOAD
|
340
mysql-test/t/plugin_auth_qa_1.test
Normal file
340
mysql-test/t/plugin_auth_qa_1.test
Normal file
@ -0,0 +1,340 @@
|
||||
# The numbers represent test cases of the test plan.
|
||||
|
||||
--source include/have_plugin_auth.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
CREATE DATABASE test_user_db;
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
|
||||
--echo ========== test 1.1.3.2 ====================================
|
||||
|
||||
# CREATE...WITH/CREATE...BY/GRANT
|
||||
CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
REVOKE PROXY ON plug_dest FROM plug_user;
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
DROP USER plug_user,plug_dest;
|
||||
#
|
||||
# GRANT...WITH
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo 1)
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
--echo 2)
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
REVOKE PROXY ON plug_dest FROM plug_user;
|
||||
--echo 3)
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
DROP USER plug_user,plug_dest;
|
||||
#
|
||||
# GRANT...WITH/CREATE...BY
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--echo 1)
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--echo 2)
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
|
||||
REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
#REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_dest'
|
||||
# IDENTIFIED BY 'plug_dest_passwd';
|
||||
DROP USER plug_user,plug_dest;
|
||||
|
||||
--echo ========== test 1.2 ========================================
|
||||
|
||||
# GRANT...WITH/CREATE...BY
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
RENAME USER plug_dest TO new_dest;
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
GRANT PROXY ON new_dest TO plug_user;
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_user,new_dest;
|
||||
|
||||
# CREATE...WITH/CREATE...BY
|
||||
CREATE USER plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
RENAME USER plug_dest TO new_dest;
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
GRANT PROXY ON new_dest TO plug_user;
|
||||
--error 1
|
||||
--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_user,new_dest;
|
||||
# CREATE...WITH
|
||||
CREATE USER plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--echo connect(plug_user,localhost,plug_user,plug_dest);
|
||||
connect(plug_user,localhost,plug_user,plug_dest);
|
||||
select USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect plug_user;
|
||||
disconnect plug_user;
|
||||
RENAME USER plug_user TO new_user;
|
||||
--echo connect(plug_user,localhost,new_user,plug_dest);
|
||||
connect(plug_user,localhost,new_user,plug_dest);
|
||||
select USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo disconnect plug_user;
|
||||
disconnect plug_user;
|
||||
UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
|
||||
FLUSH PRIVILEGES;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
DROP USER plug_dest,plug_user;
|
||||
--echo ========== test 1.3 ========================================
|
||||
|
||||
#
|
||||
CREATE USER plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
--echo connect(plug_user,localhost,plug_user,plug_dest);
|
||||
connect(plug_user,localhost,plug_user,plug_dest);
|
||||
select USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect plug_user;
|
||||
disconnect plug_user;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
UPDATE mysql.user SET user='new_user' WHERE user='plug_user';
|
||||
FLUSH PRIVILEGES;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user';
|
||||
FLUSH PRIVILEGES;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
|
||||
FLUSH PRIVILEGES;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo connect(plug_user,localhost,new_user,new_dest);
|
||||
--disable_query_log
|
||||
--error ER_PLUGIN_IS_NOT_LOADED
|
||||
connect(plug_user,localhost,new_user,new_dest);
|
||||
--enable_query_log
|
||||
UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
|
||||
UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
|
||||
FLUSH PRIVILEGES;
|
||||
GRANT PROXY ON new_dest TO new_user;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo connect(plug_user,localhost,new_user,new_dest);
|
||||
connect(plug_user,localhost,new_user,new_dest);
|
||||
select USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect plug_user;
|
||||
disconnect plug_user;
|
||||
UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest';
|
||||
FLUSH PRIVILEGES;
|
||||
CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
GRANT ALL PRIVILEGES ON test.* TO new_user;
|
||||
--echo connect(plug_user,localhost,new_dest,new_dest_passwd);
|
||||
connect(plug_user,localhost,new_dest,new_dest_passwd);
|
||||
select USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect plug_user;
|
||||
disconnect plug_user;
|
||||
DROP USER new_user,new_dest,plug_dest;
|
||||
|
||||
--echo ========== test 2, 2.1, 2.2 ================================
|
||||
|
||||
CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
|
||||
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
--echo ========== test 2.2.1 ======================================
|
||||
SELECT @@proxy_user;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
--echo connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
--disable_query_log
|
||||
--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
|
||||
connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
--enable_query_log
|
||||
GRANT PROXY ON proxied_user TO ''@'';
|
||||
--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
--echo connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
--echo ========== test 2.2.1 ======================================
|
||||
SELECT @@proxy_user;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
DROP USER ''@'',proxied_user;
|
||||
#
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO ''@''
|
||||
IDENTIFIED WITH test_plugin_server AS 'proxied_user';
|
||||
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
--echo connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
--disable_query_log
|
||||
--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
|
||||
connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
--enable_query_log
|
||||
GRANT PROXY ON proxied_user TO ''@'';
|
||||
--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
--echo connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
connect(proxy_con,localhost,proxy_user,proxied_user);
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con;
|
||||
disconnect proxy_con;
|
||||
DROP USER ''@'',proxied_user;
|
||||
#
|
||||
CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
|
||||
CREATE USER proxied_user_1 IDENTIFIED BY 'proxied_user_1_pwd';
|
||||
CREATE USER proxied_user_2 IDENTIFIED BY 'proxied_user_2_pwd';
|
||||
CREATE USER proxied_user_3 IDENTIFIED BY 'proxied_user_3_pwd';
|
||||
CREATE USER proxied_user_4 IDENTIFIED BY 'proxied_user_4_pwd';
|
||||
CREATE USER proxied_user_5 IDENTIFIED BY 'proxied_user_5_pwd';
|
||||
GRANT PROXY ON proxied_user_1 TO ''@'';
|
||||
GRANT PROXY ON proxied_user_2 TO ''@'';
|
||||
GRANT PROXY ON proxied_user_3 TO ''@'';
|
||||
GRANT PROXY ON proxied_user_4 TO ''@'';
|
||||
GRANT PROXY ON proxied_user_5 TO ''@'';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
--echo connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
|
||||
connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
|
||||
--echo connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
|
||||
connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
|
||||
--echo connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
|
||||
connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
|
||||
--echo connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
|
||||
connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
|
||||
--echo connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
|
||||
connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
|
||||
--echo connection proxy_con_1;
|
||||
connection proxy_con_1;
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection proxy_con_2;
|
||||
connection proxy_con_2;
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection proxy_con_3;
|
||||
connection proxy_con_3;
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection proxy_con_4;
|
||||
connection proxy_con_4;
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection proxy_con_5;
|
||||
connection proxy_con_5;
|
||||
SELECT USER(),CURRENT_USER();
|
||||
SELECT @@proxy_user;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
--echo disconnect proxy_con_1;
|
||||
disconnect proxy_con_1;
|
||||
--echo disconnect proxy_con_2;
|
||||
disconnect proxy_con_2;
|
||||
--echo disconnect proxy_con_3;
|
||||
disconnect proxy_con_3;
|
||||
--echo disconnect proxy_con_4;
|
||||
disconnect proxy_con_4;
|
||||
--echo disconnect proxy_con_5;
|
||||
disconnect proxy_con_5;
|
||||
DROP USER ''@'',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5;
|
||||
|
||||
--echo ========== test 3 ==========================================
|
||||
|
||||
GRANT ALL PRIVILEGES ON *.* TO plug_user
|
||||
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
|
||||
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||
GRANT PROXY ON plug_dest TO plug_user;
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
# Not working with the patch.
|
||||
|
||||
#--replace_result $MYSQLADMIN MYSQLADMIN $MASTER_MYPORT MYPORT $MASTER_MYSOCK MYSOCK
|
||||
#--exec $MYSQLADMIN $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -S $MASTER_MYSOCK -u plug_user --password=plug_dest ping 2>&1
|
||||
#--replace_result $MYSQL_CHECK MYSQL_CHECK $MASTER_MYPORT MYPORT
|
||||
#--exec $MYSQL_CHECK $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u plug_user --password=plug_dest test
|
||||
#--replace_result $MYSQL_DUMP MYSQL_DUMP $MASTER_MYPORT MYPORT
|
||||
#--exec $MYSQL_DUMP -h localhost -P $MASTER_MYPORT $PLUGIN_AUTH_OPT -u plug_user --password=plug_dest test
|
||||
#--replace_result $MYSQL_SHOW MYSQL_SHOW $MASTER_MYPORT MYPORT
|
||||
#--exec $MYSQL_SHOW $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --plugin_dir=../plugin/auth -u plug_user --password=plug_dest 2>&1
|
||||
DROP USER plug_user, plug_dest;
|
||||
DROP DATABASE test_user_db;
|
||||
--exit
|
2
mysql-test/t/plugin_auth_qa_2-master.opt
Normal file
2
mysql-test/t/plugin_auth_qa_2-master.opt
Normal file
@ -0,0 +1,2 @@
|
||||
$PLUGIN_AUTH_OPT
|
||||
$PLUGIN_AUTH_INTERFACE
|
153
mysql-test/t/plugin_auth_qa_2.test
Normal file
153
mysql-test/t/plugin_auth_qa_2.test
Normal file
@ -0,0 +1,153 @@
|
||||
# Horst Hunger
|
||||
# Created: 2010-10-06
|
||||
#
|
||||
# Test of the authentification interface. The plugin checks the expected values set
|
||||
# by this application and the application checks the values set the the plugin.
|
||||
--source include/have_plugin_interface.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
CREATE DATABASE test_user_db;
|
||||
|
||||
--echo ========== test 1.1.3.2 ====================================
|
||||
--echo === check contens of components of info ====================
|
||||
|
||||
CREATE USER qa_test_1_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_1_dest';
|
||||
CREATE USER qa_test_1_dest IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
SELECT @@proxy_user;
|
||||
SELECT @@external_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
|
||||
DROP USER qa_test_1_user;
|
||||
DROP USER qa_test_1_dest;
|
||||
|
||||
--echo === Assign values to components of info ====================
|
||||
|
||||
CREATE USER qa_test_2_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_2_dest';
|
||||
CREATE USER qa_test_2_dest IDENTIFIED BY 'dest_passwd';
|
||||
CREATE USER authenticated_as IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_2_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_2_dest TO qa_test_2_user;
|
||||
GRANT PROXY ON authenticated_as TO qa_test_2_user;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
SELECT @@proxy_user;
|
||||
SELECT @@external_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
|
||||
|
||||
DROP USER qa_test_2_user;
|
||||
DROP USER qa_test_2_dest;
|
||||
DROP USER authenticated_as;
|
||||
|
||||
--echo === Assign too high values for *length, which should have no effect ====
|
||||
|
||||
CREATE USER qa_test_3_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_3_dest';
|
||||
CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_3_dest TO qa_test_3_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_3_user;
|
||||
DROP USER qa_test_3_dest;
|
||||
|
||||
--echo === Assign too low values for *length, which should have no effect ====
|
||||
|
||||
CREATE USER qa_test_4_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_4_dest';
|
||||
CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_4_dest TO qa_test_4_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_4_user;
|
||||
DROP USER qa_test_4_dest;
|
||||
|
||||
--echo === Assign empty string especially to authenticated_as (in plugin) ====
|
||||
|
||||
CREATE USER qa_test_5_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_5_dest';
|
||||
CREATE USER qa_test_5_dest IDENTIFIED BY 'dest_passwd';
|
||||
CREATE USER ''@'localhost' IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_5_dest identified by 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'localhost' identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_5_dest TO qa_test_5_user;
|
||||
GRANT PROXY ON qa_test_5_dest TO ''@'localhost';
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_5_user;
|
||||
DROP USER qa_test_5_dest;
|
||||
DROP USER ''@'localhost';
|
||||
|
||||
--echo === Assign 'root' especially to authenticated_as (in plugin) ====
|
||||
|
||||
CREATE USER qa_test_6_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
|
||||
CREATE USER qa_test_6_dest IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_6_dest TO qa_test_6_user;
|
||||
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
REVOKE PROXY ON qa_test_6_dest FROM root;
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string FROM mysql.user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_6_user;
|
||||
DROP USER qa_test_6_dest;
|
||||
DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface';
|
||||
--sorted_result
|
||||
SELECT user,plugin,authentication_string,password FROM mysql.user;
|
||||
|
||||
|
||||
--echo === Test of the --default_auth option for clients ====
|
||||
|
||||
CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest';
|
||||
CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_11_user, qa_test_11_dest;
|
||||
DROP DATABASE test_user_db;
|
||||
|
||||
--exit
|
2
mysql-test/t/plugin_auth_qa_3-master.opt
Normal file
2
mysql-test/t/plugin_auth_qa_3-master.opt
Normal file
@ -0,0 +1,2 @@
|
||||
$PLUGIN_AUTH_OPT
|
||||
$PLUGIN_AUTH_SERVER
|
25
mysql-test/t/plugin_auth_qa_3.test
Normal file
25
mysql-test/t/plugin_auth_qa_3.test
Normal file
@ -0,0 +1,25 @@
|
||||
# Horst Hunger
|
||||
# Created: 2010-10-06
|
||||
#
|
||||
# Test of the authentification interface. The plugin checks the expected values set
|
||||
# by this application and the application checks the values set the the plugin.
|
||||
--source include/have_plugin_server.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
CREATE DATABASE test_user_db;
|
||||
|
||||
CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest';
|
||||
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
|
||||
GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
--error 1
|
||||
--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
|
||||
|
||||
DROP USER qa_test_11_user, qa_test_11_dest;
|
||||
DROP DATABASE test_user_db;
|
||||
|
||||
--exit
|
3
mysql-test/t/plugin_load_option-master.opt
Normal file
3
mysql-test/t/plugin_load_option-master.opt
Normal file
@ -0,0 +1,3 @@
|
||||
$EXAMPLE_PLUGIN_OPT
|
||||
$EXAMPLE_PLUGIN_LOAD
|
||||
--loose-plugin-example=FORCE_PLUS_PERMANENT
|
8
mysql-test/t/plugin_load_option.test
Normal file
8
mysql-test/t/plugin_load_option.test
Normal file
@ -0,0 +1,8 @@
|
||||
--source include/not_windows_embedded.inc
|
||||
--source include/have_example_plugin.inc
|
||||
|
||||
--error ER_PLUGIN_IS_PERMANENT
|
||||
UNINSTALL PLUGIN example;
|
||||
|
||||
SELECT PLUGIN_NAME, PLUGIN_STATUS, LOAD_OPTION FROM INFORMATION_SCHEMA.PLUGINS
|
||||
WHERE PLUGIN_NAME IN ('MyISAM', 'EXAMPLE');
|
@ -1,6 +1,6 @@
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_query_cache.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
#
|
||||
# Bug #30887 Server crashes on SET GLOBAL query_cache_size=0
|
||||
@ -18,12 +18,11 @@ connect (bug30887con2, localhost, root, ,test);
|
||||
|
||||
connection bug30887con1;
|
||||
--echo Activate debug hook and attempt to retrieve the statement from the cache.
|
||||
set session debug='+d,wait_in_query_cache_insert';
|
||||
set debug_sync="wait_in_query_cache_insert SIGNAL parked WAIT_FOR go";
|
||||
--send select SQL_CACHE * from t1;
|
||||
|
||||
connection default;
|
||||
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'wait_in_query_cache_insert';
|
||||
--source include/wait_condition.inc
|
||||
set debug_sync="now WAIT_FOR parked";
|
||||
|
||||
connection bug30887con2;
|
||||
--echo On a second connection; clear the query cache.
|
||||
@ -32,14 +31,18 @@ set global query_cache_size= 0;
|
||||
|
||||
connection default;
|
||||
--echo Signal the debug hook to release the lock.
|
||||
select id from information_schema.processlist where state='wait_in_query_cache_insert' into @thread_id;
|
||||
kill query @thread_id;
|
||||
set debug_sync="now SIGNAL go";
|
||||
|
||||
--echo Show query cache status.
|
||||
show status like 'Qcache_queries_in_cache';
|
||||
|
||||
connection bug30887con1;
|
||||
--reap
|
||||
|
||||
disconnect bug30887con1;
|
||||
disconnect bug30887con2;
|
||||
connection default;
|
||||
set debug_sync= 'RESET';
|
||||
set global query_cache_size= 0;
|
||||
use test;
|
||||
drop table t1;
|
||||
@ -67,18 +70,14 @@ connect(con2,localhost,root,,test,,);
|
||||
|
||||
connection con1;
|
||||
--echo # Switch to connection con1
|
||||
SET SESSION debug='+d,wait_after_query_cache_invalidate';
|
||||
SET DEBUG_SYNC = "wait_after_query_cache_invalidate SIGNAL parked WAIT_FOR go";
|
||||
--echo # Send concurrent insert, will wait in the query cache table invalidate
|
||||
--send INSERT INTO t1 VALUES (4)
|
||||
|
||||
connection default;
|
||||
--echo # Switch to connection default
|
||||
--echo # Wait for concurrent insert to reach the debug point
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE STATE = "wait_after_query_cache_invalidate" AND
|
||||
INFO = "INSERT INTO t1 VALUES (4)";
|
||||
--source include/wait_condition.inc
|
||||
SET DEBUG_SYNC = "now WAIT_FOR parked";
|
||||
|
||||
connection con2;
|
||||
--echo # Switch to connection con2
|
||||
@ -88,9 +87,7 @@ SELECT * FROM t1;
|
||||
connection default;
|
||||
--echo # Switch to connection default
|
||||
--echo # Notify the concurrent insert to proceed
|
||||
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE STATE = 'wait_after_query_cache_invalidate' INTO @thread_id;
|
||||
KILL QUERY @thread_id;
|
||||
SET DEBUG_SYNC = "now SIGNAL go";
|
||||
|
||||
connection con1;
|
||||
--echo # Switch to connection con1
|
||||
@ -107,6 +104,7 @@ disconnect con2;
|
||||
|
||||
connection default;
|
||||
--echo # Restore defaults
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
RESET QUERY CACHE;
|
||||
DROP TABLE t1,t2;
|
||||
SET GLOBAL concurrent_insert= DEFAULT;
|
||||
@ -157,15 +155,14 @@ SELECT SQL_CACHE * FROM t1;
|
||||
--echo ** before the mutex lock in invalidate_table_internal.
|
||||
--echo ** This will allow new result sets to be written into the QC.
|
||||
--echo **
|
||||
SET SESSION debug='+d,wait_in_query_cache_invalidate1';
|
||||
SET SESSION debug='+d,wait_in_query_cache_invalidate2';
|
||||
SET DEBUG_SYNC="wait_in_query_cache_invalidate1 SIGNAL parked1_1 WAIT_FOR go1_1";
|
||||
SET DEBUG_SYNC="wait_in_query_cache_invalidate2 SIGNAL parked1_2 WAIT_FOR go1_2";
|
||||
--send DELETE FROM t1 WHERE a like '%a%';
|
||||
|
||||
connection default;
|
||||
--echo =================================== Connection default
|
||||
--echo ** Assert that the expect process status is obtained.
|
||||
LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.processlist WHERE state= 'wait_in_query_cache_invalidate1';
|
||||
--source include/wait_condition.inc
|
||||
SET DEBUG_SYNC="now WAIT_FOR parked1_1";
|
||||
-- echo **
|
||||
|
||||
connection thd2;
|
||||
@ -173,32 +170,36 @@ connection thd2;
|
||||
--echo ** On THD2: Insert a result into the cache. This attempt will be blocked
|
||||
--echo ** because of a debug hook placed just before the mutex lock after which
|
||||
--echo ** the first part of the result set is written.
|
||||
SET SESSION debug='+d,wait_in_query_cache_insert';
|
||||
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1";
|
||||
--send SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3
|
||||
|
||||
connection default;
|
||||
--echo =================================== Connection default
|
||||
--echo ** Assert that the SELECT-stmt thread reaches the sync point.
|
||||
SET DEBUG_SYNC="now WAIT_FOR parked2";
|
||||
--echo **
|
||||
--echo **
|
||||
|
||||
connection thd3;
|
||||
--echo =================================== Connection thd3
|
||||
--echo ** On THD3: Insert another result into the cache and block on the same
|
||||
--echo ** debug hook.
|
||||
SET SESSION debug='+d,wait_in_query_cache_insert';
|
||||
--send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
|
||||
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
|
||||
--send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5
|
||||
|
||||
connection default;
|
||||
--echo =================================== Connection default
|
||||
--echo ** Assert that the two SELECT-stmt threads to reach the hook.
|
||||
LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 2 FROM information_schema.processlist WHERE state='wait_in_query_cache_insert';
|
||||
--source include/wait_condition.inc
|
||||
--echo ** Assert that the SELECT-stmt thread reaches the sync point.
|
||||
SET DEBUG_SYNC="now WAIT_FOR parked3";
|
||||
--echo **
|
||||
--echo **
|
||||
|
||||
--echo ** Signal the DELETE thread, THD1, to continue. It will enter the mutex
|
||||
--echo ** lock and set query cache status to TABLE_FLUSH_IN_PROGRESS and then
|
||||
--echo ** unlock the mutex before stopping on the next debug hook.
|
||||
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate1' LIMIT 1 INTO @flush_thread_id;
|
||||
KILL QUERY @flush_thread_id;
|
||||
SET DEBUG_SYNC="now SIGNAL go1_1";
|
||||
--echo ** Assert that we reach the next debug hook.
|
||||
LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate2';
|
||||
--source include/wait_condition.inc
|
||||
SET DEBUG_SYNC="now WAIT_FOR parked1_2";
|
||||
|
||||
--echo **
|
||||
--echo ** Signal the remaining debug hooks blocking THD2 and THD3.
|
||||
@ -206,10 +207,8 @@ LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.pro
|
||||
--echo ** and finally release the mutex. The threads will continue to wait
|
||||
--echo ** until a broadcast signal reaches them causing both threads to
|
||||
--echo ** come alive and check the condition.
|
||||
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id ASC LIMIT 1 INTO @thread_id;
|
||||
KILL QUERY @thread_id;
|
||||
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id DESC LIMIT 1 INTO @thread_id;
|
||||
KILL QUERY @thread_id;
|
||||
SET DEBUG_SYNC="now SIGNAL go2";
|
||||
SET DEBUG_SYNC="now SIGNAL go3";
|
||||
|
||||
--echo **
|
||||
--echo ** Finally signal the DELETE statement on THD1 one last time.
|
||||
@ -218,11 +217,7 @@ KILL QUERY @thread_id;
|
||||
--echo ** One signal will be sent to the thread group waiting for executing
|
||||
--echo ** invalidations and a broadcast signal will be sent to the thread
|
||||
--echo ** group holding result set writers.
|
||||
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate2' LIMIT 1 INTO @flush_thread_id;
|
||||
KILL QUERY @flush_thread_id;
|
||||
|
||||
LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE Id = @flush_thread_id AND Command = 'Sleep';
|
||||
--source include/wait_condition.inc
|
||||
SET DEBUG_SYNC="now SIGNAL go1_2";
|
||||
|
||||
--echo **
|
||||
--echo *************************************************************************
|
||||
@ -250,6 +245,7 @@ connection default;
|
||||
disconnect thd1;
|
||||
disconnect thd2;
|
||||
disconnect thd3;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
SET GLOBAL query_cache_size= 0;
|
||||
|
||||
connection default;
|
||||
@ -259,4 +255,66 @@ FLUSH STATUS;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
SET GLOBAL query_cache_size= DEFAULT;
|
||||
SET GLOBAL query_cache_type= DEFAULT;
|
||||
exit;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#56822: Add a thread state for sessions waiting on the query cache lock
|
||||
--echo #
|
||||
|
||||
SET @old_query_cache_size= @@GLOBAL.query_cache_size;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
|
||||
SET GLOBAL concurrent_insert= 1;
|
||||
SET GLOBAL query_cache_size= 1024*512;
|
||||
SET GLOBAL query_cache_type= ON;
|
||||
|
||||
connect(con1,localhost,root,,test,,);
|
||||
connect(con2,localhost,root,,test,,);
|
||||
|
||||
connection con1;
|
||||
--echo # Switch to connection con1
|
||||
SET DEBUG_SYNC = "wait_in_query_cache_invalidate2 SIGNAL parked WAIT_FOR go";
|
||||
--echo # Send INSERT, will wait in the query cache table invalidation
|
||||
--send INSERT INTO t1 VALUES (4);
|
||||
|
||||
connection default;
|
||||
--echo # Switch to connection default
|
||||
--echo # Wait for insert to reach the debug point
|
||||
SET DEBUG_SYNC = "now WAIT_FOR parked";
|
||||
|
||||
connection con2;
|
||||
--echo # Switch to connection con2
|
||||
--echo # Send a query that should wait on the query cache lock
|
||||
--send RESET QUERY CACHE
|
||||
|
||||
connection default;
|
||||
--echo # Switch to connection default
|
||||
--echo # Wait for the state to be reflected in the processlist
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
||||
WHERE state = "Waiting for query cache lock" AND info = "RESET QUERY CACHE";
|
||||
--source include/wait_condition.inc
|
||||
--echo # Signal that the query cache can be unlocked
|
||||
SET DEBUG_SYNC="now SIGNAL go";
|
||||
|
||||
connection con1;
|
||||
--echo # Reap con1 and disconnect
|
||||
--reap
|
||||
disconnect con1;
|
||||
|
||||
connection con2;
|
||||
--echo # Reap con2 and disconnect
|
||||
--reap
|
||||
disconnect con2;
|
||||
|
||||
connection default;
|
||||
--echo # Restore defaults
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
RESET QUERY CACHE;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL query_cache_size= DEFAULT;
|
||||
SET GLOBAL query_cache_type= DEFAULT;
|
||||
|
@ -4147,3 +4147,22 @@ DROP VIEW view_t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of test BUG#54515
|
||||
|
||||
--echo #
|
||||
--echo # Bug #57203 Assertion `field_length <= 255' failed.
|
||||
--echo #
|
||||
|
||||
SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
|
||||
UNION ALL
|
||||
SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
|
||||
AS foo
|
||||
;
|
||||
|
||||
CREATE table t1(a text);
|
||||
INSERT INTO t1 VALUES (''), ('');
|
||||
SELECT avg(distinct(t1.a)) FROM t1, t1 t2
|
||||
GROUP BY t2.a ORDER BY t1.a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of test BUG#57203
|
||||
|
@ -2719,10 +2719,6 @@ DROP PROCEDURE p1;
|
||||
--echo # Bug#5889: Exit handler for a warning doesn't hide the warning in trigger
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo # - Case 1
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1, 2);
|
||||
|
||||
@ -2747,36 +2743,6 @@ SELECT * FROM t1;
|
||||
DROP TRIGGER t1_bu;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # - Case 2
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(b CHAR(1));
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES('ab'); # Produces a warning.
|
||||
|
||||
INSERT INTO t2 VALUES('b'); # Does not produce a warning,
|
||||
# previous warning should be cleared.
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
INSERT INTO t1 VALUES(0);
|
||||
|
||||
SHOW WARNINGS;
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TRIGGER t1_bi;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#9857: Stored procedures: handler for sqlwarning ignored
|
||||
--echo #
|
||||
@ -2813,3 +2779,83 @@ SHOW WARNINGS;
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
SET sql_mode = @sql_mode_saved;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55850: Trigger warnings not cleared.
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT,
|
||||
d SMALLINT, e SMALLINT, f SMALLINT);
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999);
|
||||
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999);
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
# What happened before the patch was:
|
||||
# - INSERT INTO t1 added 3 warnings about overflow in 'x', 'y' and 'z' columns;
|
||||
# - t1_bi run and added 3 warnings about overflow in 'a', 'b' and 'c' columns;
|
||||
# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
|
||||
# => we had 9 warnings.
|
||||
#
|
||||
# Now what happens is:
|
||||
# - INSERT INTO t1 adds 3 warnings about overflow in 'x', 'y' and 'z' columns;
|
||||
# - t1_bi adds 3 warnings about overflow in 'a', 'b' and 'c' columns;
|
||||
# - The warnings added by triggers are cleared;
|
||||
# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
|
||||
# - The warnings added by triggers are cleared;
|
||||
# => we have 3 warnings.
|
||||
|
||||
--echo
|
||||
CALL p1();
|
||||
|
||||
--echo
|
||||
SHOW WARNINGS;
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo # ----------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL);
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES(
|
||||
CAST('111111 ' AS SIGNED),
|
||||
CAST('222222 ' AS SIGNED),
|
||||
NULL);
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
--echo
|
||||
--error ER_BAD_NULL_ERROR
|
||||
CALL p1();
|
||||
|
||||
--echo
|
||||
SHOW WARNINGS;
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
|
@ -82,7 +82,7 @@ select * from db1_secret.t1;
|
||||
# ...and not this
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
create procedure db1_secret.dummy() begin end;
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure db1_secret.dummy;
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure db1_secret.stamp;
|
||||
@ -106,7 +106,7 @@ select * from db1_secret.t1;
|
||||
# ...and not this
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
create procedure db1_secret.dummy() begin end;
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure db1_secret.dummy;
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure db1_secret.stamp;
|
||||
@ -926,6 +926,39 @@ DROP DATABASE B48872;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test for bug#57061 "User without privilege on routine can discover
|
||||
--echo # its existence."
|
||||
--echo #
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest_db;
|
||||
--enable_warnings
|
||||
create database mysqltest_db;
|
||||
--echo # Create user with no privileges on mysqltest_db database.
|
||||
create user bug57061_user@localhost;
|
||||
create function mysqltest_db.f1() returns int return 0;
|
||||
create procedure mysqltest_db.p1() begin end;
|
||||
--echo # Connect as user 'bug57061_user@localhost'
|
||||
connect (conn1, localhost, bug57061_user,,);
|
||||
--echo # Attempt to drop routine on which user doesn't have privileges
|
||||
--echo # should result in the same 'access denied' type of error whether
|
||||
--echo # routine exists or not.
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop function if exists mysqltest_db.f_does_not_exist;
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure if exists mysqltest_db.p_does_not_exist;
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop function if exists mysqltest_db.f1;
|
||||
--error ER_PROCACCESS_DENIED_ERROR
|
||||
drop procedure if exists mysqltest_db.p1;
|
||||
--echo # Connection 'default'.
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
drop user bug57061_user@localhost;
|
||||
drop database mysqltest_db;
|
||||
|
||||
|
||||
# Wait till all disconnects are completed
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
|
@ -636,6 +636,30 @@ UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
|
||||
DROP TABLE t1_aux, t1_not_null|
|
||||
DROP FUNCTION f1_two_inserts|
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS p1|
|
||||
DROP TABLE IF EXISTS t1|
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=INNODB|
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
TRUNCATE TABLE t1;
|
||||
END|
|
||||
|
||||
LOCK TABLES t1 WRITE|
|
||||
CALL p1()|
|
||||
FLUSH TABLES;
|
||||
UNLOCK TABLES|
|
||||
CALL p1()|
|
||||
|
||||
DROP PROCEDURE p1|
|
||||
DROP TABLE t1|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
|
@ -148,10 +148,15 @@ CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
|
||||
SET @a = 0;
|
||||
SET @b = 0;
|
||||
|
||||
--error ER_TRUNCATE_ILLEGAL_FK
|
||||
TRUNCATE t1;
|
||||
|
||||
SELECT @a, @b;
|
||||
|
||||
DELETE FROM t1;
|
||||
|
||||
SELECT @a, @b;
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
DELETE FROM t1;
|
||||
|
@ -484,6 +484,16 @@ explain select * from t2 where f1=STR_TO_DATE('4/1/2010', '%m/%d/%Y');
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#57095: Wrongly chosen expression cache type led to a wrong
|
||||
--echo # result.
|
||||
--echo #
|
||||
CREATE TABLE t1 (`b` datetime );
|
||||
INSERT INTO t1 VALUES ('2010-01-01 00:00:00'), ('2010-01-01 00:00:00');
|
||||
SELECT * FROM t1 WHERE b <= coalesce(NULL, now());
|
||||
DROP TABLE t1;
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
@ -53,7 +53,7 @@ while (!`select @aborted_clients`)
|
||||
dec $retries;
|
||||
if (!$retries)
|
||||
{
|
||||
Failed to detect that client has been aborted;
|
||||
die Failed to detect that client has been aborted;
|
||||
}
|
||||
}
|
||||
--enable_query_log
|
||||
@ -108,7 +108,7 @@ while (!`select @aborted_clients`)
|
||||
dec $retries;
|
||||
if (!$retries)
|
||||
{
|
||||
Failed to detect that client has been aborted;
|
||||
die Failed to detect that client has been aborted;
|
||||
}
|
||||
}
|
||||
--enable_query_log
|
||||
|
Reference in New Issue
Block a user