Count() does not work if a table/collection has no entries. Tested for MariaDB and Mongo.
Query
from Entity a select count(a.@id) as cnt
Expected behavior
Returning
contents(
["a.cnt"],
[["0"]])
REST API
MariaDB:
(internal error)
at $typhonql$(|main://$typhonql$|)
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:659)
at java.util.ArrayList.get(ArrayList.java:435)
at nl.cwi.swat.typhonql.backend.rascal.AggregateIt.processStream(AggregateIt.java:24)
at nl.cwi.swat.typhonql.backend.Runner.computeResultStream(Runner.java:58)
Describe the bug
Count() does not work if a table/collection has no entries. Tested for MariaDB and Mongo.
Query
Expected behavior Returning
REST API
MariaDB:
Mongo: