Version: svn 570614 (using KDE KDE 3.5.4) Installed from: Slackware Packages OS: Linux trying to run amarok with mysql 5.0.24 results in error for each sql query : [CollectionDB] MYSQL QUERY FAILED: Commands out of sync; you can't run this command now this happens both with an old db & a completely clean db. the same revision works just fine with mysql 5.0.22 could be a problem/change in mysql, of course :) full console output of an amarok session (starts up, starts collection rescan, i notice console output & gracefully clos it ;) ) is attached.
Created attachment 17301 [details] console output was too large, had to compress it :)
Comment on attachment 17301 [details] console output err. i hope this is the correct mimetype
I can confirm this
archlinux users confirm this too: http://bugs.archlinux.org/task/5205
From the MySQL docs it seems this error condition has been present since 5.0. Since only people running 5.0.24 seem to have this problem, and downgrading fixes it, I'm less inclined to believe it's an error in the code than a regression in MySQL. However, from my message about this bug to the mailing list: Looking at the CollectionDB code for query (MySqlConnection::query), if mysql_use_result is successful, mysql_free_result will always be called. I would guess that it does not have to be called if mysql_use_result is unsuccessful, but if I'm wrong about that it could be the source of your issue if you are having failed queries (in which case the problem is really figuring out why you had a failed query in the first place). There's a relevant entry here: http://mysql.com/doc/refman/5.0/en/commands-out-of-sync.html that would suggest that our code should be fine, other than the possible condition I mentioned above.
if someone is running SVN, please try this: in collectiondb.cpp, look for MySqlConnection::query in that function, look for the following else { if ( mysql_field_count( m_db ) != 0 ) { debug() << "MYSQL QUERY FAILED: " << mysql_error( m_db ) << "\n" << "FAILED QUERY: " << statement << "\n"; values = QStringList(); } } and change it to: else { if ( mysql_field_count( m_db ) != 0 ) { debug() << "MYSQL QUERY FAILED: " << mysql_error( m_db ) << "\n" << "FAILED QUERY: " << statement << "\n"; values = QStringList(); } mysql_free_result( result ); } Let me know if it works.
sorry for the long delay, i had no access to the mysql5 machine. it seems that this change indeed helps - i have revision 574108 with the change using 5.0.24 without "out of sync" errors.
SVN commit 574217 by mitchell: MySQL apparently changed their semantics for 5.0.23+ and require mysql_free_result to be called even if a mysql_use_result is not performed. This fixes the problem in the bug, and still works fine for me with MySQL 4. BUG:132114 M +1 -0 ChangeLog M +1 -1 src/collectiondb.cpp --- trunk/extragear/multimedia/amarok/ChangeLog #574216:574217 @@ -83,6 +83,7 @@ since the last time it was enabled. BUGFIXES: + * Handle changed semantics of MySQL 5.0.23+ (BR 132114) * Do not try to detach() KURLs, as this would not work for non-ascii urls. (BR 132355) * Adding songs while at end of playlist could crash in dynamic mode. --- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #574216:574217 @@ -6006,7 +6006,6 @@ values << QString::fromUtf8( (const char*)row[i] ); } } - mysql_free_result( result ); } else { @@ -6016,6 +6015,7 @@ values = QStringList(); } } + mysql_free_result( result ); } else {