Commit Graph

250 Commits

Author SHA1 Message Date
Vitaly Baranov
46ab2f76cd
Merge pull request #14919 from vitlibar/add-login-function-to-access-storage
Add login() function to IAccessStorage
2020-09-20 16:58:22 +03:00
Vitaly Baranov
02acedd6a3 Use initial_address for quota calculation when the interserver-secret mode enabled. 2020-09-19 01:04:25 +03:00
Alexander Kuzmenkov
fd33fa7f39 fixup 2020-09-17 17:55:41 +03:00
Alexander Kuzmenkov
fb64cf210a straighten the protocol version 2020-09-17 17:37:29 +03:00
Vitaly Baranov
3356d75b23
Merge pull request #13156 from azat/cluster-secure
Secure inter-cluster query execution (with initial_user as current query user) [v3]
2020-09-17 17:11:00 +03:00
Alexander Kuzmenkov
a374541214 straighten the protocol version 2020-09-17 15:15:05 +03:00
Alexander Kuzmenkov
7b8ad02a12 cleanup 2020-09-17 15:14:49 +03:00
Alexander Kuzmenkov
6217dd77b5 Merge remote-tracking branch 'origin/master' into tmp 2020-09-17 12:35:10 +03:00
Artem Zuikov
51ba12c2c3
Try speedup build (#14809) 2020-09-15 12:55:57 +03:00
Azat Khuzhin
785d1b2a75 OpenSSLHelpers cleanup
Add few more specializations for encodeSHA256():
- std::string encodeSHA256(const std::string_view &);
- std::string encodeSHA256(const void *, size_t);
- void encodeSHA256(const void *, size_t, unsigned char *);
2020-09-15 01:36:28 +03:00
Azat Khuzhin
0159c74f21 Secure inter-cluster query execution (with initial_user as current query user) [v3]
Add inter-server cluster secret, it is used for Distributed queries
inside cluster, you can configure in the configuration file:

  <remote_servers>
      <logs>
          <shard>
              <secret>foobar</secret> <!-- empty -- works as before -->
              ...
          </shard>
      </logs>
  </remote_servers>

And this will allow clickhouse to make sure that the query was not
faked, and was issued from the node that knows the secret. And since
trust appeared it can use initial_user for query execution, this will
apply correct *_for_user (since with inter-server secret enabled, the
query will be executed from the same user on the shards as on initator,
unlike "default" user w/o it).

v2: Change user to the initial_user for Distributed queries if secret match
v3: Add Protocol::Cluster package
v4: Drop Protocol::Cluster and use plain Protocol::Hello + user marker
v5: Do not use user from Hello for cluster-secure (superfluous)
2020-09-15 01:36:28 +03:00
Azat Khuzhin
ec9d7745f3 Break the query loop on UNEXPECTED_PACKET_FROM_CLIENT 2020-09-15 01:36:28 +03:00
Azat Khuzhin
d53bbd3394 Not only send the exception to the client but also log it
Otherwise there will be only tricky "Unknown packet" exception after
exception during handling INSERT queries.
2020-09-15 01:36:28 +03:00
Alexander Kuzmenkov
c62bf555d2 Merge origin/master into tmp (using imerge) 2020-09-08 16:26:38 +03:00
Alexander Kuzmenkov
d0a9926e7d fixes and some docs 2020-09-08 16:19:27 +03:00
Alexey Milovidov
e3924b8057 Fix "Arcadia" 2020-09-08 01:14:13 +03:00
BohuTANG
c094ff7eca ISSUES-9336 support MySQL handler 'set @@xx' settting 2020-09-04 12:51:15 +08:00
alesapin
10c7a6c45e
Add ability to specify Default codec for columns (#14049)
* Add ability to specify DefaultCompression codec which correspond to settings specified in config.xml

* Fix style

* Rename DefaultCompression to simple Default

* Fix compression codec

* Better codec description representation

* Less strange code and one method

* Fix delta
2020-08-28 20:40:45 +03:00
Alexander Kuzmenkov
4612794678 opentelemetry context propagation 2020-08-28 04:21:08 +03:00
Amos Bird
05a5a13e08
specific ReplicatedMergeTree settings 2020-08-27 22:37:41 +08:00
alexey-milovidov
75a3bbf5b2
Merge pull request #13722 from javisantana/fix/replicas_status_verbose
return 200 when replicas status is ok and verbose = 1
2020-08-26 00:35:47 +03:00
Javi Santana
ce64a73342 fixed tests and style 2020-08-17 09:46:38 +02:00
Javi Santana
c6780148ec return 200 when replicas status is ok and verbose = 1 2020-08-14 14:29:16 +02:00
zhang2014
96bd3ac34b ISSUES-4006 split mysql protocol 2020-08-13 20:41:36 +08:00
zhang2014
34f4c8972e ISSUES-4006 split replication packets 2020-08-13 20:07:02 +08:00
zhang2014
c76d7e3121 ISSUES-4006 split generic packets 2020-08-13 18:17:13 +08:00
zhang2014
c0d42b764e ISSUES-4006 split protocol text packet 2020-08-13 17:20:45 +08:00
zhang2014
4fcc178deb ISSUES-4006 split mysql protocol 2020-08-13 16:17:33 +08:00
zhang2014
688836cdc4 ISSUES-4006 split msql protocol & fix build 2020-08-13 14:30:29 +08:00
tavplubix
4aff48dc3f
Merge pull request #10851 from zhang2014/feature/materialize_mysql_database
ISSUES-4006 support MaterializeMySQL database engine
2020-08-12 15:59:28 +03:00
Alexey Milovidov
edd89a8610 Fix half of typos 2020-08-08 03:47:03 +03:00
zhang2014
1df8bfe4fb ISSUES-4006 fix build failure after refactor 2020-08-04 10:31:25 +08:00
Alexey Milovidov
6f690b7c0d Normalize ya.make files, fix "Arcadia" build 2020-08-02 16:57:38 +03:00
Vitaly Baranov
56665a15f7 Rework and rename the template class SettingsCollection => BaseSettings. 2020-07-31 20:54:18 +03:00
Nikolai Kochetov
a767b59f41
Merge pull request #12981 from hczhcz/patch-0728
Add http headers X-ClickHouse-Database and X-ClickHouse-Format
2020-07-31 14:19:54 +03:00
hcz
486d63864b Add X-ClickHouse-Database and X-ClickHouse-Format 2020-07-29 14:03:57 +08:00
Gleb Novikov
7f5b6fba78 Generic volume is coming...
1. SingleDiskVolume for temporary volumes
2. Generic VolumePtr in StoragePolicies
3. Removed max_data_part_size in system.storage_policies, added volume_type
2020-07-26 21:27:36 +03:00
alexey-milovidov
b5e87f5b25
Revert "Abort on std::out_of_range in debug builds" 2020-07-24 18:12:03 +03:00
Azat Khuzhin
eaaa4543f4 Abort on std::out_of_range in debug builds
This helps notice them in tests, same as:
- std::logic_error
- LOGICAL_ERROR
2020-07-23 11:36:12 +03:00
Alexander Kuzmenkov
a4a23673cc fixup 2020-07-17 17:25:13 +03:00
Alexander Kuzmenkov
4089f761e1 fix one out_of_range 2020-07-17 17:20:33 +03:00
Alexander Kuzmenkov
fb7743d8f5 Merge remote-tracking branch 'origin/master' into HEAD 2020-07-17 16:19:05 +03:00
Alexander Kuzmenkov
9d728d60d0 Abort on std::logic_error in debug builds
This helps notice them in tests, same as assert() and LOGICAL_ERROR.
2020-07-15 15:08:01 +03:00
Denis Glazachev
f787702922 Merge branch 'master' into ldap-per-user-authentication
* master: (27 commits)
  Whitespaces
  Fix typo
  Fix UBSan report in base64
  Correct default secure port for clickhouse-benchmark #11044
  Remove test with bug #10697
  Update in-functions.md (#12430)
  Allow nullable key in MergeTree
  Update arithmetic-functions.md
  [docs] add rabbitmq docs (#12326)
  Lower block sizes and look what will happen #9248
  Fix lifetime_bytes/lifetime_rows for Buffer direct block write
  Retrigger CI
  Fix up  test_mysql_protocol failed
  Implement lifetime_rows/lifetime_bytes for Buffer engine
  Add comment regarding proxy tunnel usage in PocoHTTPClient.cpp
  Add lifetime_rows/lifetime_bytes interface (exported via system.tables)
  Tiny IStorage refactoring
  Trigger integration-test-runner image rebuild.
  Delete log.txt
  Fix test_mysql_client/test_python_client error
  ...
2020-07-13 15:46:27 +04:00
Denis Glazachev
edb6ef8c09 Merge commit 'ceac649c01b0158090cd271776f3219f5e7ff57c' into ldap-per-user-authentication
* commit 'ceac649c01b0158090cd271776f3219f5e7ff57c': (75 commits)
  [docs] split misc statements (#12403)
  Update 00405_pretty_formats.reference
  Update PrettyCompactBlockOutputFormat.cpp
  Update PrettyBlockOutputFormat.cpp
  Update DataTypeNullable.cpp
  Update 01383_remote_ambiguous_column_shard.sql
  add output_format_pretty_grid_charset setting in docs
  add setting output_format_pretty_grid_charset
  Added a test for #11135
  Update index.md
  RIGHT and FULL JOIN for MergeJoin (#12118)
  Update MergeTreeIndexFullText.cpp
  restart the tests
  [docs] add syntax highlight (#12398)
  query fuzzer
  Fix std::bad_typeid when JSON functions called with argument of wrong type.
  Allow typeid_cast() to cast nullptr to nullptr.
  fix another context-related segfault
  [security docs] actually, only admins can create advisories
  query fuzzer
  ...
2020-07-11 21:32:36 +04:00
alexey-milovidov
ef41ef3162
Update MySQLHandler.cpp 2020-07-10 21:03:12 +03:00
BohuTANG
86590d4aca Change the exception catch to the generic way 2020-07-10 17:18:00 +08:00
BohuTANG
64fdce9398 Write through Poco::Exception exception to MySQL protocol client 2020-07-10 12:54:08 +08:00
BohuTANG
260bcb9d79 Add integration test for mysql replacement query 2020-07-09 22:20:54 +08:00
BohuTANG
5ca3aef919 Support MySQL 'SELECT DATABASE()' query replacement 2020-07-09 11:07:20 +08:00
Denis Glazachev
9effacfbc1 Merge branch 'master' into ldap-per-user-authentication
* master: (1102 commits)
  Update README.md
  Update README.md
  Update README.md
  Update index.md
  [docs] add intrdocution for statements page (#12189)
  Revert "Run perf tests with memory sampling (for allocations >1M)"
  Sanitize LINK_LIBRARIES property for the directories (#12160)
  [docs] refactor Domains overview (#12186)
  DOCS-647: toStartOfSecond (#12190)
  [docs] add intrdocution for commercial page (#12187)
  DOCSUP-1348 Russian translation for new functions (#133) (#12194)
  changelog fixes
  Update index.md (#12191)
  Update zh kafka.md title (#12192)
  Added test for #3767
  style fix for #12152
  Tests for fixed issues #10846 and #7347
  changelog fixes
  [docs] introduction for special table engines (#12170)
  [docs] introduction for third-party interfaces (#12175)
  ...

# Conflicts:
#	src/Access/ya.make
#	src/Common/ErrorCodes.cpp
2020-07-08 00:42:09 +04:00
Alexander Kuzmenkov
688f185f9e style fix for #12152 2020-07-07 13:28:45 +03:00
BohuTANG
cb04c503d7 Add MySQL to ClickHouse query replacement mapping table 2020-07-06 10:07:38 +08:00
BohuTANG
37ac456439 Support KILL QUERY [connection_id] for MySQL 2020-07-06 09:02:02 +08:00
BohuTANG
53997f23e6 Merge remote-tracking branch 'ck/master' into mysql_global_variables 2020-06-25 14:04:10 +08:00
BohuTANG
4d96a25655 Change MySQL global variables query to globalVariable function 2020-06-24 13:40:18 +08:00
alesapin
4185fe9975 Merge branch 'master' into atomic_metadata5 2020-06-23 11:13:05 +03:00
alexey-milovidov
1c1e12f06b
Merge pull request #11826 from ClickHouse/send-logs-on-fatal-errors
Send logs to client on fatal errors if possible
2020-06-23 09:49:48 +03:00
alesapin
b9e74f4e82 Merge branch 'master' into atomic_metadata5 2020-06-22 12:03:53 +03:00
Alexey Milovidov
71317dd59c Merge branch 'master' into send-logs-on-fatal-errors 2020-06-21 19:05:20 +03:00
Azat Khuzhin
844960195d Fix memory accounting via HTTP interface
function perf_test()
{
    time yes '127.1:8123/?wait_end_of_query=1' | head -n10000 | xargs -P10000 curl -s -d 'select 1' | grep -x -c 1
}
function server()
{
    local limit=$1 && shift
    clickhouse-server "$@" -- --max_server_memory_usage=$limit
}

perf_test:

- before this patch with 1G  limit: succeed only ~800  queries
- after  this patch with 1G  limit: succeed      ~8000 queries

- before this patch with 10G limit: succeed only ~3000  queries
- after  this patch with 10G limit: succeed      ~10000 queries

Fixes: #11153
2020-06-21 17:27:54 +03:00
Alexey Milovidov
3f96bdaa24 Minor changes after merge 2020-06-21 15:16:08 +03:00
alexey-milovidov
4ee623ccac
Merge pull request #10242 from MovElb/movelb-postgresql-wire-protocol-impl
PostgreSQL wire protocol implementation
2020-06-21 14:39:22 +03:00
Alexey Milovidov
7ba25bd799 Make it work 2020-06-20 14:17:15 +03:00
Denis Glazachev
5db60202b6 Merge branch 'master' into ldap-per-user-authentication 2020-06-19 00:11:08 +04:00
alesapin
dffdece350 getColumns in StorageInMemoryMetadta (only compilable) 2020-06-17 19:39:58 +03:00
alesapin
1ddeb3d149 Buildable getSampleBlock in StorageInMemoryMetadata 2020-06-16 18:51:29 +03:00
alesapin
eae901f58d Merge branch 'master' into atomic_metadata5 2020-06-16 14:44:45 +03:00
alesapin
36ba0192df Metadata in read and write methods of IStorage 2020-06-15 22:08:58 +03:00
Alexander Tokmakov
def0158638 configure query handler as default 2020-06-15 14:33:44 +03:00
Winter Zhang
dc6f904f0a
Merge branch 'master' into feature/ISSUES-7572 2020-06-14 18:28:06 +08:00
alexey-milovidov
da3a075821
Merge pull request #11660 from bharatnc/bnc/fix-remove-unused-imports
remove unused imports from HTTPHandlerFactory
2020-06-14 09:43:52 +03:00
Bharat Nallan
4953b5fc84 remove unused imports from HTTPHandlerFactory
This removes unused imports from `src/Server/HTTPHandlerFactory.cpp`:

```bash
- #include <re2/re2.h>
- #include <common/find_symbols.h>
- #include <Poco/StringTokenizer.h>
```
2020-06-13 21:47:44 -07:00
Alexey Milovidov
970a8e3ecc Skip empty URL parameters #10749 2020-06-14 03:56:13 +03:00
zhang2014
de96296e01 ISSUES-7572 fix build failure 2020-06-13 10:17:02 +08:00
zhang2014
8d9b770da4 ISSUES-7572 fix defaults config level & add replicas_status and prometheus handler 2020-06-13 00:15:02 +08:00
zhang2014
2c439afc01 ISSUES-7572 fix build failure 2020-06-12 19:17:34 +08:00
zhang2014
80b765542f ISSUES-7572 support config default http handler 2020-06-12 18:04:42 +08:00
Denis Glazachev
9e3a28a6b8 Merge branch 'master' into ldap-per-user-authentication
* master: (414 commits)
  Update file.md
  Update merge.md
  Update dictionary.md
  Update external-data.md
  Update distributed.md
  Update null.md
  Update set.md
  Update join.md
  Update url.md
  Update view.md
  Update materializedview.md
  Update memory.md
  Update buffer.md
  Update generate.md
  removed a sentence about global lock during rename (#11577)
  greatCircleAngle en translation (#11584)
  Update configuration-files.md
  try fix flacky test
  Update why.html
  Update rich.html
  ...

# Conflicts:
#	src/Common/ErrorCodes.cpp
#	utils/ci/jobs/quick-build/run.sh
2020-06-11 03:06:17 +04:00
MovElb
ef5d03a273 fix build 2020-06-08 16:49:10 +03:00
MovElb
fc981a2869 fix for review 2020-06-08 15:05:49 +03:00
Alexander Kuzmenkov
435f53e05a Improve error messages
Also support fmt for exception messages, the same way we use it in
logging macros.
2020-06-04 20:50:29 +03:00
Denis Glazachev
9331387340 Merge branch 'master' into ldap-per-user-authentication
* master: (29 commits)
  DOCS-620: Background pools settings (#11358)
  Update formats.md
  ya.make
  DOCS-611: background_buffer_flush_schedule_pool_size setting (#11176)
  Remove structure lock on parts send
  Update adopters.md
  This word "collapse" in Chinese means "折叠” (#11353)
  interval type link (#11351)
  Try fix tets.
  DOCS-573: system.data_type_families (#11344)
  fix flacky test with ttl
  Added test result
  Fix error with Lazy database
  Fix nullptr dereference in SYSTEM query and Lazy database
  Better code
  Added a test
  Fix unit test with UBSan
  Fix tests.
  Try fix build.
  Try fix build.
  ...
2020-06-03 00:48:21 +04:00
Denis Glazachev
979fa13b26 Simplify condition 2020-06-03 00:38:00 +04:00
Denis Glazachev
c61cbe8e98 Merge branch 'master' into ldap-per-user-authentication
* master: (114 commits)
  Update PushingToViewsBlockOutputStream.cpp
  Update PushingToViewsBlockOutputStream.cpp
  make clang-10 happy
  Fix sync_async test (remove timeout)
  CLICKHOUSEDOCS-631: temporary_files_codec, join_on_disk_max_files_to_merge settings. (#11242)
  Suppress output of cancelled queries in clickhouse-client #9473
  Better log messages in ConfigReloader
  fix select from StorageJoin
  Fix unit tests under MSan
  Added test.
  Fix build.
  Fix arguments for AggregateFunctionQuantile/
  Update style.md
  Add a guide on error messages.
  Report dictionary name on dictionary load errors.
  more types in ASOF JOIN (#11301)
  Fix part_log test
  Update test.
  Add perftest.
  Parallel processing for PushingToViewsBlockOutputStream::writeSuffix
  ...
2020-06-02 12:42:29 +04:00
Alexey Milovidov
a6bf4b5d70 Fix error with Lazy database 2020-06-02 05:06:16 +03:00
MovElb
fd5b1741a6 build fix 2020-05-31 17:05:41 +03:00
Denis Glazachev
e8144976fe Merge branch 'master' into ldap-per-user-authentication 2020-05-31 15:09:16 +04:00
Alexey Milovidov
25f941020b Remove namespace pollution 2020-05-31 00:57:37 +03:00
MovElb
142c63e487 done rebase 2020-05-30 23:02:11 +03:00
Alexey Milovidov
ffdec23d08 Remove wrong code #8441 2020-05-30 01:43:25 +03:00
tavplubix
a4e40fb5f2
Merge pull request #11269 from ClickHouse/add_context_to_idatabase_methods
Add context to IDatabase methods
2020-05-29 21:15:35 +03:00
Denis Glazachev
f1cfc7b472 Rename LDAP_PASSWORD to LDAP_SERVER and use "ldap_server" as a string key
Some refactoring
2020-05-29 11:47:01 +04:00
Denis Glazachev
f9d4136792 Merge branch 'master' into ldap-per-user-authentication 2020-05-29 10:52:44 +04:00
Alexey Milovidov
23d7947549 Fix constraints for DEFAULT fields; fix constraints for temporary tables; improve performance of INSERT for small blocks 2020-05-29 05:08:48 +03:00
Alexander Tokmakov
c071e0a473 add context to DatabaseCatalog methods 2020-05-29 02:01:18 +03:00
Alexander Tokmakov
3cff070f89 add context to IDatabase methods 2020-05-28 23:10:45 +03:00
Denis Glazachev
2863de750e Merge branch 'master' into ldap-per-user-authentication 2020-05-28 01:30:52 +04:00
Nikolai Kochetov
2dcee3db5c Merge branch 'master' into remove-experimental-use-processors-flag-3 2020-05-27 21:25:34 +03:00
Ivan
5b858de374
Split programs/server into actual program and library (#11186)
* Split programs/server into actual program and library
2020-05-27 20:52:52 +03:00