Bug 1001883 - Searching datetime fields with the 'is' operator does not return expected results
Searching datetime fields with the 'is' operator does not return expected res...
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.15
: ---
Assigned To: Dan Callaghan
Depends On:
  Show dependency treegraph
Reported: 2013-08-27 23:27 EDT by Raymond Mancy
Modified: 2018-02-05 19:41 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-02 22:29:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Raymond Mancy 2013-08-27 23:27:51 EDT
Description of problem:

Using the searchbar and searching for things via a datetime and using the 'is' operator does not return the expected results.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Search for something with a datetime (i.e System/LastInventoried)
2. use the 'is' operator

Actual results:

Nothing returned

Expected results:

The systems that were inventoried on that date

Additional info:

I replicated this problem with MariaDB 5.5.31.
The problem is with comparing datetime values as strings.

This is the crucial part of the query:

  system.date_lastcheckin >= "2013-08-28 00:00:00" AND system.date_lastcheckin <= "2013-08-29 23:59:99"

Specifically, the '<=' doesn't seem to work as we expect. Replacing it with the following, fixes the problem:

  system.date_lastcheckin >= "2013-08-28 00:00:00" AND system.date_lastcheckin <= STR_TO_DATE('2013-08-28 23:59:59', '%Y-%m-%d %H:%i:%s')
Comment 2 Dan Callaghan 2013-09-26 23:11:07 EDT
This issue was fixed by the patch for bug 989902.
Comment 3 Amit Saha 2013-09-27 00:37:15 EDT
Verified that bug is fixed in beaker-server-0.15.0-0.rc1.git.8.85dcb9c.fc18.noarch.

Verification steps:

- Prior to the bug being fixed, searching for 'SystemAdded' with the 'is' operator
returns nothing even though there is a system with that date.

- After the patch, the search works fine.
Comment 4 Nick Coghlan 2013-10-02 22:29:06 EDT
Beaker 0.15 has been released.

Note You need to log in before you can comment on or make changes to this bug.