ClickHouse/base/common
Vasily Nemkov 2d03d330bc Extended range of DateTime64 to years 1925 - 2238
The Year 1925 is a starting point because most of the timezones
switched to saner (mostly 15-minutes based) offsets somewhere
during 1924 or before. And that significantly simplifies implementation.

2238 is to simplify arithmetics for sanitizing LUT index access;
there are less than 0x1ffff days from 1925.

* Extended DateLUTImpl internal LUT to 0x1ffff items, some of which
  represent negative (pre-1970) time values.
  As a collateral benefit, Date now correctly supports dates up to 2149
  (instead of 2106).
* Added a new strong typedef ExtendedDayNum, which represents dates
  pre-1970 and post 2149.
* Functions that used to return DayNum now return ExtendedDayNum.
* Refactored DateLUTImpl to untie DayNum from the dual role of being
  a value and an index (due to negative time). Index is now a different
  type LUTIndex with explicit conversion functions from DatNum, time_t,
  and ExtendedDayNum.
* Updated DateLUTImpl to properly support values close to epoch start
  (1970-01-01 00:00), including negative ones.
* Reduced resolution of DateLUTImpl::Values::time_at_offset_change
  to multiple of 15-minutes to allow storing 64-bits of time_t in
  DateLUTImpl::Value while keeping same size.
* Minor performance updates to DateLUTImpl when building month LUT
  by skipping non-start-of-month days.
* Fixed extractTimeZoneFromFunctionArguments to work correctly
  with DateTime64.
* New unit-tests and stateless integration tests for both DateTime
  and DateTime64.
2021-02-24 17:08:35 +02:00
..
tests Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
argsToConfig.cpp Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
argsToConfig.h Arcadia (#9729) 2020-03-18 21:54:27 +03:00
arithmeticOverflow.h Fix UBSan report in Decimal arithmetic #19432 2021-02-21 13:23:18 +03:00
CMakeLists.txt Move getPageSize in common 2020-12-17 00:23:41 +03:00
constexpr_helpers.h libs/ → base/ 2020-02-14 17:48:30 +03:00
coverage.cpp Fix clang-tidy 2020-09-19 02:05:13 +03:00
coverage.h libs/ → base/ 2020-02-14 17:48:30 +03:00
DateLUT.cpp Remove dependency on tzdata 2020-06-20 15:26:44 +03:00
DateLUT.h Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
DateLUTImpl.cpp Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
DateLUTImpl.h Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
DayNum.h Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
defines.h Fix UBSan report in "round" 2021-01-29 04:03:38 +03:00
demangle.cpp Remove obsolete suppression 2020-05-11 09:50:38 +03:00
demangle.h libs/ → base/ 2020-02-14 17:48:30 +03:00
errnoToString.cpp Added a test for history in clickhouse-client 2020-06-07 20:29:34 +03:00
errnoToString.h Added a test for history in clickhouse-client 2020-06-07 20:29:34 +03:00
ErrorHandlers.h Remove namespace pollution 2020-05-31 00:57:37 +03:00
extended_types.h Remove even more code 2021-01-26 22:04:03 +03:00
find_symbols.h splitInto() now can put result into a vector of std::string_view. 2020-08-08 19:35:53 +03:00
getFQDNOrHostName.cpp Arcadia (#9729) 2020-03-18 21:54:27 +03:00
getFQDNOrHostName.h Arcadia (#9729) 2020-03-18 21:54:27 +03:00
getMemoryAmount.cpp Move getPageSize in common 2020-12-17 00:23:41 +03:00
getMemoryAmount.h libs/ → base/ 2020-02-14 17:48:30 +03:00
getPageSize.cpp Move getPageSize in common 2020-12-17 00:23:41 +03:00
getPageSize.h Move getPageSize in common 2020-12-17 00:23:41 +03:00
getResource.cpp Trying to fix TZ with plus sign inside 2020-08-13 23:28:56 +02:00
getResource.h Embed configs into binary 2020-08-08 06:42:42 +03:00
getThreadId.cpp Some provisions for Android build 2020-07-15 14:16:00 +03:00
getThreadId.h libs/ → base/ 2020-02-14 17:48:30 +03:00
iostream_debug_helpers.h Remove excessive empty lines 2020-03-03 05:43:59 +03:00
itoa.h better min/max for Int128 2020-09-22 14:35:46 +03:00
JSON.cpp Enable extra warnings for base, utils, programs 2020-05-10 01:59:34 +03:00
JSON.h Improve CCTZ contrib (#9687) 2020-03-19 13:38:34 +03:00
LineReader.cpp Fix parsing of multiline queries in interactive mode #13654 2020-11-29 17:50:42 +03:00
LineReader.h Fix race condition in client suggestions 2020-09-28 12:58:42 +03:00
LocalDate.h Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
LocalDateTime.h Remove useless code 2021-02-03 12:46:41 +03:00
logger_useful.h fix AST formatting in log messages 2020-11-22 20:23:12 +03:00
memory.h Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
mremap.cpp Enable extra warnings for base, utils, programs 2020-05-10 01:59:34 +03:00
mremap.h libs/ → base/ 2020-02-14 17:48:30 +03:00
phdr_cache.cpp Fix terribly wrong code 2020-09-19 02:05:13 +03:00
phdr_cache.h libs/ → base/ 2020-02-14 17:48:30 +03:00
preciseExp10.cpp Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
preciseExp10.h Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
ReadlineLineReader.cpp Do not use strerror 2020-12-17 21:25:12 +03:00
ReadlineLineReader.h Minor updates 2020-06-02 06:28:59 +03:00
ReplxxLineReader.cpp Fix some of the issues found by Coverity 2021-02-02 22:08:32 +03:00
ReplxxLineReader.h Don't shallow errors. 2020-12-21 14:43:05 +08:00
setTerminalEcho.cpp Do not use strerror 2020-12-17 21:25:12 +03:00
setTerminalEcho.h libs/ → base/ 2020-02-14 17:48:30 +03:00
shift10.cpp Clang Tidy, part 7 (#9799) 2020-03-23 05:12:31 +03:00
shift10.h Improve CCTZ contrib (#9687) 2020-03-19 13:38:34 +03:00
SimpleCache.h libs/ → base/ 2020-02-14 17:48:30 +03:00
sleep.cpp Fix build 2020-05-10 22:28:40 +03:00
sleep.h libs/ → base/ 2020-02-14 17:48:30 +03:00
sort.h Slightly better miniselect usage (#16896) 2020-11-13 14:28:18 +03:00
StringRef.cpp Remove one header 2020-09-14 16:34:44 +03:00
StringRef.h Add missed <stdexcept> 2020-11-21 13:26:38 +03:00
strong_typedef.h Extended range of DateTime64 to years 1925 - 2238 2021-02-24 17:08:35 +02:00
terminalColors.cpp Colorize logs that are send to client with "send_logs_level" setting 2020-02-21 23:01:38 +03:00
terminalColors.h Check for #pragma once in headers 2020-10-10 21:37:02 +03:00
throwError.h Fix wide integer left shift + refactoring (#14697) 2020-09-14 14:56:43 +03:00
time.h Add cross-compile build for FreeBSD (#9643) 2020-04-07 11:33:49 +03:00
types.h Use feature testing macro to test if char8_t is supported 2020-11-30 22:36:30 +03:00
unaligned.h libs/ → base/ 2020-02-14 17:48:30 +03:00
wide_integer_impl.h Update wide_integer_impl.h 2020-12-21 04:02:49 +03:00
wide_integer_to_string.h Fix wide integer left shift + refactoring (#14697) 2020-09-14 14:56:43 +03:00
wide_integer.h Provide a default constructor for wide::integer 2020-12-07 16:00:32 +03:00
ya.make Updated ya.make 2020-12-17 12:10:46 +03:00
ya.make.in Try fix arcadia build (#17720) 2020-12-02 17:54:52 +03:00