[patch_done] Zeos trunk Postgres "\"

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

[patch_done] Zeos trunk Postgres "\"

Post by sandeep_c24 »

I have a table in Postgres database and one of the columns contains "\". If I use PGAdmin I can see "\" but if I read this table using Zeos I don't see "\". But if I change "\" to "\\" then I can see "\" using Zeos.

I thought this problem was fixed long back, but it looks like it is back. I am using DelphiXE with update 1.

Regards

Sandeep
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

I have done some more tests and it seems to work ok in varchar fields but doesn't work in text(memo) fields.

Regards

Sandeep
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

I have found what the problem is. Following line(line number 630)

Stream := TStringStream.Create(FPlainDriver.DecodeBYTEA(GetString(ColumnIndex)));

should be

Stream := TStringStream.Create(GetString(ColumnIndex));

in file ZDbcPostgreSqlResultSet.

Sandeep
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

Could anyone also fix


function EncodeBYTEA(Value: AnsiString; Handle: PZPostgreSQLConnect): AnsiString;
function DecodeBYTEA(value: AnsiString): AnsiString;

in ZPlainPostgreSqlDriver to have const Value parameters.

Regards

Sandeep
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

I have changed few files to improve performance and encoding. Please have a look at these changes and if happy please commit them.

Regards

Sandeep
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi Sandeep,

I did commit your patch (in 2 steps, revisions 855 and 856).

I guess making a test case for the zeoslib test suite (bugreport part) is asking too much? It would make the possibility of re-introducing this bug again smaller. I suppose the test can be universal : all compilers and all databases should be able to store a "\" string into a blob and read it again.

Mark
Image
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post by sandeep_c24 »

Hi Mark

Sorry my mistake, I didn't check the changes in branch, I was just using trunk.

Regards

Sandeep
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Sorry my mistake,
:?: :?: :?:
I didn't see a mistake. Understand me very well : I applied these changes after you posted them.
They'll move to trunk next time I can spend some more time on zeoslib. (Commit is one week old now, so should be stable enough for trunk)
Mark
Image
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Sandeep,

Is this patch also for 6.6 (stable) branch? Const stuff shouldn't be a problem, but removing DecodeByteA seems tricky in a stable release...

Mark
Image
Locked