From 745696b8884d3386164cf311c7cfd36130afc1d8 Mon Sep 17 00:00:00 2001 From: zhang2014 Date: Mon, 17 Sep 2018 23:30:15 +0800 Subject: [PATCH 1/2] ISSUES-3149 fix incorrectly masks rows in views --- dbms/src/Storages/StorageView.cpp | 2 +- .../queries/0_stateless/00597_push_down_predicate.reference | 1 + dbms/tests/queries/0_stateless/00597_push_down_predicate.sql | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageView.cpp b/dbms/src/Storages/StorageView.cpp index ea1e9828ec9..bb31bd81e53 100644 --- a/dbms/src/Storages/StorageView.cpp +++ b/dbms/src/Storages/StorageView.cpp @@ -47,7 +47,7 @@ BlockInputStreams StorageView::read( { BlockInputStreams res; - ASTPtr & current_inner_query = inner_query; + ASTPtr current_inner_query = inner_query; if (context.getSettings().enable_optimize_predicate_expression) { diff --git a/dbms/tests/queries/0_stateless/00597_push_down_predicate.reference b/dbms/tests/queries/0_stateless/00597_push_down_predicate.reference index aa266c87fcd..22142c4748f 100644 --- a/dbms/tests/queries/0_stateless/00597_push_down_predicate.reference +++ b/dbms/tests/queries/0_stateless/00597_push_down_predicate.reference @@ -25,6 +25,7 @@ 2000-01-01 1 test string 1 1 1 2000-01-01 2000-01-01 1 test string 1 1 2000-01-01 1 test string 1 1 +2000-01-01 2 test string 2 2 1 1 -------Push to having expression, need check.------- diff --git a/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql b/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql index 532b5b9cc72..ede8b008867 100644 --- a/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql +++ b/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql @@ -57,6 +57,7 @@ SELECT * FROM (SELECT 1 AS id, toDate('2000-01-01') AS date FROM system.numbers -- Optimize predicate expression with view SELECT * FROM test.test_view WHERE id = 1; +SELECT * FROM test.test_view WHERE id = 2; SELECT id FROM test.test_view WHERE id = 1; SELECT s.id FROM test.test_view AS s WHERE id = 1; From 48d5d03d27592a52a886f99bd3dd5f2e71408f89 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Mon, 17 Sep 2018 20:56:24 +0300 Subject: [PATCH 2/2] add notice that dots in cluster names are forbidden [#CLICKHOUSE-3983] --- docs/en/operations/table_engines/distributed.md | 2 ++ docs/ru/operations/table_engines/distributed.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/en/operations/table_engines/distributed.md b/docs/en/operations/table_engines/distributed.md index fac2320af64..5ba4984d3f8 100644 --- a/docs/en/operations/table_engines/distributed.md +++ b/docs/en/operations/table_engines/distributed.md @@ -58,6 +58,8 @@ Here a cluster is defined with the name 'logs' that consists of two shards, each Shards refer to the servers that contain different parts of the data (in order to read all the data, you must access all the shards). Replicas are duplicating servers (in order to read all the data, you can access the data on any one of the replicas). +Cluster names must not contain dots. + The parameters `host`, `port`, and optionally `user` and `password` are specified for each server: : - `host` – The address of the remote server. You can use either the domain or the IPv4 or IPv6 address. If you specify the domain, the server makes a DNS request when it starts, and the result is stored as long as the server is running. If the DNS request fails, the server doesn't start. If you change the DNS record, restart the server. diff --git a/docs/ru/operations/table_engines/distributed.md b/docs/ru/operations/table_engines/distributed.md index 11d16606478..c922890670f 100644 --- a/docs/ru/operations/table_engines/distributed.md +++ b/docs/ru/operations/table_engines/distributed.md @@ -58,6 +58,8 @@ logs - имя кластера в конфигурационном файле с Шардами называются серверы, содержащие разные части данных (чтобы прочитать все данные, нужно идти на все шарды). Репликами называются дублирующие серверы (чтобы прочитать данные, можно идти за данными на любую из реплик). +Имя кластера не должно содержать точки. + В качестве параметров для каждого сервера указываются `host`, `port` и, не обязательно, `user`, `password`: : - `host` - адрес удалённого сервера. Может быть указан домен, или IPv4 или IPv6 адрес. В случае указания домена, при старте сервера делается DNS запрос, и результат запоминается на всё время работы сервера. Если DNS запрос неуспешен, то сервер не запускается. Если вы изменяете DNS-запись, перезапустите сервер.