I have found a few different bugs in the queryExecute function around the
result attribute. Here is the testcases:
All tested on lucee 4.5.1.000.
The bugs as I see them:
- There is no way I can find to create the result attribute variable in
the local scope. See test 2, 3, 4 - Trying to use result=“local.result” silently fails to create the
variable at all, in any scope. I believe there is no way to create any
variable that has a period in the name. See test 2. - Trying to var the result prior to the queryExecute call also keeps the
variable from being created at all - it still silently fails. see test 3. - Trying to var the result prior to the queryExecute and then set the
result as result=result (without the quotes) also silently fails to fill
the variable, see test 4 - related to #4, trying to use result=result (without the quotes) and also
without creating the variable first throws a syntax error. I assume this is
expected, the result attribute is expecting a variable name that it can use
to create the variable - I would still argue this is bad form though, we
should be able to provide the variable for the result value to go into .
See test 5.
See test 6 for an example of the ability to assign to local variables
working properly with tags.
Also, as far as I can find there is no documentation anywhere around using
the result attribute with queryExecute, which cause a lot of fumbling
around on my part trying to figure out how to make it work, with these bugs
hiding how it should actually work.
I intend to raise these as issues in the bug tracker - it would be nice if
I could get independent confirmation that these are indeed bugs and not me
making a simple mistake - but I would also like to know from the team if
you would like these as one issue encompasing all of these bugs or raised
as separate issues.
I intend to file a separate proposal to overhaul the queryExecute()
function (or replace it) in the near future, but I believe these bugs need
to be fixed regardless.
See also this other bug with
queryExecute: Log in with Atlassian account