Query.isEmpty() returns false when Query has no rows but has defined columns

Description

The following returns false:

The expected behaviour is to return true, and so do the docs state.

Live example: http://trycf.com/gist/873579e05b829c3949b2/lucee?theme=monokai

Activity

Show:
Dominic Watson
June 22, 2015, 1:47 PM
Edited

I edited the title to be more specific (and accurate) and tweaked example to show difference between supplying column definitions and not. Also updated the TryCF example.

Michael Offner
February 10, 2016, 6:20 PM

this is not a member function, this is a method of the QueryImpl class, more percise a method defined by this interface:
http://javadoc.lucee.org/lucee/runtime/type/Iterator.html#isEmpty()

So this is not offical functionality, of course we can talk about adding an offical isEmpty function, but the behaviour of this method cannot be changed.

Konstantinos Liakos
February 10, 2016, 6:29 PM
Edited

You are right, the IsEmpty(query) function works fine.

But why is the iterator not empty in the first place?

Michael Offner
April 8, 2019, 7:50 PM

we will add a member function for this ans also to other types

Assignee

Michael Offner

Reporter

Konstantinos Liakos

Labels

Affects versions

Priority

Minor
Configure