Print Thread
DOA 4.1.3.5 XE6 - QBE bug with "having"
#49344 08/06/14 06:19 AM
Joined: Jan 2004
Posts: 59
G
giga Offline OP
Member
OP Offline
Member
G
Joined: Jan 2004
Posts: 59
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



Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
giga #49346 08/06/14 08:17 AM
Joined: Aug 1999
Posts: 22,200
Member
Offline
Member
Joined: Aug 1999
Posts: 22,200
Can you check the field type of the X field?


Marco Kalter
Allround Automations
Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
Marco Kalter #49349 08/06/14 08:38 AM
Joined: Jan 2004
Posts: 59
G
giga Offline OP
Member
OP Offline
Member
G
Joined: Jan 2004
Posts: 59
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

Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
giga #49361 08/07/14 11:39 AM
Joined: Jan 2004
Posts: 59
G
giga Offline OP
Member
OP Offline
Member
G
Joined: Jan 2004
Posts: 59
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.

Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
giga #49380 08/11/14 01:43 PM
Joined: Aug 2014
Posts: 4
P
Member
Offline
Member
P
Joined: Aug 2014
Posts: 4
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.


Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
PreXident #49409 08/18/14 11:49 AM
Joined: Aug 2014
Posts: 4
P
Member
Offline
Member
P
Joined: Aug 2014
Posts: 4
[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.

Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
PreXident #49835 12/02/14 07:50 AM
Joined: Jan 2004
Posts: 59
G
giga Offline OP
Member
OP Offline
Member
G
Joined: Jan 2004
Posts: 59
Dear Marco, it is really so hard to implement this bugfix?

Re: DOA 4.1.3.5 XE6 - QBE bug with "having"
giga #51122 03/24/15 11:32 AM
Joined: Jan 2004
Posts: 59
G
giga Offline OP
Member
OP Offline
Member
G
Joined: Jan 2004
Posts: 59
Dear Marco, is there a chance that this bug will be fixed soon?

Thanks and kind regards


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 15 (0.007s) Memory: 2.5259 MB (Peak: 3.0398 MB) Data Comp: Off Server Time: 2024-04-20 14:50:50 UTC
Valid HTML 5 and Valid CSS