Patch for PSQL Accessviolation

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
Michl
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 01.04.2014, 12:53

Patch for PSQL Accessviolation

Post by Michl »

I have received an access violation because a column was inserted into a table. See topic http://zeoslib.sourceforge.net/viewtopi ... 38&t=11384

The reason was that an active connection has not registered that the metadata has changed, because all TableInfos are cached - for performance reasons.

I have attached a patch where I first check if the cached column number of the current column number corresponds. If not, the cache is updated. It will only read data used for comparison is therefore virtually no perfomance loss there. An error that persists is, if not the number of columns will change, but for example their name. However, this is imho negligible.

For me, the patch works fine now, whether it can be taken as 1:1 or whether this functionality would also be adapted for other databases, I do not know.

Greetings Michl

[edit] I forgot a "Refresh", changed patch attached
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Patch for PSQL Accessviolation

Post by EgonHugeist »

Hi michl,

i'll check this out and give you a second reply...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Patch for PSQL Accessviolation

Post by EgonHugeist »

Me again, just did check your patch...
I did change some parts: intead of clearing the whole chache i simple refresh the data of the current entry. Hope you agree.

Patch done R3181 /testing-7.2 (SVN)

But thinking about it makes me .... What happens if just a columnname did change? IMO the field should become readonly because the compare between geneic PG-Data and Metadata fails, or am i wrong?

Cheers Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Michl
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 01.04.2014, 12:53

Re: Patch for PSQL Accessviolation

Post by Michl »

I've updated my zeos and make some tests. In that tests and in my project it seems to work. :D

Thank you for your work! Now I have not to patch zeos, when I should reinstall my Lazarus, very nice! :loveit:
Post Reply