Page 1 of 1

DbLibMetadata

Posted: 21.04.2014, 18:50
by CompsSQL
I think there is a bug in ZDbcDbLibMetadata.pas (revision 3115)

in TZSybaseDatabaseMetadata.UncachedGetTables :
a call is made to ComposeObjectString with only 2 parameters :
ComposeObjectString(TableTypes, '"'))
I think this should be :
ComposeObjectString(TableTypes, 'null', '"')

and the same thing in TZSybaseDatabaseMetadata.UncachedGetUDTs.
ComposeObjectString(UDTypes, '"')
should be
ComposeObjectString(UDTypes, 'null', '"')

Re: DbLibMetadata

Posted: 27.06.2014, 23:30
by EgonHugeist
Hi CompsSQL,

have some trouble with my current sybase installation. Got only ASA running. So what's going wrong? Could you give some more details?

Re: DbLibMetadata

Posted: 19.07.2014, 07:43
by CompsSQL
in ZDbcDbLibMetadata.pas
in "function TZSybaseDatabaseMetadata.UncachedGetTables"
in the "with GetStatement.ExecuteQuery" statement, a "format" is used
the last parameter of that format statement is : ComposeObjectString(TableTypes, '"')

the function declaration for that ComposeObjectString method is :
function TZDbLibBaseDatabaseMetadata.ComposeObjectString(const S: String;
Const NullText: String = 'null'; QuoteChar: Char = #39): String;

The call to ComposeObjectString only passes 2 arguments, so the call to ComposeObjectString uses :
param 1 : S => gets filled with TableTypes => OK
param 2 : NullText => gets filled with the quote that was passed in from the call => [b]not ok[/b]
param 3 : QuoteChar => not given in the call, so the default #39 is used
__________

if you change that call to : ComposeObjectString(TableTypes, 'null', '"'), then :
param 1 : S => gets filled with TableTypes => OK
param 2 : NullText => gets filled with the string "null" => OK
param 3 : QuoteChar => gets filled with a double-quote char => OK
__________

if my program, the "TableTypes" parameter was empty.
In the TZDbLibBaseDatabaseMetadata.ComposeObjectString implementation, the first instruction is :
if S = '' then
Result := NullText
But because of the wrong parameters, this "NullText" got filled with a double-quote character
__________

the exact same thing is done in "TZSybaseDatabaseMetadata.UncachedGetUDTs", so that will need to change as well

Re: DbLibMetadata

Posted: 31.07.2014, 18:04
by marsupilami
Hello CompsSQL,

I do have a problem here. In my local copy of Zeos 7.2 I had to do the exactly reverse thing to get it working wity my quite ages Sybase ASE 12.5.
I had to modify

Code: Select all

ComposeObjectString(TableTypes, '"') // modified to: 
ComposeObjectString(TableTypes)
to get it working right. So I am not sure, if your modification is correct?
Best regards,

Jan

Re: DbLibMetadata

Posted: 13.08.2014, 17:29
by CompsSQL
your solution works for me too.

Re: DbLibMetadata

Posted: 15.08.2014, 11:38
by EgonHugeist
Colud you guys attach a patch?

Re: DbLibMetadata

Posted: 18.08.2014, 10:26
by EgonHugeist
Patch applied R3266 \testing-7.2 (SVN)