I have a table of a database open. I select the Import tab. I set Format to CSV using LOAD DATA.
I select a file to be imported.
On clicking Go, phpMyAdmin shows a blank window and never returns. The data is not imported.
I have modified the standard CSV file settings in config.inc.php to use tab delimited files.
I attach below
a copy of my config.inc.php,
a csv file test.txt
a short version of the database in question
The problem is shown on trying to import file test.txt into table "fieldnumbers".
If it matters, I am using Google Chrome on a Mac.
I am able to reproduce this bug and would like to work on this
Kasun,
please do.
Hello,
I am almost done with the fix, but i would like to know one small thing that in the query
"LOAD DATA [LOCAL] infile <filename> [rest of the options]"
How do we know when to use LOCAL and when not to,because in the earlier code just a if statement was used :
if (isset($csv_local_option))
where $csv_local_option is in $GLOBAL and on true it added LOCAL in query,
but i don't find the variable being set anywhere, so if i can have some guidance over it that would be helpful.
The MySQL manual is worthless for describing when to use LOCAL, but I found this thread: http://stackoverflow.com/questions/7965043/how-to-use-load-data-infile-statement-when-file-is-another-location which makes me think using LOCAL should be hardcoded and not a variable. I'd think we always want it (because we can't upload to the MySQL data directory), but that's not through any deep understanding of why it's in the code in the first place, just reading some random stackoverflow answer. I'll admit I'm still a bit confused.
Same thing here, As of phpmyadmin code, we just check that if "SHOW VARIABLES LIKE \'local\_infile\" produces "ON" as the value or not.
If it is "ON" we use LOCAL otherwise we don't, However use of local should be more dependent on the location rather than a mysql option.
I suggest lets try both, using local and by not using local.
under DBI_try_query. and if both of them fails, we say that import has been failed, and if first one succeeds, then just skip over the second query.
This problem is due to a regression as discussed on the dev mailing list. In the earlier versions there was an option in the UI to chose whether or not to include the LOCAL keyword.
Fixed with https://github.com/phpmyadmin/phpmyadmin/pull/267