summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2014-04-22 09:40:30 (GMT)
committerDan Vrátil <dvratil@redhat.com>2014-04-22 09:40:30 (GMT)
commit660e892d222ff65e0c5f89a62222c90aa8a76b6a (patch)
tree7c9516a2a394200d743714ab66849e19a9aec9b3
parentfcd69dcca69f9d9419a5831dedebba8324213ef1 (diff)
downloadakonadi-master.zip
akonadi-master.tar.gz
akonadi-master.tar.xz
Backport 1.12 commit to fix upgrade from Akonadi<1.12 for users with invalid DB entriesHEADmaster
-rw-r--r--0001-remove-invalid-part-before-parttable-migration.patch41
-rw-r--r--akonadi.spec9
2 files changed, 49 insertions, 1 deletions
diff --git a/0001-remove-invalid-part-before-parttable-migration.patch b/0001-remove-invalid-part-before-parttable-migration.patch
new file mode 100644
index 0000000..a367067
--- /dev/null
+++ b/0001-remove-invalid-part-before-parttable-migration.patch
@@ -0,0 +1,41 @@
+commit 4ca8b846baaad48ebbd723f6411f9571a3b0f5ad
+Author: Dan Vrátil <dvratil@redhat.com>
+Date: Tue Apr 22 11:28:07 2014 +0200
+
+ 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
+
+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( "PartTable.name" ), Query::Equals, QLatin1String( "GID" ) );
++ qb.exec();
++ }
++
+ akDebug() << "Creating a PartTable_new";
+ {
+ TableDescription description;
diff --git a/akonadi.spec b/akonadi.spec
index 936333e..d4d9d21 100644
--- a/akonadi.spec
+++ b/akonadi.spec
@@ -19,7 +19,7 @@
Summary: PIM Storage Service
Name: akonadi
Version: 1.12.1
-Release: 4%{?dist}
+Release: 5%{?dist}
License: LGPLv2+
URL: http://community.kde.org/KDE_PIM/Akonadi
@@ -38,6 +38,9 @@ Source10: akonadiserverrc.mysql
## upstreamable patches
## upstream patches
+# 1.12 branch
+Patch101: 0001-remove-invalid-part-before-parttable-migration.patch
+
# master branch
Patch212: 0012-Enable-concurrency-in-our-copy-of-QSQLITE-driver.patch
Patch213: 0013-Disable-global-transaction-mutex-for-QSQLITE3-and-en.patch
@@ -97,6 +100,7 @@ See also: %{_sysconfdir}/akonadi/mysql-global.conf
%prep
%setup -q -n akonadi-%{version}
+%patch101 -p1 -b .0001
%patch212 -p1 -b .0012
%patch213 -p1 -b .0013
@@ -204,6 +208,9 @@ fi
%changelog
+* Tue Apr 22 2014 Daniel Vrátil <dvratil@redhat.com> 1.12.1-5
+- backport 1.12.2 patch to fix upgrade from Akonadi < 1.12 for users with invalid entries in DB
+
* Wed Apr 16 2014 Rex Dieter <rdieter@fedoraproject.org> 1.12.1-4
- backport master/ branch commits to test sqlite backend concurrency support