Commit Graph

2205 Commits

Author SHA1 Message Date
vdimir
19fb88c2c1
Simple fix logical error in evaluate constant expression 2023-03-20 15:10:50 +00:00
vdimir
4930683aa8
Revert "Fix logical error in evaluate constant expression"
This reverts commit 2958c5f0f1.
2023-03-17 17:01:40 +00:00
vdimir
2958c5f0f1
Fix logical error in evaluate constant expression 2023-03-17 15:08:16 +00:00
Alexey Milovidov
4cfc040829 Fix parameterized queries 2023-03-11 20:16:06 +01:00
Alexander Tokmakov
38f9f08e1a
Merge pull request #47268 from myrrc/improvement/more-to-base-3
use std::lerp, constexpr hex.h
2023-03-08 19:07:34 +03:00
Alexey Milovidov
e2aff59a2d
Merge pull request #47106 from kssenii/allow-nested-disks-in-custom-disks
Allow nested custom disks
2023-03-08 03:00:55 +03:00
Mike Kot
9920a52c51 use std::lerp, constexpr hex.h 2023-03-07 22:50:17 +00:00
kssenii
10610cbdf4 Fix test 2023-03-02 14:46:20 +01:00
kssenii
13d50509c0 Fix style check 2023-03-01 20:16:15 +01:00
kssenii
f3e3b916c9 Allow nested custom disks 2023-03-01 19:55:59 +01:00
Maksim Kita
d39be3ac9c Fixed tests 2023-03-01 18:05:07 +01:00
Nikolay Degterinsky
10c04d5a38
Fix clone() for ASTColumnMatchers 2023-02-27 12:26:36 +01:00
Robert Schulze
c668ddd506
Make ASTSelectQuery::formatImpl() more robust
Fixes #45204

The problem is that ASTSelectQuery::group_by_with_grouping_sets == true
implies ASTSelectQuery::groupBy() but sometimes this wasn't the case. I
added a sanity check a few months ago but had no idea how the AST became
corrupt.

All crashes/exceptions were during AST fuzzing. Looking at
Client/QueryFuzzer.cpp, there is a very small chance to run into the
issue. In detail:

1. In QueryFuzzer::fuzz(), we find that the AST is a ASTSelectQuery and
   groupBy() returns true.

2. With small probability, we do
     select->group_by_with_grouping_sets = !select->group_by_with_grouping_sets;
   where the (default false) group_by_with_grouping_sets flips true.

3. With small probability, we change the expression type in the
   following WHERE or PREWHERE if-branches.

This situation is illegal. One possibility is changing the fuzzing code
to not generate it. The fuzzing code is however generic, and doesn't
really care about such details. Therefore, instead add an (theoretically
unnecessary) extra check to ASTSelectQuery::formatImpl() for robustness.
2023-02-25 22:28:00 +00:00
Alexander Tokmakov
f76c42348b
Merge pull request #46402 from lzydmxy/apply_move_partition_to_all_replicas
Apply `ALTER TABLE ON CLUSTER MOVE PARTITION TO DISK|VOLUME` to all replicas.
2023-02-23 19:42:54 +03:00
Alexey Milovidov
7d837eea86
Update FieldFromAST.cpp 2023-02-23 08:15:14 +03:00
kssenii
c4761d6cc6 Fix checks 2023-02-22 14:27:43 +01:00
kssenii
1f0ab8d427 Hide disk setting arguemtns 2023-02-21 19:24:01 +01:00
Alexey Milovidov
5ef159fa10
Merge pull request #46565 from ClickHouse/remove-pvs-studio
Remove PVS-Studio
2023-02-20 17:10:53 +03:00
Nikolay Degterinsky
f9dac6d4cf
Fix ASTAsterisk::clone() 2023-02-20 00:26:14 +01:00
Alexey Milovidov
d8cda3dbb8 Remove PVS-Studio 2023-02-19 23:30:05 +01:00
Nikolay Degterinsky
5104b2e8bf
Merge branch 'master' into parameters-rename-query 2023-02-17 17:30:37 +01:00
Nikolay Degterinsky
3b19823960
Merge branch 'master' into replace-transformer-fix-parameters 2023-02-17 02:02:54 +01:00
Alexander Tokmakov
00f9a94ddb
Merge branch 'master' into apply_move_partition_to_all_replicas 2023-02-16 20:22:35 +03:00
youennL-cs
6526c2a8ab
[RFC] Replacing merge tree new engine (#41005)
* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add keyword 'CLEANUP' when OPTIMIZE

* Cleanup uniquely when it's a replacingMergeTree

* Propagate CLEANUP information and change from 'with_cleanup' to 'cleanup'

* Cleanup data flagged as 'is_deleted'

* Fix merge when optimize and add a test

* Fix OPTIMIZE and INSERT + add tests

* New fix for cleanup at the merge

* Cleanup debug logs

* Add the SETTINGS option 'clean_deleted_rows' that can be 'never' or 'always'

* Fix regression bug; Now REplicatedMergeTree can be called as before without 'is_deleted'

* Add Replicated tests

* Disable tag 'long' for our test and cleanup some white spaces

* Update tests

* Fix tests and remove additional useless whitespace

* Fix replica test

* Style clean && add condition check for is_deleted values

* clean_deleted_rows settings is nom an enum

* Add valid default value to the clean_deleted_rows settings

* Update cleanup checkers to use the enum and fix typos in the test

* Fix submodule contrib/AMQP-CPP pointer

* Add missing messages in test reference and remove a print with non derterministic order

* fix replica test reference

* Fix edge case

* Fix a typo for the spell checker

* Fix reference

* Fix a condition to raise an error if is_deleted differ from 0/1 and cleanup

* Change tests file name and update number

* This should fix the ReplacingMergeTree parameter set

* Fix replicated parameters

* Disable allow_deprecated_syntax_for_merge_tree for our new column

* Fix a test

* Remove non deterministic order print in the test

* Test on replicas

* Remove a condition, when checking optional parameters, that should not be sueful since we disabled the deprected_syntaxe

* Revert "Remove a condition, when checking optional parameters, that should not be useful since we disabled the deprected_syntaxe"

This reverts commit b65d64c05e.

* Fix replica management and limit the number of argument to two maximum, due to the possiblity of deprecated table create/attach failing otherwise

* Test a fix for replicated log information error

* Try to add sync to have consistent results

* Change path of replicas that should cause one issue and add few prints in case it's not that

* Get cleanup info on replicas only if information found

* Fix style issues

* Try to avoid replication error 'cannot select parts...' and and replica read/write field order

* Cleanup according to PR reviews
 and add tests on error raised.

* Update src/Storages/MergeTree/registerStorageMergeTree.cpp

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>

* Select ... FINAL don't show rows with is_deleted = true

* Update and fix SELECT ... FINAL merge parameter

* Remove is_deleted rows only on the version inserted when merge

* Fix (master) updates issues

* Revert changes that should not be commited

* Add changes according to review

* Revert changes that should not be commited - part 2

---------

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 16:03:16 +03:00
Nikolay Degterinsky
d9ffbeb4a2 Small improvements 2023-02-16 10:51:13 +00:00
Nikolay Degterinsky
24bbf885db
Merge branch 'master' into parameters-rename-query 2023-02-15 10:53:44 +01:00
Nikolay Degterinsky
eb3a7f55b9 Fix parameterized queries with REPLACE transformer 2023-02-14 22:02:54 +00:00
Nikolay Degterinsky
b9d3160107 Add parameterized RENAME queries 2023-02-14 13:01:06 +00:00
lzydmxy
bbf94a2664 Apply ALTER TABLE table_name ON CLUSTER cluster MOVE PARTITION|PART partition_expr TO DISK|VOLUME 'disk_name' to all replicas.
Because `ALTER TABLE t MOVE` is not replicated.
2023-02-14 17:29:44 +08:00
Alexander Tokmakov
304b9f1a93 remove trash from MOVE PARTITION command 2023-02-13 16:10:16 +01:00
Alexey Milovidov
c6dc39f9e2
Merge pull request #46232 from aiven-sal/aiven-sal/format
ASTFunction: never rewrite tuple function as literal when formatting
2023-02-11 05:56:08 +03:00
Han Fei
2190a2a6c4
Merge pull request #46043 from ucasfl/view-syntax
Forbid wrong create view syntax
2023-02-10 21:54:57 +01:00
flynn
45ee7c7081 fix 2023-02-10 13:56:47 +00:00
Salvatore Mesoraca
8f65dc4ff7
ASTFunction: avoid rewriting tuple function as literal when not safe
It is not always safe to implicitly rewrite a `tuple` function
call to a literal. Even when the tuple has more then one element
e.g.
`SELECT (tuple(1, 2, 3) AS x).1` is not equivalent to
`SELECT ((1, 2, 3) AS x).1`, the latter is interpreted as
`SELECT tuple((1, 2, 3) AS x).1`.
2023-02-10 14:01:25 +01:00
Vitaly Baranov
39bacfb9dc
Merge branch 'master' into allow-single-disk-instead-of-storage-policy 2023-02-09 13:16:55 +01:00
kssenii
6cea67d58b Cleanup 2023-02-06 18:11:33 +01:00
kssenii
cce23cee51 Fix build 2023-02-04 13:49:32 +01:00
flynn
519bb173e8 Forbid wrong create view syntax 2023-02-04 12:47:17 +00:00
Alexey Milovidov
22bd0b6f69
Merge pull request #38983 from CurtizJ/randomize-mt-settings
Allow to randomize merge tree settings in tests
2023-02-04 02:59:52 +01:00
kssenii
536c02ca8a Adding custom field continued 2023-02-03 21:05:18 +01:00
kssenii
5f124263a6 Revert changes with complex SettingsChanges 2023-02-03 21:04:45 +01:00
Antonio Andelic
d5117f2aa6
Define S3 client with bucket and endpoint resolution (#45783)
* Update aws

* Define S3 client with bucket and endpoint resolution

* Add defines for ErrorCodes

* Use S3Client everywhere

* Remove unused errorcode

* Add DROP S3 CLIENT CACHE query

* Add a comment

* Fix style

* Update aws

* Update reference files

* Add missing include

* Fix unit test

* Remove unneeded declarations

* Correctly use RetryStrategy

* Rename S3Client to Client

* Fix retry count

* fix clang-tidy warnings
2023-02-03 14:30:52 +01:00
Alexey Milovidov
108d1c3442
Merge pull request #45872 from ClickHouse/fix-trash-query-kind
Remove trash, add a feature and fix a bug
2023-02-03 09:58:43 +03:00
kssenii
a391de18a1 Merge remote-tracking branch 'upstream/master' into allow-single-disk-instead-of-storage-policy 2023-02-02 20:49:41 +01:00
Vitaly Baranov
b8078acce2
Merge pull request #45774 from vitlibar/wiping-sensitive-info-in-named-collection-overrides
Mask sensitive info in named collection's overrides
2023-02-02 10:06:59 +01:00
Alexey Milovidov
62bfdb349a Merge branch 'master' into fix-trash-query-kind 2023-02-02 04:26:49 +01:00
Alexey Milovidov
099532ecc5
Merge pull request #45867 from Algunenano/improve_obfuscator
Improve how the obfuscator deals with queries
2023-02-02 04:23:06 +03:00
Alexey Milovidov
8e684170fe Fix even more trash 2023-02-02 02:11:16 +01:00
Nikolay Degterinsky
542f54cf2d
Merge pull request #45829 from Algunenano/fix_qualified_asterisk_children
Fix ASTQualifiedAsterisk cloning
2023-02-01 19:20:47 +01:00
Robert Schulze
b512316586
Merge pull request #45682 from ClickHouse/rename-qrc-to-qc
Rename "Query Result Cache" to "Query Cache"
2023-02-01 11:23:29 +01:00