From c6068b16c922aa0560febd4dd79376f02a079685 Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Mon, 13 May 2013 23:04:24 +0200 Subject: [PATCH] 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. --- src/core/database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/database.cpp b/src/core/database.cpp index e0755befa..5f8ede739 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -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.