Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite expiry compare is not correct. #260

Closed
dkulic opened this issue May 30, 2024 · 0 comments
Closed

SQLite expiry compare is not correct. #260

dkulic opened this issue May 30, 2024 · 0 comments

Comments

@dkulic
Copy link
Contributor

dkulic commented May 30, 2024

In SQLite comparison of expiry date is done using query

(expiry IS NULL OR expiry > DATETIME('now'))

but SQLite considers text strings for date and time comparisons by character order, not by their actual date/time value., so the check is not working correctly and Askar returns the items stored even after expired.

The fix is easy, expiry should be first converted to DATETIME, in above query something like:

(expiry IS NULL OR DATETIME(expiry) > DATETIME('now'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants