elliotchance / mbzdb

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

MusicBrainz Schema seems to have changed #49

Open leonardlaw opened 11 years ago

leonardlaw commented 11 years ago

DBD::mysql::st execute failed: Incorrect table name 'statistics.statistic' at backend/mysql.pl line 189. DBD::mysql::st fetchrow_array failed: fetch() without execute() at backend/mysql.pl line 190.

Sun Jan 13 18:23:12 2013: Loading data into 'statistics.statistic' (94 of 112)... DBD::mysql::db do failed: Incorrect table name 'statistics.statistic' at src/functions.pl line 93. [ERROR] SQL: 'LOAD DATA LOCAL INFILE 'mbdump/statistics.statistic' INTO TABLE statistics.statistic FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\' LINES TERMINATED BY '\n' STARTING BY '''

ghost commented 11 years ago

Exactly the same problem here. The statistics tables are not created when the database layout is made.

Rawrpwnzl commented 11 years ago

No statement to this issue?

hectoras commented 11 years ago

It seems statistics tables are created now from a different sql file: https://raw.github.com/metabrainz/musicbrainz-server/master/admin/sql/statistics/CreateTables.sql

As a workaround you will need to manually run the sql file and rename files statistics.statistic and statistic.statistic_event from mbdump directory to statistic and statistic_event prior to loading data.

hectoras commented 11 years ago

An (untested) patch has been commited. Please check if the current version solves the issue.

leonardlaw commented 11 years ago

No dice:

DBD::mysql::st execute failed: Incorrect table name 'statistics.statistic' at backend/mysql.pl line 194. DBD::mysql::st fetchrow_array failed: fetch() without execute() at backend/mysql.pl line 195. Undefined subroutine &main::strlen called at backend/mysql.pl line 125.

hectoras commented 11 years ago

I've not tested the patch yet ( https://github.com/elliotchance/mbzdb/pull/51, https://github.com/elliotchance/mbzdb/commit/75ab1c82dd15eecd8a96143fbb0f0fb097b555d5 ) , but I think it solves the issue. Are you using the last version?

leonardlaw commented 11 years ago

Yes, using the latest. The tables don't seem to get created. But I do see your patches to backend/mysql.pl and settings.pl

hectoras commented 11 years ago

woops! yes, there's still a bug: on line 118 $file should be $table AND both if's should be swapped ($table should be fixed if we're iterating on a statistics table prior to colum_exists call).

I'm going to add a pull request for this, but we'll need to wait until elliot merges it on the master branch.

leonardlaw commented 11 years ago

Seems like it would work, but the statistics tables are not actually created. I suspect if I manually created them, the script would work fine. Haven't had a chance to try, though.

hectoras commented 11 years ago

Yes, downloading and executing the CreateTables.sql for statistics is still missing...

SuricatoMeerkat commented 11 years ago

Working on the patch.