-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: change the format of the ascTime() function #3398
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
base: v3/master
Are you sure you want to change the base?
Conversation
@JakubOnderka could you take a review too? |
I was confused as to why this fix is necessary, so I looked into the LLVM implementation. It turns out that the use |
Thanks for reviewing that. Moreover, your suggestion to Unfortunately, after my initial commit the error still persists, even on Linux (with |
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
|
Hmm... all test have passed. It's very weird. Note, that the original problem was (in my opinion) that previously the test expected this format: |
@airween I am not sure if changing that is the best idea as even the new format will still be problematic. There is no good solution for that, but maybe the best will be include new field (maybe something like like |
thanks for reviewed this.
ah, my bad... I thought this issue is a serious one, and I didn't understand why was it failed. I assumed this tests is an old one, but meanwhile I realized that this is a new test - you added that in one of your recent commit. So we can keep this format as is, but please change that test pattern:
The first |
what
This PR changes the format of utils::string::ascTime().
The function is used only in one place, in transaction.cc, it produces the field
time_stamp
if the audit log format is JSON, for eg.:why
The old (actual) format of that function is
%c
, which is the expected format, but as the documentation writes:writes standard date and time string, e.g. Sun Oct 17 04:41:13 2010 (locale dependent)
it's locale dependent. This means if the locale uses only 1 digit for the day, then the test is failed, see this comment. The log in that case will look like this:
Please note that there are two spaces and 1 digit.
This modification changes the format and if the day is below 10, then adds a leading zero, without extra space.
references
C++ reference of strftime.
other notes
Please review this PR carefully as it may break audit log file JSON parsers if the server localization uses a single-digit date representation.