Bug 311185 - Akonadi/postgresql fail to start due to isVirtual column type
Summary: Akonadi/postgresql fail to start due to isVirtual column type
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.10
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Vrátil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-05 10:18 UTC by Yann Neveu
Modified: 2012-12-21 16:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Neveu 2012-12-05 10:18:34 UTC
Hi,
I've tried to use postgresql as database for akonadi.
I've created user, base an started akonadi.
Table was created but i think column 'isvirtual' in table 'collectiontable' has wrong type, when akonadi start:
Sql error: ERROR:  column "isvirtual" is of type boolean but expression is of type integer
LIGNE 1 : ...sourceId,name,parentId,isVirtual) VALUES (1,'Search',NULL,1)
                                                                       ^
ASTUCE : You will need to rewrite or cast the expression.
QPSQL: Unable to create query
Query: INSERT INTO CollectionTable (resourceId,name,parentId,isVirtual) VALUES (1,'Search',NULL,1)" 
Unable to initialize database. 
"[
0: akonadiserver(_Z11akBacktracev+0x34) [0x454584]
1: akonadiserver() [0x4548c1]
2: /usr/lib/libc.so.6(+0x35050) [0x7f852cfb9050]
3: /usr/lib/libc.so.6(gsignal+0x35) [0x7f852cfb8fd5]
4: /usr/lib/libc.so.6(abort+0x148) [0x7f852cfba458]
5: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7f852ea70414]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0x9b) [0x45663b]
7: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xb4) [0x7f852eb0ab54]
8: /usr/lib/libQtCore.so.4(+0x1167ff) [0x7f852eb157ff]
9: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7f852eb1ddfb]
10: akonadiserver(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5e5) [0x4586e5]
11: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x47) [0x459897]
12: akonadiserver(main+0x1a0) [0x44d170]
13: /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7f852cfa5725]
14: akonadiserver() [0x44d971]
]

I've tried to manually change type with psql but then:

Error during executing query "INSERT INTO CollectionTable (remoteId, remoteRevision, name, resourceId, cachePolicyInherit, cachePolicyCheckInterval, cachePolicyCacheTimeout, cachePolicySyncOnDemand, cachePolicyLocalParts, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9) RETURNING id" :  "ERROR:  parameter $10 of type boolean cannot be coerced to the expected type smallint


Reproducible: Always

Steps to Reproduce:
1. create pgql base with user. Configure akonadi to use it
2. start akonadi
3.
Actual Results:  
in akonadi logs:
Sql error: ERROR:  column "isvirtual" is of type boolean but expression is of type integer
LIGNE 1 : ...sourceId,name,parentId,isVirtual) VALUES (1,'Search',NULL,1)
                                                                       ^
ASTUCE : You will need to rewrite or cast the expression.
QPSQL: Unable to create query
Query: INSERT INTO CollectionTable (resourceId,name,parentId,isVirtual) VALUES (1,'Search',NULL,1)" 
Unable to initialize database. 
"[
0: akonadiserver(_Z11akBacktracev+0x34) [0x454584]
1: akonadiserver() [0x4548c1]
2: /usr/lib/libc.so.6(+0x35050) [0x7f852cfb9050]
3: /usr/lib/libc.so.6(gsignal+0x35) [0x7f852cfb8fd5]
4: /usr/lib/libc.so.6(abort+0x148) [0x7f852cfba458]
5: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74) [0x7f852ea70414]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0x9b) [0x45663b]
7: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xb4) [0x7f852eb0ab54]
8: /usr/lib/libQtCore.so.4(+0x1167ff) [0x7f852eb157ff]
9: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7f852eb1ddfb]
10: akonadiserver(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5e5) [0x4586e5]
11: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x47) [0x459897]
12: akonadiserver(main+0x1a0) [0x44d170]
13: /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7f852cfa5725]
14: akonadiserver() [0x44d971]
]

Expected Results:  
akonadi should start
Comment 1 cvollet 2012-12-17 03:01:47 UTC
Just to confirm, this does happen to me too (arch w/ kde-unstable => 4.9.90).
Comment 2 Laurent Montel 2012-12-17 09:16:57 UTC
Assign to Dan Vratil. He added it.
Comment 3 Daniel Vrátil 2012-12-21 16:18:32 UTC
Git commit c479cc720dfd2c13a2d962f447049b25ba6dec10 by Dan Vrátil.
Committed on 21/12/2012 at 17:13.
Pushed by dvratil into branch 'master'.

Fix initialization of PostgreSQL database

REVIEW: 107776

M  +1    -1    server/src/storage/akonadidb.xml

http://commits.kde.org/akonadi/c479cc720dfd2c13a2d962f447049b25ba6dec10