diff options
authorDan Vrátil <>2014-04-22 09:28:07 (GMT)
committerDan Vrátil <>2014-04-22 09:28:10 (GMT)
commit4ca8b846baaad48ebbd723f6411f9571a3b0f5ad (patch)
parenta5542751bc147c7f74131006339b55e6339b3e9f (diff)
Remove the invalid GID part from PartTable before starting PartTable migration
More people than we expected have invalid 'GID' part in their PartTable, which breaks migration to schema 25, because it expects all part types to have a valid name. To work around this fact, we DELETE all parts with name 'GID' from PartTable before starting the actual migration. This will not fix the migration for people with other invalid parts, but I haven't heard of any such. To make this completely bullet-proof, we would need to iterate through all entries, which would be massively slower than current INSERT INTO ... SELECT FROM approach. Distributions, this is a good choice for backporting into 1.12.1 ;-) BUG: 331867 FIXED-IN: 1.12.2
1 files changed, 9 insertions, 0 deletions
diff --git a/server/src/storage/dbupdater.cpp b/server/src/storage/dbupdater.cpp
index ccaf584..d6368b5 100644
--- a/server/src/storage/dbupdater.cpp
+++ b/server/src/storage/dbupdater.cpp
@@ -261,6 +261,15 @@ bool DbUpdater::complexUpdate_25()
+ {
+ // It appears that more users than expected have the invalid "GID" part in their
+ // PartTable, which breaks the migration below (see BKO#331867), so we apply this
+ // wanna-be fix to remove the invalid part before we start the actual migration.
+ QueryBuilder qb( QLatin1String( "PartTable" ), QueryBuilder::Delete );
+ qb.addValueCondition( QLatin1String( "" ), Query::Equals, QLatin1String( "GID" ) );
+ qb.exec();
+ }
akDebug() << "Creating a PartTable_new";
TableDescription description;