Commit Graph

10641 Commits

Author SHA1 Message Date
Azat Khuzhin
fa329808e5 Call next() from sync()/finalize() in WriteBuffer 2021-02-13 13:14:11 +03:00
Ilya Yatsishin
8ff458a2bf
Merge pull request #20459 from ClickHouse/decimal-comparison-ubsan 2021-02-13 12:34:40 +03:00
Azat Khuzhin
cbeda6c60e Fix LOGICAL_ERROR for join_use_nulls=1 when JOIN contains const from SELECT 2021-02-13 11:05:25 +03:00
alesapin
f80137626a
Merge pull request #19580 from ClickHouse/in_memory_raft
In memory coordination inside ClickHouse
2021-02-13 10:19:23 +03:00
Alexey Milovidov
1546f5bcb9 Suppress UBSan report in Decimal comparison 2021-02-13 03:54:38 +03:00
Alexey Milovidov
1c55be261c Fix UBSan report in arrayDifference 2021-02-13 03:45:06 +03:00
Alexander Kuzmenkov
716a3df6eb
Merge pull request #20337 from ClickHouse/aku/window-prototype
window function rank() and friends
2021-02-13 03:03:49 +03:00
alexey-milovidov
2fe2190a20
Merge pull request #19721 from azat/buffer-profile
Add separate config directive for Buffer profile
2021-02-13 02:43:41 +03:00
alexey-milovidov
04701376ac
Merge pull request #20232 from ClickHouse/fix_int_field_to_decimal_conversion
Fix integer Field to Decimal conversion
2021-02-13 02:22:32 +03:00
alexey-milovidov
371e84957a
Merge pull request #20303 from azat/constant-folding-fixes
Do not allow early constant folding of explicitly forbidden functions
2021-02-13 02:20:06 +03:00
Alexey Milovidov
34f5ea00e4 Merge branch 'master' into in-memory-compression 2021-02-13 02:08:40 +03:00
Alexey Milovidov
3f8336963b Non significant change in AggregationCommon 2021-02-13 00:30:58 +03:00
Alexey Milovidov
b5826121db Fix Arcadia 2021-02-13 00:29:06 +03:00
Alexey Milovidov
453450985f Performance improvement by Nikolai Kochetov 2021-02-13 00:26:25 +03:00
Alexey Milovidov
1c656830fc Fix clang-tidy 2021-02-13 00:26:12 +03:00
Alexander Tokmakov
184ec67dac better ddl queue cleanup 2021-02-12 22:23:50 +03:00
Nikita Mikhailov
2a52aa8ca3 fix test 2021-02-12 20:25:40 +03:00
Alexander Tokmakov
f64f9b672b fix 2021-02-12 19:22:01 +03:00
alesapin
a25ce1c166
Revert "Fix access control manager destruction order" 2021-02-12 19:13:57 +03:00
Nikita Mikhailov
fcd080631f Merge branch 'master' of github.com:ClickHouse/ClickHouse into keen-wolf-filefuncwithreadbuf 2021-02-12 17:53:18 +03:00
alexey-milovidov
f669a9f97a
Merge pull request #20348 from kitaisreal/common-types-template-instantiations
Common types template instantiations
2021-02-12 15:53:00 +03:00
Nikolai Kochetov
2ba503a9cc
Merge pull request #20110 from vitlibar/mongodb-doesnt-connect-before-read
MongoDB table engine now establishes connection only when it reads data.
2021-02-12 15:49:45 +03:00
Nikita Mikhaylov
3174c57562
Update src/Formats/JSONEachRowUtils.cpp
Co-authored-by: tavplubix <tavplubix@gmail.com>
2021-02-12 15:29:19 +03:00
Alexander Kuzmenkov
824475b224 cleanup 2021-02-12 13:37:27 +03:00
alesapin
a94e223cee
Merge pull request #20344 from azat/join_use_nulls-fix
Fix null dereference with join_use_nulls=1
2021-02-12 12:48:53 +03:00
alesapin
9aadbde86c
Merge pull request #20339 from kitaisreal/decimal-binary-operation-constants-fix
Decimal binary operation constants fix
2021-02-12 12:32:58 +03:00
Maksim Kita
f9527738c9 Added comments 2021-02-12 12:12:04 +03:00
Maksim Kita
e141367bcf
Merge pull request #20345 from azat/RANGE_HASHED-dict-fix
Avoid invalid dereference in RANGE_HASHED() dictionary
2021-02-12 11:05:10 +03:00
alesapin
a2bb586170
Merge pull request #20335 from ClickHouse/fix_scheduling_of_non_successful_background_tasks
Fix backoff for failed background tasks in replicated merge tree
2021-02-12 10:06:04 +03:00
Alexey Milovidov
170daa5d65 Generate ya.make 2021-02-12 05:33:39 +03:00
Alexey Milovidov
71d84b9f67 Fix style 2021-02-12 03:52:53 +03:00
Alexey Milovidov
ed7270dd8b Better interface 2021-02-12 03:25:00 +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
Alexander Tokmakov
c9cf63e958 fix 2021-02-12 01:23:40 +03:00
alexey-milovidov
5a4a5fda20
Update ColumnVector.h 2021-02-12 01:04:55 +03:00
Maksim Kita
b276eac197 Common types template instantiations 2021-02-12 00:54:50 +03:00
Alexey Milovidov
5355175e49 Development 2021-02-12 00:26:14 +03:00
Alexey Milovidov
a2da05039e Merge branch 'master' into in-memory-compression 2021-02-11 23:59:14 +03:00
Alexey Milovidov
b61ce427a8 Whitespaces 2021-02-11 23:59:00 +03:00
alesapin
5f32f65211 Merge branch 'master' into in_memory_raft 2021-02-11 23:09:29 +03:00
Azat Khuzhin
f6cfcd4da9 Fix null dereference with join_use_nulls=1
Found with MSan [1], the following query triggers null dereference:

```sql
SELECT
    Y.id - 1
FROM X
RIGHT JOIN Y ON (X.id + 1) = Y.id
SETTINGS join_use_nulls=1; -- { serverError 53 }
```

```
Received signal 11
(version 21.3.1.5916, build id: 2E9E84AA32AEAAC7C8B6EB45DA3EC0B4F15E9ED4) (from thread 100) (query_id: 9ab8cb0d-be8d-445e-8498-930a7268488b) Received signal Segmentation fault (11)
Address: 0x10 Access: read. Address not mapped to object.
Stack trace: 0x2d079d65 0x29bf1f30 0x12b12220 0x12b13098 0x12b17b08 0x12b20459 0x2ae37913 0x2ae352d9 0x2c746072 0x2c7585dd 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d 0x2c7483e3 0x2c74e63d
4. ./obj-x86_64-linux-gnu/../contrib/boost/boost/smart_ptr/intrusive_ptr.hpp:0: DB::ColumnConst::ColumnConst(COW<DB::IColumn>::immutable_ptr<DB::IColumn> const&, unsigned long) @ 0x2d079d65 in /workspace/clickhouse
5. ./obj-x86_64-linux-gnu/../src/Common/COW.h:0: DB::createBlockWithNestedColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) @ 0x29bf1f30 in /workspace/clickhouse
6. DB::FunctionOverloadResolverAdaptor::getReturnTypeDefaultImplementationForNulls(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::function<std::__1::shared_ptr<DB::IDataType const> (std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&)> const&) @ 0x12b12220 in /workspace/clickhouse
7. DB::FunctionOverloadResolverAdaptor::getReturnTypeWithoutLowCardinality(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const @ 0x12b13098 in /workspace/clickhouse
8. DB::FunctionOverloadResolverAdaptor::getReturnType(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const @ 0x12b17b08 in /workspace/clickhouse
9. DB::FunctionOverloadResolverAdaptor::build(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const @ 0x12b20459 in /workspace/clickhouse
```

  [1]: https://clickhouse-test-reports.s3.yandex.net/19451/64c0bf98290362fa216c05b070aa122a12af3c25/fuzzer_msan/report.html#fail1
2021-02-11 21:30:05 +03:00
alexey-milovidov
dc3ffd3fe2
Merge pull request #19451 from azat/safe-writes
Do not silently ignore write errors
2021-02-11 21:19:11 +03:00
Azat Khuzhin
2907385400 Avoid invalid dereference in RANGE_HASHED() dictionary
UBsan report the following [1], when query does not contains any columns
from the dictionary:

```sql
SELECT
    toUInt32(toUInt32(NULL, toUInt32(NULL, inf, NULL), NULL)),
    toUInt32(toUInt32(toUInt32(toUInt32(toUInt32(NULL, 1., NULL)), toUInt32(toUInt32(NULL, 0.5, NULL)), toUInt32(NULL, NULL)), toUInt32(toUInt32(NULL, 1., NULL)), toUInt32(NULL, NULL)), toUInt32(toUInt32(toUInt32(toUInt32(NULL, 1000.0001220703125, NULL)), toUInt32(toUInt32(NULL, 10.000100135803223, NULL)), toUInt32(NULL, NULL)), NULL, NULL, NULL))
FROM somedict
```

```
std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> >::back() @ 0x128c07a6 in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/RangeDictionaryBlockInputStream.h:0: DB::RangeDictionaryBlockInputStream<DB::RangeHashedDictionary, unsigned short, unsigned long>::fillBlock(DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, DB::PODArray<unsigned short, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, DB::PODArray<unsigned short, 4096ul, Allocator<false, false>, 15ul, 16ul> const&) const @ 0x1692335e in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/RangeDictionaryBlockInputStream.h:0: DB::RangeDictionaryBlockInputStream<DB::RangeHashedDictionary, unsigned short, unsigned long>::getBlock(unsigned long, unsigned long) const @ 0x16922f96 in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/DictionaryBlockInputStreamBase.cpp:23: DB::DictionaryBlockInputStreamBase::getHeader() const @ 0x166ab57c in /workspace/clickhouse
```

  [1]: https://clickhouse-test-reports.s3.yandex.net/19451/64c0bf98290362fa216c05b070aa122a12af3c25/fuzzer_ubsan/report.html#fail1
2021-02-11 21:07:37 +03:00
alexey-milovidov
7b55eb8c58
Merge pull request #20178 from amosbird/delayinactive
Delay or throw insertion when too many inactive parts
2021-02-11 20:52:04 +03:00
alexey-milovidov
ef3c9b531c
Merge pull request #20287 from kitaisreal/delta-sum-aggregate-function-use-restrict-keyword
Aggregate function deltaSum use restrict keyword
2021-02-11 20:47:07 +03:00
alexey-milovidov
d15d340691
Merge pull request #20301 from azat/numbers-numeric-limit
Accept arbitrary numeric types for numbers() arguments (for scientific notation)
2021-02-11 20:41:15 +03:00
Alexander Kuzmenkov
1275be58bf Merge remote-tracking branch 'origin/master' into HEAD 2021-02-11 19:49:37 +03:00
Alexander Kuzmenkov
ebb47595aa
Merge pull request #20293 from ClickHouse/aku/window-prototype-3
make window functions faster
2021-02-11 19:49:02 +03:00
Alexander Kuzmenkov
a77415781f reserve the result columns in advance 2021-02-11 19:48:27 +03:00
Alexander Kuzmenkov
62b3bf7b57 some tests and speedup 2021-02-11 19:20:57 +03:00
Maksim Kita
369dc613c4 Decimal binary operation constants fix 2021-02-11 19:05:17 +03:00
Alexander Kuzmenkov
a2943fd196 cleanpu 2021-02-11 18:47:52 +03:00
Alexander Kuzmenkov
d8f9a8d3cd first_value and last_value 2021-02-11 18:41:54 +03:00
Ivan
0854dccfde
Fix ANTLR parser tests 2021-02-11 18:21:21 +03:00
Alexander Tokmakov
9afb16759e fix 2021-02-11 18:14:38 +03:00
Alexander Kuzmenkov
ecbcf47f28 lag/lead stubs + cleanup 2021-02-11 18:07:42 +03:00
Alexander Kuzmenkov
772073a0db
Update WindowTransform.cpp 2021-02-11 17:01:09 +03:00
Alexey Milovidov
9b4f6fb711 Don't compress small blocks 2021-02-11 16:41:21 +03:00
Alexey Milovidov
4d650a2a56 Adjust config 2021-02-11 16:41:21 +03:00
Alexey Milovidov
280f459f71 Fix quadratic INSERT 2021-02-11 16:41:21 +03:00
Alexey Milovidov
d539948fe7 In memory compression: a prototype 2021-02-11 16:40:15 +03:00
alexey-milovidov
263d751d64
Merge pull request #20169 from ClickHouse/no-excessive-squash-memory
Disable excessive squashing of blocks for StorageMemory #13052
2021-02-11 16:38:24 +03:00
Alexander Kuzmenkov
525400bc41 window function rank() and friends 2021-02-11 16:29:30 +03:00
alesapin
447fcfa1c9 Fix build 2021-02-11 15:12:01 +03:00
alesapin
3253638969 Fix backoff for failed background tasks in replicated merge tree 2021-02-11 14:46:18 +03:00
alesapin
99a471e047 Add ability to start as follower 2021-02-11 13:25:10 +03:00
alesapin
0acd018361 Fix typo 2021-02-11 12:58:02 +03:00
alesapin
74630acff5 More debug in test 2021-02-11 12:49:49 +03:00
tavplubix
17af32a59b
Merge pull request #20215 from azat/dist-lockless-SYSTEM-FLUSH-DISTRIBUTED
Lockless SYSTEM FLUSH DISTRIBUTED
2021-02-11 12:30:46 +03:00
alesapin
b49b7f859d Simplify startup with fixed config 2021-02-11 12:17:57 +03:00
Alexander Kuzmenkov
363007b964 fixes 2021-02-11 11:39:39 +03:00
alesapin
d88f7bc0c8
Merge pull request #20224 from ClickHouse/fix_config_reloader_destruction
Fix access control manager destruction order
2021-02-11 11:18:00 +03:00
alesapin
56453256b7
Merge pull request #20300 from ClickHouse/restrict_to_drop_version_column
Don't allow to drop or rename version column
2021-02-11 11:04:00 +03:00
alesapin
121c5c9605
Merge pull request #20279 from ClickHouse/relax_check_in_data_writer
Relax check in data writer for non adaptive tables
2021-02-11 10:57:07 +03:00
alesapin
c2bb2c2902
Merge pull request #20097 from ClickHouse/remove-adding-missed-step
Build actions dag to evaluate missing defaults.
2021-02-11 10:51:21 +03:00
Alexander Kuzmenkov
467ff74814 Merge remote-tracking branch 'origin/master' into HEAD 2021-02-11 10:42:39 +03:00
Alexander Kuzmenkov
38678ff484 Merge remote-tracking branch 'origin/master' into HEAD 2021-02-11 10:40:05 +03:00
Alexander Kuzmenkov
2571dac984
Merge pull request #20111 from ClickHouse/aku/window-prototype
RANGE OFFSET window frame
2021-02-11 10:39:21 +03:00
Vladimir Ch
73a0e2961b
Merge pull request #20175 from amosbird/countrewrite 2021-02-11 09:38:12 +03:00
Alexey Milovidov
dbb41ce4e2 Remove debug output 2021-02-11 02:55:52 +03:00
Alexey Milovidov
f442b30f30 Fix test 2021-02-11 01:23:27 +03:00
alexey-milovidov
e33477a16e
Merge pull request #20282 from ClickHouse/dont_allow_ttl_for_old_syntax
Don't allow TTL in old syntax
2021-02-11 00:46:30 +03:00
Azat Khuzhin
6b82e8ad19 Mark ignore() as not suitable for constant folding 2021-02-11 00:39:03 +03:00
Azat Khuzhin
53ea58810e Do not allow constant folding of explicitly forbidden functions 2021-02-11 00:38:47 +03:00
Alexey Milovidov
d3dba0e52a Merge branch 'master' into no-excessive-squash-memory 2021-02-10 23:45:12 +03:00
Alexander Tokmakov
15256d86e5 better replica recovery and queue cleanup 2021-02-10 23:30:40 +03:00
Azat Khuzhin
809fa7e4cc Sync SYSTEM FLUSH DISTRIBUTED with TRUNCATE 2021-02-10 23:10:37 +03:00
Anton Popov
365e2fb746
Merge pull request #20231 from fuwhu/refine-loadDataParts-code
refine code in MergeTreeData::loadDataParts to avoid parsing WAL file as data part
2021-02-10 22:42:31 +03:00
alesapin
6f837b41e3
Update inplaceBlockConversions.h 2021-02-10 22:32:34 +03:00
Azat Khuzhin
5001b19613 Accept arbitrary numeric types for numbers() arguments (for scientific notation)
This is to make the syntax simpler, i.e. avoid explicit cast to UInt64
if you want to use scientific notation (i.e. 1e9 over 1 000 000 000).

v2: use plain evaluateConstantExpression() over
evaluateConstantExpressionOrIdentifierAsLiteral() since identifier will
not work anyway
2021-02-10 22:32:32 +03:00
alesapin
891fce3275 Don't allow to drop or rename version column 2021-02-10 22:23:48 +03:00
Alexander Kuzmenkov
695e3a797a some optimizations 2021-02-10 21:55:11 +03:00
Azat Khuzhin
935870b2c2 Add separate config directive for Buffer profile
If you push data via Buffer engine then all your queries will be done
from one user, however this is not always desired behavior, since this
will not allow to limit queries with max_concurrent_queries_for_user and
similar.
2021-02-10 21:40:26 +03:00
Alexey Milovidov
30b2554fa3 Fix error 2021-02-10 20:48:39 +03:00
Anton Popov
ece7e87cfb
Merge pull request #20079 from ClickHouse/vdimir/fix-join-used-flag
Split use flags and RowRef in HashJoin
2021-02-10 20:34:22 +03:00
Maksim Kita
86ff45c50e Aggregate function deltaSum use restrict keyword 2021-02-10 19:19:48 +03:00
Nikita Mikhailov
47f62e899b style 2021-02-10 17:52:28 +03:00
Nikita Mikhailov
6c9f5e4991 try 2021-02-10 17:16:27 +03:00
Alexander Kuzmenkov
e557d60cdb fixes for sort order 2021-02-10 16:27:22 +03:00
alesapin
b4d53886a3 Add sync request/response 2021-02-10 16:01:05 +03:00
Nikolai Kochetov
af214e794f Review fixes. 2021-02-10 15:45:39 +03:00
Alexander Kuzmenkov
d5b0f30732 cache the block size in the block itself for some speedup 2021-02-10 15:44:07 +03:00
Alexander Kuzmenkov
b57b3244f5 reuse sort order 2021-02-10 15:44:07 +03:00
Alexander Kuzmenkov
a67a54e2a5 cleanup 2021-02-10 15:44:07 +03:00
alesapin
a63d73db58 Don't allow TTL in old syntax 2021-02-10 15:09:12 +03:00
alesapin
e07bdad5c0 Fix test build 2021-02-10 14:44:21 +03:00
alesapin
420f2958e2
Merge pull request #19991 from ClickHouse/constant-propagation-fix
Do not use inputs which values are known constants in ActionsDAG.
2021-02-10 14:13:52 +03:00
alesapin
21faea1f68 Relax check in data writer for non adaptive tables 2021-02-10 13:43:31 +03:00
Maksim Kita
85396fc82e
Merge pull request #20057 from rf/rf/add-deltasum
Add `deltaSum` aggregate function, docs & test
2021-02-10 13:28:48 +03:00
alesapin
0d179e021b Add sync cmd 2021-02-10 13:15:42 +03:00
alesapin
57d8d81d59 Fix style 2021-02-10 13:02:09 +03:00
alesapin
9179fc8d96
Merge pull request #20226 from ClickHouse/fix_race_in_system_parts
Fix benign race in system.parts
2021-02-10 12:45:51 +03:00
alesapin
c95140d906 Better startup and non-verbose logging by default 2021-02-10 12:28:53 +03:00
Nikolai Kochetov
253c72afc4
Merge pull request #20251 from ClickHouse/fix-20242
Fix not closed ports in DelayedPortsProcessor
2021-02-10 12:28:28 +03:00
vdimir
d9afee55ba
Add RewriteCountVariantsVisitor.cpp to ya.make 2021-02-10 12:48:41 +08:00
Amos Bird
fc6c57f8e0
Fix 2021-02-10 12:48:41 +08:00
Amos Bird
565a148da9
Normalize count() variants 2021-02-10 12:48:41 +08:00
Amos Bird
afb5846a24
refactor 2021-02-10 11:22:24 +08:00
HuFuwang
4ac8860cea refine code in MergeTreeData::loadDataParts to avoid parsing WAL file as data part. 2021-02-10 10:13:43 +08:00
alexey-milovidov
4ff3a28a9f
Merge pull request #20211 from amosbird/fixcte2
Fix CTE in INSERT-SELECT
2021-02-10 02:12:05 +03:00
alexey-milovidov
21b1a3fc6d
Merge pull request #20246 from ucasFL/avg-optimize
fix a problem in ArithmeticOperationsInAgrFuncOptimize
2021-02-10 02:10:15 +03:00
alexey-milovidov
ec9808bf63
Merge pull request #20228 from ClickHouse/add_some_final_specifiers
Add final to some classes
2021-02-09 23:37:47 +03:00
Russ Frank
6b80ae6c4f style fixes 2021-02-09 15:01:57 -05:00
Nikolai Kochetov
8ba9576ed9 Added comment. 2021-02-09 22:52:48 +03:00
Nikolai Kochetov
27d607a955 Respect header in addMissingDefaults 2021-02-09 22:48:34 +03:00
alesapin
51c221f993 Fix outdated session kill 2021-02-09 21:29:06 +03:00
Vladimir Ch
a8acaafd56
Merge pull request #20223 from vdimir/fix-array-join-missing-arg
Handle syntax error for ARRAY JOIN with no args
2021-02-09 20:13:09 +03:00
alesapin
9d414d215e Merge branch 'master' into in_memory_raft 2021-02-09 20:00:50 +03:00
Alexander Kuzmenkov
a2a0d385c5 style 2021-02-09 19:50:39 +03:00
Nikolai Kochetov
db09d5a990 Fix not closed ports in DelayedPortsProcessor 2021-02-09 19:35:46 +03:00
Vitaly Baranov
9de7a0a779
Add comment 2021-02-09 18:55:36 +03:00
alesapin
c78f3ba204 Missed file 2021-02-09 18:39:15 +03:00
Alexander Kuzmenkov
8212976dc0 add boundary order check 2021-02-09 18:36:08 +03:00
Maksim Kita
a2560cecf4
Merge branch 'master' into fuse 2021-02-09 18:30:18 +03:00
Alexander Tokmakov
2c6a0e74fb better replica creation 2021-02-09 18:14:20 +03:00
alesapin
b130fbfd78 Add coordination settings 2021-02-09 17:47:18 +03:00
Alexander Kuzmenkov
c18749a704 fix a bug and add some tests 2021-02-09 17:44:04 +03:00
feng lv
5e0095c70b fix a problem in ArithmeticOperationsInAgrFuncOptimize 2021-02-09 14:17:48 +00:00
alexey-milovidov
faf28eeff3
Merge pull request #20183 from ucasFL/avg-optimize
rewrite avg for algebraic optimization
2021-02-09 16:36:13 +03:00
alesapin
9667bdcbd2 Merge branch 'master' into in_memory_raft 2021-02-09 16:06:31 +03:00
Alexander Kuzmenkov
6e40b9fb6c fix for the DESC frame 2021-02-09 14:56:58 +03:00
Alexander Kuzmenkov
fe8b414a69 cleanup 2021-02-09 14:56:58 +03:00
tavplubix
86530e603c
Merge pull request #20027 from bharatnc/ncb/event_time_micro_part_log
add event_time_microseconds field to system.part_log table
2021-02-09 14:46:40 +03:00
Alexander Tokmakov
4859657c42 fix int field to decimal conversion 2021-02-09 13:21:54 +03:00
hexiaoting
28b981a76b Fix style error and test cases error 2021-02-09 18:08:55 +08:00
alesapin
cb1194d37a Add final to some classes 2021-02-09 12:05:54 +03:00
alesapin
8da9f150de Fix race in system.parts 2021-02-09 11:51:17 +03:00
Nikolai Kochetov
798ffdc719 Fix build. 2021-02-09 11:37:55 +03:00
Nikolai Kochetov
229acbad5d
Merge pull request #20077 from ClickHouse/remove-adding-const-column-transform
Remove AddingConstColumn step and transform.
2021-02-09 11:28:44 +03:00
alesapin
accf48a21b
Merge pull request #20212 from nvartolomei/codespace-4851
Remove dead code
2021-02-09 11:27:27 +03:00
alesapin
15ce3dc112 Fix access control manager destruction order 2021-02-09 11:24:39 +03:00
vdimir
241769ee7c
Handle syntax error for ARRAY JOIN with no args 2021-02-09 11:21:26 +03:00
Russ Frank
2cde36a155 dont allow col type to be decimal 2021-02-08 22:53:45 -05:00
Russ Frank
b297e0ef36 feedback: use references, dont support decimal, rearrange struct members 2021-02-08 22:51:03 -05:00
Amos Bird
8911a038a0
Another fix 2021-02-09 11:46:06 +08:00
Russ Frank
746dc1ddae Merge remote-tracking branch 'origin/master' into rf/add-deltasum 2021-02-08 15:35:16 -05:00
alexey-milovidov
38c7ad3c38
Merge pull request #20204 from amosbird/fixubs
Fix ubsan error
2021-02-08 23:19:16 +03:00
Alexander Tokmakov
5e0cbfe972 Merge branch 'master' into database_replicated 2021-02-08 23:01:12 +03:00
alesapin
b8baf3a443 Fix some warnings 2021-02-08 22:40:44 +03:00
Alexander Tokmakov
78c1d69b8c better code 2021-02-08 22:36:17 +03:00
tavplubix
ac477d9850
Merge pull request #19771 from ClickHouse/thread_state_improvements
Minor code improvements around ThreadStatus
2021-02-08 22:34:55 +03:00
Nikolai Kochetov
e0a806c180
Delete filterPushDown.cpp 2021-02-08 22:10:27 +03:00
Azat Khuzhin
ce91c257b2 Lockless SYSTEM FLUSH DISTRIBUTED
Right now SYSTEM FLUSH DISTRIBUTED will block:
- INSERT into this Distributed table (requireDirectoryMonitor())
- SELECT * FROM system.distribution_queue
2021-02-08 22:07:30 +03:00
Maksim Kita
ebf5868652
Merge pull request #20164 from kitaisreal/cache-dictionaries-lru-cache
Added LRUHashMap
2021-02-08 21:00:27 +03:00
Nicolae Vartolomei
c336cac306 Remove dead code 2021-02-08 17:36:58 +00:00
Nicolae Vartolomei
a8f37e7704 Remove dead code 2021-02-08 17:19:35 +00:00
Amos Bird
46f2b4063f
Fix CTE in INSERT-SELECT 2021-02-09 00:25:24 +08:00
Ivan Lezhankin
a287443438 Merge remote-tracking branch 'upstream/master' into dwarf-folly 2021-02-08 18:36:41 +03:00
bharatnc
60c8dfa22c PartLog - populate event_time_microseconds for MergeParts 2021-02-08 07:25:44 -08:00
bharatnc
cb65515dc7 PartLog - fix style checks 2021-02-08 07:25:44 -08:00
bharatnc
46c843b004 PartLog - fix formatting 2021-02-08 07:25:44 -08:00
bharatnc
aa7f5cfe79 PartLog - use ColumnsWithTypeAndName for all columns 2021-02-08 07:25:44 -08:00
bharatnc
19cf5ca6c0 PartLog - try fix event_time_microseconds column 2021-02-08 07:25:44 -08:00
bharatnc
f1d2804bb0 PartLog - populate event_time s & us from same timespec 2021-02-08 07:25:44 -08:00
bharatnc
c98baf3496 PartLog - add field event_time_microseconds column 2021-02-08 07:25:44 -08:00
alesapin
f2feeb9b19 Missing fix 2021-02-08 18:20:12 +03:00
Nikolai Kochetov
4840d663e6
Merge pull request #20035 from ClickHouse/early-stop-for-delayed-ports-processor
Close input ports in DelayedPortsProcessor as soon as all outputs are finished
2021-02-08 18:18:11 +03:00
alesapin
d57613aa18 Fix 0_o build in arcadia 2021-02-08 16:50:03 +03:00
templarzq
7e3186c826
optimize aggfunc column data copy (#19407)
* optimize agg column data copy

* add aggfunc col data copy test

* fix null warning

* fix style

* fix style

* fix style

* fix style

* fix copy same dat to same pos bug

* fix style

* fix style

* Update ColumnAggregateFunction.cpp

fix type check

* control record buf size

* fix performance

* fix performance

* fix destroy data speed

* decrease run time.

* fix warning

* decrease test run time

* Update aggfunc_col_data_copy.xml

* replace unordered_map with HashMap

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix compile err

* fix hash map compile err

* fix compile err

* fix compile err

* fix format

* faster test

Co-authored-by: centos7 <templarzq@localhost.localdomain>
2021-02-08 16:18:48 +03:00
Anton Popov
f1beeb7c25
Merge pull request #20099 from azat/remove-not-existing-setting
Remove never existing insert_in_memory_parts_timeout
2021-02-08 16:09:03 +03:00
alesapin
add89c17f2 Less serde in responses, watches on followers 2021-02-08 16:06:55 +03:00
lehasm
363aefb42e
DOCSUP-3908: mannWitneyUTest, welchTTest and studentTTest documentation (#19784)
* studentTTest function description

* welchttest description, links in studentttest

* mannWhitneyUTest description

* Text changed slightly

* Text changed slightly

* Text changed slightly

* Text changed slightly

* - First header is first level.
- sample_index type set to UInt64.
- Return values renamed.

- mannWhitneyUTest:
  - added continuity_correction parameter
  - optional parameters wrapped in braces [ ]
  - description refactored
  - example SQL placed on single line

* Improved formulations (hopefully)
General data type names used (Integer, Float, Decimal)
Removed names from return values

* Fixes

* Optional parameters stated explicitly

* New line at the end of files

* Russian function description

* Files moved in the right folder

* Translated 'Original article' to russian

* Typos are fixed

* fixed alowed parameter value: "two sided" -> "two-sided"
* duplicate word "require" is removed from exception messages

* mannWhitneyUTest description changed
Added Tuple link in return values
"samples from two populations" added in short descriptions

* Russian translation updated

* fix

Co-authored-by: Alexey Smirnov <alexey-sm@yandex-team.ru>
2021-02-08 15:58:27 +03:00
Nikolai Kochetov
00d5d28ddf Fix build. 2021-02-08 15:52:30 +03:00
Nikolai Kochetov
d7fa440356
Merge branch 'master' into remove-adding-const-column-transform 2021-02-08 15:49:23 +03:00
Alexey Milovidov
dc01464764 Merge branch 'master' into no-excessive-squash-memory 2021-02-08 15:39:22 +03:00
alexey-milovidov
e192676238
Merge pull request #19603 from JackyWoo/add_quota_type
add quota type QUERY_SELECTS and QUERY_INSERTS
2021-02-08 15:31:54 +03:00
tavplubix
060be5b2db
rerun CI checks 2021-02-08 15:04:40 +03:00
tavplubix
b31891ce2b
Merge pull request #20105 from nicelulu/zookeeper_table_in_query
Supports system.zookeeper path IN query.
2021-02-08 15:01:56 +03:00
tavplubix
2daa403201
Update AggregateFunctionGroupArrayMoving.h 2021-02-08 14:59:51 +03:00
Amos Bird
e9001a7dde
Fix ubsan error 2021-02-08 19:41:58 +08:00
Amos Bird
109a392e0c
Fix ubsan 2021-02-08 19:41:16 +08:00
vdimir
776b682f28
Add comment for used_flags in hash join, fix build 2021-02-08 14:38:31 +03:00
Kruglov Pavel
b256bd455c
Merge pull request #19961 from ucasFL/shard-id
add setting insert_shard_id
2021-02-08 14:28:13 +03:00
alesapin
786e687b2f Trying to avoid unlimited wait 2021-02-08 14:01:50 +03:00
Alexander Tokmakov
91d0924665 write dictionaries metadata to zk 2021-02-08 12:46:30 +03:00
Alexander Tokmakov
7ce0ef2561 show clusters for replicated db 2021-02-08 12:14:17 +03:00
Nikolai Kochetov
13b2c2de20 Fixing ya.make 2021-02-08 12:06:14 +03:00
Nikolai Kochetov
bd8f88f464 Fix style 2021-02-08 12:04:19 +03:00
Nikolai Kochetov
77cb68c3e7 Fixing build. 2021-02-08 12:03:04 +03:00
Maksim Kita
7ee1ad6833 Fixed unit tests 2021-02-08 11:44:32 +03:00
alesapin
d5ee7d33e9 Merge branch 'master' into in_memory_raft 2021-02-08 10:30:31 +03:00
hexiaoting
2c278f1e02 Restrict move JOINON to WHERE optimizer only to inner join 2021-02-08 13:44:50 +08:00
Maksim Kita
285d46bc56 Fix gcc build issues 2021-02-07 23:54:14 +03:00
Alexey Milovidov
8118e20eec Fix some tests 2021-02-07 23:40:30 +03:00
Alexey Milovidov
869bca74a7 Fix some tests 2021-02-07 23:37:55 +03:00
feng lv
6a5a539e98 rewrite avg for algebraic optimization 2021-02-07 14:41:41 +00:00
alexey-milovidov
3b43b0a1be
Merge pull request #20131 from azat/DateTime64-fix
DateTime64 fixes
2021-02-07 16:55:28 +03:00
Alexey Milovidov
0145be85df Do not spill warnings suppressions from ANTLR 2021-02-07 16:50:57 +03:00
Maksim Kita
1201c4c55f Fixed build issues 2021-02-07 16:45:29 +03:00
alexey-milovidov
0b043c41b6
Merge pull request #20160 from ClickHouse/cumulative-sum-normalized
Fix UBSan report in arrayCumSum
2021-02-07 14:28:16 +03:00
Amos Bird
ab5c7b75a4
Delay or throw insertion when too many inactive parts 2021-02-07 19:03:55 +08:00
Ivan
4181f8d9b7
Fix segfault using ANTLR parser (#20156)
* Fix build of utils

* Fix visitor
2021-02-07 11:06:39 +03:00
alexey-milovidov
ed5a81ab59
Merge pull request #20078 from abyss7/better-read-buffers-4
LimitReadBuffer: check that position always advances
2021-02-07 07:33:08 +03:00
Amos Bird
1b32292dd0
bitmap function for all native integers 2021-02-07 11:32:54 +08:00
JackyWoo
77c0f0a0e7 add quota type QUERY_SELECTS and QUERY_INSERTS 2021-02-07 10:57:18 +08:00
Alexey Milovidov
38ea4af339 Fix quadratic INSERT 2021-02-07 05:40:06 +03:00
Alexey Milovidov
c75e34c291 Corrections 2021-02-07 05:39:53 +03:00
Alexey Milovidov
905793a7e4 Disable excessive squashing of blocks for StorageMemory #13052 2021-02-07 04:57:17 +03:00
Azat Khuzhin
46ff7d2ab0 Fix DateTime64 overflows 2021-02-07 02:24:31 +03:00
alexey-milovidov
75f3ca8e34
Merge pull request #20150 from ClickHouse/useless-changes
Useless changes
2021-02-07 01:40:12 +03:00
alexey-milovidov
f2ab4f2ce9
Merge pull request #20037 from abyss7/better-read-buffers-2
ReadBuffer: check for unread data on next()
2021-02-07 01:33:06 +03:00
alexey-milovidov
417cfcd698
Update ReadBuffer.h 2021-02-07 01:31:20 +03:00
alexey-milovidov
66b868d865
Merge pull request #20153 from zlobober/customize_prewhere_optimizer
Allow using MergeTreeWhereOptimizer not only with MergeTree-based storages
2021-02-07 01:10:11 +03:00
alexey-milovidov
44b44c1fe7
Update InterpreterSelectQuery.cpp 2021-02-07 01:09:55 +03:00
alexey-milovidov
f5a853381b
Merge pull request #20152 from ucasFL/remove-useless-code
remove some useless code
2021-02-07 00:58:34 +03:00
Maksim Kita
eadd23aa38 Added LRUHashMap 2021-02-07 00:06:27 +03:00
alexey-milovidov
d0a1e69e99
Merge pull request #20094 from ClickHouse/columns-description-fuzzer
Add fuzzer for ColumnsDescription
2021-02-06 23:21:41 +03:00
Alexey Milovidov
1209c02869 Fix overflow in mapPopulateSeries 2021-02-06 23:18:42 +03:00
Alexey Milovidov
d9d49a4d30 Fix UBSan report in arrayCumSum 2021-02-06 22:22:21 +03:00
Alexey Milovidov
65902f4c6e Fix UBSan report in arrayCumSum 2021-02-06 22:21:22 +03:00
Alexey Milovidov
fd899daa00 Fix UBSan report in arrayCumSum 2021-02-06 22:17:19 +03:00
Ivan Lezhankin
8953fe1eb2 Fix seekable buffer 2021-02-06 19:30:46 +03:00
Maxim Akhmedov
0cd3601928 Allow using MergeTreeWhereOptimizer not only with MergeTree-based storages 2021-02-06 18:08:42 +03:00
feng lv
529fb1ea49 remove some useless code 2021-02-06 14:59:48 +00:00
Kruglov Pavel
d94e8624d7
Merge branch 'master' into shard-id 2021-02-06 16:48:17 +03:00
Alexey Milovidov
4092916db6 Useless changes 2021-02-06 14:56:10 +03:00
tavplubix
1c5d6bbe44
Merge pull request #20051 from stigsb/materializemysql-system-tables-fix
Show details of MaterializeMySQL tables in `system.tables`
2021-02-06 14:50:11 +03:00
Alexey Milovidov
26d4d52b9b Merge branch 'master' into columns-description-fuzzer 2021-02-06 13:31:50 +03:00
Azat Khuzhin
c4b5eed4ff Fix DateTime64 initialization (to match DateTime behaviour)
There was no specializations for toDateTime64(<numeric>), and because of
this default decimal conversion was used, however this is not enough for
DateTime/DateTime64 types, since the date may overflow and the proper
check is required (like DateTime has), and this what UBsan found [1]:

    ../src/IO/WriteHelpers.h:812:33: runtime error: index 508 out of bounds for type 'const char [201]' Received signal -3 Received signal Unknown signal (-3)

Backtrace:

    (gdb) bt
    0  LocalDateTime::LocalDateTime (this=0x7fffffff8418, year_=1970, month_=1 '\001', day_=1 '\001', hour_=2 '\002', minute_=0 '\000', second_=254 '\376') at LocalDateTime.h:83
    1  0x00000000138a5edb in DB::writeDateTimeText<(char)45, (char)58, (char)32, (char)46> (datetime64=..., scale=7, buf=..., date_lut=...) at WriteHelpers.h:852
    2  0x0000000019c379b4 in DB::DataTypeDateTime64::serializeText (this=0x7ffff5c4b0d8, column=..., row_num=0, ostr=..., settings=...) at DataTypeDateTime64.cpp:66
    3  0x0000000019d297e4 in DB::IDataType::serializeAsText (this=0x7ffff5c4b0d8, column=..., row_num=0, ostr=..., settings=...) at IDataType.cpp:387

  [1]: https://clickhouse-test-reports.s3.yandex.net/19527/cea8ae162ffbf92e5ed29304ab010704c5d611c8/fuzzer_ubsan/report.html#fail1

Also fix CAST for DateTime64
2021-02-06 13:04:53 +03:00
Azat Khuzhin
0627ba0e36 Fix timezone argument for DateTime64
It should be marked with always const, otherwise it will bail:

    Code: 44, e.displayText() = DB::Exception: Illegal column String of time zone argument of function, must be constant string: While processing toDateTime(-1, 1, 'GMT'), Stack trace (when copying this message, always include the lines below):
2021-02-06 13:04:53 +03:00
Azat Khuzhin
f4c2048bf2 Fix toDateTime64(toDate()/toDateTime()) for DateTime64
Maybe this is even does not worth it, but at least there was code that
assume that this should work - ToDateTime64Transform in
FunctionsConversion.h.
2021-02-06 13:04:53 +03:00
alexey-milovidov
5c281bd2f1
Merge pull request #20133 from ClickHouse/fix_if_tuple
Fix if with tuple then/else arguments
2021-02-06 09:52:54 +03:00
alexey-milovidov
dee8f1fbf2
Merge pull request #20132 from ClickHouse/fix-data-type-parser-exponential
Fix the case when DataType parser may have exponential complexity
2021-02-06 08:42:40 +03:00
Nikolai Kochetov
9d62842a33 Fix tests. 2021-02-05 22:52:06 +03:00
alesapin
011109c82a
Merge pull request #17348 from xjewer/alex/CLICKHOUSE-606_deduplication_UUID
CLICKHOUSE-606: query deduplication based on parts' UUID
2021-02-05 22:47:34 +03:00
alesapin
f81a407cdd Fix if with tuple then/else arguments 2021-02-05 22:39:26 +03:00
Nikolai Kochetov
d563cfb2be Fix tests. 2021-02-05 22:22:11 +03:00
Alexey Milovidov
60f2e89cfb Fix the case when DataType parser may have exponential complexity 2021-02-05 22:21:30 +03:00
Nikolai Kochetov
5aa27a6dd1 Fix tests. 2021-02-05 21:21:48 +03:00
Nikolai Kochetov
a761143286 Fix tests. 2021-02-05 21:19:41 +03:00
Nikolai Kochetov
e49315e058 Fix tests. 2021-02-05 19:52:50 +03:00
Nikolai Kochetov
a7f58da87e Fix tests. 2021-02-05 19:35:21 +03:00
Alexander Kuzmenkov
4bb38f333b some simple cases 2021-02-05 18:34:03 +03:00
Nikolai Kochetov
85c175883e Rename functions. 2021-02-05 18:11:26 +03:00
Nikolai Kochetov
872d2a8ad5 Fix test. 2021-02-05 17:42:41 +03:00
Nikolai Kochetov
31384cd652 Fix test. 2021-02-05 17:37:49 +03:00
Nikolai Kochetov
8c49e84668 Fix test. 2021-02-05 16:42:45 +03:00
Stig Bakken
3fc1641d91 Show details of MaterializeMySQL tables in system.tables 2021-02-05 21:37:29 +08:00
vdimir
01a6e01ad7
Store usage info flags separate from row refs in hash join 2021-02-05 16:20:13 +03:00
Nikolai Kochetov
98cfefdcfb Fix build 2021-02-05 14:49:58 +03:00
Nikolai Kochetov
9869f70a0d Remove AddMissed step and transform. 2021-02-05 14:41:44 +03:00
alesapin
aafadc06df Better types 2021-02-05 13:31:46 +03:00
Ivan Lezhankin
16d399aa35 Another build fix 2021-02-05 13:31:18 +03:00
alesapin
65d7b39cd6
Merge pull request #20073 from ClickHouse/fix-split-filter-remove-column
Fix removing of filter column when split filter actions.
2021-02-05 13:31:02 +03:00
alesapin
449e8e3fd9 More checks for setting 2021-02-05 13:15:02 +03:00
tavplubix
f59dc7f40d
Merge pull request #20066 from havardk/multi-table-update
Fix handling of TABLE_MAP_EVENT from MySQL
2021-02-05 13:11:59 +03:00
alesapin
7cbc135e72 More isolated code 2021-02-05 12:54:34 +03:00
Nikolai Kochetov
a34cd32552 Fix build 2021-02-05 12:25:16 +03:00
Alexander Kuzmenkov
6824f13a35 tmp 2021-02-05 12:13:19 +03:00
Vitaly Baranov
1c51b4a4e4 MongoDB table engine now establishes connection only when it reads data. 2021-02-05 11:47:31 +03:00
vdimir
c6c1541c9f
Remove assert from CollectJoinOnKeysVisitor.cpp 2021-02-05 10:53:26 +03:00
vdimir
1e2c302248
Merge pull request #18377 from Jokser/disk-s3-backup-restore-metadata 2021-02-05 10:44:59 +03:00
alesapin
ab98040003 More logs 2021-02-05 10:15:28 +03:00
zhangxiao871
581495ae23 Supports system.zookeeper path IN query. 2021-02-05 14:45:28 +08:00
alexey-milovidov
34151eea2c
Merge pull request #20067 from ClickHouse/mod-negative-type-promotion
Add type promotion for modulo of division of negative number
2021-02-05 09:31:46 +03:00
hexiaoting
e1359b01a1 Remove unnecessary codes 2021-02-05 11:11:27 +08:00
Russ Frank
2f31eabc13 turn off ubsan for deltasum functions 2021-02-04 21:22:05 -05:00
Ivan
d135a727e2
Merge branch 'master' into better-read-buffers-2 2021-02-05 02:17:05 +03:00
Ivan Lezhankin
d59b45e496 Fix build 2021-02-05 02:14:17 +03:00
Azat Khuzhin
64c0bf9829 TCPHandler: catch exceptions from the WriteBuffer in destructor
For TCPHandler it is safe thing todo.

Otherwise *San will report [1]:

    2021.01.24 15:33:40.103996 [ 270 ] {} <Trace> BaseDaemon: Received signal -1
    2021.01.24 15:33:40.110693 [ 270 ] {} <Fatal> BaseDaemon: (version 21.2.1.5789, build id: FF421B087D1E2EAA19FA17B5AB3AE413832744E0) (from thread 48318) Terminate called for uncaught exception:
    2021.01.24 15:33:40.114845 [ 270 ] {} <Trace> BaseDaemon: Received signal 6
    2021.01.24 15:33:40.138738 [ 218027 ] {} <Fatal> BaseDaemon: ########################################
    2021.01.24 15:33:40.138838 [ 218027 ] {} <Fatal> BaseDaemon: (version 21.2.1.5789, build id: FF421B087D1E2EAA19FA17B5AB3AE413832744E0) (from thread 48318) (no query) Received signal Aborted (6)
    2021.01.24 15:33:40.138912 [ 218027 ] {} <Fatal> BaseDaemon:
    2021.01.24 15:33:40.139277 [ 218027 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f185474118b 0x7f1854720859 0xaddc0cc 0x2af9fab8 0x2af9fa04 0xa91758b 0x1e418bb5 0x20725b4f 0x20725d9e 0x266b47a3 0x269772f5 0x26971847 0x7f18548f6609 0x7f185481d293
    2021.01.24 15:33:40.139637 [ 218027 ] {} <Fatal> BaseDaemon: 3. raise @ 0x4618b in /usr/lib/x86_64-linux-gnu/libc-2.31.so
    2021.01.24 15:33:40.140113 [ 218027 ] {} <Fatal> BaseDaemon: 4. abort @ 0x25859 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
    2021.01.24 15:33:40.144121 [ 218027 ] {} <Fatal> BaseDaemon: 5. ./obj-x86_64-linux-gnu/../base/daemon/BaseDaemon.cpp:0: terminate_handler() @ 0xaddc0cc in /usr/bin/clickhouse
    2021.01.24 15:33:40.151208 [ 218027 ] {} <Fatal> BaseDaemon: 6. ./obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_handlers.cpp:61: std::__terminate(void (*)()) @ 0x2af9fab8 in /usr/bin/clickhouse
    2021.01.24 15:33:40.153085 [ 218027 ] {} <Fatal> BaseDaemon: 7. ./obj-x86_64-linux-gnu/../contrib/libcxxabi/src/cxa_handlers.cpp:0: std::terminate() @ 0x2af9fa04 in /usr/bin/clickhouse
    2021.01.24 15:33:40.155209 [ 218027 ] {} <Fatal> BaseDaemon: 8. ? @ 0xa91758b in /usr/bin/clickhouse
    2021.01.24 15:33:40.156621 [ 218027 ] {} <Fatal> BaseDaemon: 9. ./obj-x86_64-linux-gnu/../src/IO/WriteBufferFromPocoSocket.cpp:0: DB::WriteBufferFromPocoSocket::~WriteBufferFromPocoSocket() @ 0x1e418bb5 in /usr/bin/clickhouse
    2021.01.24 15:33:40.161041 [ 218027 ] {} <Fatal> BaseDaemon: 10. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:2518: DB::TCPHandler::~TCPHandler() @ 0x20725b4f in /usr/bin/clickhouse
    2021.01.24 15:33:40.164557 [ 218027 ] {} <Fatal> BaseDaemon: 11. ./obj-x86_64-linux-gnu/../src/Server/TCPHandler.h:101: DB::TCPHandler::~TCPHandler() @ 0x20725d9e in /usr/bin/clickhouse
    2021.01.24 15:33:40.165921 [ 218027 ] {} <Fatal> BaseDaemon: 12. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/include/Poco/AtomicCounter.h:314: Poco::Net::TCPServerDispatcher::run() @ 0x266b47a3 in /usr/bin/clickhouse
    2021.01.24 15:33:40.167347 [ 218027 ] {} <Fatal> BaseDaemon: 13. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/ThreadPool.cpp:0: Poco::PooledThread::run() @ 0x269772f5 in /usr/bin/clickhouse
    2021.01.24 15:33:40.169401 [ 218027 ] {} <Fatal> BaseDaemon: 14. ./obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread_POSIX.cpp:0: Poco::ThreadImpl::runnableEntry(void*) @ 0x26971847 in /usr/bin/clickhouse
    2021.01.24 15:33:40.169498 [ 218027 ] {} <Fatal> BaseDaemon: 15. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
    2021.01.24 15:33:40.169566 [ 218027 ] {} <Fatal> BaseDaemon: 16. __clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
    2021.01.24 15:33:41.027601 [ 218027 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: 63D7491B39260494BA0D785E1860B427. There is no information about the reference checksum.

  [1]: https://clickhouse-test-reports.s3.yandex.net/19451/1e16bd6f337985a82fbdf4eded695dc6e663af58/stress_test_(address).html#fail1

v2: Fix catching errors in WriteBufferFromPocoSocket destructor
2021-02-05 01:32:36 +03:00
Azat Khuzhin
98e3a99a88 Do not catch exceptions during final flush in writers destructors
Since this hides real problems, since destructor does final flush and if
it fails, then data will be lost.

One of such examples if MEMORY_LIMIT_EXCEEDED exception, so lock
exceptions from destructors, by using
MemoryTracker::LockExceptionInThread to block these exception, and allow
others (so std::terminate will be called, since this is c++11 with
noexcept for destructors by default).

Here is an example, that leads to empty block in the distributed batch:

    2021.01.21 12:43:18.619739 [ 46468 ] {7bd60d75-ebcb-45d2-874d-260df9a4ddac} <Error> virtual DB::CompressedWriteBuffer::~CompressedWriteBuffer(): Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 332.07 GiB (attempt to allocate chunk of 4355342 bytes), maximum: 256.00 GiB, Stack trace (when copying this message, always include the lines below):

    0. DB::Exception::Exception<>() @ 0x86f7b88 in /usr/bin/clickhouse
    ...
    4. void DB::PODArrayBase<>::resize<>(unsigned long) @ 0xe9e878d in /usr/bin/clickhouse
    5. DB::CompressedWriteBuffer::nextImpl() @ 0xe9f0296 in /usr/bin/clickhouse
    6. DB::CompressedWriteBuffer::~CompressedWriteBuffer() @ 0xe9f0415 in /usr/bin/clickhouse
    7. DB::DistributedBlockOutputStream::writeToShard() @ 0xf6bed4a in /usr/bin/clickhouse
2021-02-05 01:31:45 +03:00
Azat Khuzhin
4beb5c1b8a TCPHandler: Move constructor into the module and add missing headers 2021-02-05 01:31:42 +03:00
Azat Khuzhin
a46d65f99d Fix typo in comment for memoryTrackerCanThrow() 2021-02-05 01:29:46 +03:00
Azat Khuzhin
48b415d3e4 Remove never existing insert_in_memory_parts_timeout
Fixes: a43cb93be5 ("remove questionable functionality")
Cc: @CurtizJ
2021-02-05 01:26:40 +03:00
Ivan
0db2aa3c2e
Check that position doesn't go beyond end (#20039) 2021-02-05 01:21:24 +03:00
Nikolai Kochetov
d9aa1096cf Build actions dag to evaluate missing defaults. 2021-02-04 23:36:50 +03:00
vdimir
91ea99129e
Merge pull request #19999 from kreuzerkrieg/change_the_idisk_interface
return `DiskType` instead of `String` in IDisk::getType()
2021-02-04 22:46:54 +03:00
Alexander Tokmakov
18f6b5bbad add timeouts 2021-02-04 22:41:44 +03:00
Alexey Milovidov
d2c1a97d86 Minor modification 2021-02-04 22:41:17 +03:00
alesapin
c5312bf362 Trying to disable suspicious parameter 2021-02-04 22:29:46 +03:00
Russ Frank
bcf5a70e4f check arg type 2021-02-04 14:28:45 -05:00
Ivan Lezhankin
84b88c6802 CC 2021-02-04 22:06:43 +03:00
Alexey Milovidov
19c38c61e6 Add fuzzer for ColumnsDescription 2021-02-04 22:03:56 +03:00
Ivan Lezhankin
2b9909d396 Merge remote-tracking branch 'upstream/master' into better-read-buffers-2 2021-02-04 21:51:23 +03:00
Ivan Lezhankin
bcbe6f209c Merge branch 'better-read-buffers-1' into better-read-buffers-2 2021-02-04 21:50:31 +03:00
Ivan Lezhankin
610d7b755b Don't forget to update position of inner buffer 2021-02-04 21:50:15 +03:00
Alexander Kuzmenkov
26020daca5 Merge remote-tracking branch 'origin/master' into HEAD 2021-02-04 20:58:25 +03:00
Alexander Kuzmenkov
3796a183ba Merge remote-tracking branch 'origin/master' into HEAD 2021-02-04 20:54:36 +03:00
Russ Frank
2bfeef23cf correct merge logic 2021-02-04 11:55:19 -05:00
Alexey Milovidov
85b5805c3c Fix tests 2021-02-04 19:36:31 +03:00