Commit Graph

1086 Commits

Author SHA1 Message Date
Alexander Tokmakov
12bbb7de87 fix race on TID allocation 2022-05-20 12:41:44 +02:00
Robert Schulze
b475fbc9a7
Merge pull request #37300 from ClickHouse/cmake-cleanup-pt3
Various cmake cleanups
2022-05-20 10:02:36 +02:00
Robert Schulze
0c55ac76d2
A few clangtidy updates
Enable:

- bugprone-lambda-function-name: "Checks for attempts to get the name of
  a function from within a lambda expression. The name of a lambda is
  always something like operator(), which is almost never what was
  intended."

- bugprone-unhandled-self-assignment: "Finds user-defined copy
  assignment operators which do not protect the code against
  self-assignment either by checking self-assignment explicitly or using
  the copy-and-swap or the copy-and-move method.""

- hicpp-invalid-access-moved: "Warns if an object is used after it has
  been moved."

- hicpp-use-noexcept: "This check replaces deprecated dynamic exception
  specifications with the appropriate noexcept specification (introduced
  in C++11)"

- hicpp-use-override: "Adds override (introduced in C++11) to overridden
  virtual functions and removes virtual from those functions as it is
  not required."

- performance-type-promotion-in-math-fn: "Finds calls to C math library
  functions (from math.h or, in C++, cmath) with implicit float to
  double promotions."

Split up:

- cppcoreguidelines-*. Some of them may be useful (haven't checked in
  detail), therefore allow to toggle them individually.

Disable:

- linuxkernel-*. Obvious.
2022-05-17 20:56:57 +02:00
Robert Schulze
43945cea1b
Fixing some warnings 2022-05-16 20:59:27 +02:00
Robert Schulze
e3cfec5b09
Merge remote-tracking branch 'origin/master' into clangtidies 2022-05-16 10:12:50 +02:00
Robert Schulze
8117a1ce52
Don't leak suppression for -Wreserved-identifier out of header 2022-05-15 09:48:54 +02:00
Robert Schulze
1b81bb49b4
Enable clang-tidy modernize-deprecated-headers & hicpp-deprecated-headers
Official docs:

  Some headers from C library were deprecated in C++ and are no longer
  welcome in C++ codebases. Some have no effect in C++. For more details
  refer to the C++ 14 Standard [depr.c.headers] section. This check
  replaces C standard library headers with their C++ alternatives and
  removes redundant ones.
2022-05-09 08:23:33 +02:00
Robert Schulze
f866f8143d
Enable clang-tidy modernize-use-noexcept
Official docs:

  This check replaces deprecated dynamic exception specifications with
  the appropriate noexcept specification (introduced in C++11). By
  default this check will replace throw() with noexcept, and
  throw(<exception>[,...]) or throw(...) with noexcept(false).
2022-05-08 19:31:38 +02:00
Robert Schulze
3d3977bad3
Enable clang-tidy cert-err60-cpp
Official docs:

  This check flags all throw expressions where the exception object is
  not nothrow copy constructible.
2022-05-06 00:36:26 +02:00
mergify[bot]
64084b5e32
Merge branch 'master' into shared_ptr_helper3 2022-05-03 20:46:16 +00:00
Robert Schulze
ad0b3be79d
Replace uses of SFINAE by C++20 concepts
- enable_if is usually regarded as fragile and unreadable

- C++20 concepts are much easier to read and produce more expressive
  error messages
2022-05-02 09:23:53 +02:00
Robert Schulze
330212e0f4
Remove inherited create() method + disallow copying
The original motivation for this commit was that shared_ptr_helper used
std::shared_ptr<>() which does two heap allocations instead of
make_shared<>() which does a single allocation. Turned out that
1. the affected code (--> Storages/) is not on a hot path (rendering the
performance argument moot ...)
2. yet copying Storage objects is potentially dangerous and was
   previously allowed.

Hence, this change

- removes shared_ptr_helper and as a result all inherited create() methods,

- instead, Storage objects are now created using make_shared<>() by the
  caller (for that to work, many constructors had to be made public), and

- all Storage classes were marked as noncopyable using boost::noncopyable.

In sum, we are (likely) not making things faster but the code becomes
cleaner and harder to misuse.
2022-05-02 08:46:52 +02:00
Alexey Milovidov
1ddb04b992
Merge pull request #36715 from amosbird/refactorbase
Reorganize source files so that base won't depend on Common
2022-04-30 09:40:58 +03:00
Amos Bird
4a5e4274f0
base should not depend on Common 2022-04-29 10:26:35 +08:00
mergify[bot]
20e2fa9b3f
Merge branch 'master' into dynamic-columns-9 2022-04-28 17:53:03 +00:00
mergify[bot]
01357b2e1a
Merge branch 'master' into speed-up-build 2022-04-22 04:34:27 +00:00
Maksim Kita
57444fc7d3
Merge pull request #36444 from rschu1ze/clang-tidy-fixes
Clang tidy fixes
2022-04-21 16:11:27 +02:00
mergify[bot]
9c75f83a0b
Merge branch 'master' into speed-up-build 2022-04-20 23:20:21 +00:00
Robert Schulze
b24ca8de52
Fix various clang-tidy warnings
When I tried to add cool new clang-tidy 14 warnings, I noticed that the
current clang-tidy settings already produce a ton of warnings. This
commit addresses many of these. Almost all of them were non-critical,
i.e. C vs. C++ style casts.
2022-04-20 10:29:05 +02:00
alesapin
dd2e085ae5
Merge pull request #36365 from ClickHouse/fix-memory-warning-at-server-startup
Fix error in sanity checks
2022-04-18 11:51:21 +02:00
Alexey Milovidov
9bab9077b2 Fix error in sanity checks 2022-04-18 03:39:56 +02:00
Alexey Milovidov
f046dd6642 Speed up build a little 2022-04-16 03:58:50 +02:00
Alexey Milovidov
ccdd0a60f7 Remove Arcadia 2022-04-16 00:28:56 +02:00
Anton Popov
6364b6f78f Merge remote-tracking branch 'upstream/master' into dynamic-columns-9 2022-04-08 15:05:51 +00:00
Anton Popov
3fce23357c fix insertion of complex json with nested arrays 2022-04-08 14:58:02 +00:00
Alexander Tokmakov
7f54e7b422 Merge branch 'master' into mvcc_prototype 2022-04-07 15:14:06 +02:00
Anton Popov
13cb564d1e
Merge pull request #35716 from kssenii/fix-local-logs-level
Fix send_logs_level for clickhouse local
2022-04-06 18:52:47 +02:00
kssenii
83488b2d13 Better 2022-04-05 14:48:26 +02:00
mergify[bot]
3183b61c74
Merge branch 'master' into mvcc_prototype 2022-03-31 12:27:09 +00:00
Alexander Tokmakov
287d858fda Merge branch 'master' into mvcc_prototype 2022-03-29 16:24:12 +02:00
alesapin
842c0b8ff0 Merge remote-tracking branch 'origin/startup-sanity-checks' into startup-sanity-checks 2022-03-29 14:29:33 +02:00
alesapin
ed2c461fe1 Merge branch 'master' into startup-sanity-checks 2022-03-29 14:09:20 +02:00
alesapin
b838a7dcb0 Remove outdated links from CI 2022-03-28 15:53:22 +02:00
Sergei Trifonov
85f2ed12e1 fix darwin build 2022-03-25 12:52:50 +01:00
alesapin
93d1b1d198 Merge branch 'master' into startup-sanity-checks 2022-03-24 11:17:06 +01:00
Sergei Trifonov
c7cf14e743 fix style and darwin build 2022-03-23 19:15:01 +01:00
Alexander Tokmakov
9702b5177d Merge branch 'master' into mvcc_prototype 2022-03-14 21:45:38 +01:00
Maksim Kita
e14cfd5dcd Fix clang-tidy warnings in Access folder 2022-03-14 18:17:35 +00:00
alesapin
96c0e9fddf Better cmake 2022-03-11 15:47:07 +01:00
Alexander Tokmakov
8acfb8d27f Merge branch 'master' into mvcc_prototype 2022-03-07 17:40:15 +01:00
alesapin
c5a456802f Fix build 2022-03-04 19:39:11 +01:00
alesapin
5416b567d5 Merge branch 'master' into standalone_keeper_build 2022-03-04 13:35:07 +01:00
alesapin
0eb7d28192 Building small keeper binary 2022-03-03 21:27:46 +01:00
Vladimir C
38cf9ca7c2
Merge pull request #35005 from vdimir/fixarm64/00092_obfuscator 2022-03-03 12:17:30 +01:00
Maksim Kita
7d90afb3b0
Merge pull request #34988 from azat/safe-exit
Fix signal-unsafe TSan report in client
2022-03-03 09:21:26 +01:00
vdimir
c89de91fd4
clickhouse obfuscator aarch64 fix 2022-03-02 21:31:40 +00:00
Azat Khuzhin
798da0c314 Introduce safeExit() helper (_exit() compatible with TSan)
v2: add missing defines.h header
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-02 22:17:17 +03:00
Maksim Kita
b1a956c5f1 clang-tidy check performance-move-const-arg fix 2022-03-02 18:15:27 +00:00
Alexander Tokmakov
aa6b9a2abc Merge branch 'master' into mvcc_prototype 2022-02-23 23:22:03 +03:00
Amos Bird
56197cf31e
Allow only to specify --log-file 2022-02-18 18:14:58 +08:00
Alexander Tokmakov
dae044f86b Merge branch 'master' into mvcc_prototype 2022-02-17 13:49:37 +03:00
Vladimir C
ddad064285
Merge pull request #34463 from vdimir/wide_integer_from_builtin_double_multiplier
Use `cpp_bin_float_double` in `set_multiplier` for `wide_integer_from_builtin` for aarch64
2022-02-15 15:24:20 +01:00
Sergei Trifonov
0f66743104 support determine available memory for FreeBSD 2022-02-15 13:59:00 +03:00
Alexander Tokmakov
1e4e569151 Merge branch 'master' into mvcc_prototype 2022-02-15 02:26:47 +03:00
Maksim Kita
70ffcb8e33
Merge pull request #34393 from kitaisreal/sort-added-equal-items-randomization
Sort added equal items ranges randomization
2022-02-14 16:41:19 +01:00
Vladimir C
ebd93d07e5
fix 2022-02-14 12:36:30 +01:00
Maksim Kita
e13a0bfb39 Enable randomization of sort only in debug 2022-02-13 15:10:44 +00:00
Maksim Kita
7cbf18ef59 Fixed tests 2022-02-13 15:10:44 +00:00
Maksim Kita
4a18e627ec Updated implementation 2022-02-13 15:10:44 +00:00
Maksim Kita
42792dec48 Simplified implementation 2022-02-13 15:10:44 +00:00
Maksim Kita
b536b27e15 Fixed tests 2022-02-13 15:10:44 +00:00
Maksim Kita
10293acafb Sort added equal items ranges randomization 2022-02-13 15:10:44 +00:00
kssenii
fecf7f3d08 May be fix test 01065_window_view_event_hop_watch_bounded.py 2022-02-12 18:24:09 +01:00
Vladimir C
d40275af4f
fix 2022-02-11 21:22:02 +01:00
vdimir
b17d27413e
Use cpp_bin_float_double_extended in wide_integer_from_builtin 2022-02-11 18:01:19 +01:00
Alexander Tokmakov
07e66e690d Merge branch 'master' into mvcc_prototype 2022-02-11 15:53:32 +03:00
vdimir
4b1325ba63
Try to use double in set_multiplier for wide_integer_from_builtin 2022-02-09 14:27:21 +01:00
alexey-milovidov
38d92d0507
Merge pull request #33996 from save-my-heart/fix/signal_pipe_buf_size
reduce signal_pipe_buf_size
2022-02-06 04:50:47 +03:00
Alexander Tokmakov
ca5f951558 Merge branch 'master' into mvcc_prototype 2022-02-03 18:56:44 +03:00
Sergei Trifonov
68bc456830
Merge pull request #34223 from azat/bump-fmt
Bump fmtlib from 7.0.0 to 8.1.1
2022-02-02 00:03:25 +03:00
alexey-milovidov
cafb19d7fb
Merge pull request #34114 from amosbird/replxxwithlexer
Combining our lexer with replxx for better multiple line editing
2022-02-01 16:32:25 +03:00
Azat Khuzhin
220ed206c1 logger_useful: implicitly convert fmt::basic_runtime for std::string ctor
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Azat Khuzhin
bedf208cbd Use fmt::runtime() for LOG_* for non constexpr
Here is oneliner:

    $ gg 'LOG_\(DEBUG\|TRACE\|INFO\|TEST\|WARNING\|ERROR\|FATAL\)([^,]*, [a-zA-Z]' -- :*.cpp :*.h | cut -d: -f1 | sort -u | xargs -r sed -E -i 's#(LOG_[A-Z]*)\(([^,]*), ([A-Za-z][^,)]*)#\1(\2, fmt::runtime(\3)#'

Note, that I tried to do this with coccinelle (tool for semantic
patchin), but it cannot parse C++:

    $ cat fmt.cocci
    @@
    expression log;
    expression var;
    @@

    -LOG_DEBUG(log, var)
    +LOG_DEBUG(log, fmt::runtime(var))

I've also tried to use some macros/templates magic to do this implicitly
in logger_useful.h, but I failed to do so, and apparently it is not
possible for now.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: manual fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Alexander Tokmakov
2e4ae37d98 Merge branch 'master' into mvcc_prototype 2022-02-01 13:20:03 +03:00
Maksim Kita
8513f20cfd
Merge pull request #34145 from kitaisreal/bitset-sort-performance-check
pdqsort performance check
2022-01-31 12:35:13 +01:00
Maksim Kita
5ef83deaa6 Update sort to pdqsort 2022-01-30 19:49:48 +00:00
Amos Bird
ae16b362d3
Better case-insensitive completion 2022-01-30 19:50:24 +08:00
Amos Bird
bb34435928
Better code 2022-01-30 19:48:35 +08:00
Amos Bird
62e89a6445
Ignore case for history search and completion 2022-01-30 19:48:34 +08:00
Amos Bird
556cce9f3c
We need highlight to use Lexer 2022-01-30 19:48:34 +08:00
Amos Bird
54517753d7
Combining our lexer with replxx 2022-01-30 19:48:33 +08:00
save-my-heart
4894e93e05
Merge branch 'ClickHouse:master' into fix/signal_pipe_buf_size 2022-01-30 06:29:00 +08:00
Alexey Milovidov
7135ff448f Revert #33957 2022-01-30 01:09:15 +03:00
Alexander Tokmakov
fb9b2d5326 Merge branch 'master' into mvcc_prototype 2022-01-28 21:18:36 +03:00
tavplubix
b92958815a
Update LineReader.cpp 2022-01-28 13:38:36 +03:00
Vitaly Baranov
484743edff
Merge pull request #33201 from azat/client-interactive-suggest
Client interactive suggest (extract info from CREATE queries)
2022-01-28 16:30:16 +07:00
save-my-heart
cc3cbc6503 remove whitespace to pass style check 2022-01-26 23:05:07 +08:00
save-my-heart
62ba4833df fix dereference null pointer 2022-01-26 22:55:19 +08:00
save-my-heart
2c37b572d4 fix 2022-01-26 22:21:18 +08:00
save-my-heart
99c8736f00 fix build error on freebsd & aarch 2022-01-26 22:18:17 +08:00
Azat Khuzhin
0fe1f070fa Fix getauxval() in glibc-compatibility
getauxval() from glibc-compatibility did not work always correctly:

- it does not work after setenv(), and this breaks vsyscalls,
  like sched_getcpu() [1] (and BaseDaemon.cpp always set TZ if timezone
  is defined, which is true for CI [2]).

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: https://github.com/ClickHouse/ClickHouse/pull/32928#issuecomment-1015762717

- another think that is definitely broken is LSan (Leak Sanitizer), it
  relies on worked getauxval() but it does not work if __environ is not
  initialized yet (there is even a commit about this).

  And because of, at least, one leak had been introduced [3]:

    [3]: https://github.com/ClickHouse/ClickHouse/pull/33840

Fix this by using /proc/self/auxv.

And let's see how many issues will LSan find...

I've verified this patch manually by printing AT_BASE and compared it
with output of LD_SHOW_AUXV.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-26 12:56:27 +03:00
save-my-heart
c1036f0b8e ensure signal_pipe_buf_size is <= PIPE_BUF 2022-01-25 22:43:44 +08:00
Maksim Kita
c1db61b4ed
Merge pull request #33946 from azat/build-cleanup
Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES)
2022-01-24 23:42:04 +01:00
Azat Khuzhin
1acd644040 Add inplace merge for new completion words
This will allow:
- use addWords() everywhere
- remove that optimization for empty words case (initial load)
- and now we remove duplicates according to comparator

v2: replace parameter pack in addWords() with explicit Compare for both
cases (just pass default)
2022-01-24 22:59:18 +03:00
Azat Khuzhin
b9948155cd Remove extra copying for completion words
Return Replxx::completions_t over Words array, that way we avoids one
copying of std::string (although it breaks incapsulation).
2022-01-24 23:04:48 +03:00
Azat Khuzhin
4a0facd341 Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES)
There is no more MAKE_*, so remove this alias.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-24 17:28:33 +03:00
Azat Khuzhin
37dbff7587 Revert glibc compatibility (via .symver) in favor of hermetic build (bundled libc)
This patch reverts glibc compatibility (via .symver) #29594,
in favor of hermetic build (that provides bundled libc version) #30011

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-24 16:03:56 +03:00
Alexander Tokmakov
0ea0a8ccc7 Merge branch 'master' into mvcc_prototype 2022-01-20 17:05:55 +03:00
Azat Khuzhin
e0e81b340d Fix w/o ODBC build 2022-01-20 10:02:02 +03:00
Azat Khuzhin
e3b140a387 Add alias library for fmt 2022-01-20 10:02:02 +03:00