Skip to content

SQL warnings "null value eliminated in set function" (code -1003, state 01003)  #88

@raphj

Description

@raphj

When saving a document that contains new tasks, we sometimes get such warnings in the log (I use hqldb):

2024-01-16 11:46:42,502 [qtp952562199-1837 - http://localhost:8090/xwiki/bin/preview/Main/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1003, SQLState: 01003 
2024-01-16 11:46:42,502 [qtp952562199-1837 - http://localhost:8090/xwiki/bin/preview/Main/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - warning: null value eliminated in set function 

Apparently this is a warning mandated by the SQL standard. (via https://stackoverflow.com/questions/18719436/getting-warning-null-value-is-eliminated-by-an-aggregate-or-other-set-operation/18719852#18719852)

This comes from query select max(taskObject.number) from Document doc, doc.object(TaskManager.TaskManagerClass) as taskObject, this seem to be because some taskObject.number fields are null when the query runs.

Adding where taskObject.number is not null fixes the issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions