queryExecute result attribute bugs

Description

Copying most of this from the google group conversation: https://groups.google.com/forum/#!searchin/lucee/query/lucee/KlP7G4ApwoU/BF2k8EoOphAJ

I have found a few different bugs in the queryExecute function around the result attribute. Here is the testcases:

https://gist.github.com/ryanguill/b6497628e951a3cffacd

All tested on lucee 4.5.1.000.

The bugs as I see them:

1) There is only one way I can find to create the result attribute variable in the local scope. See test 2, 3, 4 - test 7 does work (thanks to John Berquist)
2) 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.
3) 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.
4) 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
5) related to LDEV-5, 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.

Environment

None

Attachments

8
  • 27 Oct 2016, 10:52 am
  • 26 Apr 2016, 08:37 am
  • 26 Apr 2016, 08:37 am
  • 26 Apr 2016, 08:36 am
  • 26 Apr 2016, 08:36 am
  • 26 Apr 2016, 08:36 am
  • 26 Apr 2016, 08:35 am
  • 26 Apr 2016, 08:32 am

Activity

Show:

Michael Offner 27 October 2016 at 14:39

testcase 4,5,6 are not valid, the rest of the testcases passes with Lucee 5
https://github.com/lucee/Lucee/blob/cf0e38bab3caffb54d00fac9cff8aef38f57df9b/test/tickets/LDEV0218.cfc

So this is a Lucee 4.5 issue only and already solved with 5.0

Pothys - MitrahSoft 27 October 2016 at 10:50

I've added the test cases for queryExecute(). I've written the testcases for Lucee 5.1.0.34

Out of 8 cases, 3 were failed, all the 3 cases have an similarity that, the value for result attribute have been provided without hashes & quotes(like result=result / result=local.result ) with/without a variable predefined.

Screenshot: Testcases_5_1_0_34.jpg
Pull request: https://github.com/lucee/Lucee/pull/50

Adam Tuttle 12 May 2016 at 22:03

I also agree that this should not be considered minor. In my case I'm using PostgreSQL, so I can add "returning fooId" to my query to have it return the generated id as a typical recordset, but that is just a band-aid for an otherwise majorly broken language feature.

Pete Freitag 12 May 2016 at 20:16

Ran into this today.

Agree with Tom, I think this should not be marked minor, it is pretty essential to get the result.generatedKey in many cases.

Former user 26 April 2016 at 10:33
Edited

because when this ticket was raised, that was the default priority that Jira assigned it - I've been meaning to take this through triage including setting up the unit tests for it however have been too busy with my day job to spend much time on Lucee 4 issues sadly. I guess also at least in this instance there is a workaround, albeit an annoying one.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 10 March 2015 at 00:42
Updated 15 July 2020 at 15:18

Flag notifications