5.4.1+8 QoQ error data exception: string data, rig...
# lucee
d
5.4.1+8 QoQ error data exception: string data, right truncation ; size limit: 32768 table: QDISTINCTFIELDSALL column: OPTIONLIST Looks a little like this https://luceeserver.atlassian.net/browse/LDEV-4615
We just upgraded from 5.3.9 and hit this error on a rather large query
This is the query its failing on, if I remove the distinct, it works ok. Not sure how to make a reproducible test case 😞
Copy code
<cfquery name="qDistinctFields" dbtype="query">
	select distinct fieldcode, fieldcodelower, fieldname, datatypedefinition, maxlength, fieldtypedefinition, islocked, optionlist, questionlistid, questionlistname,
		isCustomForm, isappform,
		templatelist, 
		questionheadingdisplay, questionheading, sectionheading, pageheadingdisplay, pageheading
	from qDistinctFieldsAll
	where isAppForm = 1
	order by fieldcodelower, fieldname
</cfquery>
z
what does the source table create table statement look like?
out of interest, does group by work
d
It’s an oracle table with a varchar(2000)
Won’t be able to check the second question until tomorrow now
z
strange, do you have the full stacktrace?
d
dump.txt
z
thanks... odd, at least with 5.4.18 we get much more meaningful stack traces
d
group by produces the same error
z
some of those column names look reserved
can you DM me the create table statement?
d
maxlength seems like it would be
from oracle?
👍 1
z
that should be working via native QOQ
yeah, I have a local instance
i'll have a play after day$job is over this evening (berlin time)
d
no worries, Im in Brisbane so clocking off for today
z
i have a cracking qoq debug setup for hacking on https://github.com/lucee/Lucee/pull/1211
yeah bet it's the maxlength column name
d
It looked very sus
z
i tried adding support for reserved works, but that created other problems lol
😄 1
@bdw429s curious why this feel thru to hsqldb tho
b
I agree, seems like native should work
I'm waiting for my bags at an airport in spain so I can't take a look, but setting the system property to disable hsqldb will tell you.
z
escaping the heatwave? softy!
☀️ 1
can't quite repo, @Dean can u try with
lucee.qoq.hsqldb.disable set
to false?
d
Copy code
LUCEE_QOQ_HSQLDB_DISABLE=false
LUCEE_QOQ_HSQLDB_DEBUG=true
Logs...
Copy code
"ERROR","XNIO-1 task-4","07/11/2023","11:20:34","QoQ [select distinct fieldcode, fieldcodelower, fieldname, datatypedefinition, maxlength, fieldtypedefinition, islocked, optionlist, questionlistid, questionlistname,
		isCustomForm, isappform,
		templatelist, 
		questionheadingdisplay, questionheading, sectionheading, pageheadingdisplay, pageheading
	from qDistinctFieldsAll
	where isAppForm = 1
	order by fieldcodelower, fieldname] errored and is falling back to HyperSQL.","column name [isAppForm] already exist;lucee.runtime.exp.DatabaseException: column name [isAppForm] already exist
@bdw429s @zackster
Ive found if I match the casing of the field
isappform
in the select, it works.
b
@Dean Is there a stack trace on that error?
d
Will have one shortly...
Its the same as the one I posted above
b
Shouldn't be
The one you posted above is specifically from hsqldb and was captured prior to you turning on the debug flag
You need to look for a stack trace in the logs where you found the "falling back" message
d
Yes, did you want me to set LUCEE_QOQ_HSQLDB_DISABLE=false to true?
b
well, it shouldn't be necessary, but it sure would be easier 🙂
The debug flag should have put a stack in the log where you found the "falling back message"
d
ahhhhhhh
b
But if you just disable hsqldb in the first place when you'll see the actual full native exception as the only exception
I'm not entirely sure Zac didn't just have you disable hsqldb in the first place, which was my suggestion above
Then that just completely removes hsqldb from the picture
d
I did that earlier and got a different message
trying to find it
b
Yes, that was likely the actual native error for which I'm wanting the stack trace, lol
There are two different bugs going on here • the native QoQ seems to have an issue recognizing the column names when the case doesn't match • then it falls back to Hsqldb which throws a data truncation error
d
hsqldberror.txt
let me know if thats enough, or you want me to recreate with hsqldb off
b
Perfecto
Gracias
@zackster Where do you want the fix for this QoQ bug sent?
The repro case for it is simply
Copy code
qry = queryNew( 'col', 'varchar', [['foo'],['bar']] );

result = queryExecute(sql="
            SELECT  distinct col
            FROM qry
            where COL = 'foo'
        "
        ,params=[]
        ,options={dbtype="query"}
        );
where the case of the column in the select list is different than that in the where clause
Bug has prolly been there for a while, but the hsqldb fallback masked it until the new hsqldb upgrade had its update and failed for its own recent
z
for 6
and 5.4, it's a bug fix, it will be 5.4.2.0
@zackster There's pulls for the native QoQ bug fix for 5.4 and 6.0
teamQoQ!
💪 1
d
Woohoo...thanks guys!