Skip to content

Introduce sessions#26864

Merged
vitlibar merged 2 commits intoClickHouse:masterfrom
vitlibar:refactor-sessions
Aug 18, 2021
Merged

Introduce sessions#26864
vitlibar merged 2 commits intoClickHouse:masterfrom
vitlibar:refactor-sessions

Conversation

@vitlibar
Copy link
Copy Markdown
Member

@vitlibar vitlibar commented Jul 27, 2021

This is required to add system.session_log table.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

  • Not for changelog

This PR introduces a new class Session which provides a set of utilities to authenticate, create a session context and query contexts for connections of any kind (TCP / HTTP / GRPC / MySQL / PostgreSQL / etc.) to clickhouse-server. The main idea of this PR is to move some common session-related code from multiple connection handlers to one place.

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 27, 2021
@vitlibar vitlibar force-pushed the refactor-sessions branch 12 times, most recently from 24c1e37 to f883438 Compare August 1, 2021 18:18
@Enmk
Copy link
Copy Markdown
Contributor

Enmk commented Aug 1, 2021

Required for #22415

@vitlibar vitlibar force-pushed the refactor-sessions branch 9 times, most recently from de75532 to 90e40d3 Compare August 3, 2021 05:26
@vitlibar vitlibar force-pushed the refactor-sessions branch 4 times, most recently from 09b62ab to 25db9fc Compare August 6, 2021 11:35
@vitlibar vitlibar marked this pull request as ready for review August 6, 2021 17:35
@vitlibar vitlibar changed the title [WIP] Refactor sessions Refactor sessions Aug 6, 2021
@vitlibar vitlibar force-pushed the refactor-sessions branch 13 times, most recently from 4bc5c1d to 660ce8b Compare August 15, 2021 08:02
@vitlibar vitlibar force-pushed the refactor-sessions branch 3 times, most recently from 3b262d6 to f7e9cae Compare August 15, 2021 13:29
@vitlibar vitlibar changed the title Refactor sessions Introduce sessions Aug 15, 2021
Enmk and others added 2 commits August 18, 2021 14:24
This is required to add system.session_log table.
@vitlibar vitlibar merged commit 65ee9a1 into ClickHouse:master Aug 18, 2021
@vitlibar vitlibar deleted the refactor-sessions branch August 18, 2021 22:38
@alexey-milovidov alexey-milovidov mentioned this pull request Aug 19, 2021
2 tasks
azat added a commit to azat/ClickHouse that referenced this pull request Sep 26, 2021
Before this patch:

    $ clickhouse-client --database foo -q 'select 1'
    Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000. (ATTEMPT_TO_READ_AFTER_EOF)

After:

    $ clickhouse-client --database foo -q 'select 1'
    Received exception from server (version 21.11.1):
    Code: 81. DB::Exception: Received from localhost:9000. DB::Exception: Database foo doesn't exist. (UNKNOWN_DATABASE)
    (query: select 1)

Fixes: ClickHouse#26864 (cc @vitlibar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants