Menu

#3879 (ok 4.0.1) Import broken for CSV using LOAD DATA in 4.0.0rc2

4.0.0
fixed
None
1
2013-06-11
2013-04-17
No

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.

1 Attachments

Discussion

  • Kasun Chathuranga

    I am able to reproduce this bug and would like to work on this

     
  • Marc Delisle

    Marc Delisle - 2013-04-17

    Kasun,
    please do.

     
  • Ayush Choubey

    Ayush Choubey - 2013-04-17

    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.

     
  • Isaac Bennetch

    Isaac Bennetch - 2013-04-18

    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.

     
  • Ayush Choubey

    Ayush Choubey - 2013-04-18

    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.

     
  • Madhura Jayaratne

    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.

     
  • Madhura Jayaratne

    • summary: Import broken for CSV using LOAD DATA in 4.0.0rc2 --> (ok 4.0.1) Import broken for CSV using LOAD DATA in 4.0.0rc2
    • status: open --> open-fixed
    • assigned_to: Madhura Jayaratne
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2013-05-14
    • Status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.