Bug 86943 - LibreOffice crashes when accessing a view in a sqlite database
Summary: LibreOffice crashes when accessing a view in a sqlite database
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-02 21:22 UTC by Sagan
Modified: 2014-12-19 17:14 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sagan 2014-12-02 21:22:40 UTC
Hi. My operating system is ArchLinux. I work with GnuCash (2.6.3) using a sqlite database. I defined 4 views in the sqlite database. The sqlite database is connected to LibreOffice Base (and Calc) via ODBC (sqliteodbc 0.999-1, unixodbc 2.3.2-1, libdbi-drivers 0.9.0-2). Until sqlite 3.8.6-1 everything worked fine. Since updating to sqlite 3.8.7-1 (and also 3.8.7.1-1 or 3.8.7.2-1) LibreOffice crashes without any error message or log file when accessing two of the four views. There are no problems opening the views with sqliteman in sqlite 3.8.7. After downgrading to sqlite 3.8.6-1 it works fine again.
The two views:
--------
CREATE VIEW "Trn" AS    SELECT "guid" AS "Id", "num" AS "Num", "description" AS "Description", substr( "post_date",1, 4 ) || '-' || substr( "post_date", 5, 2 ) || '-' || substr( "post_date", 7, 2 ) || ' ' || substr( "post_date", 9, 2 ) || ':' || substr( "post_date", 11, 2 ) || ':' || substr( "post_date", 13, 2 ) AS "Post-Date" FROM "transactions"
--------
CREATE VIEW "Trn" AS SELECT "transactions"."guid" AS "Id", "transactions"."num" AS "Num", "transactions"."description" AS "Description", "transactions"."post_date" AS "Date-Trans", "slots"."gdate_val" AS "Date-Slots", CASE WHEN ("slots"."gdate_val" is NULL) THEN (substr( "transactions"."post_date", 1, 4 ) || '-' || substr( "transactions"."post_date", 5, 2 )) ELSE (substr( "slots"."gdate_val", 1, 4 ) || '-' || substr( "slots"."gdate_val", 5, 2 )) END AS "Date_YM", CASE WHEN ("slots"."gdate_val" is NULL) THEN (substr( "transactions"."post_date", 7, 2 )) ELSE (substr( "slots"."gdate_val", 7, 2 )) END AS "Date_D" FROM "transactions" LEFT OUTER JOIN "slots" ON "transactions"."guid" = "slots"."obj_guid" and "slots"."name" = 'date-posted'
--------
To reproduce the crash create a new (empty) sqlite database in GnuCash. Create one of the views in the GnuCash database and connect this sqlite database to LibreOffice Base via ODBC. Accessing one of the views in Base causes a crash of LibreOffice.
I don't know whether this is a problem in LibreOffice or in sqlite.
Thanks.
Sagan
Comment 1 Robert Großkopf 2014-12-03 19:05:13 UTC
LibreOffice connets via ODBC, sqliteman would connect directly to the sqlite database. So it could also be a problem with ODBC-connection.

Views were shown for Base as tables. Base has nothing to do with the SQL-code. It is saved in sqlite.

Could you try to connect to sqlite through ODBC with other programs?
Comment 2 Sagan 2014-12-06 18:56:48 UTC
I will try to find a program, where I can try to connect to sqlite via odbc. If you know such a program, please let me know (I am not a programmer)
Comment 3 Sagan 2014-12-18 15:44:25 UTC
Tests with isql (unixodbc) and iodbctest (libiodbc) showed, that this is not a bug in LibreOffice but probably in the ODBC driver sqliteodbc. Maybe sqlite-versions higher than 3.8.6.1 are not supported yet.
Thanks and sorry for the inconvenience.