Bug 150388

Summary: Lost all input after update
Product: [Applications] KEXI Reporter: zerkovic <phoranix>
Component: KexiDBAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: normal    
Priority: HI    
Version: 1.1.3 (KOffice 1.6.3)   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description zerkovic 2007-10-01 22:21:54 UTC
Version:           1.1.3 (using KDE KDE 3.5.7)
Installed from:    Debian testing/unstable Packages
OS:                Linux

all forms appear blank with no input whatsoever anymore, same for my tables, same for my backup.

in other words i lost a lot a lot of work with this update.
Comment 1 Jarosław Staniek 2007-10-12 16:32:47 UTC
Someone reported this for Mandriva as well, I need more info...

http://lists.kde.org/?t=119214058200001&r=1&w=2
Comment 2 zerkovic 2007-10-12 18:05:08 UTC
1. returned to debian testing (kexi - koffice). and kexi is functioning normal.
2. it happened after the last koffice upgrade (something like 11th octobre).
3. there appears to be no content in the forms, or for that matter: reports.
4. you helped me out, checking if the content really was destroyed, via commandline. it was clear the content hadnt disappeared 
Comment 3 Jarosław Staniek 2007-10-15 13:13:43 UTC
Wayne (shakacat at ukulele.com) has experienced a warning like this, on Mandriva 2008:

KexiDB: WARNING: Connection::querySingleRecord(): !cursor->moveFirst() || cursor->eof() SELECT db_value FROM kexi__db WHERE db_property='kexiproject_major_ver' LIMIT 1


Hmm, the query:
SELECT db_value FROM kexi__db WHERE db_property='kexiproject_major_ver'

should work. You can try to run:

ksqlite colors.kexi
and type the query; the result should be: '1'. 


I suspect there can be a conflict between libraries if you already have installed older version of kexisqlite library. The proper dependency should be


% ldd /usr/lib/kde3/kexidb_sqlite3driver.so

kexidb_sqlite3driver.so
[..]
        libkexisql3.so.3 => /usr/lib/...../libkexisql3.so.3
[..]


Please make sure you have /usr/lib/libkexisql3.so.3 installed from the proper package and not an older version. Have you compiled Kexi before?



I am trying to locate a common source of the problem...
So far I've compared source code from the Mandriva source package against the SVN 1.6 branch and even compiled it (on suse) and have not found any problem.
Comment 4 zerkovic 2007-10-15 15:24:24 UTC
errors:

QLayout: Cannot add null widget to QHBoxLayout/unnamed
[...]
QLayout: Cannot add null widget to QHBoxLayout/unnamed
QLayout "unnamed" added to KexiFormView "trajectformulier", which already has a layout

when trying to open forms

using: kexi -v
Qt: 3.3.7
KDE: 3.5.7
Kexi: 1.1.3 (KOffice 1.6.3)

Version: 1:1.6.3-3 (Debian:unstable) > 1:1.6.3-2 has no probs here
Comment 5 Jarosław Staniek 2007-10-15 15:47:52 UTC
1. I need to make sure I understand you. 
For the following test: http://kexi.pl/js/kde/tests/colors.kexi is your reslult similar to these?

Table: http://kexi.pl/js/kde/tests/e2a61d6cb28568be.png
Form: http://kexi.pl/js/kde/tests/fc639cebc7aed11c.png

(just received the shots from a Mandriva 2008 user).


2. The warnings you posted above are not relevant.

3. So is 1:1.6.3-2 but 1:1.6.3-3 is broken?
Comment 6 zerkovic 2007-10-15 16:02:35 UTC
the answer is: yes. i get the same result: no readable content whatsoever. opening my db gives the same result too.
Comment 7 Jarosław Staniek 2007-10-15 16:06:16 UTC
My question should be:

"3. So is 1:1.6.3-2 OK but 1:1.6.3-3 is broken?"
Comment 8 zerkovic 2007-10-15 16:10:19 UTC
i am sorry, yes. 1:1.6.3-2 is ok. 1:1.6.3-3 gives the error
Comment 9 Jarosław Staniek 2007-10-15 16:28:32 UTC
I guess the problem may be dependent on newer compiler your distribution is built upon. Are you able to compile Kexi on your machine (with my help)? I would send you a possible fix...
Comment 10 zerkovic 2007-10-15 18:38:32 UTC
yes, i am able. i am on irc #kexi now
Comment 11 Jarosław Staniek 2007-10-16 09:14:32 UTC
Just commited possible fix to koffice/kexi/kexidb (see the patch below). 

Zerkovic has compiled the SVN source code (even without the patch) under his Debian/testing and the bug disappeared.

Index: kexidb/field.h
===================================================================
--- kexidb/field.h      (revision 725666)
+++ kexidb/field.h      (working copy)
@@ -507,7 +507,7 @@
                 Every QueryAsterisk object returns true here,
                 and every Field object returns false.
                */
-               virtual bool isQueryAsterisk() const { return false; }
+               inline bool isQueryAsterisk() const { return m_type == Field::As
terisk; }

                /*! \return string for debugging purposes. */
                virtual QString debugString() const;
Index: kexidb/queryschema.h
===================================================================
--- kexidb/queryschema.h        (revision 725666)
+++ kexidb/queryschema.h        (working copy)
@@ -803,9 +803,6 @@
                 \a table may be NULL - then the asterisk becames "all-tables" t
ype asterisk. */
                virtual void setTable(TableSchema *table);

-               /*! Reimplemented. */
-               virtual bool isQueryAsterisk() const  { return true; }
-
                /*! This is convenience method that returns true
                 if the asterisk has "all-tables" type (2nd type).*/
                bool isSingleTableAsterisk() const { return m_table!=NULL; }
Comment 12 Jarosław Staniek 2008-01-10 17:45:02 UTC
The patch fixes the problem as previously confirmed by Adam Pigg.