From 7df3f867ea962c19262afaa03c4e849442db328f Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 26 Jun 2012 20:34:23 +0200 Subject: [PATCH] * Re-bind values for failed TomahawkSqlQueries. --- src/libtomahawk/database/TomahawkSqlQuery.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libtomahawk/database/TomahawkSqlQuery.cpp b/src/libtomahawk/database/TomahawkSqlQuery.cpp index 47471c749..1c2449993 100644 --- a/src/libtomahawk/database/TomahawkSqlQuery.cpp +++ b/src/libtomahawk/database/TomahawkSqlQuery.cpp @@ -87,7 +87,15 @@ TomahawkSqlQuery::exec() if ( lastError().text().toLower().contains( "no query" ) ) { tDebug() << Q_FUNC_INFO << "Re-preparing query!"; + + QMap< QString, QVariant > bv = boundValues(); prepare( m_query ); + + foreach ( const QString& key, bv.keys() ) + { + tDebug() << Q_FUNC_INFO << "Rebinding key" << key << "with value" << bv.value( key ); + bindValue( key, bv.value( key ) ); + } } if ( isBusyError( lastError() ) )