Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #12165 to 20.5: Fix splitting table name of dictionary source #12259

Merged
merged 905 commits into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
905 commits
Select commit Hold shift + click to select a range
444a869
simple changelog script
akuzm Jun 30, 2020
67d03b6
bump CI
alesapin Jun 30, 2020
3585700
Fix tests.
KochetovNicolai Jun 30, 2020
b1d2d55
Add explicit test for a case where AST hashes collide for different p…
nvartolomei Jun 30, 2020
948af0b
Merge pull request #12045 from ClickHouse/fix_loading_of_tables
alexey-milovidov Jun 30, 2020
e48b6b8
[blog] add RSS feed (#12064)
blinkov Jun 30, 2020
594fc92
Update CHANGELOG.md
akuzm Jun 30, 2020
baec409
Merge pull request #11993 from ClickHouse/aku/more-jemalloc-tweaks
akuzm Jun 30, 2020
4d300ab
bump ci
alesapin Jun 30, 2020
a541683
Moved useless S3 logging to TRACE level.
excitoon Jun 30, 2020
c95d09a
Add a test to cover non-const tuple elemenets (just in case)
nvartolomei Jul 1, 2020
5ef3c95
Bump
alesapin Jul 1, 2020
b2df6ac
Update query-complexity.md
filimonov Jul 1, 2020
2f9c52c
Update query-complexity.md
filimonov Jul 1, 2020
3cf01e9
Update query-complexity.md
filimonov Jul 1, 2020
bdc78a0
Update query-complexity.md
filimonov Jul 1, 2020
03a643e
DOCS-609: max_server_memory_usage (#11771)
BayoNet Jul 1, 2020
64bbccb
Add force_primary_key to a pk in tuple test
nvartolomei Jul 1, 2020
41fed28
DOCS-510: runningAccumulate (#12061)
BayoNet Jul 1, 2020
f8ceca6
Remove const specifier to allow auto-move (clangtidy)
nvartolomei Jul 1, 2020
3854ce6
Rewrite Set lookup to make it more readable
nvartolomei Jul 1, 2020
f0e715a
[docs] Sync zh/development/build-osx.md from EN (#12071)
BohuTANG Jul 1, 2020
811d124
Merge pull request #12002 from vitlibar/fix-partial-revokes
Jul 1, 2020
9ed5c6d
ISSUES-4006 support first for ALTER ADD|MODIFY COLUMN
zhang2014 Jul 1, 2020
faaf353
Update deb image
alesapin Jul 1, 2020
29178a1
Don't download image twice
alesapin Jul 1, 2020
f0b012c
Remove garbage from images
alesapin Jul 1, 2020
cf306c5
bump ci
alesapin Jul 1, 2020
f90a7c0
Merge pull request #12063 from ClickHouse/aku/changelog-20.3.11
akuzm Jul 2, 2020
e0273d3
Changelog for 20.1, 20.4
akuzm Jul 1, 2020
99514a7
fixup
akuzm Jul 2, 2020
41088c3
Merge remote-tracking branch 'origin/master' into HEAD
akuzm Jul 2, 2020
c7d8bf6
DOCS-635: Translated the EN version of the AvroConfluent format descr…
BayoNet Jul 2, 2020
cc2cadb
Merge pull request #11893 from excitoon-favorites/autostartmoves
Akazz Jul 2, 2020
79cd33a
Fix tests.
KochetovNicolai Jul 2, 2020
4c3ae82
Better PVS image
alesapin Jul 2, 2020
e79be9b
DOCS-605: Description for the always_fetch_merged_part setting (#11921)
BayoNet Jul 2, 2020
e9d3c48
Update Dockerfile
blinkov Jul 2, 2020
b9b7abe
revert e9d3c48f56ca07a7104d58d8ead5fdce76db81de
blinkov Jul 2, 2020
b4492bc
[blog] 'Package Repository Behind CDN' post (#12082)
blinkov Jul 2, 2020
03b36c2
Improve REVOKE command: now it requires only grant/admin option for only
Jul 2, 2020
cec02d1
Merge pull request #12067 from excitoon-favorites/betters3logs
alesapin Jul 2, 2020
65dae99
Merge pull request #12056 from ClickHouse/fix-11808
alesapin Jul 2, 2020
f87c3af
Merge pull request #12055 from ClickHouse/fix-9766
alesapin Jul 2, 2020
1fb90f3
Merge pull request #12052 from ClickHouse/test_image_changes
alesapin Jul 2, 2020
6527e04
Fix limiting the number of threads for VIEW.
KochetovNicolai Jul 2, 2020
71059e4
Merge pull request #12062 from nvartolomei/nv/set-index-tuple-types
CurtizJ Jul 2, 2020
4d01fb3
Update tips.md
alexey-milovidov Jul 2, 2020
aca1d8a
Added test.
KochetovNicolai Jul 2, 2020
7ae8a19
Merge branch 'add-storage-rabbitmq-read-only' of github.com:kssenii/C…
alesapin Jul 2, 2020
64583ce
Merge branch 'master' into add-storage-rabbitmq-read-only
alesapin Jul 2, 2020
923c7e7
Remove pvs studio from images list
alesapin Jul 2, 2020
82061da
Merge pull request #12040 from azat/dist-fixes
alexey-milovidov Jul 2, 2020
9e02a0d
Merge pull request #11991 from ClickHouse/aku/perf-partial
akuzm Jul 2, 2020
96df2e6
Better shutdown and conversion
alesapin Jul 2, 2020
ab54a96
Reverse arguments
alesapin Jul 2, 2020
57d727d
Fix result_rows and result_bytes metrics for selects.
KochetovNicolai Jul 2, 2020
e7ab4df
Fix result_rows and result_bytes metrics for selects.
KochetovNicolai Jul 2, 2020
8513e1e
improve breadcrumbs markup
blinkov Jul 2, 2020
3f51419
Fix tests.
KochetovNicolai Jul 2, 2020
a5cbeda
fix segfault with -StateResample combinators
CurtizJ Jul 2, 2020
c6c7ee3
Less race conditions
alesapin Jul 2, 2020
17d49af
fix test with buffer table
CurtizJ Jul 2, 2020
b81c66a
[docker] install ca-certificates before the first apt-get update (#12…
blinkov Jul 2, 2020
3435328
DOCS-522: max_parser_depth (#12097)
BayoNet Jul 2, 2020
0700a70
Rewrite curl dependency in a more ch compatible way
azat Jun 29, 2020
4c751bf
Added results for AWS Lightsail
alexey-milovidov Jul 3, 2020
457f56b
(typo) in doc (#12099)
manmitya Jul 3, 2020
68ca587
Update polymorphic_parts_l.xml
akuzm Jul 3, 2020
d1a9352
Update polymorphic_parts_m.xml
akuzm Jul 3, 2020
03becdb
Update polymorphic_parts_s.xml
akuzm Jul 3, 2020
6104872
kafka: fix SIGSEGV on DROP TABLE
azat Jul 1, 2020
e7179c4
kafka: check that the data is still usable after parsing
azat Jul 2, 2020
8508200
kafka: improve logging during engine shutdown
azat Jul 2, 2020
de8bc99
kafka: avoid superior polling after DROP/DETACH TABLE
azat Jul 2, 2020
bd5e5e9
kafka: remove outdated comment
azat Jul 2, 2020
3c717d4
Added test.
KochetovNicolai Jul 3, 2020
17c89f3
Merge pull request #12085 from ClickHouse/fix-11937
KochetovNicolai Jul 3, 2020
d5732d3
Create codeql-analysis.yml
blinkov Jul 3, 2020
c57edd2
Tiny fixes
alesapin Jul 3, 2020
d962fd9
Create anchore-analysis.yml
blinkov Jul 3, 2020
1ffc4ad
Update polymorphic_parts_s.xml
akuzm Jul 3, 2020
02ee988
Update polymorphic_parts_m.xml
akuzm Jul 3, 2020
e27e509
Update polymorphic_parts_l.xml
akuzm Jul 3, 2020
2577d71
Changelog for 20.5
akuzm Jul 3, 2020
c9a41ba
Update CHANGELOG.md
KochetovNicolai Jul 3, 2020
e7acda7
Update README.md
blinkov Jul 3, 2020
b3ec449
Fix test (#12088)
alesapin Jul 3, 2020
0ce2d48
Test for a fixed issue #10668, related to input_format_allow_errors_n…
filimonov Jul 3, 2020
0a6f3ca
Add unbundled mode flag
alesapin Jul 3, 2020
b3f1842
Remove LC converting to Arrow.
KochetovNicolai Jul 3, 2020
3d37a63
Remove LC converting to Arrow.
KochetovNicolai Jul 3, 2020
d015a4d
Move skip lists to clickhouse-test
alesapin Jul 3, 2020
6d08b7b
Remove LC converting to Arrow.
KochetovNicolai Jul 3, 2020
07cbb42
More verbose message about skip
alesapin Jul 3, 2020
5098df8
Make skip-list optional
alesapin Jul 3, 2020
8ec70c2
Added test.
KochetovNicolai Jul 3, 2020
027c6b7
Create initializeAggregation to initialize an aggregation function ba…
Jul 3, 2020
23b44ca
Add type column in system.disks
ianton-ru Jul 3, 2020
d4d9de2
Merge pull request #12101 from ClickHouse/codeql-analysis
alexey-milovidov Jul 3, 2020
66227d8
Merge pull request #12102 from ClickHouse/anchore-analysis
alexey-milovidov Jul 3, 2020
cd9a71b
Update clickhouse-test
alesapin Jul 3, 2020
929d652
Merge pull request #12083 from vitlibar/improve-revoke-command
Jul 3, 2020
5a4d9fb
Merge pull request #12070 from ClickHouse/filimonov-max_rows_to_read-…
qoega Jul 3, 2020
fba02ba
fix test with UBSan
nikitamikhaylov Jul 3, 2020
5c97106
Merge branch 'master' of github.com:ClickHouse/ClickHouse into Avogar…
nikitamikhaylov Jul 3, 2020
6e59953
Add missing query context for system logs
filimonov Jul 3, 2020
ab34313
Fix handling dependency of table with ENGINE=Dictionary on dictionary.
Jul 3, 2020
dad96be
Add test.
Jul 3, 2020
4d9cfe4
Update 01355_CSV_input_format_allow_errors.sh
tavplubix Jul 3, 2020
3ea0641
Merge pull request #12105 from filimonov/test_fixed_issue_10668
tavplubix Jul 3, 2020
6677e0a
Merge pull request #12073 from zhang2014/feature/atfer_column_modify_…
alexey-milovidov Jul 3, 2020
f665602
Update CHANGELOG.md
alexey-milovidov Jul 3, 2020
9944305
Update Dockerfile
blinkov Jul 3, 2020
08dfc14
Added a showcase of minimal Docker image
alexey-milovidov Jul 3, 2020
5d68bc5
Added a comment
alexey-milovidov Jul 3, 2020
a41e574
Added a comment
alexey-milovidov Jul 3, 2020
e922fb9
Added a comment
alexey-milovidov Jul 3, 2020
89034ed
Formatting
alexey-milovidov Jul 3, 2020
338e772
contrib/unixodbc-cmake: Fix build when UNBUNDLED
matwey Jul 4, 2020
8dc2043
Fix version column in replicated version collapsing merge tree (#12121)
alesapin Jul 4, 2020
bfa8cdc
Move skip lists for tests to skip_list.json file (#12107)
alesapin Jul 4, 2020
a2b6d58
Merge pull request #11069 from kssenii/add-storage-rabbitmq-read-only
alesapin Jul 4, 2020
20c8e22
poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED
matwey Jul 4, 2020
caafbe1
Add missed <atomic> include in ProxyListConfiguration
matwey Jul 4, 2020
73676f5
Improve performace of reading in order of sorting key. (#11696)
CurtizJ Jul 4, 2020
e6aacaa
Do not enable sentry if ENABLE_LIBRARIES is not set
azat Jul 4, 2020
9258368
Fail if curl library was enabled and was not found in case of unbundl…
azat Jul 4, 2020
176a7f2
Normalize "pid" file handling #3501
alexey-milovidov Jul 4, 2020
d9ea8cf
Update StatusFile.cpp
alexey-milovidov Jul 4, 2020
5382b6c
Merge pull request #12126 from ClickHouse/minimal-docker-image
alexey-milovidov Jul 4, 2020
f1151ed
Merge pull request #12133 from ClickHouse/normalize-pid-file
alexey-milovidov Jul 4, 2020
d387fa7
New ISO8601 year modificators for formatDateTime
vivarum Jul 4, 2020
918e979
Merge branch 'master' into fix-if-fixed-string
alexey-milovidov Jul 4, 2020
6ae9bfe
Merge pull request #12131 from matwey/fix/cmake_unixodbc
alexey-milovidov Jul 4, 2020
c4b6c78
Merge branch 'master' into fix-constraints
alexey-milovidov Jul 4, 2020
c6def5f
Merge pull request #12108 from ClickHouse/fix-12086
alexey-milovidov Jul 4, 2020
cf1967b
Merge pull request #12089 from ClickHouse/fix-11595
alexey-milovidov Jul 4, 2020
e05283d
Merge pull request #12060 from ClickHouse/fix-12053
alexey-milovidov Jul 4, 2020
d10856c
Added a test
alexey-milovidov Jul 4, 2020
f91e34b
Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder
azat Jul 4, 2020
731d926
Remove harmful code from "geoDistance" #12117
alexey-milovidov Jul 4, 2020
f8a43d5
Update formatDateTime.cpp
alexey-milovidov Jul 4, 2020
c696354
Merge pull request #12115 from ianton-ru/disk-type-in-system-disks
alexey-milovidov Jul 4, 2020
96e8e93
Fix warnings from CodeQL
alexey-milovidov Jul 4, 2020
55f9ddb
Added a test
alexey-milovidov Jul 4, 2020
d2e8c0d
Minor modification
alexey-milovidov Jul 4, 2020
c5cf719
Update libdivide to the latest master
alexey-milovidov Jul 4, 2020
351eda5
Replace exit to abort in libdivide
alexey-milovidov Jul 5, 2020
73a5c38
Fix potential overflow in integer division #12119
alexey-milovidov Jul 5, 2020
63a88de
Added a test
alexey-milovidov Jul 5, 2020
6e1c1b0
Whitespace
alexey-milovidov Jul 5, 2020
66e810f
Added a test for #4211
alexey-milovidov Jul 5, 2020
10c40f4
Attempt to fix "Arcadia" build
alexey-milovidov Jul 5, 2020
c257255
Merge pull request #12134 from matwey/fix/missed_include
alexey-milovidov Jul 5, 2020
e83df36
Rename test
alexey-milovidov Jul 5, 2020
32a5dcd
Update arraySum.cpp
alexey-milovidov Jul 5, 2020
307c3c9
Run perf tests with memory sampling (for allocations >1M)
azat Jul 5, 2020
99e9b15
Make code clearer: use enum instead of `bool internal`.
Jul 5, 2020
f02edaa
Merge pull request #12137 from ClickHouse/fix-loop-geodistance
alexey-milovidov Jul 5, 2020
5902718
Merge pull request #12141 from ClickHouse/test-for-remote-failover-nu…
alexey-milovidov Jul 5, 2020
ec563e5
Merge pull request #12138 from ClickHouse/codeql
alexey-milovidov Jul 5, 2020
1a760e1
Update StorageDictionary.h
alexey-milovidov Jul 5, 2020
cb126a2
Update StorageDictionary.h
alexey-milovidov Jul 5, 2020
8c3417f
ILIKE operator (#12125)
myrrc Jul 5, 2020
eecf7ae
Merge pull request #12140 from ClickHouse/fix-division
alexey-milovidov Jul 5, 2020
068f9fc
Merge pull request #12139 from ClickHouse/update-libdivide
alexey-milovidov Jul 5, 2020
0f1bfa5
Merge pull request #12042 from ClickHouse/fix-constraints
alexey-milovidov Jul 5, 2020
ab15c8d
Merge pull request #12021 from ClickHouse/fix-if-fixed-string
alexey-milovidov Jul 5, 2020
c08e24d
Merge pull request #12136 from vivarum/vivarum-04659-new-ISO8601-year…
alexey-milovidov Jul 5, 2020
3709eed
Merge pull request #12080 from ClickHouse/aku/changelog-20.4.6
alexey-milovidov Jul 5, 2020
5816858
add parseDateTimeBestEffortUS function (#12028)
ucasfl Jul 5, 2020
5d2013f
Merge pull request #12104 from ClickHouse/aku/changelog-20.5
alexey-milovidov Jul 5, 2020
c1e31b6
Cleanup changelog (half done). Now it is acceptable #12104
alexey-milovidov Jul 5, 2020
70e5618
Cleanup changelog (half done). Now it is more acceptable #12104
alexey-milovidov Jul 5, 2020
7997da3
Cleanup changelog (half done). Now it is more acceptable #12104
alexey-milovidov Jul 5, 2020
89497a0
Cleanup changelog (half done). Additions requested by @filimonov #12104
alexey-milovidov Jul 5, 2020
5eb60d5
Remove underscore as word-break character. This partially reverts #11975
alexey-milovidov Jul 5, 2020
05ee63b
Fix bad test number
alexey-milovidov Jul 5, 2020
f267223
Added a test
alexey-milovidov Jul 5, 2020
3ae9d3c
Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the na…
alexey-milovidov Jul 5, 2020
e2e92af
fix segfault with -StateResample combinators
CurtizJ Jul 5, 2020
7f3a8f3
Fix bad code in redundant ORDER BY optimization #10067
alexey-milovidov Jul 5, 2020
752b021
Add a test
alexey-milovidov Jul 6, 2020
37ac456
Support KILL QUERY [connection_id] for MySQL
BohuTANG Jul 6, 2020
ea0fb00
Merge pull request #12116 from vitlibar/fix-table-dictionary-dependency
alexey-milovidov Jul 6, 2020
de4459c
Fix error
alexey-milovidov Jul 6, 2020
bd523a0
Autocomplete does not have to work in "Unbundled" build
alexey-milovidov Jul 6, 2020
f08ff90
Whitespace
alexey-milovidov Jul 6, 2020
cb04c50
Add MySQL to ClickHouse query replacement mapping table
BohuTANG Jul 6, 2020
6483ba7
Style
alexey-milovidov Jul 6, 2020
569a892
update ya.make
Jul 6, 2020
0124eeb
Added function "hasThreadFuzzer"
alexey-milovidov Jul 6, 2020
8179b34
Fix test under ThreadFuzzer
alexey-milovidov Jul 6, 2020
1719ab1
Merge pull request #12041 from azat/curl-proper-cmake
alexey-milovidov Jul 6, 2020
3aad122
Merge pull request #12092 from CurtizJ/fix-state-resample
alexey-milovidov Jul 6, 2020
2a026ee
Merge branch 'master' into fix-test-under-thread-fuzzer
alexey-milovidov Jul 6, 2020
4f63af9
Merge pull request #12145 from ClickHouse/fix-suggest-word-break-chars
alexey-milovidov Jul 6, 2020
935b943
Test for issue #9088
filimonov Jul 3, 2020
71b410e
Remove unused potentially dangerous function
alexey-milovidov Jul 6, 2020
1ca45c1
Fix mutations interpreter #9088
alexey-milovidov Jul 6, 2020
eb2cffa
Added a test
alexey-milovidov Jul 6, 2020
4508876
Added another test just in case
alexey-milovidov Jul 6, 2020
d8ae9c5
Added yet another test just in case
alexey-milovidov Jul 6, 2020
ced1272
Update 01358_mutation_delete_null_rows.sql
alexey-milovidov Jul 6, 2020
1650bf9
Fix test
alexey-milovidov Jul 6, 2020
7df372c
Fix flaky test
alexey-milovidov Jul 6, 2020
63e1e23
Attempt to fix flaky test 00721_force_by_identical_result_after_merge…
alexey-milovidov Jul 6, 2020
4ec787c
Merge pull request #12147 from ClickHouse/fix-logical-error-table-fun…
alexey-milovidov Jul 6, 2020
b6a19b5
Merge pull request #12148 from ClickHouse/fix-bad-redundant-order-by-…
alexey-milovidov Jul 6, 2020
0e8fad6
[anchore] more detailed Dockerfile scan reports (#12159)
blinkov Jul 6, 2020
96eb381
Update Dockerfile
blinkov Jul 6, 2020
30f05d0
Update array-functions.md (#12130)
yhgcn Jul 6, 2020
18c48ce
Add integration test for mysql replacement query
BohuTANG Jul 6, 2020
b444b7d
Update array-functions.md (#12129)
yhgcn Jul 6, 2020
9f32615
Merge pull request #11606 from CurtizJ/polymorphic-parts-2
akuzm Jul 6, 2020
dac7a39
fix ubsan final
nikitamikhaylov Jul 6, 2020
5c6d6bd
Merge pull request #11995 from azat/load_balancing-priority
nikitamikhaylov Jul 6, 2020
9e776e6
[docs] improve redirects destination
blinkov Jul 6, 2020
5a2cb78
Update SECURITY.md (#12161)
qoega Jul 6, 2020
9b26afc
Update Dockerfile
blinkov Jul 6, 2020
d648628
Merge pull request #12075 from azat/StorageKafka-SIGSEGV-fix
akuzm Jul 6, 2020
8e767bf
Merge pull request #12153 from ClickHouse/fix-mutations-interpreter
alesapin Jul 6, 2020
66bed10
Merge pull request #12109 from PerformanceVision/initialize_aggregation
CurtizJ Jul 6, 2020
a066195
add cluster() adn clusterAllReplicas() table functions description, a…
Slach Jul 6, 2020
53522c7
Merge pull request #11662 from Avogar/orc_output_format
nikitamikhaylov Jul 6, 2020
7ce3464
Remove -v from ninja
alesapin Jul 6, 2020
4e0e8cd
Merge pull request #12157 from ClickHouse/fix-flaky-test-721
alexey-milovidov Jul 6, 2020
3059be5
Merge branch 'master' into fix-test-under-thread-fuzzer
alexey-milovidov Jul 6, 2020
fd266ff
Merge pull request #12154 from ClickHouse/fix-test-under-thread-fuzzer
alexey-milovidov Jul 6, 2020
a2047de
[docs] introduction for integration table engines (#12167)
blinkov Jul 6, 2020
8038383
Fix #10437, CR fixes
filimonov Jul 6, 2020
93517b4
Same change for Kafka - just in case, and to make it conform.
filimonov Jul 6, 2020
7372c46
[docs] add redirect from an introduction index page (#12176)
blinkov Jul 6, 2020
a3ad766
Merge pull request #12174 from ClickHouse/remove_ninja_v_for_binary_b…
alexey-milovidov Jul 6, 2020
685fb46
[website] add apple-touch-icon (#12164)
blinkov Jul 6, 2020
e60b888
Merge pull request #12124 from ClickHouse/docker-apt-get-upgrade-1
alexey-milovidov Jul 6, 2020
2e8ba34
Better assert
alexey-milovidov Jul 6, 2020
4733504
Don't split dictionary source's table name into schema and table name…
Jul 6, 2020
1c0c8a7
Merge pull request #11892 from excitoon-favorites/relatives3paths
Akazz Jul 6, 2020
c78d44c
Sync reference file with changes in sql file
filimonov Jul 6, 2020
a3826e5
Merge pull request #12142 from azat/perf-memory-sampling
akuzm Jul 6, 2020
30cc78a
[docs] introduction for third-party interfaces (#12175)
blinkov Jul 6, 2020
8d65dea
[docs] introduction for special table engines (#12170)
blinkov Jul 6, 2020
488a8cb
Merge pull request #12120 from filimonov/query_context_for_system_logs
tavplubix Jul 7, 2020
dce7709
Merge pull request #12152 from BohuTANG/mysql_kill_query
akuzm Jul 7, 2020
be85f9f
Merge pull request #12165 from vitlibar/fix-split-dictionary-source-t…
alesapin Jul 7, 2020
25ca668
Merge commit 'dce7709405f5399d2c2c8c3e60c62342540c248d' into backport…
Jul 7, 2020
b3329d0
Merge remote-tracking branch 'origin/backport/20.5/12165' into cherry…
Jul 7, 2020
419beb5
Merge pull request #12199 from ClickHouse/cherrypick/20.5/be85f9f98ab…
Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions programs/odbc-bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set (CLICKHOUSE_ODBC_BRIDGE_SOURCES
ODBCBlockOutputStream.cpp
ODBCBridge.cpp
PingHandler.cpp
SchemaAllowedHandler.cpp
validateODBCConnectionString.cpp
)

Expand Down
6 changes: 6 additions & 0 deletions programs/odbc-bridge/HandlerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Poco::Net::HTTPRequestHandler * HandlerFactory::createRequestHandler(const Poco:
return new IdentifierQuoteHandler(keep_alive_timeout, context);
#else
return nullptr;
#endif
else if (uri.getPath() == "/schema_allowed")
#if USE_ODBC
return new SchemaAllowedHandler(keep_alive_timeout, context);
#else
return nullptr;
#endif
else if (uri.getPath() == "/write")
return new ODBCHandler(pool_map, keep_alive_timeout, context, "write");
Expand Down
3 changes: 2 additions & 1 deletion programs/odbc-bridge/HandlerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "MainHandler.h"
#include "ColumnInfoHandler.h"
#include "IdentifierQuoteHandler.h"
#include "SchemaAllowedHandler.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
Expand All @@ -15,7 +16,7 @@

namespace DB
{
/** Factory for '/ping', '/', '/columns_info', '/identifier_quote' handlers.
/** Factory for '/ping', '/', '/columns_info', '/identifier_quote', '/schema_allowed' handlers.
* Also stores Session pools for ODBC connections
*/
class HandlerFactory : public Poco::Net::HTTPRequestHandlerFactory
Expand Down
76 changes: 76 additions & 0 deletions programs/odbc-bridge/SchemaAllowedHandler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#include "SchemaAllowedHandler.h"

#if USE_ODBC

# include <IO/WriteBufferFromHTTPServerResponse.h>
# include <IO/WriteHelpers.h>
# include <Poco/Data/ODBC/ODBCException.h>
# include <Poco/Data/ODBC/SessionImpl.h>
# include <Poco/Data/ODBC/Utility.h>
# include <Poco/Net/HTMLForm.h>
# include <Poco/Net/HTTPServerRequest.h>
# include <Poco/Net/HTTPServerResponse.h>
# include <common/logger_useful.h>
# include "validateODBCConnectionString.h"

# define POCO_SQL_ODBC_CLASS Poco::Data::ODBC

namespace DB
{
namespace
{
bool isSchemaAllowed(SQLHDBC hdbc)
{
std::string identifier;

SQLSMALLINT t;
SQLRETURN r = POCO_SQL_ODBC_CLASS::SQLGetInfo(hdbc, SQL_SCHEMA_USAGE, nullptr, 0, &t);

if (POCO_SQL_ODBC_CLASS::Utility::isError(r))
throw POCO_SQL_ODBC_CLASS::ConnectionException(hdbc);

return t != 0;
}
}


void SchemaAllowedHandler::handleRequest(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response)
{
Poco::Net::HTMLForm params(request, request.stream());
LOG_TRACE(log, "Request URI: {}", request.getURI());

auto process_error = [&response, this](const std::string & message)
{
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR);
if (!response.sent())
response.send() << message << std::endl;
LOG_WARNING(log, message);
};

if (!params.has("connection_string"))
{
process_error("No 'connection_string' in request URL");
return;
}

try
{
std::string connection_string = params.get("connection_string");
POCO_SQL_ODBC_CLASS::SessionImpl session(validateODBCConnectionString(connection_string), DBMS_DEFAULT_CONNECT_TIMEOUT_SEC);
SQLHDBC hdbc = session.dbc().handle();

bool result = isSchemaAllowed(hdbc);

WriteBufferFromHTTPServerResponse out(request, response, keep_alive_timeout);
writeBoolText(result, out);
}
catch (...)
{
process_error("Error getting schema usage from ODBC '" + getCurrentExceptionMessage(false) + "'");
tryLogCurrentException(log);
}
}

}

#endif
31 changes: 31 additions & 0 deletions programs/odbc-bridge/SchemaAllowedHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include <Poco/Logger.h>
#include <Poco/Net/HTTPRequestHandler.h>

#if USE_ODBC

namespace DB
{
class Context;


/// This handler establishes connection to database, and retrieve whether schema is allowed.
class SchemaAllowedHandler : public Poco::Net::HTTPRequestHandler
{
public:
SchemaAllowedHandler(size_t keep_alive_timeout_, Context &)
: log(&Poco::Logger::get("SchemaAllowedHandler")), keep_alive_timeout(keep_alive_timeout_)
{
}

void handleRequest(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response) override;

private:
Poco::Logger * log;
size_t keep_alive_timeout;
};

}

#endif
24 changes: 24 additions & 0 deletions src/Common/XDBCBridgeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class IXDBCBridgeHelper
virtual Poco::URI getMainURI() const = 0;
virtual Poco::URI getColumnsInfoURI() const = 0;
virtual IdentifierQuotingStyle getIdentifierQuotingStyle() = 0;
virtual bool isSchemaAllowed() = 0;
virtual String getName() const = 0;

virtual ~IXDBCBridgeHelper() = default;
Expand All @@ -61,6 +62,7 @@ class XDBCBridgeHelper : public IXDBCBridgeHelper
Poco::Logger * log = &Poco::Logger::get(BridgeHelperMixin::getName() + "BridgeHelper");

std::optional<IdentifierQuotingStyle> quote_style;
std::optional<bool> is_schema_allowed;

protected:
auto getConnectionString() const
Expand All @@ -80,6 +82,7 @@ class XDBCBridgeHelper : public IXDBCBridgeHelper
static constexpr inline auto MAIN_HANDLER = "/";
static constexpr inline auto COL_INFO_HANDLER = "/columns_info";
static constexpr inline auto IDENTIFIER_QUOTE_HANDLER = "/identifier_quote";
static constexpr inline auto SCHEMA_ALLOWED_HANDLER = "/schema_allowed";
static constexpr inline auto PING_OK_ANSWER = "Ok.";

XDBCBridgeHelper(const Context & global_context_, const Poco::Timespan & http_timeout_, const std::string & connection_string_)
Expand Down Expand Up @@ -128,6 +131,27 @@ class XDBCBridgeHelper : public IXDBCBridgeHelper
return *quote_style;
}

bool isSchemaAllowed() override
{
if (!is_schema_allowed.has_value())
{
startBridgeSync();

auto uri = createBaseURI();
uri.setPath(SCHEMA_ALLOWED_HANDLER);
uri.addQueryParameter("connection_string", getConnectionString());

ReadWriteBufferFromHTTP buf(
uri, Poco::Net::HTTPRequest::HTTP_POST, {}, ConnectionTimeouts::getHTTPTimeouts(context));

bool res;
readBoolText(res, buf);
is_schema_allowed = res;
}

return *is_schema_allowed;
}

/**
* @todo leaky abstraction - used by external API's
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Dictionaries/CassandraDictionarySource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CassandraDictionarySource::CassandraDictionarySource(
, dict_struct(dict_struct_)
, settings(settings_)
, sample_block(sample_block_)
, query_builder(dict_struct, settings.db, settings.table, settings.where, IdentifierQuotingStyle::DoubleQuotes)
, query_builder(dict_struct, settings.db, "", settings.table, settings.where, IdentifierQuotingStyle::DoubleQuotes)
{
cassandraCheck(cass_cluster_set_contact_points(cluster, settings.host.c_str()));
if (settings.port)
Expand Down
4 changes: 2 additions & 2 deletions src/Dictionaries/ClickHouseDictionarySource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ClickHouseDictionarySource::ClickHouseDictionarySource(
, where{config.getString(config_prefix + ".where", "")}
, update_field{config.getString(config_prefix + ".update_field", "")}
, invalidate_query{config.getString(config_prefix + ".invalidate_query", "")}
, query_builder{dict_struct, db, table, where, IdentifierQuotingStyle::Backticks}
, query_builder{dict_struct, db, "", table, where, IdentifierQuotingStyle::Backticks}
, sample_block{sample_block_}
, context(context_)
, is_local{isLocalAddress({host, port}, secure ? context.getTCPPortSecure().value_or(0) : context.getTCPPort())}
Expand Down Expand Up @@ -97,7 +97,7 @@ ClickHouseDictionarySource::ClickHouseDictionarySource(const ClickHouseDictionar
, update_field{other.update_field}
, invalidate_query{other.invalidate_query}
, invalidate_query_response{other.invalidate_query_response}
, query_builder{dict_struct, db, table, where, IdentifierQuotingStyle::Backticks}
, query_builder{dict_struct, db, "", table, where, IdentifierQuotingStyle::Backticks}
, sample_block{other.sample_block}
, context(other.context)
, is_local{other.is_local}
Expand Down
16 changes: 3 additions & 13 deletions src/Dictionaries/ExternalQueryBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,12 @@ namespace ErrorCodes
ExternalQueryBuilder::ExternalQueryBuilder(
const DictionaryStructure & dict_struct_,
const std::string & db_,
const std::string & schema_,
const std::string & table_,
const std::string & where_,
IdentifierQuotingStyle quoting_style_)
: dict_struct(dict_struct_), db(db_), where(where_), quoting_style(quoting_style_)
{
if (auto pos = table_.find('.'); pos != std::string::npos)
{
schema = table_.substr(0, pos);
table = table_.substr(pos + 1);
}
else
{
schema = "";
table = table_;
}
}
: dict_struct(dict_struct_), db(db_), schema(schema_), table(table_), where(where_), quoting_style(quoting_style_)
{}


void ExternalQueryBuilder::writeQuoted(const std::string & s, WriteBuffer & out) const
Expand Down
3 changes: 2 additions & 1 deletion src/Dictionaries/ExternalQueryBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ struct ExternalQueryBuilder
{
const DictionaryStructure & dict_struct;
std::string db;
std::string table;
std::string schema;
std::string table;
const std::string & where;

IdentifierQuotingStyle quoting_style;
Expand All @@ -28,6 +28,7 @@ struct ExternalQueryBuilder
ExternalQueryBuilder(
const DictionaryStructure & dict_struct_,
const std::string & db_,
const std::string & schema_,
const std::string & table_,
const std::string & where_,
IdentifierQuotingStyle quoting_style_);
Expand Down
4 changes: 2 additions & 2 deletions src/Dictionaries/MySQLDictionarySource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ MySQLDictionarySource::MySQLDictionarySource(
, dont_check_update_time{config.getBool(config_prefix + ".dont_check_update_time", false)}
, sample_block{sample_block_}
, pool{mysqlxx::PoolFactory::instance().get(config, config_prefix)}
, query_builder{dict_struct, db, table, where, IdentifierQuotingStyle::Backticks}
, query_builder{dict_struct, db, "", table, where, IdentifierQuotingStyle::Backticks}
, load_all_query{query_builder.composeLoadAllQuery()}
, invalidate_query{config.getString(config_prefix + ".invalidate_query", "")}
, close_connection{config.getBool(config_prefix + ".close_connection", false) || config.getBool(config_prefix + ".share_connection", false)}
Expand All @@ -87,7 +87,7 @@ MySQLDictionarySource::MySQLDictionarySource(const MySQLDictionarySource & other
, dont_check_update_time{other.dont_check_update_time}
, sample_block{other.sample_block}
, pool{other.pool}
, query_builder{dict_struct, db, table, where, IdentifierQuotingStyle::Backticks}
, query_builder{dict_struct, db, "", table, where, IdentifierQuotingStyle::Backticks}
, load_all_query{other.load_all_query}
, last_modification{other.last_modification}
, invalidate_query{other.invalidate_query}
Expand Down
39 changes: 37 additions & 2 deletions src/Dictionaries/XDBCDictionarySource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace DB
namespace ErrorCodes
{
extern const int SUPPORT_IS_DISABLED;
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
Expand Down Expand Up @@ -60,6 +61,39 @@ namespace
std::unique_ptr<ReadWriteBufferFromHTTP> read_buf;
BlockInputStreamPtr reader;
};


ExternalQueryBuilder makeExternalQueryBuilder(const DictionaryStructure & dict_struct_,
const std::string & db_,
const std::string & schema_,
const std::string & table_,
const std::string & where_,
IXDBCBridgeHelper & bridge_)
{
std::string schema = schema_;
std::string table = table_;

if (bridge_.isSchemaAllowed())
{
if (schema.empty())
{
if (auto pos = table.find('.'); pos != std::string::npos)
{
schema = table.substr(0, pos);
table = table.substr(pos + 1);
}
}
}
else
{
if (!schema.empty())
throw Exception{"Dictionary source of type " + bridge_.getName() + " specifies a schema but schema is not supported by "
+ bridge_.getName() + "-driver",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
}

return {dict_struct_, db_, schema, table, where_, bridge_.getIdentifierQuotingStyle()};
}
}

static const UInt64 max_block_size = 8192;
Expand All @@ -76,11 +110,12 @@ XDBCDictionarySource::XDBCDictionarySource(
, update_time{std::chrono::system_clock::from_time_t(0)}
, dict_struct{dict_struct_}
, db{config_.getString(config_prefix_ + ".db", "")}
, schema{config_.getString(config_prefix_ + ".schema", "")}
, table{config_.getString(config_prefix_ + ".table")}
, where{config_.getString(config_prefix_ + ".where", "")}
, update_field{config_.getString(config_prefix_ + ".update_field", "")}
, sample_block{sample_block_}
, query_builder{dict_struct, db, table, where, bridge_->getIdentifierQuotingStyle()}
, query_builder{makeExternalQueryBuilder(dict_struct, db, schema, table, where, *bridge_)}
, load_all_query{query_builder.composeLoadAllQuery()}
, invalidate_query{config_.getString(config_prefix_ + ".invalidate_query", "")}
, bridge_helper{bridge_}
Expand All @@ -104,7 +139,7 @@ XDBCDictionarySource::XDBCDictionarySource(const XDBCDictionarySource & other)
, where{other.where}
, update_field{other.update_field}
, sample_block{other.sample_block}
, query_builder{dict_struct, db, table, where, other.bridge_helper->getIdentifierQuotingStyle()}
, query_builder{other.query_builder}
, load_all_query{other.load_all_query}
, invalidate_query{other.invalidate_query}
, invalidate_query_response{other.invalidate_query_response}
Expand Down
1 change: 1 addition & 0 deletions src/Dictionaries/XDBCDictionarySource.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class XDBCDictionarySource final : public IDictionarySource
std::chrono::time_point<std::chrono::system_clock> update_time;
const DictionaryStructure dict_struct;
const std::string db;
const std::string schema;
const std::string table;
const std::string where;
const std::string update_field;
Expand Down