Version: 2.2.0 (using KDE 4.3.1) OS: Linux Installed from: Debian testing/unstable Packages The debug log: amarok: BEGIN: void DatabaseImporterDialog::pageChanged(KPageWidgetItem*, KPageWidgetItem*) amarok: BEGIN: virtual void DatabaseImporter::startImporting() amarok: BEGIN: virtual void FastForwardImporter::import() amarok: END__: virtual void FastForwardImporter::import() - Took 0.00015s amarok: END__: virtual void DatabaseImporter::startImporting() - Took 0.00024s amarok: BEGIN: virtual void FastForwardWorker::run() amarok: END__: void DatabaseImporterDialog::pageChanged(KPageWidgetItem*, KPageWidgetItem*) - Took 0.00057s amarok: BEGIN: QSqlDatabase FastForwardWorker::databaseConnection() amarok: END__: QSqlDatabase FastForwardWorker::databaseConnection() - Took 0.008s amarok: exec() false active? false size: -1 amarok: [ERROR!] Error executing import query: "Could not execute import query: " amarok: END__: virtual void FastForwardWorker::run() - Took 0.7s amarok: BEGIN: void FastForwardImporter::finishUp() amarok: END__: void FastForwardImporter::finishUp() - Took 0.00044s It doesn't say much, but the postgresql log is more interesting: LOG: statement: select version() LOG: statement: SET CLIENT_ENCODING TO 'UNICODE' LOG: statement: SET DATESTYLE TO 'ISO' LOG: statement: SELECT lastmountpoint, S.url, S.createdate, accessdate, percentage, rating, playcounter, lyrics, title, A.name, R.name, C.name, G.name, Y.name, track, discnumber, filesize FROM statistics S LEFT OUTER JOIN devices D ON S.deviceid = D.id LEFT OUTER JOIN lyrics L ON L.deviceid = S.deviceid AND L.url = S.url LEFT OUTER JOIN tags T ON T.deviceid = S.deviceid AND T.url = S.url LEFT OUTER JOIN album A ON T.album = A.id LEFT OUTER JOIN artist R ON T.artist = R.id LEFT OUTER JOIN composer C ON T.composer = C.id LEFT OUTER JOIN genre G ON T.genre = G.id LEFT OUTER JOIN year Y ON T.year = Y.id ORDER BY lastmountpoint, S.url ERROR: syntax error at end of input at character 9 STATEMENT: EXECUTE So it looks like it runs the query, but then issues an empty "EXECUTE". Looking at the code it seems http://gitorious.org/amarok/amarok/blobs/master/src/databaseimporter/amarok14/FastForwardWorker.cpp#line138 should probably prepare the query, but instead simply runs it. Might be a bug in Qt? Anyway, it worked in 2.1. so my guess is it was introduced by http://gitorious.org/amarok/amarok/commit/36e4e88761c269b2f90068373d4cf72848b9e886 Regards
QT 4.5 documentation says the constructor "QSqlQuery(const QString & query = QString(), QSqlDatabase db = QSqlDatabase() )" automatically calls exec() when it receives a non-empty string. http://qt.nokia.com/doc/4.5/qsqlquery.html#QSqlQuery-2 http://qt.gitorious.org/qt/qt/blobs/4.5/src/sql/kernel/qsqlquery.cpp#line282 My guess is: the line 140 of "src/databaseimporter/amarok14/FastForwardWorker.cpp" should not be there, because it tells the QSqlQuery object to execute a second (and not prepared yet) query. http://gitorious.org/amarok/amarok/blobs/master/src/databaseimporter/amarok14/FastForwardWorker.cpp#line140 ---- I'm now downloading Amarok 2.2 source code (Ubuntu 8.10 package). I will try to comment that line and see if that change makes importing from amarok 1.4 work again.
@Anderson: That's great, a patch (or merge request) would be very welcome.
Created attachment 37501 [details] Patch made by me that fixes PostgreSQL database importing from Amarok 1.4 (i hope) I hope the command line "$ diff -C 3 <original file> <modified file>" makes an useful patch... I used to apply patch from others, but this is my first patch ever... :-)
Thanks, I've committed your patch. Seb, do you think the patch is OK? commit f8d604e3c9111db376337fd0b20129162ed28f51 Author: Mark Kretschmann <kretschmann@kde.org> Date: Sun Oct 11 11:58:53 2009 +0200 Fix database import from Amarok 1.4 for Postgres. Patch by Anderson <amg1127@cefetrs.tche.br>. Please test :) @Seb: Do you think the patch is OK? BUG: 209175