[Akonadi] [Bug 409234] akonadi with qt5 5.13 is unable to initialize database when using the PostgreSQL backend

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Mon Nov 18 21:02:19 GMT 2019


https://bugs.kde.org/show_bug.cgi?id=409234

--- Comment #8 from v.pupillo at gmail.com ---
Yes, the backend is different but the problem is the same, it's a case problem.
After upgrade to Fedora 31 (with lower_case_table_names=0), Akonadi said: 
org.kde.pim.akonadiserver: "Sql error: Duplicate column name 'id' QMYSQL:
Unable to execute query\nQuery: ALTER TABLE CollectionTable ADD COLUMN id
BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY"
org.kde.pim.akonadiserver: Unable to initialize database.

Then I dropped the akonadi database and created a new one. With
lower_case_table_names=0, Akonadi start and recreate the database. Work fine
for a day. The next day Akonadi says: 

org.kde.pim.akonadiserver: "\nSql error: Duplicate column name 'id' QMYSQL:
Unable to execute query\nQuery: ALTER TABLE CollectionTable ADD COLUMN id
BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY". 

Then I tried with lower_case_table_names=1, akonadi says: 
org.kde.pim.akonadiserver: "\nSql error: Can't create table
`akonadi_vin_new`.`collectiontable` (errno: 121 \"Duplicate key on write or
update\") QMYSQL: Unable to execute query\nQuery: CREATE TABLE CollectionTable
(id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, remoteId VARBINARY(255),
remoteRevision VARBINARY(255), name VARBINARY(255) NOT NULL, parentId BIGINT,
resourceId BIGINT NOT NULL, enabled BOOL NOT NULL DEFAULT true, syncPref
TINYINT DEFAULT 2, displayPref TINYINT DEFAULT 2, indexPref TINYINT DEFAULT 2,
referenced BOOL NOT NULL DEFAULT false, cachePolicyInherit BOOL NOT NULL
DEFAULT true, cachePolicyCheckInterval INTEGER NOT NULL DEFAULT -1,
cachePolicyCacheTimeout INTEGER NOT NULL DEFAULT -1, cachePolicySyncOnDemand
BOOL NOT NULL DEFAULT false, cachePolicyLocalParts VARBINARY(255), queryString
VARBINARY(32768), queryAttributes VARBINARY(255), queryCollections
VARBINARY(255), isVirtual BOOL DEFAULT false, FOREIGN KEY (parentId) REFERENCES
CollectionTable(id) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY
(resourceId) REFERENCES ResourceTable(id) ON UPDATE CASCADE ON DELETE CASCADE) 
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8"

This is why I suggest to switch to snake_case tables and columns name, works
with all the databases.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list