Commit Graph

611 Commits

Author SHA1 Message Date
Alexey Milovidov
e8919c49fb Merge branch 'master' into replace-memcpy 2021-03-13 09:39:58 +03:00
kssenii
5d953a4b86 Better 2021-03-12 21:48:52 +00:00
kssenii
323fb54a8e Fix split build finally 2021-03-12 21:12:34 +00:00
Nikita Mikhaylov
e234990cf6
Merge pull request #19257 from nikitamikhaylov/geometry_functions
Merging geometry functions
2021-03-12 17:05:24 +03:00
Nikita Mikhailov
e78fc3109c better ubsan testing 2021-03-11 15:08:18 +03:00
Yatsishin Ilya
abbf4b01c2 Merge remote-tracking branch 'origin/master' into fixes-clang-12-cmake-3.19 2021-03-11 09:44:30 +03:00
Yatsishin Ilya
c2760f6388 readpassphrase mute recursion in macro expansion 2021-03-10 18:05:24 +03:00
Yatsishin Ilya
7b69ef92be gcc old cast check failed 2021-03-10 18:04:34 +03:00
Yatsishin Ilya
eb0e972620 implicit cast to disable warning 2021-03-10 12:01:03 +03:00
Alexey Milovidov
8619665ef2 Remove AVX 2021-03-10 10:04:33 +03:00
Yatsishin Ilya
71d745b4ec implicit const conversion 2021-03-09 17:31:54 +03:00
Alexey Milovidov
7664a3d53e Fix MSan 2021-03-09 01:29:32 +03:00
Alexey Milovidov
e02de2355e Remove useless files 2021-03-08 13:22:17 +03:00
Alexey Milovidov
3fb5b247ed Evaluate another memcpy 2021-03-08 13:19:25 +03:00
Alexey Milovidov
f0342eda9c Add experimental memcpy implementation 2021-03-08 13:05:18 +03:00
Alexey Milovidov
da32a617b2 Merge branch 'jart-memcpy' into replace-memcpy 2021-03-08 12:15:49 +03:00
Alexey Milovidov
2c86bc4ea3 Addition to prev. revision 2021-03-08 10:00:54 +03:00
Alexey Milovidov
1200d9d9c5 Range checks and monotonicity 2021-03-07 10:10:37 +03:00
Alexey Milovidov
7052ecd446 Fix error 2021-03-07 09:30:52 +03:00
Alexey Milovidov
1bb62f578b Unit tests passing 2021-03-07 04:10:38 +03:00
Alexey Milovidov
8271cec093 Fix error 2021-03-07 02:36:24 +03:00
Alexey Milovidov
d406999e8f Remove debug output 2021-03-07 01:36:48 +03:00
Alexey Milovidov
0dbadc8d8e Fix error 2021-03-07 01:35:23 +03:00
Alexey Milovidov
8d5d1b76fb Fix error 2021-03-07 00:36:29 +03:00
Alexey Milovidov
d276fac135 Support negative time_t in more functions 2021-03-05 05:04:23 +03:00
Alexey Milovidov
738d106874 Support negative time_t in more functions 2021-03-05 05:03:55 +03:00
Alexey Milovidov
ecee81b714 Fix clang-tidy 2021-03-05 04:50:16 +03:00
Alexey Milovidov
790aa8697c Fix typos 2021-03-05 04:47:50 +03:00
Alexey Milovidov
1722978c2b Comments and corrections 2021-03-05 04:45:12 +03:00
Alexey Milovidov
7cc471f9b9 Simplify code 2021-03-05 04:22:12 +03:00
Haavard Kvaalen
efa94c5735 Fix use after free in mysqlxx::Pool::tryGet()
tryGet() created an Entry object that referenced a Connection, but then
deleted the Connection just before the Entry went out of scope.
2021-03-04 16:51:27 +01:00
Alexey Milovidov
ed492ccf5d Fix Africa/Juba 2021-03-04 05:36:36 +03:00
Alexey Milovidov
b9a8509f79 Adjustments 2021-03-04 05:18:17 +03:00
Alexey Milovidov
31010624d6 Attempt to simplify code 2021-03-04 03:35:23 +03:00
Alexey Milovidov
4f08539754 Remove strange code 2021-03-04 03:01:08 +03:00
Alexey Milovidov
1096fc328a Make some tests automated 2021-03-04 02:11:27 +03:00
Alexey Milovidov
ffc39574f1 Removed very old example (for jemalloc performance regression) 2021-03-04 02:04:01 +03:00
Alexey Milovidov
2632b568ae Move tests to appropriate place 2021-03-04 01:34:30 +03:00
Alexey Milovidov
51d51e4748 Return private 2021-03-04 00:44:58 +03:00
Alexey Milovidov
fdc00beb77 Whitespaces 2021-03-03 23:56:59 +03:00
Alexey Milovidov
6f5877abdf Fix build after merge with master 2021-03-03 23:53:52 +03:00
Alexey Milovidov
4e8239e098 Merge branch 'master' into DateTime64_extended_range 2021-03-03 23:43:20 +03:00
Alexey Milovidov
b1b3db09d7 Remove commented out code 2021-03-03 23:34:15 +03:00
Alexey Milovidov
ed0099a113 Maybe unused condition 2021-03-03 23:24:56 +03:00
Alexey Milovidov
aaef0c5ebd Fix build 2021-03-03 23:19:26 +03:00
Alexey Milovidov
cf0912ba02 Remove unused field 2021-03-03 23:14:33 +03:00
alexey-milovidov
3e19f4a00f
Update DateLUTImpl.h 2021-03-03 23:09:59 +03:00
alexey-milovidov
0889e0da87
Update DateLUTImpl.h 2021-03-03 22:52:07 +03:00
alexey-milovidov
2f23f1b123
Update DateLUTImpl.h 2021-03-03 22:49:20 +03:00
alexey-milovidov
80c17d5537
Update DateLUTImpl.cpp 2021-03-03 22:41:10 +03:00
alexey-milovidov
e412bcb490
Update DateLUTImpl.cpp 2021-03-03 22:30:12 +03:00
alexey-milovidov
04672a4365
Update DateLUTImpl.cpp 2021-03-03 22:29:26 +03:00
Alexey Milovidov
aecdadd02e Add missing files 2021-03-03 02:33:17 +03:00
Alexey Milovidov
d1b3258ae7 Try without AVX 2021-03-03 00:16:34 +03:00
Alexey Milovidov
50c62c3b4c Add memcpy implementation from @jart 2021-03-02 22:12:30 +03:00
alexey-milovidov
3bd180c416
Merge pull request #20149 from keen-wolf/timezone_about
fix toMinute function to handle special timezone
2021-02-28 21:53:51 +03:00
keenwolf
303c389b36 change the time_t to unsigned to handle properly the start date of 1970-01-01 2021-02-28 18:11:54 +08:00
Alexander Kazakov
63b95c7451
MySQL dictionary source: A mechanism for retrying unexpected connection loss during communication with mysql server (#21237)
* Added a new type of Exception

for better recognition of connection failures

* Added more logging for mysql communication

* Retries on connection loss during query.

Make MySQL dictionary source resilient to unexpected loss of connection
during querying MySQL. This behavior is controlled with
".fail_on_connection_loss" config parameter, which defaults to false.

* Stripped some debugging leftover garbage

* Minor followup corrections

* Corrections after PR comments

* Yet more fixes
2021-02-27 11:18:28 +03:00
Alexander Kazakov
66f603512c
A followup correction to #19998 (#21221) 2021-02-26 11:42:37 +03:00
Alexander Kazakov
4bcaed98d8
Added "opt_reconnect" parameter to config for controlling MYSQL_OPT_RECONNECT option (#19998)
* Support for MYSQL_OPT_RECONNECT option

It can now be controlled by .opt_reconnect = {true|false} parameter in
the mysql replica config section
2021-02-26 09:49:49 +03:00
Maksim Kita
63173eebdb
Merge pull request #21088 from azat/__has_feature-gcc-fix
Fix __has_feature macros under gcc
2021-02-25 18:34:14 +03:00
Nikolai Kochetov
3cda69feaf
Merge pull request #20632 from ClickHouse/akz/mysqlxx-randomize-replicas
mysqlxx::PoolWithFailover: Randomize list of same-priority replicas
2021-02-25 13:11:41 +03:00
alexey-milovidov
d5757c67e6 Update DateLUTImpl.h 2021-02-24 17:09:27 +02:00
alexey-milovidov
b8b916008c Update DateLUTImpl.h 2021-02-24 17:09:27 +02:00
Vasily Nemkov
d321c13cbf Fixed special build 2021-02-24 17:08:43 +02:00
Vasily Nemkov
7a53daaefd Fixed issues reported by PVS-Studio and Clang11/GCC10 2021-02-24 17:08:43 +02:00
Vasily Nemkov
4fcc23ec9a Fixed build for GCC-10 2021-02-24 17:08:43 +02:00
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
Alexander Kazakov
196d454114 Initialize random engine with clock and thread_id
Thread-safe and fairly descent approach in our case
2021-02-24 14:55:16 +03:00
Alexander Kazakov
deb566a40b Resorted from std::random_device to std::rand() 2021-02-24 11:48:04 +03:00
Azat Khuzhin
810023a65c Do not undefine __has_feature (may break c++ headers)
If the order of <common/defines.h> and c++ header will be wrong the
compilation will be broken.

v2: rename __ch_has_feature to ch_has_feature to fix -Wreserved-id-macro
v3: do not fallback to 0
2021-02-23 19:46:47 +03:00
Azat Khuzhin
8ab578065a Fix __has_feature macros under gcc
__has_feature supported only by clang.

But libcxx/libcxxabi overrides it to 0:

    $ fgrep -r 'define __has_feature' contrib/libcxx*
    contrib/libcxx/include/__config:#define __has_feature(__x) 0
    contrib/libcxxabi/src/demangle/DemangleConfig.h:#define __has_feature(x) 0

Thus the checks for __has_feature will be wrong, undefine it again to
avoid such issues.

This will also fix building with sanitizers under gcc (before this patch
BOOST_USE_UCONTEXT wasn't set for sanitizers).
2021-02-23 19:39:34 +03:00
Alexey Milovidov
d2a9e5842a Fix wrong formatting of overflowed DateTime64 2021-02-21 21:01:46 +03:00
Alexey Milovidov
9cb972e9ed Fix UBSan report in Decimal arithmetic #19432 2021-02-21 13:23:18 +03:00
alexey-milovidov
e8583ddfe2
Update BaseDaemon.cpp 2021-02-20 09:10:15 +03:00
Azat Khuzhin
7474a7e3ca Increase buffer for uncaught exception / std::terminate
Use PIPE_BUF over some magic number 1024 in terminate_handler, since
according to pipe(7):

    PIPE_BUF
           POSIX.1  says  that  write(2)s of less than PIPE_BUF bytes must be atomic

Also note that 1024, is too small, especially for C++ stacktraces (and
especially for debug builds, that contains lots of non-inlined helpers
for various ptrs).
2021-02-19 22:45:06 +03:00
Ivan
414f470c79
Make Poco HTTP Server zero-copy again (#19516)
* Refactoring: part 1

* Refactoring: part 2

* Handle request using ReadBuffer interface

* Struggles with ReadBuffer's

* Fix URI parsing

* Implement parsing of multipart/form-data

* Check HTTP_LENGTH_REQUIRED before eof() or will hang

* Fix HTTPChunkedReadBuffer

* Fix build and style

* Fix test

* Resist double-eof

* Fix arcadian build
2021-02-19 15:51:26 +03:00
Alexander Kazakov
0296d7d026 Added some explanations on randomization 2021-02-17 21:51:05 +03:00
Alexander Kazakov
acb5fb8179 Randomly shuffle replicas withing the same priority 2021-02-17 20:58:04 +03:00
alexey-milovidov
bde4da0ff0
Merge pull request #20465 from azat/write-abnormal-server-termination-fixes
Fix abnormal server terminations due to write failures
2021-02-15 00:05:48 +03:00
Azat Khuzhin
06e8065ee6 Add missing sync of underlying files 2021-02-13 13:19:51 +03:00
Ilya Yatsishin
8ff458a2bf
Merge pull request #20459 from ClickHouse/decimal-comparison-ubsan 2021-02-13 12:34:40 +03:00
Alexey Milovidov
c760d5224d Suppress UBSan report in Decimal comparison 2021-02-13 03:56:38 +03:00
Alexey Milovidov
1546f5bcb9 Suppress UBSan report in Decimal comparison 2021-02-13 03:54:38 +03:00
Alexey Milovidov
edd5844bed Print stack trace on SIGTRAP 2021-02-13 00:29:47 +03:00
alexey-milovidov
4e32dbd024
Merge pull request #19317 from abyss7/dwarf-folly
Print inline frames for fatal stacktraces
2021-02-12 02:38:50 +03:00
Ivan
be831d09f7
Update Pytest check (#18972)
* [WIP]

* Update skip-list

* Update ci_config.json

* Do not sync inserts for test

* Fix more tests

* Fix another test

* Enable one more test

* More fixed tests

* More test fixes

* Do not absolutize server path for now

* More test fixes

* Unset CLICKHOUSE_LOG_COMMENT where necessary

* Remove debugging set -e

* Fix more tests

* Fix test reference

* Fix style check
2021-02-10 21:09:13 +03:00
Ivan Lezhankin
a287443438 Merge remote-tracking branch 'upstream/master' into dwarf-folly 2021-02-08 18:36:41 +03:00
Nicolae Vartolomei
479b45d772 Fix linker flags for shared linking on macOS
This combination now works: `-DUSE_STATIC_LIBRARIES=0 -DSPLIT_SHARED_LIBRARIES=1`.

Without `SPLIT_SHARED_LIBRARIES` it is still failing.
2021-02-07 14:58:52 +00:00
keenwolf
610798aa48 fix the toMinute bug which will cause toDateTime or toString printing wrong time 2021-02-06 15:32:49 +08:00
alexey-milovidov
867f5a8975
Merge pull request #20029 from ClickHouse/remove-useless-code-5
Remove useless code
2021-02-03 21:06:43 +03:00
Nikolai Kochetov
c39c965612
Merge pull request #19962 from keen-wolf/timezoneOffset
Implement the timezoneOffset function
2021-02-03 20:37:34 +03:00
Alexey Milovidov
02da869d10 Remove useless code 2021-02-03 12:46:41 +03:00
Alexey Milovidov
940b337eec Remove useless files 2021-02-03 10:03:32 +03:00
Alexey Milovidov
f8592f4539 Remove useless files 2021-02-03 10:03:13 +03:00
Alexey Milovidov
191389d040 Fix some of the issues found by Coverity 2021-02-02 22:08:32 +03:00
Alexey Milovidov
12485eee6b Fix some of the issues found by Coverity 2021-02-02 22:07:23 +03:00
keenwolf
9beb7689cc add comments and update test cases. 2021-02-02 23:35:45 +08:00
keenwolf
d251807ea4 add function timezoneOffset 2021-02-02 11:01:20 +08:00
Alexey Milovidov
7b8589dbde Merge branch 'master' into utf8mb4-in-mysql-client 2021-01-31 01:37:27 +03:00