Bug #10697 MySQL Test: EVAL fails to evaluate two variables specified in one statement
Submitted: 18 May 2005 6:04 Modified: 19 May 2005 15:36
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.5-beta-nt OS:Linux (Redhat Linux 9.0)
Assigned to: CPU Architecture:Any

[18 May 2005 6:04] Disha
Description:
When we execute a script from mysql-test as follows:

--disable_warnings
--enable_info
Drop database if exists test1;
Create database test1;
use test1;
Create table t1 (f1 char(10),f2 char(10));
eval load data local infile '$MYSQL_TEST_PATH\$TEXT_FILE' into table t1;
Select count(*) from t1;

Only one of the two variables i.e. $MYSQL_TEST_PATH & $TEXT_FILE gets evaluated and the script execution fails.

How to repeat:
1. Set two ENVIRONMENT variables as $MYSQL_TEST_PATH and $TEXT_FILE to point to the location of mysql-test folder and table data file paths respectively.

2. Create an data file 'test.txt' and place it in 't' folder within 'mysql-test' folder.

3. Create a test script say 'test1.test' with following contents and place it in the 't' folder within mysql-test folder:

4. Create an empty file say 'test1.result' and place it in 'r' folder within mysql-test folder.

--disable_warnings
--enable_info
Drop database if exists test1;
Create database test1;
use test1;
Create table t1 (f1 char(10),f2 char(10));
eval load data local infile '$MYSQL_TEST_PATH\$TEXT_FILE' into table t1;
Select count(*) from t1;

3. Execute the script 'test1.test' from mysql-test like:
      ./mysql-test-run --force test1

4. Observe that the script execution fails.

Expected Result: Script should execute successfully without ant warnings or errors.

Actual Result: It give an error message "At line 9: query 'load data local infile '$TEXT_FILE' into table t1' failed: 2: File '$TEXT_FILE' not found ".
[19 May 2005 15:36] Omer Barnir
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

This is not a bug.
The '\' escapes the '$' resulting in the evaluation of $TEXT_FILE as such and not as an environment variable.
The proper usage is '$MYSQL_TEST_PATH/$TEXT_FILE' (with a 'forward slash). 
and is not OS dependent (works on Windows as well).