287 words

g when using SIZE in combination with date lower parameter

#1
2017-11-10 10:46

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

doppelrittberger
doppelrittberger's picture
Joined on 2016-01-13
User Post #38
#2
2017-11-10 10:53

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,889
#3
2017-11-10 11:15

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

doppelrittberger
doppelrittberger's picture
Joined on 2016-01-13
User Post #39
#4
2017-11-10 11:22

> 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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,890
#5
2017-11-10 11:31

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

doppelrittberger
doppelrittberger's picture
Joined on 2016-01-13
User Post #40
#6
2017-11-13 11:06

Please try build 2.7.2_06 that should fix this bug.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,890

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel