Bug #45890 main.grant failes
Submitted: 1 Jul 2009 22:27 Modified: 4 Jul 2009 12:49
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1.36 OS:Any
Assigned to: CPU Architecture:Any

[1 Jul 2009 22:27] Christian Hammers
Description:
Aren't regression tests suppsed to pass on a "production" release?!
This is the fourth or fifth that fails?

main.gcc296                              [ pass ]     10
main.gis                                 [ pass ]    419
main.gis-rtree                           [ pass ]    398
main.grant                               [ fail ]
        Test ended at 2009-07-01 22:23:59

CURRENT_TEST: main.grant
mysqltest: At line 333: query 'connect  conn1,localhost,mysqltest_3,,' failed: 1044: Access denied for user 'mysqltest_3'@'localhost' to database 'test'

The result from queries just before the failure was:
< snip >
localhost       test    grant_user      t1      c       Insert
localhost       test    grant_user      t1      d       Insert
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
show grants for grant_user@localhost;
Grants for grant_user@localhost
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
Host    Db      User    Table_name      Column_name     Column_priv
drop user grant_user@localhost;
drop table t1;
create database mysqltest_1;
create database mysqltest_2;
create table mysqltest_1.t1 select 1 a, 2 q;
create table mysqltest_1.t2 select 1 b, 2 r;
create table mysqltest_2.t1 select 1 c, 2 s;
create table mysqltest_2.t2 select 1 d, 2 t;
grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;

More results from queries before failure can be found in /srv/home/james/debian/mysql/build-area/mysql-dfsg-5.1-5.1.36/mysql-test/var/log/grant.log

 - saving '/srv/home/james/debian/mysql/build-area/mysql-dfsg-5.1-5.1.36/mysql-test/var/log/main.grant/' to '/srv/home/james/debian/mysql/build-area/mysql-dfsg-5.1-5.1.36/mysql-test/var/log/main.grant/'

Retrying test, attempt(2/3)...

main.grant                               [ retry-fail ]

How to repeat:
make test

Suggested fix:
x
[2 Jul 2009 6:00] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please indicate accurate package name you are using (filename you downloaded). If you compiled sources yourself provide configure options.
[3 Jul 2009 22:23] Christian Hammers
The test case only says "GRANT USAGE TO 'mysqltest'@'localhost';" but then tries to connect with use mysqltest to the "test" database.
As "USAGE" does not permit changing to any database the test failed - except if there is already a default permission for everybody to connect to the test database. This default permission comes from the bootstrapped "scripts/mysql_system_tables_data.sql". Debian has removed this grant for security reasons and thus the test failed for us.

I wrote a Debian specific patch that fixes just test case for us so you can close the bug.

bye,

-christian-
[4 Jul 2009 12:49] Sveta Smirnova
Thank you for the feedback.

Closed as "Not a Bug", because this was not MySQL bug.