[Kmymoney-devel] Review Request 121288: Database version is set after creating tables

Christian David christian-david at web.de
Sat Nov 29 09:33:49 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121288/#review71073
-----------------------------------------------------------


The failed test asumes that opening an empty database should fail. But the rest of the code says:?"If the tables are missing, create them". So we have to decide what we want.


kmymoney/mymoney/storage/mymoneydatabasemgrtest.cpp
<https://git.reviewboard.kde.org/r/121288/#comment49647>

    Why was this needed? If opened the database should have the most recent version.



kmymoney/mymoney/storage/mymoneystoragesql.cpp
<https://git.reviewboard.kde.org/r/121288/#comment49649>

    This is still an open issue: ```m_storage->fileFixVersion()``` was never set before - so it just contains junk.
    
    But it is not really set anywhere else. The database driver just uses ```m_storage->fileFixVersion()``` to write it to the database and ```m_storage->setFileFixVersion()``` is only called with the version which was stored in the database.



kmymoney/mymoney/storage/mymoneystoragesql.cpp
<https://git.reviewboard.kde.org/r/121288/#comment49648>

    I think this can be replaced by return 0; upgradeDb() just removes all views and then it recreates them (if I did everything correctly). If someone knows that for sure please write me.


- Christian David


On Nov. 29, 2014, 10:22 vorm., Christian David wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121288/
> -----------------------------------------------------------
> 
> (Updated Nov. 29, 2014, 10:22 vorm.)
> 
> 
> Review request for KMymoney.
> 
> 
> Repository: kmymoney
> 
> 
> Description
> -------
> 
> So the upgrade routine is not executed starting from version 0 - which
> is useless as the database should be the most recent version anyway.
> 
> Also removed the version param from createTables(int version). It was
> not used and was totaly useless as createTables() calls upgradeDb().
> 
> This is also a workaround bug 341304 as the upgradeToV1() won't be
> called after creation of tables anymore. The bug persists if the user
> has a version 0 database.
> 
> CCBUG: 341304
> 
> 
> Diffs
> -----
> 
>   kmymoney/mymoney/storage/mymoneystoragesql.cpp 2f403b1151cf86d5092981e60a5b7e0b308736b6 
>   kmymoney/mymoney/storage/mymoneystoragesql.h ae79b484186e700367f9a4362ffd19772825cf22 
>   kmymoney/mymoney/storage/mymoneydatabasemgrtest.cpp 80ff5a725e41e2a344cf32019b22803059ab9f93 
> 
> Diff: https://git.reviewboard.kde.org/r/121288/diff/
> 
> 
> Testing
> -------
> 
> make test
> 
> only one fail left (see comments)
> 
> FAIL!  : MyMoneyDatabaseMgrTest::testBadConnections() 'sql->open(m_url, QIODevice::ReadWrite) != 0' returned FALSE. ()
>    Loc: [/home/christian/Develop/kmymoney/kmymoney/mymoney/storage/mymoneydatabasemgrtest.cpp(105)]
> 
> 
> Thanks,
> 
> Christian David
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20141129/f0e470af/attachment-0001.html>


More information about the KMyMoney-devel mailing list