Commit Graph

29299 Commits

Author SHA1 Message Date
Wangyang Guo
d6fb682f71 Columns: remove static declaration to zero registers
Static declaration will enforce an extra mem load. But zeroing register
does not need it (like: vpxor zmm, zmm, zmm).
2022-07-26 10:27:01 +08:00
Vladimir Chebotaryov
f32d9c5539
Uppercase ROWS, GROUPS, RANGE in queries with windows. (#39410) 2022-07-25 22:53:53 +02:00
Kseniia Sumarokova
9abbb35cda
Fix integration test 2022-07-25 23:40:23 +03:00
Alexander Gololobov
25deba2c1b
Merge branch 'master' into feature/sql-standard-delete 2022-07-25 22:13:20 +02:00
Alexey Milovidov
c05190237a
Merge pull request #39551 from ClickHouse/freebsd_start_fix
Fix for empty function name on FreeBSD build
2022-07-25 20:52:03 +03:00
Alexander Tokmakov
f1e1cff272 fix create/drop index on cluster 2022-07-25 18:00:54 +02:00
Alexander Tokmakov
778dcf6994
Merge pull request #39230 from Algunenano/improve_replicated_merge_logging
Improve logging around replicated merges
2022-07-25 18:42:12 +03:00
Kruglov Pavel
5aae0a2e04
Fix style 2022-07-25 17:20:01 +02:00
Alexander Gololobov
48de02a7b8 Capitalized const name 2022-07-25 16:32:16 +02:00
Alexander Gololobov
7b44950d1d More detailed comment 2022-07-25 16:14:33 +02:00
Nikolay Degterinsky
c4b72277df Fix logs rotation issue 2022-07-25 13:58:04 +00:00
vdimir
b6f640013d
Fix bug in ASOF JOIN with enable_optimize_predicate_expression 2022-07-25 12:58:34 +00:00
Antonio Andelic
04b03b6a90 Don't allow to overwrite on startup 2022-07-25 12:38:48 +00:00
Sergei Trifonov
d9d1381c3f Merge branch 'master' into concurrency-control 2022-07-25 14:16:46 +02:00
mergify[bot]
e53cf7fd9f
Merge branch 'master' into direct-dictionary-dict-has-multiple-same-keys-fix 2022-07-25 11:41:58 +00:00
Alexander Gololobov
dbcb7e5f1e Fix for empty function name on FreeBSD build 2022-07-25 13:11:36 +02:00
Mikhail Filimonov
33ee858d18
Fix bug with maxsplit in the splitByChar 2022-07-25 13:11:02 +02:00
Kruglov Pavel
83c7da6e88
Merge branch 'master' into fix-protobuf-capnp-empty-message 2022-07-25 13:02:41 +02:00
Kruglov Pavel
dd8667d3f9
Update settings description 2022-07-25 13:02:25 +02:00
Igor Nikonov
dc96a6270d Remove optimize_memory_usage flag
Memory usage with DistinctSortedTransform fixed in #39538
2022-07-25 10:27:33 +00:00
Robert Schulze
24c74da473
Merge pull request #39430 from azat/getauxval-fix
Fix LSan by fixing getauxval() (resubmit v4)
2022-07-25 10:43:09 +02:00
Alexey Milovidov
6fdcb009ff
Merge pull request #39533 from ClickHouse/now-in-block
Add function `nowInBlock`
2022-07-25 04:22:11 +03:00
Alexey Milovidov
388d06fda1
Merge pull request #39535 from ClickHouse/stringref
Less usage of StringRef
2022-07-25 04:06:11 +03:00
Azat Khuzhin
93f876b58a Add a test for LSan
(cherry picked from commit 51e7c41883)
v2: fix type check
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-25 01:21:40 +03:00
Igor Nikonov
41e72aac83 Fix: DistinctSortedTransform doesn't take advantage of sorting
clearing_columns are set incorrectly, so we never clear HashSet
2022-07-24 21:35:36 +00:00
Alexey Milovidov
668f632d78
Merge pull request #39523 from loskutov/patch-1
LZ4_decompress_faster.cpp: remove endianness-dependent code
2022-07-25 00:06:58 +03:00
Robert Schulze
2785783def
Mark DEFLAPT_QPL as 'experimental' codec + cosmetics 2022-07-24 20:10:11 +00:00
Alexander Gololobov
460950ecdc
Merge branch 'master' into feature/sql-standard-delete 2022-07-24 21:27:22 +02:00
Robert Schulze
4333750985
Less usage of StringRef
... replaced by std::string_view, see #39262
2022-07-24 18:33:52 +00:00
Alexey Milovidov
cff712970e Add function nowInBlock 2022-07-24 19:58:48 +02:00
Robert Schulze
73c04b64e3
Merge pull request #39493 from nicelulu/fix_build_osx
Fix build on mac osx
2022-07-24 18:11:34 +02:00
Robert Schulze
c788e05c77
Merge pull request #39292 from zvonand/zvonand-b58-datatype
Simplify Base58 encoding/decoding
2022-07-24 18:09:40 +02:00
Alexey Milovidov
0209012e5e
Merge pull request #39517 from pkit/pkit/fix_examples
fix `-DENABLE_EXAMPLES=1` in master
2022-07-24 17:41:23 +03:00
Ignat Loskutov
c2954b23cb
LZ4_decompress_faster.cpp: remove endianness-dependent code
Little-endian is little-endian no matter what the native endianness is.
2022-07-24 20:55:17 +08:00
Andrey Zvonov
032fcab70e set char to be explicitely signed 2022-07-24 14:23:22 +02:00
Azat Khuzhin
22d8e532ed Fix ORDER BY that matches projections ORDER BY
In case of projection is seleted and it is comlete (all parts has such
projection) and ORDER BY matches projection ORDER BY, and
optimize_read_in_order=1 (default), then the sorting is simply not done,
because projections has separate plan, and so
InterpreterSelectQuery::executeOrder() -> SortingStep has
pipeline.getNumStreams() == 0 and it cannot do sorting.

Fix this, by adding sorting when creating plan for reading from
projections.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-24 15:23:13 +03:00
Kseniia Sumarokova
04944ff6f5
Merge pull request #39509 from monadbobo/remove_duplicate_code
Removed some duplicate code.
2022-07-24 14:24:40 +03:00
Alexander Gololobov
6692770113 Allow to update "system" virtual columns such as _row_exists 2022-07-24 12:21:47 +02:00
Alexander Gololobov
c8b3c574a4 Disable lightweight delete if table has projections 2022-07-24 12:21:47 +02:00
Alexander Gololobov
be64b45583 Properly handle empty parts list 2022-07-24 12:21:47 +02:00
Alexander Gololobov
594195451e Cleanups 2022-07-24 12:21:18 +02:00
Alexey Milovidov
c489ad7d71
Merge pull request #25333 from MaxWk/exact-rows-before-limit
add setting exact_rows_before_limit
2022-07-24 02:30:31 +03:00
Alexey Milovidov
071374b152 Remove SPLIT_BINARY 2022-07-24 01:15:54 +02:00
Alexey Milovidov
a897c263f0
Merge branch 'master' into http-buffer-small-fixes 2022-07-24 01:46:10 +03:00
mergify[bot]
0933dd7904
Merge branch 'master' into add-option-for-outfile-to-print-stdout 2022-07-23 19:50:10 +00:00
Alexey Milovidov
2d12180f9e
Merge pull request #39195 from HarryLeeIBM/hlee-s390x-LZ4
Fix LZ4 decompression issue for s390x
2022-07-23 22:31:42 +03:00
Kseniia Sumarokova
f146183400
Merge pull request #39491 from ClickHouse/remove_unused_constructor
Remove unused constructor
2022-07-23 21:16:39 +02:00
mergify[bot]
c01ff2d38a
Merge branch 'master' into improve_replicated_merge_logging 2022-07-23 19:10:10 +00:00
Constantine Peresypkin
d645d03e89 fix -DENABLE_EXAMPLES=1 in master 2022-07-23 19:00:52 +02:00
Antonio Andelic
afb6cb6824 Add KeeperContext 2022-07-23 14:45:31 +00:00
Antonio Andelic
6aff87d4b5 Ignore system paths from snapshots and logstore 2022-07-23 13:46:59 +00:00
Kseniia Sumarokova
77ddb8eda0
Merge pull request #39506 from CurtizJ/fix-direct-io
Fix reading from async read buffer with direct io
2022-07-23 06:08:48 +02:00
Igor Nikonov
95511428b3 Couple optimizations
+ do not apply filter to chunk if there is no data for output
+ checking clear_data flag at compile time
2022-07-23 00:03:26 +00:00
Igor Nikonov
739ff34c6e Add some tests, still not sure about optimize_memory_usage option 2022-07-22 22:48:26 +00:00
Kruglov Pavel
f79924f270
Merge branch 'master' into file_default_value 2022-07-22 21:17:37 +02:00
Simon Liu
2305f282dc Removed some duplicate code. 2022-07-23 02:27:17 +08:00
Anton Popov
c1a5514e46 fix reading from async read buffer with direct io 2022-07-22 16:58:30 +00:00
Vitaly Baranov
6174fe1d72 Fix tests. 2022-07-22 18:33:46 +02:00
Robert Schulze
6a631426b7
Disable vectorization for uint64 --> float32 cast 2022-07-22 12:49:16 +00:00
Robert Schulze
cad0e7a62c
Move hot loop inside nested if/else statements
- required to control the vectorization of a specific cast which
  annotates the loop using pragmas
2022-07-22 11:53:23 +00:00
Robert Schulze
654047dfbf
Fix compiler warning 2022-07-22 11:28:05 +00:00
Alexander Tokmakov
0cbbe7ac76
Update SSDCacheDictionaryStorage.h 2022-07-22 11:17:58 +00:00
Alexander Tokmakov
9d7a72c8bc
remove some dead and commented code 2022-07-22 11:17:58 +00:00
avogar
4874b4a6e7
Allow CREATE TEMPORARY TABLE ... (list of columns) AS ... 2022-07-22 11:17:58 +00:00
Robert Schulze
cae9786aa8
Fix test failures 2022-07-22 11:17:58 +00:00
Robert Schulze
af48474297
Update src/Common/TraceSender.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-07-22 11:17:57 +00:00
Robert Schulze
a21f45ec17
Update src/Functions/formatReadableTimeDelta.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-07-22 11:17:57 +00:00
Robert Schulze
ecd4c31387
Even less usage of StringRef
--> see #39300
2022-07-22 11:17:57 +00:00
Antonio Andelic
46a6fbd7aa Small polish 2022-07-22 11:03:07 +00:00
Igor Nikonov
329adc3419
Merge branch 'master' into distinct_sorted_chunk_perf_impr 2022-07-22 12:58:59 +02:00
Igor Nikonov
51f63c3a0c Add setting optimize_distinct_in_order_memory_usage 2022-07-22 10:57:57 +00:00
zhangxiao871
0d4d1e66b5 Fix build 2022-07-22 18:53:44 +08:00
Ilya Yatsishin
196fe5a269
Merge branch 'master' into exact-rows-before-limit 2022-07-22 12:34:30 +02:00
Alexander Tokmakov
bed2206ae9
Merge pull request #39460 from ClickHouse/remove_some_dead_and_commented_code
Remove some dead and commented code
2022-07-22 13:24:34 +03:00
alesapin
69984b28e0 Remove unused constructor 2022-07-22 12:21:10 +02:00
Alexander Tokmakov
c77117eadf
Update SSDCacheDictionaryStorage.h 2022-07-22 12:54:20 +03:00
Alexander Tokmakov
4c35e5fe8c
Merge pull request #39462 from Avogar/create-tmp-tables-as
Allow CREATE TEMPORARY TABLE ... (list of columns) AS ...
2022-07-22 12:29:50 +03:00
Antonio Andelic
3040ff0959 Merge branch 'master' into keeper-version-check 2022-07-22 08:07:55 +00:00
Antonio Andelic
75476d5110 Store only root system node 2022-07-22 08:07:38 +00:00
Robert Schulze
99579ab440
Merge pull request #39364 from ClickHouse/stringref-to-string_view
Even less usage of StringRef
2022-07-22 09:30:49 +02:00
jasperzhu
614f3b14a2
Merge branch 'master' into dev_intel_iaa_deflate 2022-07-22 11:05:44 +08:00
jinjunzh
f663c1e5e2 fixed condition fault 2022-07-21 17:14:20 -04:00
Igor Nikonov
7db5d54820 Adopt to the case when not all columns in distinct are part of sorting
description
2022-07-21 21:04:58 +00:00
HarryLeeIBM
d5727dfb44 Removed __BYTE_ORDER__ and fixed style issue 2022-07-21 13:09:45 -07:00
Vitaly Baranov
7795b2cec3 Fix system.backups: now it can show duplicate UUIDs with different flag. 2022-07-21 20:30:26 +02:00
Alexander Tokmakov
0441d3629e
Merge pull request #39440 from liangliangpan/optimize-cluster-table-func
optimize select query from cluster table function
2022-07-21 20:40:31 +03:00
Mikhail f. Shiryaev
cf0b01b189
Update version to 22.8.1.1 2022-07-21 19:21:28 +02:00
avogar
794aa691bc Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-protobuf-capnp-empty-message 2022-07-21 17:04:37 +00:00
Robert Schulze
ea0a3bf600
Merge branch 'master' into stringref-to-string_view 2022-07-21 18:33:06 +02:00
jinjunzh
aa8dae5f72 add nullptr check for flushAsynchronousDecompressRequests 2022-07-21 12:04:11 -04:00
Alexander Gololobov
50bd8147fd Make lightweight delete work with compact parts (not in optimal way yet) 2022-07-21 17:59:34 +02:00
Kruglov Pavel
f4f05ec786
Merge pull request #39447 from Avogar/better-parse-time-delta
Extend time units in parseTimeDelta function
2022-07-21 17:39:40 +02:00
Nikolai Kochetov
17de7b2876
Revert "Fix trivial count optimization with array join" 2022-07-21 17:14:34 +02:00
Igor Nikonov
122a1123b2 - disable the worst case for distinct in order in perf test for now
+ functional test for query with the worst perfomance
+ debug logging in DistinctStep
2022-07-21 15:03:19 +00:00
vdimir
96bcae419c
Cleanup logic around join_algorithm setting 2022-07-21 14:53:39 +00:00
Maksim Kita
82fc7375dd
Merge pull request #39444 from amosbird/fix-trivial-count-opt-1
Fix trivial count optimization with array join
2022-07-21 16:35:49 +02:00
Maksim Kita
6443116e80 DirectDictionary improve performance of dictHas with duplicate keys 2022-07-21 16:29:28 +02:00
avogar
821f006a7a Allow CREATE TEMPORARY TABLE ... (list of columns) AS ... 2022-07-21 14:24:11 +00:00
Andrey Zvonov
e473606cd1
Merge branch 'master' into zvonand-b58-datatype 2022-07-21 15:55:05 +02:00
Alexander Tokmakov
9e9969cea7
Merge pull request #37827 from arthurpassos/host_regexp_multiple_domains
Test host_regexp against all PTR records instead of only one
2022-07-21 16:43:05 +03:00
Alexander Tokmakov
9a55f84885
Revert "Remove broken optimisation in Direct dictionary dictHas implementation" 2022-07-21 16:24:18 +03:00
Alexander Tokmakov
8bd674186a
Update getStructureOfRemoteTable.cpp 2022-07-21 16:15:42 +03:00
Antonio Andelic
fdd79e62da
Merge pull request #39393 from ClickHouse/keeper-disable-digest-default
Disable real-time digest in Keeper by default
2022-07-21 15:15:22 +02:00
Alexander Tokmakov
a8da5d96fc remove some dead and commented code 2022-07-21 15:05:48 +02:00
Nikolai Kochetov
80f2c6f2d4
Merge pull request #39456 from ClickHouse/respect-alias-for-additional-table-filter
Respect table alias for additional_table_filters.
2022-07-21 14:02:18 +02:00
Anton Popov
68aab132a5
Merge pull request #38989 from lokax/tuple_elem
feat(function): tupleElement with default value
2022-07-21 13:58:08 +02:00
Alexander Tokmakov
f79f12408d fixes 2022-07-21 13:57:24 +02:00
Kruglov Pavel
64a189249f
Merge pull request #39423 from ClickHouse/Avogar-patch-1
Disable format_csv_allow_single_quotes by default
2022-07-21 13:36:45 +02:00
Anton Kozlov
0e44e34e69 Do not optimize GROUP BY functions that shadow their arguments 2022-07-21 11:33:48 +00:00
Nikolai Kochetov
e6969d5010 Respect table alias for additional_table_filters. 2022-07-21 11:23:09 +00:00
Kruglov Pavel
b98cb546f6
Merge branch 'master' into file_default_value 2022-07-21 12:27:20 +02:00
Vitaly Baranov
dc392cd4d3 Improve synchronization between hosts in distributed backup.
Use ephemeral zk nodes to check other hosts for termination.
2022-07-21 11:45:26 +02:00
Maksim Kita
baea3b01b1
Merge pull request #39385 from jawm/jawm/direct-dicthas
Remove broken optimisation in Direct dictionary dictHas implementation
2022-07-21 11:43:48 +02:00
Kruglov Pavel
49c839bdc1
Merge pull request #39413 from vitlibar/fix-interactive-client-with-older-server
Fix interactive client with older server
2022-07-21 11:37:20 +02:00
Maksim Kita
e28152ec36
Merge pull request #39427 from ltrk2/bugfix/missing-dependency
Introduce a dependency to libuv when building NATS
2022-07-21 11:37:05 +02:00
Antonio Andelic
7d30ab80c4 Fix compatibility 2022-07-21 09:31:06 +00:00
Alexander Gololobov
1ea9f143ff Leave only _row_exists-based implementation of lightweight delete 2022-07-21 11:26:13 +02:00
avogar
d63786e709 Better 2022-07-21 09:07:23 +00:00
avogar
49d980d16c Extend time units in parseTimeDelta function 2022-07-21 08:55:51 +00:00
Amos Bird
98ff54700a
Fix trivial count optimization with array join 2022-07-21 16:23:25 +08:00
Vladimir C
9bd777ad76
Merge pull request #39443 from vdimir/cross_to_inner_join_rewrite_1
Set default value cross_to_inner_join_rewrite = 1
2022-07-21 09:30:55 +02:00
vdimir
43a0129425
Set default value cross_to_inner_join_rewrite = 1 2022-07-21 08:43:38 +02:00
Nikolai Kochetov
e15967e9db
Merge pull request #38475 from ClickHouse/additional-filters
Additional filters for a table (from setting)
2022-07-21 07:52:04 +02:00
Mingliang Pan
e019b6ba69
Update getStructureOfRemoteTable.cpp 2022-07-21 12:11:33 +08:00
Alexey Milovidov
844042fc18
Merge pull request #39433 from ClickHouse/revert-39396-try-fix-write-buffer-terminate
Revert "Fix WriteBuffer finalize in destructor when cacnel query"
2022-07-21 07:04:07 +03:00
Mingliang Pan
3f76c8d7fd
optimize select query from cluster table function
Use local node as first priority to get Structure Of Remote Table.
we have many distributed queries( like   select xx from cluster('xx',view  (xxxx)   ) on a clickhouse cluster.  we found that the first node (shard_num=1)  have 2 times of query number compared to other shards.
The reason is that  the getStructureOfRemoteTableInShard func always take the first shard to execute  "DESC TABLE xx" query.
The better way is to  use local node as first priority which save the network rpc and reduce the pressure of first shard .
2022-07-21 11:56:35 +08:00
Alexey Milovidov
4305eacd92
Merge pull request #39434 from ClickHouse/revert-39299-fix-lsan-v3
Revert "[RFC] Fix LSan by fixing getauxval()"
2022-07-21 06:47:54 +03:00
Alexey Milovidov
41045ba704
Update Settings.h 2022-07-21 06:42:51 +03:00
Alexey Milovidov
19c4c0bd6e
Update CoordinationSettings.cpp 2022-07-21 06:41:42 +03:00
Alexey Milovidov
443f7c1237 Merge branch 'master' into Avogar-patch-1 2022-07-21 05:28:26 +02:00
Alexey Milovidov
fd691000b7
Merge pull request #39342 from azat/bg-executor-fix
Fix possible UB in MergeTreeBackgroundExecutor (leads to SIGSEGV on race with DROP/DETACH)
2022-07-21 05:22:51 +03:00
Alexey Milovidov
f4f5a5e044
Merge pull request #39397 from azat/fix-extractAll
Fix UB (stack-use-after-scope) in extactAll()
2022-07-21 05:21:18 +03:00
Alexey Milovidov
dcda9d3bd1
Merge pull request #39365 from Avogar/fix-capnproto-abort
Avoid possible abort() in CapnProto on exception descruction
2022-07-21 05:20:45 +03:00
Alexey Milovidov
72dda35108
Revert "[RFC] Fix LSan by fixing getauxval()" 2022-07-21 04:34:04 +03:00
Kruglov Pavel
92995a832b
Revert "Fix WriteBuffer finalize in destructor when cacnel query" 2022-07-21 01:45:16 +02:00
Nikita Taranov
f7c6830433
Merge branch 'master' into hlee-s390x-LZ4 2022-07-21 01:34:03 +02:00
Azat Khuzhin
4b3f90870d
Remove specialization global lock/unlock from ActionLocksManager (#39215)
This had been done in InterpreterSystemQuery explicitly, with grants
checking.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-21 01:29:35 +02:00
Igor Nikonov
635a566bec Comment change 2022-07-20 21:37:46 +00:00
Igor Nikonov
e50aebb5f0
Merge branch 'master' into distinct_sorted_chunk_perf_impr 2022-07-20 23:17:11 +02:00
Nikolai Kochetov
3b755ffb2a
Merge pull request #39391 from ClickHouse/fix-date-time-64-columns-dor-dict
Fix scale for DateTime64 dictionary attribute.
2022-07-20 23:14:33 +02:00
Igor Nikonov
965f96bd84 DISTINCT in order: perf improvement
+ reduce allocations in DistinctSortedChunkTransform
+ use it for final distinct as well
2022-07-20 20:44:47 +00:00
Nikolai Kochetov
91043351aa Fixing build. 2022-07-20 20:30:16 +00:00
Kseniia Sumarokova
3759ee76a7
Merge pull request #39386 from ClickHouse/kssenii-patch-4
Rethrow exception on cache initialisation on server startup, better error message
2022-07-20 21:26:25 +02:00
Smita Kulkarni
605fc5f121 Addressed review comments
- Added finalizeImpl() override in ForkWriteBuffer to call finalize() of all the buffers.
- Removed clearing buffer in ForkWriteBuffer destructor.
2022-07-20 21:02:54 +02:00
Nikolai Kochetov
0341c6c54b Try to firx keeper build. 2022-07-20 17:30:52 +00:00
Nikolai Kochetov
91aa2385ca
Merge branch 'master' into additional-filters 2022-07-20 18:56:24 +02:00
Igor Nikonov
7616a24c40
Merge pull request #38980 from ClickHouse/explain_ast_rewrite_follow_up
EXPLAIN AST rewrite: rename to optimize
2022-07-20 18:42:14 +02:00
Nikolai Kochetov
85e5597798 Fix some tests. 2022-07-20 15:54:12 +00:00
Kruglov Pavel
55c625deb1
Fix typo 2022-07-20 17:52:18 +02:00
Kruglov Pavel
d4c399d7f7
Update settings history 2022-07-20 17:50:24 +02:00
Kruglov Pavel
eb4dcdb6a0
Disable format_csv_allow_single_quotes by default 2022-07-20 17:47:47 +02:00
Kruglov Pavel
0efed4644d
Merge pull request #38957 from Avogar/compatibility-setting
Add compatibility setting and system.settings_changes system table
2022-07-20 17:46:06 +02:00
ltrk2
658c39625f Introduce a dependency to libuv when building NATS 2022-07-20 08:27:45 -07:00
Nikita Taranov
9dbfc354d1
Merge branch 'master' into hlee-s390x-LZ4 2022-07-20 17:15:31 +02:00
James Morrison
d60a02829f Remove broken optimisation in Direct dictionary dictHas implementation
I noticed this while working on another feature - if a set of keys being
passed to `hasKeys` contains duplicates, then only one of the result
slots for these keys will be populated.

My fix uses to a simpler implementation which is likely slower, but is
correct, which seems more important. No doubt faster approaches exist
which are also correct.
2022-07-20 14:45:32 +00:00
avogar
17a271ec30 Fix error codes 2022-07-20 14:33:46 +00:00
Harry Lee
466fceb3ee
Fix exception in AsynchronousMetrics for s390x (#39193) 2022-07-20 15:25:33 +02:00
lokax
22792d1c6a fix style
Signed-off-by: lokax <m632656684@gmail.com>
2022-07-20 21:20:00 +08:00
lokax
140f5e6685 recursive check array offsets
Signed-off-by: lokax <m632656684@gmail.com>
2022-07-20 21:20:00 +08:00
lokax
d40f04b860 fix function name
Signed-off-by: lokax <m632656684@gmail.com>
2022-07-20 21:20:00 +08:00
lokax
ff433c1c01 fix build
Signed-off-by: lokax <m632656684@gmail.com>
2022-07-20 21:20:00 +08:00
lokax
647eafa00e support for array type 2022-07-20 21:20:00 +08:00
lokax
f1e9c23f46 add tryGetPostitionByName function 2022-07-20 21:20:00 +08:00
lokax
5c6b18a9bd fix: 3rd parameter must be constant 2022-07-20 21:20:00 +08:00
lokax
6e23d2cb85 feat(function): tupleElement with default value 2022-07-20 21:20:00 +08:00
lokax
61a6117a33 overload getPostitionByName function 2022-07-20 21:20:00 +08:00
Yakov Olkhovskiy
c4d040e02c
Merge branch 'master' into bug-with-fill-date 2022-07-20 09:10:45 -04:00
Dmitry Novik
a09422de7b
Merge pull request #38642 from ClickHouse/group-by-use-nulls
Add group_by_use_nulls setting
2022-07-20 14:42:42 +02:00
Nikolay Degterinsky
c9ae525da7
Merge branch 'master' into file_default_value 2022-07-20 14:22:58 +02:00
zvonand
11b8d788ca small improvements 2022-07-20 13:36:47 +02:00
Kruglov Pavel
3fb3015375
Merge pull request #39340 from Avogar/better-exception-messages
Better exception messages in schema inference
2022-07-20 13:29:15 +02:00
avogar
784ee11594 Add settings to skip fields with unsupported types in Protobuf/CapnProto schema inference 2022-07-20 11:16:25 +00:00
Igor Nikonov
5509850b23
Merge branch 'master' into explain_ast_rewrite_follow_up 2022-07-20 12:18:47 +02:00
Vladimir C
7694c72154
Merge pull request #38887 from bigo-sg/hive_file_crash
fixed: crash caused by IHiveFile be shared among threads
2022-07-20 12:15:57 +02:00
Kruglov Pavel
a1b63b4a02
Fix style 2022-07-20 12:07:22 +02:00
Kruglov Pavel
7722b647b7
Merge pull request #39396 from Avogar/try-fix-write-buffer-terminate
Fix WriteBuffer finalize in destructor when cacnel query
2022-07-20 12:06:20 +02:00
lgbo-ustc
4b46d80169 update codes 2022-07-20 18:03:34 +08:00
Vitaly Baranov
8873d16afe Fix interactive client with older server after https://github.com/ClickHouse/ClickHouse/pull/38970 2022-07-20 11:51:55 +02:00
Kseniia Sumarokova
0840dfe2e0
Update LRUFileCache.cpp 2022-07-20 11:42:24 +02:00
Maksim Kita
d3ce4ffc88
Merge pull request #38929 from pkit/pkit/wait_pid_fix
fix long wait for process exit in ShellCommand
2022-07-20 11:26:38 +02:00
Vladimir C
da26cf5609
Merge pull request #39326 from vdimir/setting_cross_to_inner_rewrite
Set default value cross_to_inner_join_rewrite = 2 for comma join
2022-07-20 11:13:47 +02:00
Robert Schulze
df53a556eb
Fix test failures 2022-07-20 07:59:02 +00:00
Azat Khuzhin
18eb8b6d48 Fix UB (stack-use-after-scope) in extactAll()
After #37544 OptimizedRegularExpressionImpl started to be moved, but
StringSearcher is not copyable since it holds pointers that goes out of
scope after move (before Regexps::get() returns std::shared_ptr<Regexp>
but it had been replaced with Regexps::createRegexp() that returns
Regexp object).

<details>

<summary>ASan report</summary>

    ==48348==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fff577239a9 at pc 0x00001518209b bp 0x7fff57723820 sp 0x7fff57723818
    READ of size 1 at 0x7fff577239a9 thread T0
        0 0x1518209a in char8_t const* DB::StringSearcher<true, true>::search<char8_t>(char8_t const*, char8_t const*) const /bld/./src/Common/StringSearcher.h:730:41
        1 0x1518dd3f in char8_t const* DB::StringSearcher<true, true>::search<char8_t>(char8_t const*, unsigned long) const /bld/./src/Common/StringSearcher.h:751:16
        2 0x1518dd3f in OptimizedRegularExpressionImpl<false>::match(char const*, unsigned long, std::__1::vector<OptimizedRegularExpressionDetails::Match, std::__1::allocator<OptimizedRegularExpressionDetails::Match> >&, unsigned int) const /bld/./src/Common/OptimizedRegularExpression.cpp:463:54
        3 0x1811cb42 in DB::ExtractAllImpl::get(char const*&, char const*&) /bld/./src/Functions/FunctionsStringArray.h:588:18
        4 0x1811aa62 in DB::FunctionTokens<DB::ExtractAllImpl>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const /bld/./src/Functions/FunctionsStringArray.h:704:30
        5 0x14fe17b4 in DB::IFunction::executeImplDryRun(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const /bld/./src/Functions/IFunction.h:409:16

    Address 0x7fff577239a9 is located in stack of thread T0 at offset 201 in frame
        0 0x1518d98f in OptimizedRegularExpressionImpl<false>::match(char const*, unsigned long, std::__1::vector<OptimizedRegularExpressionDetails::Match, std::__1::allocator<OptimizedRegularExpressionDetails::Match> >&, unsigned int) const /bld/./src/Common/OptimizedRegularExpression.cpp:439

</details>

CI: https://s3.amazonaws.com/clickhouse-test-reports/39342/c6f7698f9ad6ae22199182ebf7c3b2dac77d69d8/fuzzer_astfuzzerasan,actions//report.html
Fixes: #37544 (cc @rschu1ze)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-20 10:18:44 +03:00
Vitaly Baranov
150e058be9 lockTablesForReading() comes back. 2022-07-20 09:04:18 +02:00
Alexander Tokmakov
988569bdb1
Merge pull request #39366 from ClickHouse/fix_race_in_replication_queue
Do not enqueue uneeded parts for check
2022-07-20 00:35:02 +03:00
zvonand
592499e290 fix server crash on negative size 2022-07-19 23:11:03 +02:00
avogar
5c16d6b553 Fix WriteBuffer finalize in destructor when cacnel query 2022-07-19 19:21:30 +00:00
Kseniia Sumarokova
891dbccdc7
Update LRUFileCache.cpp 2022-07-19 19:18:42 +02:00
Antonio Andelic
a4450225c7 Disable digest by default 2022-07-19 17:14:44 +00:00
Nikolai Kochetov
775b96fe13 Remove comment 2022-07-19 17:05:44 +00:00
Robert Schulze
4e41cac07a
Merge branch 'master' into dev_intel_iaa_deflate 2022-07-19 18:48:24 +02:00
jinjunzh
9c440bec28 Merge branch 'dev_intel_iaa_deflate' of https://github.com/jinjunzh/ClickHouse into dev_intel_iaa_deflate 2022-07-19 17:50:23 -04:00
jinjunzh
94332d876a Fixed type&style issue 2022-07-19 17:48:41 -04:00
jinjunzh
b0c6fcf3a0 demoted log to INFO when the job pool is exhausted 2022-07-19 15:30:25 -04:00
jinjunzh
8f6cc6971b add comments for readBig 2022-07-19 14:24:00 -04:00
Nikolai Kochetov
51396aa083 Fix scale for DateTime64 dictionary attribute. 2022-07-19 16:46:52 +00:00
Robert Schulze
02ed126533
Update src/Common/TraceSender.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-07-19 18:44:31 +02:00
vdimir
c0547bb09c
fix space 2022-07-19 18:33:55 +02:00
vdimir
10e4ef135d
Set default value cross_to_inner_join_rewrite = 2 for comma join 2022-07-19 18:33:54 +02:00
jinjunzh
3a7fa8887f refine readCompressedDataBlockForAsynchronous 2022-07-19 10:23:25 -04:00
Kruglov Pavel
88d59520a2
Fix 2022-07-19 15:20:56 +02:00
Sergei Trifonov
499818751e
Merge pull request #39280 from ClickHouse/avg-cpu-progress
fix cpu usage metric in client
2022-07-19 15:17:44 +02:00
Antonio Andelic
a3e00faaf9 Fix unit tests 2022-07-19 13:14:36 +00:00
Dmitry Novik
50989bdb68
Merge branch 'master' into group-by-use-nulls 2022-07-19 14:58:01 +02:00
Kseniia Sumarokova
2e3ceb351e
Update LRUFileCache.cpp 2022-07-19 14:44:56 +02:00
Kseniia Sumarokova
f7bb69ef7a
Update LRUFileCache.cpp 2022-07-19 14:43:11 +02:00
Kseniia Sumarokova
af7acb1782
Update LRUFileCache.cpp 2022-07-19 14:41:31 +02:00
Igor Nikonov
37af968548 Rename option rewrite -> optimize 2022-07-19 12:40:50 +00:00
Kseniia Sumarokova
5ad4e9d28f
Update LRUFileCache.cpp 2022-07-19 14:33:50 +02:00
Robert Schulze
7146685f9d
Merge pull request #39299 from azat/fix-lsan-v3
[RFC] Fix LSan by fixing getauxval()
2022-07-19 14:27:41 +02:00
avogar
4f020654be Get rid of unneded ifdefs 2022-07-19 12:12:40 +00:00
kssenii
e9e405e330 Fix 2022-07-19 14:07:41 +02:00
Constantine Peresypkin
246614229f fix long wait for process exit in ShellCommand
fixes #38889
2022-07-19 14:07:27 +02:00
zvonand
30eb2cbcb3 removed Base58 domain type 2022-07-19 14:03:13 +02:00
Alexander Tokmakov
a761da9f1b add comment 2022-07-19 13:58:59 +02:00
Robert Schulze
9d0e3d107b
Update src/Functions/formatReadableTimeDelta.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-07-19 13:17:33 +02:00
alesapin
bdc09c8319
Merge pull request #39303 from ClickHouse/whitespaces
Whitespaces
2022-07-19 13:17:29 +02:00
Alexander Tokmakov
3e7414b356 add comment 2022-07-19 12:47:20 +02:00
Kruglov Pavel
12221cffc9
Merge pull request #39071 from jiahui-97/parse_timedelta
implementation of parseTimeDelta function
2022-07-19 12:39:56 +02:00
Alexander Tokmakov
acb1fa53ed
Merge pull request #39341 from ClickHouse/fix_memory_exceptions_with_transactions
Fix memory exceptions with transactions
2022-07-19 13:31:15 +03:00
Alexander Tokmakov
1fff3b24b8
Merge pull request #39337 from ClickHouse/minor_fix_for_ordinary_database
Do not start on unexpected Ordinary metadata
2022-07-19 13:30:56 +03:00
Nikolai Kochetov
d0db7135cb
Merge pull request #38946 from amosbird/nullable-partition-fix1
Fix incorrect partition pruning when there is a nullable partition
2022-07-19 12:14:36 +02:00
zvonand
d245d6349a fixed zero check 2022-07-19 12:08:08 +02:00
Kseniia Sumarokova
f168e0c5d0
Merge pull request #39272 from kssenii/fixes-for-materialized-pg
Fix segfault in materialised postgresql
2022-07-19 11:56:10 +02:00
Nikolay Degterinsky
4ae356f218 Fix NULL, add test 2022-07-19 09:15:42 +00:00
Antonio Andelic
ce570b6ee3 Add logs and 4LW for api version 2022-07-19 09:02:57 +00:00
Antonio Andelic
e6ded88ea3 Small refactoring 2022-07-19 08:51:12 +00:00
jasperzhu
c044c67745
Merge branch 'master' into dev_intel_iaa_deflate 2022-07-19 15:32:57 +08:00
Robert Schulze
81ef1099cc
Even less usage of StringRef
--> see #39300
2022-07-19 07:01:06 +00:00
jiahui-97
e7af88b688 implementation of parseTimeDelta function
Co-authored-by: Kruglov Pavel <48961922+Avogar@users.noreply.github.com>
2022-07-19 09:33:02 +08:00
jinjunzh
a53ed21dba restore the function doDecompressDataSynchronous 2022-07-18 17:44:15 -04:00
Alexander Tokmakov
d82f378a9d do not enqueue uneeded parts for check 2022-07-18 23:37:07 +02:00
Smita Kulkarni
8b523bec16 Addressed review comments
- Updated destructor of ForkWriteBuffer to clear buffer
2022-07-18 22:12:26 +02:00
avogar
6eb234a1cc Avoid abort() in capnproto on exception descruction 2022-07-18 19:53:24 +00:00
Kruglov Pavel
1513285166
Fix typo 2022-07-18 20:54:13 +02:00
jinjunzh
332d3fd1a7 add comments for doDecompressDataAsynchronous 2022-07-18 14:40:49 -04:00
Alexander Gololobov
614cb9a87f Disable trivial count() optimization if _row_exists column is present 2022-07-18 20:08:01 +02:00
Alexander Gololobov
ae0d00083c Renamed __row_exists to _row_exists 2022-07-18 20:07:36 +02:00
Alexander Gololobov
f324ca9921 Cleanups 2022-07-18 20:07:22 +02:00
Alexander Gololobov
f956810fdd Rewrite DELETE FROM into UPDATE __row_exist=0 2022-07-18 20:07:10 +02:00
Alexander Gololobov
9de72d995a POC lightweight delete using __row_exists virtual column and prewhere-like filtering 2022-07-18 20:06:42 +02:00
Kruglov Pavel
24c9467641
Fix 2022-07-18 19:55:14 +02:00
avogar
3f81aadb60 Fix schema inference in case of empty messages in Protobuf/CapnProto formats 2022-07-18 17:53:33 +00:00
Robert Schulze
6df3c9d799
Merge pull request #39300 from ClickHouse/stringref-to-stringview
First try at reducing the use of StringRef
2022-07-18 19:20:16 +02:00
Kruglov Pavel
c7569d8b05
Fix build 2022-07-18 18:28:42 +02:00
Smita Kulkarni
e165e68386 Addressed review comment
- updated creating ForkWriteBuffer in ClientBase to avoid duplication
2022-07-18 18:12:13 +02:00
Azat Khuzhin
c6f7698f9a Fix possible UB in MergeTreeBackgroundExecutor
Lambda erase_from_active() captures the item (TaskRuntimeDataPtr), most
of the code path is OK, since it explicitly reset the item->task.

However one is not, when it moves the item to pending list, which will
be cleaned up when the table will be DROP/DETACH'ed, from
MergeTreeBackgroundExecutor::removeTasksCorrespondingToStorage(),
and in this case if IStorage will be already removed, then it will lead
to use-after-free on destroying the lambda, since it captures the item
by value.

And I belive that CI founds this issue here [1]:

<details>

<summary>stack trace</summary>

    4 0x268d1354 in DB::ReplicatedMergeTreeQueue::CurrentlyExecuting::~CurrentlyExecuting() build_docker/../src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp:1510:33
    5 0x268ead1a in std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting>::operator()(DB::ReplicatedMergeTreeQueue::CurrentlyExecuting*) const build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:54:5
    6 0x268ead1a in std::__1::unique_ptr<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting, std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting> >::reset(DB::ReplicatedMergeTreeQueue::CurrentlyExecuting*) build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:315:7
    7 0x268ead1a in std::__1::unique_ptr<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting, std::__1::default_delete<DB::ReplicatedMergeTreeQueue::CurrentlyExecuting> >::~unique_ptr() build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:269:19
    8 0x268ead1a in DB::ReplicatedMergeTreeQueue::SelectedEntry::~SelectedEntry() build_docker/../src/Storages/MergeTree/ReplicatedMergeTreeQueue.h:351:12
    9 0x268ead1a in void std::__1::__destroy_at<DB::ReplicatedMergeTreeQueue::SelectedEntry, 0>(DB::ReplicatedMergeTreeQueue::SelectedEntry*) build_docker/../contrib/libcxx/include/__memory/construct_at.h:56:13
    ...
    16 0x265e9abb in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>)::'lambda'()::~() build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:127:30
    17 0x265e9abb in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>) build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:235:1
    18 0x265ea730 in DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::threadFunction() build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:261:13

</details>

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/0/533c7888038453c047df816f3f65292cca05a54f/stateless_tests__ubsan__actions_.html

And I also I think that the following issue will also be fixed [2]:

<details>

<summary>stack trace</summary>

    [ 680 ] {} <Fatal> : Logical error: 'Memory tracker: allocations not allowed.'.
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 23. /build/build_docker/../src/Common/formatReadable.cpp:46: formatReadableSizeWithBinarySuffix(double, int) @ 0x1713bb98 in /usr/bin/clickhouse
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 31. ../src/Common/MemoryTracker.cpp:112: MemoryTracker::logPeakMemoryUsage() @ 0x170e0ab9 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 32. /build/build_docker/../src/Common/MemoryTracker.cpp:98: MemoryTracker::~MemoryTracker() @ 0x170e063a in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 33. /build/build_docker/../src/Storages/MergeTree/MergeList.cpp:144: DB::MergeListElement::~MergeListElement() @ 0x279fb290 in /usr/bin/clickhouse
    ...
    [ 23430 ] {} <Fatal> BaseDaemon: 38. /build/build_docker/../src/Storages/MergeTree/BackgroundProcessList.h:41: DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>::~BackgroundProcessListEntry() @ 0x276ce6c7 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 39. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:54: std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> >::operator()(DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>*) const @ 0x276ce60b in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 40. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:316: std::__1::unique_ptr<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>, std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> > >::reset(DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>*) @ 0x276ce57c in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 41. /build/build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:269: std::__1::unique_ptr<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo>, std::__1::default_delete<DB::BackgroundProcessListEntry<DB::MergeListElement, DB::MergeInfo> > >::~unique_ptr() @ 0x276ce399 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 42. /build/build_docker/../src/Storages/MergeTree/MutatePlainMergeTreeTask.h:22: DB::MutatePlainMergeTreeTask::~MutatePlainMergeTreeTask() @ 0x27defceb in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 43. /build/build_docker/../contrib/libcxx/include/__memory/construct_at.h:57: void std::__1::__destroy_at<DB::MutatePlainMergeTreeTask, 0>(DB::MutatePlainMergeTreeTask*) @ 0x27dd69c1 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: 44. /build/build_docker/../contrib/libcxx/include/__memory/construct_at.h:82: void std::__1::destroy_at<DB::MutatePlainMergeTreeTask, 0>(DB::MutatePlainMergeTreeTask*) @ 0x27dd6955 in /usr/bin/clickhouse
    [ 23430 ] {} <Fatal> BaseDaemon: Integrity check of the executable skipped because the reference checksum could not be read. (calculated checksum: 91F5937571C11255DFE73230B52CE9C0)
    [ 602 ] {} <Fatal> Application: Child process was terminated by signal 6.

</details>

  [2]: https://s3.amazonaws.com/clickhouse-test-reports/39222/a068c397dfd7943359a8b554566c3c70b78baf8d/stateless_tests__debug__actions__%5B1/3%5D.html

Refs: https://github.com/ClickHouse/ClickHouse/pull/29614#discussion_r720455032 (cc @nikitamikhaylov)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-18 19:01:41 +03:00
Alexander Tokmakov
51c4ffad8c block memory exceptions in TransactionLog 2022-07-18 17:40:09 +02:00
avogar
2367f40b70 Better exception messages in schema inference 2022-07-18 15:36:33 +00:00
Alexander Tokmakov
23312164bf do not start on unexpected Ordinary metadata 2022-07-18 17:05:03 +02:00