PG8 Blob problem

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
bali001
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 03.10.2005, 17:22

PG8 Blob problem

Post by bali001 »

Hi,

I've some problem with Zeos 651 PG8 driver bytea/text field handling:
selecting RTF text from bytea/text field causes incorrect result due to DecodeString function

original code:

Code: Select all

function TZPostgreSQLResultSet.GetString(ColumnIndex: Integer): String;
begin
  Result := DecodeString(GetRawString(ColumnIndex));
end;
if i remove DecodeString function it works fine:

Code: Select all

function TZPostgreSQLResultSet.GetString(ColumnIndex: Integer): String;
begin
  Result := GetRawString(ColumnIndex);
end;
DecodeString function comment in source:
"Converts an string from escape PostgreSQL format.
@param Value a string in PostgreSQL escape format.
@return a regular string."

Platform:
Zeosdbo: 6.5.1-alpha_cvs_13-10-2005
Protocol: postgresql-8.x (libpq8x.dll replaced with ODBC 8.1.0 libpq.dll)
IDE: Delphi7
DB: PostgreSQL 8.1.0
OS: Windows XP SP2

Thanks for help
Balazs
//sorry for my English :)
cnliou
Zeos Dev Team
Zeos Dev Team
Posts: 31
Joined: 11.11.2005, 12:18

Re: PG8 Blob problem

Post by cnliou »

Zeosdbo encodes text/varchar values before insert/update by calling PQexec C function provided by libpq.dll. In order to return correct values to ZReadOnlyQuery etc., zeosdbo decodes the text/varchar values after retrieving them from libpq.dll.

The encoding/decoding functions are
EncodeString() and DecodeString().

Did you save your RTF data bypassing zeosdbo :?:

Regards,

CN
bali001
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 03.10.2005, 17:22

Post by bali001 »

Hi CN!

RTF data insert is correct via zeosdbo (TZQuery).

Balazs
cnliou
Zeos Dev Team
Zeos Dev Team
Posts: 31
Joined: 11.11.2005, 12:18

Post by cnliou »

We made some changes on line 585 for dbc/ZDbcPostgreSqlResultSet.pas.
Please try cvs version and see if this problem still persists.

Regards,

CN
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

FYI:

Some more changes have been made. They have to be tested and then committed to CVS. After that a new CVS-Build will be released, soon.

Please be patient and stick to us ...
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
bali001
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 03.10.2005, 17:22

Post by bali001 »

thank you CN and thank you Michael

I will be patient and stick to you :D

Balazs
Post Reply