Range Check Error in ZPlainPostgresqlDriver
Moderators: gto, cipto_kh, EgonHugeist, olehs
Range Check Error in ZPlainPostgresqlDriver
Hello,
An 'Range Check Error' is occurring in the Zeos when retrieving fields of the type text or bytea in ZPlainPostgresqlDriver - function DecodeBYTEA().
My envinronment is Delphi2005 and Postgresql 8.1.4.
Please, i need help or solution.
Regards,
Paulo
An 'Range Check Error' is occurring in the Zeos when retrieving fields of the type text or bytea in ZPlainPostgresqlDriver - function DecodeBYTEA().
My envinronment is Delphi2005 and Postgresql 8.1.4.
Please, i need help or solution.
Regards,
Paulo
I got the same "Range check error" and instead of {$R-} I suggest the folowing:
The point is I don't like to use workarounds ($R-) insteat I prefer to fix the issue.
Plamen
Code: Select all
--- C:/Temp/Zeos/src/plain/ZPlainPostgreSqlDriver.pas (revision 162)
+++ C:/Temp/Zeos/src/plain/ZPlainPostgreSqlDriver.pas (working copy)
@@ -992,7 +992,7 @@
decoded:=ZPlainPostgreSql8.PQunescapeBytea(pansichar(value),@len);
SetLength(result,len);
dest:=pchar(result);
- Move(decoded^,result[1],len);
+ if (len > 0) then Move(decoded^,result[1],len);
ZPlainPostgreSql8.PQFreemem(decoded);
end;
The point is I don't like to use workarounds ($R-) insteat I prefer to fix the issue.
Plamen
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Good idea. Apparently my advice above was not correct anyway. The only place where we used this trick is in the ZdbcInterbaseUtils unit. If you use interbase, please feel free to have a look there as well. (I'm just the handyman, not a real experienced developer)
This one will get in ASAP. I hope it will pass the testing suite. (Ever used that tool for Zeoslib? You'll find it in the ZeosDboDevel.bpg package for D7)
Mark
This one will get in ASAP. I hope it will pass the testing suite. (Ever used that tool for Zeoslib? You'll find it in the ZeosDboDevel.bpg package for D7)
Mark
Never used Zeoslib testing suite but will give it a try.
I am using Zeos since 3-4 years with D7 and Postgresql. The reason I come back here was because an upgrade is underway: PostgreSQL 7.4 -> 8.1.5 and D7-> BDS 2006.
I'll take the oportunity to ask all people here if the ZeosLib for BDS 2006 (Delphi 10) + PostgreSQL 8.1.x could be taken as stable enough??
Also, having PostgreSQL 6-7 years experience (admin+user) I'll be glad if I can help Zeos Dev Team in D10 + Pg coding.
Regards,
Plamen
I am using Zeos since 3-4 years with D7 and Postgresql. The reason I come back here was because an upgrade is underway: PostgreSQL 7.4 -> 8.1.5 and D7-> BDS 2006.
I'll take the oportunity to ask all people here if the ZeosLib for BDS 2006 (Delphi 10) + PostgreSQL 8.1.x could be taken as stable enough??
Also, having PostgreSQL 6-7 years experience (admin+user) I'll be glad if I can help Zeos Dev Team in D10 + Pg coding.
Regards,
Plamen
Hello,plamendp wrote:Never used Zeoslib testing suite but will give it a try.
I'll take the oportunity to ask all people here if the ZeosLib for BDS 2006 (Delphi 10) + PostgreSQL 8.1.x could be taken as stable enough??
Also, having PostgreSQL 6-7 years experience (admin+user) I'll be glad if I can help Zeos Dev Team in D10 + Pg coding.
we are using Pg 8.1.x in production environment with Delphi 2006 and freepascal. It is stable enough for us. We have a billing system running with 24/7 uptime.
If you have some time to spend on Pg coding for Zeos drop me a PM as i am coordinating the development. We would be really happy if we get experienced coders who join the team!
thanks,
helmut