Bug 1001883 - Searching datetime fields with the 'is' operator does not return expected results
Summary: Searching datetime fields with the 'is' operator does not return expected res...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 0.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.15
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-28 03:27 UTC by Raymond Mancy
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-10-03 02:29:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Raymond Mancy 2013-08-28 03:27:51 UTC
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):

develop

How reproducible:

Always

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

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-27 03:11:07 UTC
This issue was fixed by the patch for bug 989902.

Comment 3 Amit Saha 2013-09-27 04:37:15 UTC
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-03 02:29:06 UTC
Beaker 0.15 has been released.


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