Commit a79e8fa2 authored by Matthias Leich's avatar Matthias Leich

1. Fix for Bug#58600 main.not_embedded_server test does not cleanup properly

   - remove the superfluous file
   - add an preemptive removal of the outfile before the
     SELECT ... INTO OUTFILE ...
2. Remove an already disabled subtest
   It's functionality is covered by tests in the suite funcs_1.
3. Adjust the formatting within some sub testcase to the formatting used
   in all other sub testcases
parent ce7a75fe
...@@ -7,13 +7,13 @@ slave_skip_errors OFF ...@@ -7,13 +7,13 @@ slave_skip_errors OFF
# #
# FLUSH PRIVILEGES should not implicitly unlock locked tables. # FLUSH PRIVILEGES should not implicitly unlock locked tables.
# #
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (c1 int); CREATE TABLE t1 (c1 INT);
lock tables t1 read; LOCK TABLES t1 READ;
flush privileges; FLUSH PRIVILEGES;
ERROR HY000: Table 'host' was not locked with LOCK TABLES ERROR HY000: Table 'host' was not locked with LOCK TABLES
unlock tables; UNLOCK TABLES;
drop table t1; DROP TABLE t1;
# #
# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
# #
...@@ -28,7 +28,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1; ...@@ -28,7 +28,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost'; GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
connection: con1 connection: con1
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest'; SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '<outfile>';
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1; INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
......
...@@ -4,31 +4,7 @@ ...@@ -4,31 +4,7 @@
-- source include/not_embedded.inc -- source include/not_embedded.inc
# The following fails sporadically because 'check-testcase' runs # End of 4.1 tests
# queries before this test and there is no way to guarantee that any
# previous process finishes. The purpose of the test is not clearly
# stated, there is no reference to any bug report, and "select from
# I_S from prepared statement" doesn't look like something that's
# really imporant to test. I'm commenting out this for now. If
# anyone wants to keep this, please fix the race and motivate why we
# need to test this. If you see this comment and it is after mid-2009
# or so, feel free to remove this test from the file. /Sven
#
#
## Show full process list with prepare
## To not show other connections, this must be the first test and we must
## have a server restart before this one
##
## We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to
## exclude system threads that may/may not be active in the server
## (namely the ndb injector thread)
##
## End of 4.1 tests
#
#prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' ';
#--replace_column 1 number 6 time 3 localhost
#execute stmt1;
#deallocate prepare stmt1;
call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was not locked with LOCK TABLES"); call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was not locked with LOCK TABLES");
...@@ -46,14 +22,14 @@ SHOW VARIABLES like 'slave_skip_errors'; ...@@ -46,14 +22,14 @@ SHOW VARIABLES like 'slave_skip_errors';
--echo # FLUSH PRIVILEGES should not implicitly unlock locked tables. --echo # FLUSH PRIVILEGES should not implicitly unlock locked tables.
--echo # --echo #
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
create table t1 (c1 int); CREATE TABLE t1 (c1 INT);
lock tables t1 read; LOCK TABLES t1 READ;
--error ER_TABLE_NOT_LOCKED --error ER_TABLE_NOT_LOCKED
flush privileges; FLUSH PRIVILEGES;
unlock tables; UNLOCK TABLES;
drop table t1; DROP TABLE t1;
--echo # --echo #
--echo # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN --echo # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
...@@ -83,8 +59,18 @@ connect (con1,localhost,nopriv_user,,); ...@@ -83,8 +59,18 @@ connect (con1,localhost,nopriv_user,,);
connection con1; connection con1;
--echo connection: con1 --echo connection: con1
let outfile=$MYSQLTEST_VARDIR/tmp/mytest;
--error 0,1
--remove_file $outfile
--replace_result $outfile <outfile>
--error ER_PROCACCESS_DENIED_ERROR --error ER_PROCACCESS_DENIED_ERROR
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest'; eval SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '$outfile';
# A removal of the outfile is necessary, at least today (2010-12-07), because
# the outfile is created even if the SELECT statement fails.
# If the server is improved in the future this may not happen.
# ==> Do not fail if the outfile does not exist.
--error 0,1
--remove_file $outfile
--error ER_PROCACCESS_DENIED_ERROR --error ER_PROCACCESS_DENIED_ERROR
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1; INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
......
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