Rico Jansen wrote:
Mark Huijser wrote:

BasicQueryHandler.readNodes should trucate results to maxNumber, if the databaseHandler supports maxNumber, but shouldn't it always truncate the results if the maxNumber is set? And what happens if the DatabaseHandler doesn't support max at all?

Then it should fall back to the java code truncate.

Well, lets take a look at the code. the List of results is not filled at all if the databaseHandler doensn't support max, so the result is an empty List! Looks like a bug to me.


In informix specifically, maxNumber-support is set to true, but in the case of a UNION query, max (SELECT FIRST n) cannot be used (stupid informix). So here we are dependent on the fallback in BasicQueryHandler.readNodes, which - poorly - never trucates the results :-(, because maxNumber-support is set to true.

That is indeed a probleem, that certain queries dissalow certain constructions, but is hardly the fault of Informix. What is it supposed to do with a first in union situation ?. The first clause only applies to the fist half of the union not the second half, but if you put it in both it just sums the both firsts or does it do something special like taking both firsts and halve the result ? Remember a union query is the concatenation of two queries, so clauses on the first half don't apply to the second. This includes first count,max and other clauses.

It is indeed a bit strange that Informix bans the use of first alltogether in unions, but that is probably because otherwise these kinds of problems crop up.

Ok. that makes sense.

Mark




Reply via email to