Page 1 of 1

[patch_done] Zeos trunk Postgres "\"

Posted: 19.11.2010, 00:50
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

Posted: 19.11.2010, 01:10
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

Posted: 19.11.2010, 03:43
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

Posted: 19.11.2010, 04:17
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

Posted: 19.11.2010, 05:32
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

Posted: 19.11.2010, 22:59
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

Posted: 21.11.2010, 22:04
by sandeep_c24
Hi Mark

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

Regards

Sandeep

Posted: 26.11.2010, 22:16
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

Posted: 27.12.2010, 14:48
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