Bug #96105 Load data local infile doesn't resolve ~ as home directory
Submitted: 5 Jul 2019 10:23 Modified: 5 Jul 2019 13:11
Reporter: Dmitriy Tseyler Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:8.0.15, 8.0.16 OS:Any
Assigned to: CPU Architecture:Any

[5 Jul 2019 10:23] Dmitriy Tseyler
Description:
MySQL Connector/J doesn't resolve paths with tilde char, but should

How to repeat:
1. Write a simple command like:

LOAD DATA LOCAL INFILE '~/Documents/some_file.txt'
INTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
IGNORE 1 LINES;

2. Execute

Expected:
File successfully uploaded to a database

Actual:
...FileNotFoundException...

Suggested fix:
Replace tilde char in the path with System.getProperty("user.home")
[5 Jul 2019 13:11] Umesh Shastry
Hello Dmitriy,

Thank you for the report.

regards,
Umesh