Bug when using SIZE in combination with date lower parameter

#1

Hello,

I have 2 entity types, which I want to query, ParserJob and Tag. Unfortunately there seems to be a bug if I use the lower date select:

SELECT j.jobId, SIZE(j.tags) FROM ParserJob j WHERE j.dateCreated < :date

This returns a SIZE(j.tags) of 0 Tags, but the only existing ParserJob has 1 Tag. If I run the query:

SELECT j.jobId, SIZE(j.tags) FROM ParserJob j WHERE j.dateCreated >= :date

I get the correct result (1 Tag).

You find a test case at <deleted>. Please start the Tester.main(), both queries should return the same results. I use the latest ObjectDB 2.7.2_05 on Windows 10 but the bug also exists in older versions.

Thanks in advance
Markus

#2

Can you confirm that the query that returns 0 should actually return no results as there are no matching jobs in the database?

ObjectDB Support
#3

Hello,

yes, I can confirm that both queries should return the same results but they do not. The first query returns 1 result and a tags size of 1 which is correct, the second query also returns 1 result but 0 tags which is obviously wrong since no tags get filtered by the query.

Thanks in advance
Markus

#4

> yes, I can confirm that both queries should return the same results but they do not.

But there is only one ParserJob instance, so one query should return no results, doesn't it? dateCreated cannot be both before and after the date parameter.

ObjectDB Support
#5

Hello,

to archieve the results the date parameter used in both queries is obviously not the same. For the first query it is 1 year in the future, for the second query 1 year in the past. Otherwise there would be no bug. My provided test case illustrates this behavior.

Best regards
Markus

#6

Please try build 2.7.2_06 that should fix this bug.

ObjectDB Support
#7

Thanks. That fixed the bug.

Reply