elliotchance / mbzdb

🎵 Port of the MusicBrainz database to run on other RDBMSs with replication (previously named MB_MySQL.)
88 stars 33 forks source link

load_data also tries to load data from directories #38

Open splitfeed opened 12 years ago

splitfeed commented 12 years ago

I accidentally left an mbdump directory within mbdumb and got the following error: Thu Nov 10 17:49:04 2011: Loading data into 'mbdump' (52 of 81)... DBD::mysql::db do failed: Table 'ngsdb.mbdump' doesn't exist at src/functions.pl line 92, line 2. SQL: 'LOAD DATA LOCAL INFILE 'mbdump/mbdump' INTO TABLE mbdump FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\' LINES TERMINATED BY '\n' STARTING BY '''

It was obviously my mistake, but it could have been avoided and spared me the time to do it all over ;)

hectoras commented 12 years ago

I've not tested it, but I think adding this on line 102 would do the trick:

next if(-d "./mbdump/$table");

hectoras commented 12 years ago

I've issued a pull request for this: dea91cadfa812cdd4a9140729dabfdecee51d9ea

hectoras commented 12 years ago

I think this can be closed now