Subject RE: [IBO] IBOQuery parser bug
Author Support List
Tomek,

Thanks for reporting this bug.

I have fixed it and will put it in the next release. If you want to patch
your sources, you can alter TIB_Dataset.SysFinishRawSQL such that:

if IsSelectSQL {+++} and not SQLIsExecuteBlock {+++} then
begin
if OrderingItemNo = 0 then
tmpStr := Trim( SQLOrder.Text )
else
tmpStr := GetOrderingSQL( OrderingItemNo );

Adding in the check for the EXECUTE BLOCK statement type here will avoid the
order by clause from getting tinkered with.

Regards,
Jason LeRoy Wharton
www.ibobjects.com


> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Behalf Of tomjanczkadao
> Sent: Monday, August 08, 2011 1:58 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] IBOQuery parser bug
>
> Hi
> Bug is very simple to reproduce at any database, just open with
> TIBOQuery statement like this:
>
> execute block
> returns(OUT_STRING varchar(31))
> as
> begin
> select db.rdb$character_set_name
> from RDB$DATABASE db
> order by db.rdb$character_set_name
> into :OUT_STRING;
> suspend;
> end
>
> SQLMonitor shows what is sent to FB:
>
> execute block
> returns(OUT_STRING varchar(31))
> as
> begin
> select db.rdb$character_set_name
> from RDB$DATABASE db
> ORDER BY db.rdb$character_set_name into ? /* PRM_0 */ ASC
> ;
> suspend;
> end
>
> Problem is ORDER BY clause, followed by INTO.
> 1. parameters inside execute block should not be prepared at all.
> 2. parsing order clause appends ASC after INTO!!
>
> IBO 4.9.14 build 12
>
> Regards, Tomek