MySQL 9.6.0
Source Code Documentation
mysql_timestamp_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2025, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_TIMESTAMP_IMP_H
25#define MYSQL_TIMESTAMP_IMP_H
27#include "sql/log.h"
28
30 public:
31 /**
32 Make and return an ISO 8601 / RFC 3339 compliant timestamp.
33
34 @param buffer a buffer of at least iso8601_size bytes to store
35 the timestamp in. The timestamp will be \0 terminated.
36 @param size size of the buffer.
37
38 @retval 0 if size < iso8601_size
39 else length of the timestamp (excluding \0)
40 */
42 (char *buffer, size_t size));
43
44 /**
45 Make and return an ISO 8601 / RFC 3339 compliant timestamp.
46 Accepts the log_timestamps global variable in its third parameter.
47
48 @param buf A buffer of at least iso8601_size bytes to store
49 the timestamp in. The timestamp will be \0 terminated.
50 @param utime Microseconds since the epoch
51 @param mode if 0, use UTC; if 1, use local time
52
53 @retval length of timestamp (excluding \0)
54 */
56 (char *buf, ulonglong utime,
58};
59
60#endif /* MYSQL_TIMESTAMP_IMP_H */
Definition: mysql_timestamp_imp.h:29
static int make_iso8601_timestamp(char *buf, ulonglong utime, enum enum_iso8601_tzmode mode) noexcept
Make and return an ISO 8601 / RFC 3339 compliant timestamp.
Definition: mysql_timestamp_imp.cc:40
static int make_iso8601_timestamp_now(char *buffer, size_t size) noexcept
Make and return an ISO 8601 / RFC 3339 compliant timestamp.
Definition: mysql_timestamp_imp.cc:33
enum_iso8601_tzmode
Definition: iso8601_tzmode.h:35
Error logging, slow query logging, general query logging: If it's server-internal,...
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: buf0block_hint.cc:30
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
mode
Definition: file_handle.h:61
Specifies macros to define Service Implementations.
#define DEFINE_METHOD(retval, name, args)
A macro to ensure method implementation has required properties, that is it does not throw exceptions...
Definition: service_implementation.h:79