1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 20:34:39 +01:00

Handle leading spaces when splitting schema update queries.

Otherwise the commands aren't splitted correctly, so the queries aren't run correctly, and the root cause might not be obvious.
This commit is contained in:
Arnaud Bienner 2013-05-13 23:04:24 +02:00
parent 70041b07c8
commit c6068b16c9

View File

@ -551,7 +551,7 @@ void Database::ExecSchemaCommands(QSqlDatabase& db,
int schema_version,
bool in_transaction) {
// Run each command
const QStringList commands(schema.split(";\n\n"));
const QStringList commands(schema.split(QRegExp("; *\n\n")));
// We don't want this list to reflect possible DB schema changes
// so we initialize it before executing any statements.