Bug #41113 Can't LOAD or EXPORT to files on a Windows SUBST drive
Submitted: 28 Nov 2008 19:02 Modified: 28 Nov 2008 22:01
Reporter: Jay Alverson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Windows Severity:S3 (Non-critical)
Version:5.0.67 OS:Windows
Assigned to: CPU Architecture:Any

[28 Nov 2008 19:02] Jay Alverson
Description:
MySQL won't export or load data that's on a drive letter created by the SUBST command.

How to repeat:
[code]mysql> 
mysql> #  Microsoft Windows XP [Version 5.1.2600]
mysql> #  (C) Copyright 1985-2001 Microsoft Corp.
mysql> 
mysql> use test;
Database changed
mysql> select version();
+---------------------+
| version()           |
+---------------------+
| 5.0.67-community-nt | 
+---------------------+
1 row in set (0.00 sec)

mysql> 
mysql> desc dir2;
+-------+-----------+------+-----+---------+-------+
| Field | Type      | Null | Key | Default | Extra |
+-------+-----------+------+-----+---------+-------+
| line  | char(200) | YES  |     | NULL    |       | 
+-------+-----------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> delete from dir2;
Query OK, 54 rows affected (0.00 sec)

mysql> 
mysql> # P: is a subst drive...
mysql> load data infile 'P:/AHK/New-Hotkeys.ahk' into table dir2 lines terminated by '\r\n';
ERROR 29 (HY000): File 'P:\AHK\New-Hotkeys.ahk' not found (Errcode: 2)
mysql> 
mysql> # actual path...
mysql> load data infile 'C:/zCDROMS/CodingTemp/AHK/New-Hotkeys.ahk' into table dir2 lines terminated by '\r\n';
Query OK, 54 rows affected, 11 warnings (0.00 sec)
Records: 54  Deleted: 0  Skipped: 0  Warnings: 11

mysql> 
mysql> select count(*) from dir2;
+----------+
| count(*) |
+----------+
|       54 | 
+----------+
1 row in set (0.00 sec)

mysql> 
mysql> # export to subst drive...
mysql> SELECT * INTO OUTFILE 'p:/ahk/TestExport.txt' LINES TERMINATED BY '\r\n' FROM dir2;
ERROR 1 (HY000): Can't create/write to file 'p:\ahk\TestExport.txt' (Errcode: 2)
mysql> 
mysql> # export to actual path
mysql> SELECT * INTO OUTFILE 'C:/zCDROMS/CodingTemp/AHK/TestExport.txt' LINES TERMINATED BY '\r\n' FROM dir2;
Query OK, 54 rows affected (0.00 sec)

mysql> exit[/code]
[28 Nov 2008 19:04] Jay Alverson
Probably not a bug, but it might be handy down the road.
[28 Nov 2008 22:01] MySQL Verification Team
Thank you for the bug report. Duplicate of bug: http://bugs.mysql.com/bug.php?id=28520