Hello,
Recently i upgrade from Delphi2010 to XE7. I used Zeos 6 before but now i had to switch to 7.1 stable release.
After upgrade i have problem with tableoid postgresql tables hidden column.
Simple example:
CREATE DATABASE test_zeos;
CREATE TABLE table_a ("int" integer, text text);
When i execute SQL in TZQuery:
SELECT tableoid, * FROM table_a;
There we have:
First chance exception at $00405C03. Exception class $C0000005 with message 'access violation at 0x00405c03: read of address 0x00000000'. Process Project1.exe (1984)
Of course: SELECT * FROM table_a; works OK.
It is possible to workaround something like this: SELECT my_new_procedure(tableoid), * FROM table_a;
but this is my last unhappy solution.
Tableoid is hidden column in every postgresql table, it is very important to me.
I checked the same bug under 2010 with 7.1 and the same bug with 7.2 from SVN on both my Delphi.
Any chance for help ?
Regards Jaromir
Postgresql tableoid column problem
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Postgresql tableoid column problem
Hello Jaromir,
I can confirm this bug. It is a problem with the table info cache in the postgresql driver. I am working on a solution...
Best regards,
Jan
I can confirm this bug. It is a problem with the table info cache in the postgresql driver. I am working on a solution...
Best regards,
Jan
Re: Postgresql tableoid column problem
Probably you can use ad hoc???:
select tableoid::regclass::oid, * from table
and change ParamChar.
Michal
select tableoid::regclass::oid, * from table
and change ParamChar.
Michal
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Postgresql tableoid column problem
Hello
the problem is that there is a range check error in the table metadata caching code of the postgresql driver. System fields like oid and tableoid are stored with a negative index number in PostgreSQL whereas the cache in the driver only loads information of fields with positive indices and later on accesses them without checking if the index number is for the column is positive. The attached patch solves this problem by adding a check for negative numbers and resolving them statically. The static mapping is no problem because PostgreSQL also has static mappings for them in its source code.
With best regards,
Jan
the problem is that there is a range check error in the table metadata caching code of the postgresql driver. System fields like oid and tableoid are stored with a negative index number in PostgreSQL whereas the cache in the driver only loads information of fields with positive indices and later on accesses them without checking if the index number is for the column is positive. The attached patch solves this problem by adding a check for negative numbers and resolving them statically. The static mapping is no problem because PostgreSQL also has static mappings for them in its source code.
With best regards,
Jan
You do not have the required permissions to view the files attached to this post.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Postgresql tableoid column problem
Thank you, Jan.
Patch applied R3596 \testing-7.2 (SVN)
@jaromir
please test the fix and give us a reply..
Patch applied R3596 \testing-7.2 (SVN)
@jaromir
please test the fix and give us a 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/
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/
Re: Postgresql tableoid column problem
Jan !!
Thank You very much !
It looks like everything is ok. This patch is probably not for 7.1 but i did changes manually and my code passed few tests.
I'l be testing next few days - if something will be wrong i'll make a call
Thanks Jan again.
Regards Jaromir
Thank You very much !
It looks like everything is ok. This patch is probably not for 7.1 but i did changes manually and my code passed few tests.
I'l be testing next few days - if something will be wrong i'll make a call
Thanks Jan again.
Regards Jaromir