Commit 449bfbd7 authored by Matthias Leich's avatar Matthias Leich

Merge 5.0 -> 5.1

+ fix wrong resultfile have_outfile.require
parents 690dc721 7da691c9
# include/count_sessions.inc
#
# SUMMARY
#
# Stores the number of current sessions in $count_sessions.
#
#
# USAGE
#
# Please look into include/wait_until_count_sessions.inc
# for examples of typical usage.
#
#
# EXAMPLE
# backup.test, grant3.test
#
#
# Created: 2009-01-14 mleich
#
let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
# include/wait_until_count_sessions.inc
#
# SUMMARY
#
# Waits until the passed number ($count_sessions) of concurrent sessions was
# observed via
# SHOW STATUS LIKE 'Threads_connected'
# or the operation times out.
# Note: Starting with 5.1 we could also use
# SELECT COUNT(*) FROM information_schema.processlist
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
# runs in all versions 5.0+
#
#
# USAGE
#
# let $count_sessions= 3;
# --source include/wait_until_count_sessions.inc
#
# OR typical example of a test which uses more than one session
# Such a test could harm successing tests if there is no server shutdown
# and start between.cw
#
# If the testing box is slow than the disconnect of sessions belonging to
# the current test might happen when the successing test gets executed.
# This means the successing test might see activities like unexpected
# rows within the general log or the PROCESSLIST.
# Example from bug http://bugs.mysql.com/bug.php?id=40377
# --- bzr_mysql-6.0-rpl/.../r/log_state.result
# +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
# @@ -25,6 +25,7 @@
# event_time user_host ... command_type argument
# TIMESTAMP USER_HOST ... Query create table t1(f1 int)
# TIMESTAMP USER_HOST ... Query select * from mysql.general_log
# +TIMESTAMP USER_HOST ... Quit
# ....
#
# What to do?
# -----------
# <start of test>
# # Determine initial number of connections (set $count_sessions)
# --source include/count_sessions.inc
# ...
# connect (con1,.....)
# ...
# connection default;
# ...
# disconnect con1;
# ...
# # Wait until we have reached the initial number of connections
# # or more than the sleep time above (10 seconds) has passed.
# # $count_sessions
# --source include/wait_until_count_sessions.inc
# <end of test>
#
# Important note about tests with unfortunate (= not cooperative
# to successing tests) architecture:
# connection con1;
# send SELECT ..., sleep(10)
# connection default;
# ...
# disconnect con1;
# <end of test>
# should be fixed by
# connection con1;
# send SELECT ..., sleep(10)
# connection default;
# ...
# connect con1;
# reap;
# connection default;
# disconnect con1;
# <end of test>
# and not only by appending include/wait_until_count_sessions.inc etc.
#
#
# EXAMPLE
#
# backup.test, grant3.test
#
#
# Created: 2009-01-14 mleich
#
let $wait_counter= 50;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
while ($wait_counter)
{
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
let $success= `SELECT $current_sessions = $count_sessions`;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
--echo # Timeout in wait_until_count_sessions.inc
--echo # Number of sessions expected: $count_sessions found: $current_sessions
}
...@@ -367,20 +367,20 @@ drop database TESTDB; ...@@ -367,20 +367,20 @@ drop database TESTDB;
flush privileges; flush privileges;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost; GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
grant execute on * to `a@`@localhost; GRANT EXECUTE ON * TO `a@`@localhost;
create table t2 (s1 int); CREATE TABLE t2 (s1 INT);
insert into t2 values (1); INSERT INTO t2 VALUES (1);
drop function if exists f2; DROP FUNCTION IF EXISTS f2;
create function f2 () returns int CREATE FUNCTION f2 () RETURNS INT
begin declare v int; select s1 from t2 into v; return v; end// BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
select f2(); SELECT f2();
f2() f2()
1 1
drop function f2; DROP FUNCTION f2;
drop table t2; DROP TABLE t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost; DROP USER `a@`@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database if exists mysqltest_1; drop database if exists mysqltest_1;
drop database if exists mysqltest_2; drop database if exists mysqltest_2;
...@@ -438,6 +438,7 @@ SELECT * FROM t2; ...@@ -438,6 +438,7 @@ SELECT * FROM t2;
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2' ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
SELECT * FROM t1 JOIN t2 USING (b); SELECT * FROM t1 JOIN t2 USING (b);
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2' ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
USE test;
DROP TABLE db1.t1, db1.t2; DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost; DROP USER mysqltest1@localhost;
DROP DATABASE db1; DROP DATABASE db1;
......
load_file(concat(@tmpdir,"/outfile.test")) load_file(concat(@tmpdir,'/outfile.test'))
Outfile OK Outfile OK
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1(a int) engine=innodb; CREATE TABLE t1(a INT) ENGINE=innodb;
lock tables t1 write; LOCK TABLES t1 WRITE;
insert into t1 values(10); INSERT INTO t1 VALUES(10);
select * from t1; SELECT * FROM t1;
a a
10 10
drop table t1; DROP TABLE t1;
This diff is collapsed.
This diff is collapsed.
# Can't run with embedded server # Can't run with embedded server because we use GRANT
-- source include/not_embedded.inc -- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# Test of GRANT commands # Test of GRANT commands
SET NAMES binary; SET NAMES binary;
...@@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost; ...@@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_1@localhost with grant option; grant select on `my\_1`.* to mysqltest_1@localhost with grant option;
connect (user_a,localhost,mysqltest_1,,); connect (user_a,localhost,mysqltest_1,,);
connection user_a; connection user_a;
--error 1410 --error ER_CANT_CREATE_USER_WITH_GRANT
grant select on `my\_1`.* to mysqltest_2@localhost; grant select on `my\_1`.* to mysqltest_2@localhost;
create user mysqltest_2@localhost; create user mysqltest_2@localhost;
disconnect user_a; disconnect user_a;
disconnect master;
connection default; connection default;
delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.user where user like 'mysqltest\_%';
...@@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%'; ...@@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges; flush privileges;
# #
# Bug: #19828 Case sensitivity in Grant/Revoke # Bug#19828 Case sensitivity in Grant/Revoke
# #
grant select on test.* to CUser@localhost; grant select on test.* to CUser@localhost;
...@@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST; ...@@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST;
# #
# Bug#31194: Privilege ordering does not order properly for wildcard values # Bug#31194 Privilege ordering does not order properly for wildcard values
# #
CREATE DATABASE mysqltest_1; CREATE DATABASE mysqltest_1;
...@@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1; ...@@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1;
--echo End of 5.0 tests --echo End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
# This is a test for bug 578 # Test for Bug#578 mysqlimport -l silently fails when binlog-ignore-db is set
-- source include/have_innodb.inc --source include/have_innodb.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
connection con1; connection con1;
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1(a int) engine=innodb; CREATE TABLE t1(a INT) ENGINE=innodb;
--enable_warnings --enable_warnings
lock tables t1 write; LOCK TABLES t1 WRITE;
insert into t1 values(10); INSERT INTO t1 VALUES(10);
disconnect con1; disconnect con1;
connection con2; connection con2;
# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit, # The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
# and the other commit when we write to the binlog was not done because of # and the other commit when we write to the binlog was not done because of
# binlog-ignore-db # binlog-ignore-db
select * from t1; SELECT * FROM t1;
drop table t1; DROP TABLE t1;
connection default;
disconnect con2;
# End of 4.1 tests # End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
This diff is collapsed.
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
--source include/have_ssl.inc --source include/have_ssl.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings --enable_warnings
...@@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL); ...@@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL); connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL); connect (con4,localhost,ssl_user4,,,,,SSL);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045 --error ER_ACCESS_DENIED_ERROR
connect (con5,localhost,ssl_user5,,,,,SSL); connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1; connection con1;
# Check ssl turned on # Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
select * from t1; select * from t1;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
delete from t1; delete from t1;
connection con2; connection con2;
# Check ssl turned on # Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
select * from t1; select * from t1;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
delete from t1; delete from t1;
connection con3; connection con3;
# Check ssl turned on # Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
select * from t1; select * from t1;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
delete from t1; delete from t1;
connection con4; connection con4;
# Check ssl turned on # Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
select * from t1; select * from t1;
--error 1142 --error ER_TABLEACCESS_DENIED_ERROR
delete from t1; delete from t1;
connection default; connection default;
disconnect con1;
disconnect con2;
disconnect con3;
disconnect con4;
drop user ssl_user1@localhost, ssl_user2@localhost, drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
...@@ -97,7 +105,7 @@ drop table t1; ...@@ -97,7 +105,7 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 --exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
# #
# BUG#21611 Slave can't connect when master-ssl-cipher specified # Bug#21611 Slave can't connect when master-ssl-cipher specified
# - Apparently selecting a cipher doesn't work at all # - Apparently selecting a cipher doesn't work at all
# - Usa a cipher that both yaSSL and OpenSSL supports # - Usa a cipher that both yaSSL and OpenSSL supports
# #
...@@ -115,7 +123,7 @@ drop table t1; ...@@ -115,7 +123,7 @@ drop table t1;
--echo End of 5.0 tests --echo End of 5.0 tests
# #
# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in # Bug#26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in
# Event (see also information_schema.test for the other part of test for # Event (see also information_schema.test for the other part of test for
# this bug). # this bug).
# #
...@@ -171,7 +179,7 @@ SET GLOBAL event_scheduler=0; ...@@ -171,7 +179,7 @@ SET GLOBAL event_scheduler=0;
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 --exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
# #
# Bug #27669 mysqldump: SSL connection error when trying to connect # Bug#27669 mysqldump: SSL connection error when trying to connect
# #
CREATE TABLE t1(a int); CREATE TABLE t1(a int);
...@@ -190,10 +198,11 @@ INSERT INTO t1 VALUES (1), (2); ...@@ -190,10 +198,11 @@ INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1 --exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1; DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
# #
# Bug#39172: Asking for DH+non-RSA key with server set to use other key caused # Bug#39172 Asking for DH+non-RSA key with server set to use other key caused
# YaSSL to crash the server. # YaSSL to crash the server.
# #
# Common ciphers to openssl and yassl # Common ciphers to openssl and yassl
...@@ -231,3 +240,6 @@ select 'is still running; no cipher request crashed the server' as result from d ...@@ -231,3 +240,6 @@ select 'is still running; no cipher request crashed the server' as result from d
## ##
--echo End of 5.1 tests --echo End of 5.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
...@@ -5,6 +5,10 @@ eval set @tmpdir="../../tmp"; ...@@ -5,6 +5,10 @@ eval set @tmpdir="../../tmp";
enable_query_log; enable_query_log;
-- source include/have_outfile.inc -- source include/have_outfile.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# test of into outfile|dumpfile # test of into outfile|dumpfile
# #
...@@ -46,7 +50,7 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist")); ...@@ -46,7 +50,7 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1; drop table t1;
# Bug#8191 # Bug#8191 SELECT INTO OUTFILE insists on FROM clause
disable_query_log; disable_query_log;
eval select 1 into outfile "../../tmp/outfile-test.4"; eval select 1 into outfile "../../tmp/outfile-test.4";
enable_query_log; enable_query_log;
...@@ -54,11 +58,11 @@ select load_file(concat(@tmpdir,"/outfile-test.4")); ...@@ -54,11 +58,11 @@ select load_file(concat(@tmpdir,"/outfile-test.4"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
# #
# Bug #5382: 'explain select into outfile' crashes the server # Bug#5382 'explain select into outfile' crashes the server
# #
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
EXPLAIN EXPLAIN
SELECT * SELECT *
INTO OUTFILE '/tmp/t1.txt' INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
...@@ -68,7 +72,7 @@ DROP TABLE t1; ...@@ -68,7 +72,7 @@ DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# #
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails # Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
# #
disable_query_log; disable_query_log;
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4" eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
...@@ -114,6 +118,7 @@ from information_schema.schemata ...@@ -114,6 +118,7 @@ from information_schema.schemata
where schema_name like 'mysqltest'; where schema_name like 'mysqltest';
connection default; connection default;
disconnect con28181_1;
grant file on *.* to user_1@localhost; grant file on *.* to user_1@localhost;
connect (con28181_2,localhost,user_1,,mysqltest); connect (con28181_2,localhost,user_1,,mysqltest);
...@@ -125,9 +130,12 @@ from information_schema.schemata ...@@ -125,9 +130,12 @@ from information_schema.schemata
where schema_name like 'mysqltest'; where schema_name like 'mysqltest';
connection default; connection default;
disconnect con28181_2;
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test; use test;
revoke all privileges on *.* from user_1@localhost; revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost; drop user user_1@localhost;
drop database mysqltest; drop database mysqltest;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment