Posted By: giga DOA 4.1.3.5 XE6 - QBE bug with "having" - 08/06/14 06:19 AM
I have a simple select that do grouping where X is varchar (string) field:

select x, count(*) from table group by x;

When I do QBE on the field X, it generates having clause without quotas and select crash!!!

select x, count(*) from table group by x;
having (x = 01002)
/* Modified for QBE */

This works correctly at version 4.1.1.0 where is generated:
having (x = '01002')

How can I fix this behaviour?

Reagrds Vlada


Can you check the field type of the X field?
Posted By: giga Re: DOA 4.1.3.5 XE6 - QBE bug with "having" - 08/06/14 08:38 AM
Hi Marco, thank you.

As I told before - varchar2(10), defined as TStringField at TOracleDataSet.

To reproduce:
create table test (x varchar2(10))
sql.text := 'select x, count(*) from test group by x';
qbemode := True;
qbedefinitions.field[0].Value := '01234'
ExecuteQBE
Posted By: giga Re: DOA 4.1.3.5 XE6 - QBE bug with "having" - 08/07/14 11:39 AM
I did some research and there is result:

- when the field is created it has DataType ftString
- when the QBEMode is set to true, DataType change to 231

That's why the SQL is not correctly generated because you do not count on DataType 231.
For the users with the sources, the problem is in procedure OracleData.SetFieldSize. I guess it uses wrong offset somehow, so TField's FDataType is overwritten instead of FSize.

For ones without the source code access, you can patch the OracleData.dcu manually:
32bit - address on 2E0708 needs to be 58 instead of 50
64bit - unfortunatelly offset is too large for this instruction to be fixed, it needs to be replaced which breaks the dcu and I have no idea about dcu format. Thankfully it is working fine without fixing anyway. However I was not feeling comfortable knowing that some fields are just ramdomly set, so I have changed the three-byte instruction to three one-byte returns (addresses 4A2703, 4A2704, 4A2705 to C3)

Hopefully we get the official fix soon.

[quote=PreXident]
32bit - address on 2E0708 needs to be 58 instead of 50
64bit - unfortunatelly offset is too large for this instruction to be fixed, it needs to be replaced which breaks the dcu and I have no idea about dcu format. Thankfully it is working fine without fixing anyway. However I was not feeling comfortable knowing that some fields are just ramdomly set, so I have changed the three-byte instruction to three one-byte returns (addresses 4A2703, 4A2704, 4A2705 to C3)
[/quote]
Addresses are actually wrong, there are excess zeros. Use 2E078, 4A273, 4A274, 4A275 instead. Sorry for confusion.
Posted By: giga Re: DOA 4.1.3.5 XE6 - QBE bug with "having" - 12/02/14 07:50 AM
Dear Marco, it is really so hard to implement this bugfix?
Posted By: giga Re: DOA 4.1.3.5 XE6 - QBE bug with "having" - 03/24/15 11:32 AM
Dear Marco, is there a chance that this bug will be fixed soon?

Thanks and kind regards
© Allround Automations forums