![]() |
MySQL 9.7.0
Source Code Documentation
|
Files | |
| file | my_temporal.h |
| Server classes for temporal handling (DATE, TIME, DATETIME) | |
| file | my_temporal.cc |
| Implementation of low level date, time and datetime utilities. | |
Functions | |
| bool | Time_val::is_adjusted (uint32_t decimals) const |
| uint32_t | Time_val::actual_decimals () const |
| void | Time_val::adjust_fraction (uint32_t decimals, bool round) |
| bool | Time_val::add (Time_val tv, bool subtract) |
| Add a time value to another time value, or subtract it. More... | |
| bool | Time_val::add (Interval &iv, bool subtract) |
| Add an interval to a time value, or subtract it. More... | |
| static Time_val | Time_val::strip_date (const MYSQL_TIME &mt) |
| Creates a Time_val from a date_time by extracting only the time fields. More... | |
| Time_val::operator MYSQL_TIME () const | |
| Convert time value to the generalized temporal time format. More... | |
| void | Time_val::store_time (uint8_t *ptr, uint32_t dec) const |
| Convert server time value to storage engine interface format. More... | |
| static void | Time_val::load_time (const uint8_t *ptr, uint32_t dec, Time_val *time) |
| Convert from storage engine interface time format to server time value. More... | |
| int64_t | Time_val::to_int_rounded () const |
| base100 representation without microsecond, but rounded '-12:34:56.999999' is returned as -123457 More... | |
| int64_t | Time_val::to_int_truncated () const |
| base100 representation without microsecond, '-12:34:56.999999' is returned as -123456 More... | |
| double | Time_val::to_double () const |
| base100 representation with microseconds, returned as double precision float More... | |
| size_t | Time_val::to_string (char *buffer, uint32_t dec) const |
| std::string | Time_val::to_string () const |
| static int | Date_val::make_date (uint32_t year, uint32_t month, uint32_t day, my_time_flags_t flags, Date_val *date) |
| Make date from year, month and day components, according to validation flags. More... | |
| int | Date_val::check_date (my_time_flags_t flags) const |
| Check date for validity, according to calendar and validation flags. More... | |
| static void | Date_val::day_number_to_date (uint32_t daynr, uint32_t *year, uint32_t *month, uint32_t *day) |
| Convert day number to date. More... | |
| bool | Date_val::add (Interval &iv, bool subtract) |
| Add an interval to a date value, or subtract it. More... | |
| void | Date_val::set_last_day_of_month () |
| Adjust date to have last day of month. More... | |
| static Date_val | Date_val::strip_time (const MYSQL_TIME &mtime) |
| Creates a Date_val from a date_time by extracting only the date fields. More... | |
| Date_val::operator MYSQL_TIME () const | |
| Convert date value to the generalized temporal time format. More... | |
| Date_val::operator Datetime_val () const | |
| Convert date value to a datetime value, where time component is 00:00:00. More... | |
| int32_t | Date_val::to_int () const |
| uint32_t | Date_val::day_number () const |
| size_t | Date_val::to_string (char *buffer) const |
| std::string | Date_val::to_string () const |
Variables | |
| static const uint32_t | divisors [] = {1000000, 100000, 10000, 1000, 100, 10} |
| static const uint32_t | month_days [] |
| static const uint32_t | leap_days [] |
| static const uint32_t | sum_days [] |
| uint32_t Time_val::actual_decimals | ( | ) | const |
| bool Time_val::add | ( | Interval & | iv, |
| bool | subtract | ||
| ) |
Add an interval to a time value, or subtract it.
| iv | Interval to add or subtract |
| subtract | If true, subtract the time value, otherwise add it. |
| bool Date_val::add | ( | Interval & | iv, |
| bool | subtract | ||
| ) |
Add an interval to a date value, or subtract it.
| iv | Interval to add or subtract |
| subtract | If true, subtract the interval value, otherwise add it. |
| bool Time_val::add | ( | Time_val | tv, |
| bool | subtract | ||
| ) |
Add a time value to another time value, or subtract it.
| tv | Time value to add or subtract |
| subtract | If true, subtract the time value, otherwise add it. |
| void Time_val::adjust_fraction | ( | uint32_t | decimals, |
| bool | round | ||
| ) |
| int Date_val::check_date | ( | my_time_flags_t | flags | ) | const |
Check date for validity, according to calendar and validation flags.
| flags | validation flags |
| uint32_t Date_val::day_number | ( | ) | const |
Date must have valid year, month and day values (month 0 and day 0 are invalid), but there is no other validity check (e.g February 31 is allowed).
|
staticprivate |
Convert day number to date.
Convert a day number to a date.
Day number 1 is date 0000-01-01.
| daynr | day number to convert | |
| [out] | year | year of date, range is 0000 to 9999. |
| [out] | month | month of date (note: January is 0, February is 1, etc) |
| [out] | day | day of date, returned as a zero-based number |
Day number 1 is returned as date 0000-01-01.
This function is called from mysqld's print_fatal_signal(). Do not make changes to this function that make that call unsafe.
| bool Time_val::is_adjusted | ( | uint32_t | decimals | ) | const |
|
static |
Convert from storage engine interface time format to server time value.
| ptr | The pointer to read the value at. | |
| dec | Precision. | |
| [out] | time | Returned time value |
|
static |
Make date from year, month and day components, according to validation flags.
| year | year component | |
| month | month component | |
| day | day component | |
| flags | flags for validation | |
| [out] | date | constructed date, if date is valid |
|
explicit |
Convert date value to a datetime value, where time component is 00:00:00.
|
explicit |
Convert time value to the generalized temporal time format.
|
explicit |
Convert date value to the generalized temporal time format.
| void Date_val::set_last_day_of_month | ( | ) |
Adjust date to have last day of month.
Setting last day of month zero is not a valid operation.
| void Time_val::store_time | ( | uint8_t * | ptr, |
| uint32_t | dec | ||
| ) | const |
Convert server time value to storage engine interface format.
| [out] | ptr | The buffer to put value at. |
| dec | Precision. |
|
static |
Creates a Time_val from a date_time by extracting only the time fields.
|
static |
Creates a Date_val from a date_time by extracting only the date fields.
| double Time_val::to_double | ( | ) | const |
base100 representation with microseconds, returned as double precision float
| int32_t Date_val::to_int | ( | ) | const |
| int64_t Time_val::to_int_rounded | ( | ) | const |
base100 representation without microsecond, but rounded '-12:34:56.999999' is returned as -123457
| int64_t Time_val::to_int_truncated | ( | ) | const |
base100 representation without microsecond, '-12:34:56.999999' is returned as -123456
| std::string Time_val::to_string | ( | ) | const |
| std::string Date_val::to_string | ( | ) | const |
| size_t Date_val::to_string | ( | char * | buffer | ) | const |
| size_t Time_val::to_string | ( | char * | buffer, |
| uint32_t | dec | ||
| ) | const |
|
static |
|
static |
|
static |
|
static |