YADA
YADA copied to clipboard
nullpointerexception on unconventional query
On a big SELECT /union/ SELECT / union ... query, which the parser declares is unparseable (but works when executing "plain vanilla"), the query cannot be executed because I get:
java.lang.NullPointerException
at com.novartis.opensource.yada.QueryManager.prepQueryForExecution(QueryManager.java:702)
at com.novartis.opensource.yada.QueryManager.prepQueriesForExecution(QueryManager.java:857)
at com.novartis.opensource.yada.QueryManager.processRequest(QueryManager.java:189)
at com.novartis.opensource.yada.QueryManager.
QueryManager - line 702 is doing a:
yq.getType().equals(...)
yq.getTypes() returns null, because yq.type has not been set.
yq.type should probably default to some "UNDERTMINED" value that does not fail its '.equas()' or perhaps yq.getTypes() should never return null....
everything works again when I surround my query with SELECT * FROM ( the original big union query) etc.
It would be really nice to upgrade the parser (it fails with 8.6.1. because there is a lot of postgres peculiarities) but a NullPointerException should never happen in QueryManager etc.