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

MySQL/MariaDB: Fix icingadb_schema.timestamp not being UNX time #700

Merged
merged 2 commits into from Mar 25, 2024

Conversation

lippserd
Copy link
Member

We previously incorrectly used CURRENT_TIMESTAMP() an alias for NOW() which returns the current date and time in the format YYYY-MM-DD hh:mm:ss using the session time zone. Since we are using numeric context, the value is stored in the format YYYYMMDDhhmmss. But actually we want to set a (millisecond) UNIX timestamp here, so we need to use UNIX_TIMESTAMP() instead.

Since the timestamps need to be corrected, there is also a schema upgrade.

`CURRENT_TIMESTAMP()` an alias for `NOW()` returns the current date and
time in the format `YYYY-MM-DD hh:mm:ss` using the session time zone.
Since we are using numeric context, the value is stored in the format
`YYYYMMDDhhmmss`. But actually we want to set a (millisecond) UNIX
timestamp here, so we need to use `UNIX_TIMESTAMP()` instead.
@cla-bot cla-bot bot added the cla/signed label Mar 18, 2024
@lippserd lippserd added this to the 1.1.2 milestone Mar 18, 2024
We previously incorrectly used `CURRENT_TIMESTAMP()` instead of
`UNIX_TIMESTAMP()` so the timestamps need to be corrected.
@julianbrost julianbrost merged commit 16333b1 into main Mar 25, 2024
31 checks passed
@julianbrost julianbrost deleted the icingadb_schema-timestamp branch March 25, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants