mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Removed obsolete and problematic pragma call.
This commit is contained in:
@@ -68,6 +68,7 @@ DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )
|
|||||||
tLog() << "Database ID:" << m_dbid;
|
tLog() << "Database ID:" << m_dbid;
|
||||||
init();
|
init();
|
||||||
query.exec( "PRAGMA auto_vacuum = FULL" );
|
query.exec( "PRAGMA auto_vacuum = FULL" );
|
||||||
|
query.exec( "PRAGMA synchronous = NORMAL" );
|
||||||
|
|
||||||
tDebug( LOGVERBOSE ) << "Tweaked db pragmas:" << t.elapsed();
|
tDebug( LOGVERBOSE ) << "Tweaked db pragmas:" << t.elapsed();
|
||||||
|
|
||||||
@@ -102,9 +103,7 @@ DatabaseImpl::init()
|
|||||||
TomahawkSqlQuery query = newquery();
|
TomahawkSqlQuery query = newquery();
|
||||||
|
|
||||||
// make sqlite behave how we want:
|
// make sqlite behave how we want:
|
||||||
query.exec( "PRAGMA synchronous = ON" );
|
|
||||||
query.exec( "PRAGMA foreign_keys = ON" );
|
query.exec( "PRAGMA foreign_keys = ON" );
|
||||||
//query.exec( "PRAGMA temp_store = MEMORY" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -115,14 +114,14 @@ DatabaseImpl::~DatabaseImpl()
|
|||||||
/*
|
/*
|
||||||
#ifdef TOMAHAWK_QUERY_ANALYZE
|
#ifdef TOMAHAWK_QUERY_ANALYZE
|
||||||
TomahawkSqlQuery q = newquery();
|
TomahawkSqlQuery q = newquery();
|
||||||
|
|
||||||
q.exec( "ANALYZE" );
|
q.exec( "ANALYZE" );
|
||||||
q.exec( "SELECT * FROM sqlite_stat1" );
|
q.exec( "SELECT * FROM sqlite_stat1" );
|
||||||
while ( q.next() )
|
while ( q.next() )
|
||||||
{
|
{
|
||||||
tLog( LOGSQL ) << q.value( 0 ).toString() << q.value( 1 ).toString() << q.value( 2 ).toString();
|
tLog( LOGSQL ) << q.value( 0 ).toString() << q.value( 1 ).toString() << q.value( 2 ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -722,7 +721,7 @@ DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
|
|||||||
tLog() << "Failed to open database" << dbname;
|
tLog() << "Failed to open database" << dbname;
|
||||||
throw "failed to open db"; // TODO
|
throw "failed to open db"; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( checkSchema )
|
if ( checkSchema )
|
||||||
{
|
{
|
||||||
QSqlQuery qry = QSqlQuery( db );
|
QSqlQuery qry = QSqlQuery( db );
|
||||||
@@ -735,7 +734,7 @@ DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
version = CURRENT_SCHEMA_VERSION;
|
version = CURRENT_SCHEMA_VERSION;
|
||||||
|
|
||||||
if ( version < 0 || version == CURRENT_SCHEMA_VERSION )
|
if ( version < 0 || version == CURRENT_SCHEMA_VERSION )
|
||||||
m_db = db;
|
m_db = db;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user