OK to push by me.
First I thought that you should add a pointer to bug#39277 in the test,
but after some consideration, I agree that it is better to only mention
bug#41002.
Btw, will this (symlink test failure) still be an issue in 4.1 and 5.0?
(I did not manage to repeat it in mysql-5.0-bugteam).
/Mattias
Ingo Struewing wrote:
> #At file:///home2/mydev/bzrroot/mysql-5.1-bug41002-1/
>
> 2711 Ingo Struewing 2008-11-25
> Bug#41002 - symlink.test fails on symlinked datadir
>
> symlink.test failed when run in an environment that has mysql-test/var
> symlinked to elsewhere, e.g. a memory file system. This is the case
> when running mysql-test-run --mem.
>
> In this case the server does not detect that the directory specified
> with a DATA/INDEX DIRECTORY clause is within its data home directory.
> This problem was reported as Bug#39277 (Creation of table with data
> and/or index files in data home directory succeeds). It was decided
> that it will not be fixed in 5.1. Hence, the current behavior is
> accepted for 5.1. It will be fixed in 6.0 though.
>
> Fixed the test case so that it works in both environments. 1. When no
> symbolic link is involved, the server notices that the data/index
> directory is in its data hone directory and rejects the CREATE/ALTER
> TABLE statement. 2. When the data home directory is symlinked, it
> does not notice the problem and executes the statement sucessfully.
> modified:
> mysql-test/r/symlink.result
> mysql-test/t/symlink.test
>
> per-file messages:
> mysql-test/r/symlink.result
> Bug#41002 - symlink.test fails on symlinked datadir
> Updated test result.
> mysql-test/t/symlink.test
> Bug#41002 - symlink.test fails on symlinked datadir
> Adjusted the test case to the accepted behavior.
> It needs to accept success and failure of some statements.
> === modified file 'mysql-test/r/symlink.result'
> --- a/mysql-test/r/symlink.result 2008-10-24 12:50:59 +0000
> +++ b/mysql-test/r/symlink.result 2008-11-25 14:06:31 +0000
> @@ -148,16 +148,16 @@ DROP TABLE t1;
> End of 5.0 tests
> CREATE TABLE t1(a INT)
> INDEX DIRECTORY='TEST_DIR/master-data/mysql';
> -ERROR HY000: Incorrect arguments to INDEX DIRECTORY
> +DROP TABLE IF EXISTS t1;
> CREATE TABLE t1(a INT)
> DATA DIRECTORY='TEST_DIR/master-data/test';
> -ERROR HY000: Incorrect arguments to DATA DIRECTORY
> +DROP TABLE IF EXISTS t1;
> CREATE TABLE t1(a INT)
> DATA DIRECTORY='TEST_DIR/master-data/';
> -ERROR HY000: Incorrect arguments to DATA DIRECTORY
> +DROP TABLE IF EXISTS t1;
> CREATE TABLE t1(a INT)
> INDEX DIRECTORY='TEST_DIR/master-data';
> -ERROR HY000: Incorrect arguments to INDEX DIRECTORY
> +DROP TABLE IF EXISTS t1;
> CREATE TABLE t1(a INT)
> INDEX DIRECTORY='TEST_DIR/master-data_var';
> ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errcode:
> 2)
>
> === modified file 'mysql-test/t/symlink.test'
> --- a/mysql-test/t/symlink.test 2008-10-01 13:01:04 +0000
> +++ b/mysql-test/t/symlink.test 2008-11-25 14:06:31 +0000
> @@ -194,26 +194,49 @@ DROP TABLE t1;
> #
> # Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
> #
> +# With Bug#41002 (symlink.test fails on symlinked datadir) it was
> +# decided that the below statements may also succeed if the data
> +# home directory is symlinked, e.g. mysql-test-run --mem.
> +# This will be fixed in 6.0 only.
> +#
> --replace_result $MYSQLTEST_VARDIR TEST_DIR
> ---error ER_WRONG_ARGUMENTS
> +--error 0,ER_WRONG_ARGUMENTS
> eval CREATE TABLE t1(a INT)
> INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
> +--disable_warnings
> +DROP TABLE IF EXISTS t1;
> +--enable_warnings
> +#
> --replace_result $MYSQLTEST_VARDIR TEST_DIR
> ---error ER_WRONG_ARGUMENTS
> +--error 0,ER_WRONG_ARGUMENTS
> eval CREATE TABLE t1(a INT)
> DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
> +--disable_warnings
> +DROP TABLE IF EXISTS t1;
> +--enable_warnings
> +#
> --replace_result $MYSQLTEST_VARDIR TEST_DIR
> ---error ER_WRONG_ARGUMENTS
> +--error 0,ER_WRONG_ARGUMENTS
> eval CREATE TABLE t1(a INT)
> DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
> +--disable_warnings
> +DROP TABLE IF EXISTS t1;
> +--enable_warnings
> +#
> --replace_result $MYSQLTEST_VARDIR TEST_DIR
> ---error ER_WRONG_ARGUMENTS
> +--error 0,ER_WRONG_ARGUMENTS
> eval CREATE TABLE t1(a INT)
> INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
> +--disable_warnings
> +DROP TABLE IF EXISTS t1;
> +--enable_warnings
> +#
> --replace_result $MYSQLTEST_VARDIR TEST_DIR
> --error 1
> eval CREATE TABLE t1(a INT)
> INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var';
> +
> +#
> # BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
> # silently ignored
> #
>
>