Commit Graph

48 Commits

Author SHA1 Message Date
kssenii
6fbd49f554 Merge master 2022-06-23 21:40:01 +02:00
kssenii
fe0ab845f5 Update tests 2022-06-23 21:00:44 +02:00
kssenii
d4758c7ce9 Update tests 2022-06-23 15:57:12 +02:00
Vitaly Baranov
2c8788266c Fix tests. 2022-06-20 03:44:49 +02:00
Vadim Volodin
637d293fbd Add SYSTEM UNFREEZE query 2022-06-08 15:21:14 +03:00
Alexander Tokmakov
e8f33fb0d9 fix flaky tests 2022-05-26 14:17:05 +02:00
Vitaly Baranov
f34a5cdee2
Merge branch 'master' into ON_CLUSTER-grant 2022-05-17 13:21:20 +02:00
Azat Khuzhin
01e1c5345a Add separate CLUSTER grant
In case you have different roles for the same user on multiple clusters,
ON CLUSTER query can help to overcome some limitations.

Consider the following example:
- cluster_with_data, dev_user (readonly=2)
- stage_cluster, dev_user (readonly=0)

So when you will execute the following query from stage_cluster, it will
be successfully executed, since ON CLUSTER queries has different system
profile:

    DROP DATABASE default ON CLUSTER cluster_with_data

This is not 100% safe, but at least something.

Note, that right now only ON CLUSTER query it self is supported, but
separate clusters are not (i.e. GRANT CLUSTER some_cluster_name TO
default), since right now grants sticked to database+.

v2: on_cluster_queries_require_cluster_grant
v3: fix test and process flags as bit mask
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 13:57:45 +03:00
Mikhail Artemenko
cf48390cb9
Merge branch 'master' into MeiliSearch 2022-05-02 00:28:42 +03:00
Nikita Mikhaylov
93a65463d0
Added SYSTEM SYNC DATABASE query (#35944) 2022-05-01 15:40:18 +02:00
Mikhail Artemenko
2fd86cc564
Merge branch 'master' into MeiliSearch 2022-04-13 12:05:46 +03:00
Mikhail Artemenko
4ed6ec6780 change fast_test references 2022-04-13 10:35:37 +03:00
Alexander Tokmakov
6591d1ceb7 Merge branch 'master' into mvcc_prototype 2022-04-01 15:38:46 +02:00
taiyang-li
6fcdb9dd78 fix fasttest 2022-03-21 14:28:48 +08:00
Alexander Tokmakov
645629a01b fix tests 2022-03-11 13:06:44 +01:00
Vitaly Baranov
e148b43a29 Privileges CREATE/ALTER/DROP ROW POLICY now can be granted on a table or on database.* as well as globally *.* 2022-02-11 12:35:52 +07:00
Maksim Kita
f7b70877c8 Fixed tests 2022-02-10 10:27:11 +00:00
mergify[bot]
61ac72ca32
Merge branch 'master' into addressToLineWithInlines 2022-01-27 12:02:56 +00:00
Vitaly Baranov
cc38fe3fb6 Fix checking access for the SYSTEM command. 2022-01-25 18:54:59 +07:00
cmsxbc
58dd1a2d5c
add function addressToLineWithInlines 2022-01-25 19:13:47 +08:00
Alexey Milovidov
a3bbdffe3d Update test 2021-12-30 23:39:43 +03:00
Vasily Nemkov
3b762f10a0 Fixed test 2021-09-23 10:31:59 +03:00
alesapin
a249dcc5f5
Merge pull request #28301 from kssenii/materialized-postgresql
MaterializedPostgreSQL: allow dynamically adding/deleting tables, altering settings
2021-09-20 14:16:29 +03:00
Maksim Kita
784a4a33e0 Fixed tests 2021-09-17 18:43:00 +03:00
kssenii
d0113743c9 Merge branch 'master' of github.com:ClickHouse/ClickHouse into materialized-postgresql 2021-09-05 01:07:31 +03:00
Vladimir Chebotarev
22f6ea526e Fix test. 2021-08-30 11:49:26 +03:00
kssenii
378e1f74aa Fix tests 2021-08-28 19:51:04 +03:00
Realist007
31e26862b5
Merge branch 'master' into feature/create-simple-lambda-function 2021-07-21 10:33:53 +03:00
ANDREI STAROVEROV
c03a75a289 Fix tests 2021-07-21 01:02:18 +03:00
kssenii
ff56f1787c Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into g-arslan-add-sqlite-support 2021-07-07 15:19:12 +00:00
Aleksei Semiglazov
9a5365fc41
CLICKHOUSE-784: reset merge tree setting
Add an ability to reset custom setting to default and remove it from table's metadata.
This will allow to rollback the change without knowing the system/config's default.

Signed-off-by: Aleksei Semiglazov <asemiglazov@cloudflare.com>
2021-07-01 20:09:54 +01:00
Mike Kot
4c391f8e99
SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652)
* initial commit: add setting and stub

* typo

* added test stub

* fix

* wip merging new integration test and code proto

* adding steps interpreters

* adding firstly proposed solution (moving parts etc)

* added checking zookeeper path existence

* fixing the include

* fixing and sorting includes

* fixing outdated struct

* fix the name

* added ast ptr as level of indirection

* fix ref

* updating the changes

* working on test stub

* fix iterator -> reference

* revert rocksdb submodule update

* fixed show privileges test

* updated the test stub

* replaced rand() with thread_local_rng(), updated the tests

updated the test

fixed test config path

test fix

removed error messages

fixed the test

updated the test

fixed string literal

fixed literal

typo: =

* fixed the empty replica error message

* updated the test and the code with logs

* updated the possible test cases, updated

* added the code/test milestone comments

* updated the test (added more testcases)

* replaced native assert with CH one

* individual replicas recursive delete fix

* updated the AS db.name AST

* two small logging fixes

* manually generated AST fixes

* Updated the test, added the possible algo change

* Some thoughts about optimizing the solution:

ALTER MOVE PARTITION .. TO TABLE -> move to detached/ + ALTER ... ATTACH

* fix

* Removed the replica sync in test as it's invalid

* Some test tweaks

* tmp

* Rewrote the algo by using the executeQuery instead of

hand-crafting the ASTPtr.

Two questions still active.

* tr: logging active parts

* Extracted the parts moving algo into a separate helper function

* Fixed the test data and the queries slightly

* Replaced query to system.parts to direct invocation,

started building the test that breaks on various parts.

* Added the case for tables when at least one replica is alive

* Updated the test to test replicas restoration by detaching/attaching

* Altered the test to check restoration without replica restart

* Added the tables swap in the start if the server failed last time

* Hotfix when only /replicas/replica... path was deleted

* Restore ZK paths while creating a replicated MergeTree table

* Updated the docs, fixed the algo for individual replicas restoration case

* Initial parts table storage fix, tests sync fix

* Reverted individual replica restoration to general algo

* Slightly optimised getDataParts

* Trying another solution with parts detaching

* Rewrote algo without any steps, added ON CLUSTER support

* Attaching parts from other replica on restoration

* Getting part checksums from ZK

* Removed ON CLUSTER, finished working solution

* Multiple small changes after review

* Fixing parallel test

* Supporting rewritten form on cluster

* Test fix

* Moar logging

* Using source replica as checksum provider

* improve test, remove some code from parser

* Trying solution with move to detached + forget

* Moving all parts (not only Committed) to detached

* Edited docs for RESTORE REPLICA

* Re-merging

* minor fixes

Co-authored-by: Alexander Tokmakov <avtokmakov@yandex-team.ru>
2021-06-20 11:24:43 +03:00
Nicolae Vartolomei
af311c8642 Add acl for move partition between shards
We can not easily verify permissions on destination shard

and instead we require a custom grant that can be given to

superadmins.
2021-06-05 10:41:30 +01:00
Arslan G
fbc5734302 Clean up code and fix tests 2021-05-28 20:00:26 +03:00
Amos Bird
264cff6415
Projections
TODO (suggested by Nikolai)

1. Build query plan fro current query (inside storage::read) up to WithMergableState
2. Check, that plan is simple enough: Aggregating - Expression - Filter - ReadFromStorage (or simplier)
3. Check, that filter is the same as filter in projection, and also expression calculates the same aggregation keys as in projection
4. Return WithMergableState if projection applies

3 will be easier to do with ActionsDAG, cause it sees all functions, and dependencies are direct (but it is possible with ExpressionActions also)

Also need to figure out how prewhere works for projections, and
row_filter_policies.

wip
2021-05-11 18:12:23 +08:00
Pavel Kovalenko
37c637cc34 Minor fixes. 2021-04-21 13:34:07 +03:00
Maksim Kita
aa42150ebd Added integration test 2021-04-18 13:38:36 +03:00
songenjie
f731739fab fix suggests 2021-04-14 10:05:41 +08:00
songenjie
fbd26789af [test] show privileges 2021-04-13 14:08:26 +08:00
Alexey Milovidov
7cc6eeff0d Update test 2021-03-28 05:55:41 +03:00
Pavel Kovalenko
0062e459a3 Fixed tests 2021-02-24 19:56:07 +03:00
kssenii
c5cf556aaf Fix fast test 2020-12-28 13:56:46 +00:00
Amos Bird
7e1d71305a
fix test 2020-12-01 10:15:38 +08:00
Amos Bird
078b14610d
ALTER MODIFY SAMPLE BY 2020-08-27 22:31:30 +08:00
alesapin
11f88340a5 Merge branch 'mongo' of https://github.com/ageraab/ClickHouse into storage_mongodb 2020-06-26 16:03:06 +03:00
amudong
7723dc4935 add drop relica database and the whole replica
fix removeReplicaByZKPath

fix bug: add zkpath empty judge

fix: rewrite code

delete useless code.

fix:ast fromat

fix bug

add test_drop_replica

add drop_replica doc

add drop databse checkAccess

refactor dropReplica

update tests

add static method StorageReplicatedMergeTree::dropReplicaByZkPath

update doc and delete useless code

fix conflict

fix doc

fix doc

fix StorageReplicatedMergeTree::dropReplica

fix bug

delete useless code
2020-06-23 12:12:30 +08:00
bobrovskij artemij
8d69223aaf show_privileges test fix, one more build fix 2020-05-27 01:20:25 +03:00
Vitaly Baranov
b1f362b2dc Add system table for access types. 2020-05-14 14:12:20 +03:00