Bug #38523 main.gis fails with error message about unable to read data file
Submitted: 1 Aug 2008 21:56 Modified: 5 Mar 2009 3:13
Reporter: Olav Sandstå Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:6.0.7 OS:Linux (Redhat 5)
Assigned to: Paul DuBois CPU Architecture:Any

[1 Aug 2008 21:56] Olav Sandstå
Description:
When running the main.gis test I get the following error:

os136802@fimafeng09:~/<3>falcon-linux/mysql-test> ./mysql-test-run.pl gis
Logging: ./mysql-test-run.pl gis
MySQL Version 6.0.7
Using dynamic switching of binlog format
Skipping ndbcluster, mysqld not compiled with ndbcluster
Skipping SSL, mysqld not compiled with SSL
Using MTR_BUILD_THREAD      = 0
Using MASTER_MYPORT         = 9306
Using MASTER_MYPORT1        = 9307
Using SLAVE_MYPORT          = 9308
Using SLAVE_MYPORT1         = 9309
Using SLAVE_MYPORT2         = 9310
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
=======================================================

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

main.gis                       [ fail ]

mysqltest: At line 396: query 'load data infile '../std_data_ln/bad_gis_data.dat' into table t1' failed with wrong errno 1085: 'The file '/home/os136802/mysql/develop/repo/falcon-linux/mysql-test/var/std_data_ln/bad_gis_data.dat' must be in the database directory or be readable by all', instead of 1263...

The result from queries just before the failure was:
< snip >
select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))))
POINT(10 10)
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))))
POINT(10 10)
create table t1 (g GEOMETRY);
select * from t1;
Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
def	test	t1	t1	g	g	255	4294967295	0	Y144	0	63
g
select asbinary(g) from t1;
Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
def					asbinary(g)	252	4294967295	0Y	128	0	63
asbinary(g)
drop table t1;
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
alter table t1 disable keys;
load data infile '../std_data_ln/bad_gis_data.dat' into table t1;
ERROR HY000: The file '/home/os136802/mysql/develop/repo/falcon-linux/mysql-test/var/std_data_ln/bad_gis_data.dat' must be in the database directory or be readable by all

More results from queries before failure can be found in /home/os136802/mysql/develop/repo/falcon-linux/mysql-test/var/log/gis.log

Aborting: main.gis failed in default mode. 
To continue, re-run with '--force'.
Stopping All Servers

How to repeat:
I repeat this by running:

./mysql-test-run.pl gis
[1 Aug 2008 22:02] Olav Sandstå
The error message says the following: The file '/home/os136802/mysql/develop/repo/falcon-linux/mysql-test/var/std_data_ln/bad_gis_data.dat' must be in the database directory or be readable by all

I have verified that the data file exits. But it is not readable by all, just by owner and by group. This triggers the test to fail. If I change the file to be readable by all then the test succeed.

Suggested fix: this test should not require that the data file it reads is readable by all.

Workaround: make the data file readable by all.
[2 Aug 2008 11:30] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please indicate how you compiled server and if you compiled/run tests as different users.
[2 Aug 2008 14:45] Olav Sandstå
Thanks for trying to repeat this error.

I do not thin that I did anything special in order to get this this error. I did not do anything special when configuring and compiling mysql. Both the compilation and test run were done with my standard unix user on this machine.

The thing that might trigger this is that I run with umask equal to 22. So when I branch the source code the file bad_gis_data.dat get the following access permissions:

  -rw-r-----   1 olav    clustra        4 Jun 17 12:03 bad_gis_data.dat

If I change this with chmod o+x to give read access to everybody the problem dissappear.

When you tried to reproduce the bug what where the access permissions on this file?
[2 Aug 2008 16:30] Sveta Smirnova
Thank you for the feedback.

If I compile using standard script ./BUILD/compile-pentium-debug-max permissions of file is:

$ls -l std_data/bad_gis_data.dat 
-rw-r--r--  1 ssmirnova ssmirnova 4 Jun  9 23:08 std_data/bad_gis_data.dat

Please provide your configure line.
[2 Sep 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[3 Sep 2008 12:22] Olav Sandstå
Sorry for the late feedback on this. I am still able to reproduce the test failure. When reading through my previous report and reproducing the problem I see that I provided a wrong comment about umask for the machine I had run bzr on. So here is how I reproduce the problem:

1. Have umask equal 27.

2. Check out from bzr

3. Check that the result of this is that the following file is not readable by "all":

%> ls -l ./mysql-test/std_data/bad_gis_data.dat
-rw-r-----   1 os136802 4 Sep  3 13:21 ./mysql-test/std_data/bad_gis_data.dat

4. Run autoconf

5. Configure with the following command:

./configure --with-plugins=myisam,falcon,innobase --with-debug

6. Compile.

7. Run the test:

   ./mysql-test-run.pl gis
[1 Nov 2008 22:40] Sveta Smirnova
Thank you for the feedback.

Verified as described.
[5 Mar 2009 3:13] Paul DuBois
No action taken. This is a problem resulting from mode changes to test files that were nowhere recommended and should not have been made.