GNOME Bugzilla – Bug 634392
File->SaveAs sqlite3 brings up "already exists" box in error
Last modified: 2018-06-29 22:47:00 UTC
My large register file named 'current' is gzipped XML. When I follow these steps to convert it to a sqlite3 file named 'kurrent' I get in error a box saying 'kurrent' already exists. To reproduce: 1. Bring up the check register file "current" 2. Click File -> Save As 3. Select type of sqlite 4. Type filename of 'kurrent' 5. Hit "Save" 6. Observe the file is *not yet* created. (Why not?? it should be! Perhaps this is the bug?) Make this observation by using the Linux ls(1) command which shows the 'current' file exists but the 'kurrent' file does not exist. 7. Hit "Save" again. 8. Observe the appearance of an error box which says "The file sqlite3:///home/blah/blah/kurrent.gnucash already exists. Are you sure you want to overwrite it?" With correct operation, step 6 will show that the file is created and step 7 will be unnecessary. Operating System is Fedora 13.
I can confirm this behavior in Fedora12. Except... Hitting "Save As" (in the dialog) the first time creates the file. If I select 'NO' to overwrite, the file only contains the GNCLOCK table.
Similar behavior with MySql. Again the only table is GNCLOCK. Additionally the error dialog shows the password in clear text.
Rich, what distro are you using? Can each of you go through the exercise again and attach the relevant bits of the gnucash.trace?
Never mind. I just replicated it in Debian, and I know what's happening: The lock routine is happening before the existence check.
This fix is a threefer: Not only is this bug fixed, but so are the ones mentioned in IRC about the password showing up in the "already open" dialog and the new file/database not being in history. Fixed in r19798, tested with Sqlite3 and MySql.
This breaks the python bindings with: gnucash_core.c: In function '_wrap_qof_session_begin': gnucash_core.c:14238: error: too few arguments to function 'qof_session_begin' make[5]: *** [_gnucash_core_c_la-gnucash_core.lo] Error 1 I've also made a note in Bug 634165 regarding this.
Apologies to John, it seems that make and make clean doesn't rebuild src/optional/python-bindings/gnucash_core.c
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=634392. Please update any external references or bookmarks.