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

Select from system tables when table based on table function. #55540

Merged
merged 7 commits into from Nov 9, 2023

Conversation

MikhailBurdukov
Copy link
Contributor

@MikhailBurdukov MikhailBurdukov commented Oct 12, 2023

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Prevent reference to a remote data source for the data_paths column in system.tables if the table is created with a table function using explicit column description.

Example:

CREATE table test_pg (id Int, value Int) AS postgresql('localhost:5432', 'test_db', 'test_table', 'test1', '123456')

SELECT data_paths FROM system.tables WHERE name='test_pg'

Result:

┌─data_paths─┐
│ []         │
└────────────┘

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Oct 12, 2023
@robot-clickhouse
Copy link
Member

robot-clickhouse commented Oct 12, 2023

This is an automated comment for commit 517ce45 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
Bugfix validate checkChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ success
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker image for serversThe check to build and optionally push the mentioned image to docker hub✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub✅ success
SQLTestThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
SQLancerFuzzing tests that detect logical bugs with SQLancer tool✅ success
SqllogicRun clickhouse on the sqllogic test set against sqlite and checks that all statements are passed✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help❌ failure
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure

@antaljanosbenjamin antaljanosbenjamin self-assigned this Oct 12, 2023
@@ -152,7 +152,7 @@ class StorageProxy : public IStorage
CheckResults checkData(const ASTPtr & query, ContextPtr context) override { return getNested()->checkData(query, context); }
void checkTableCanBeDropped([[ maybe_unused ]] ContextPtr query_context) const override { getNested()->checkTableCanBeDropped(query_context); }
bool storesDataOnDisk() const override { return getNested()->storesDataOnDisk(); }
Strings getDataPaths() const override { return getNested()->getDataPaths(); }
Strings getDataPaths() const override { return {}; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it will return wrong result

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understood StorageProxy keeps tables based on table functions and with StorageMaterializedMySQL engine. Seems like the second one might have its own data. Can we always return empty value for StorageTableFunctionProxy class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, see, for example, table function file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file function have not empty value:

CREATE TABLE test_file AS file('test.tsv', 'TSV', 'column1 UInt32, column2 UInt32, column3 UInt32')
SELECT * FROM system.tables WHERE name='test_file'\G
Query id: a3de9511-6340-463a-a349-fabe502285c9

Row 1:
──────
data_paths: ['/var/lib/clickhouse/user_files/test.tsv']

Will look for different solution.

@antaljanosbenjamin
Copy link
Member

I am trying to understand the change, but the test succeeds on my machine even without your changes. The data_paths fields is an empty array.

I am not super familiar with the implementation of postgres/mysql table functions, that's why I was happy to review this PR, so I can learn.

As far as I can see in case of PostgreSQL/MySQL, the StorageProxy::getNested() will return StoragePostgreSQL/StorageMySQL. As none of them override the default implementation of getDataPaths, in IStorage, I don't see how the data_paths would contain anything but an empty array.

The sources I used to collect the above informations:

  1. ITableFunction.cpp: the implementation of get_storage just call executeImpl of the table function.
  2. TableFunctionPostgreSQL: the implementation of executeImpl returns a StoragePostgreSQL object
  3. StoragePostgreSQL.h: it doesn't override getDataPaths()

Do I miss something?

@MikhailBurdukov
Copy link
Contributor Author

The motivation of this PR is to make selecting the data_paths column without throwing the exception is cases when source of the data is table function.

but the test succeeds on my machine even without your changes

This is strange. Have tested with build from the master branch:

git log 
commit ebfad5c8b886aafbea656e7fbecff277b6e801fe (origin/master, origin/HEAD, master)
Merge: e64abfc557e db1b9408f39
Author: Alexander Tokmakov <tavplubix@clickhouse.com>
Date:   Fri Oct 13 13:07:28 2023 +0200

    Merge pull request #55587 from azat/fix-replica-group
    
    Fix replica groups for Replicated database engine

commit db1b9408f398634eddbf7c50418872805ee57dd3
Author: Azat Khuzhin <a3at.mail@gmail.com>
Date:   Fri Oct 13 12:25:33 2023 +0200

    Fix replica groups for Replicated database engine
    
    Should fix 02447_drop_database_replica test
    
    Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

commit e64abfc557e7595a7801eae29ccb12153bc7f7f4
Merge: 8a1363bcf11 3aac663bd26
Author: vdimir <vdimir@clickhouse.com>
Date:   Fri Oct 13 12:29:58 2023 +0200

    Merge pull request #49555 from ClickHouse/vdimir/analyzer_fix_join_tests
    
    Fixing join tests with analyzer

Also with the latest ClickHouse build from curl https://clickhouse.com/ | sh
The result is the same:

PATH=/data/disk2/home/mburdukov/workspace/clickhouse_test:$PATH ./tests/clickhouse-test 02888_system_tables_with_inaccsessible_table_function
Using queries from '/data/disk2/home/mburdukov/workspace/clickhouse_src/tests/queries' directory
Connecting to ClickHouse server... OK

Running 1 stateless tests (MainProcess).

02888_system_tables_with_inaccsessible_table_function:                  [ FAIL ] - return code: 102
[mburdukov] 2023.10.17 10:00:22.760461 [ 2904597 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> PostgreSQLConnectionPool: Connection error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

[mburdukov] 2023.10.17 10:00:22.769409 [ 2904597 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> PostgreSQLConnectionPool: Connection error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

[mburdukov] 2023.10.17 10:00:22.769557 [ 2904597 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> PostgreSQLConnectionPool: Connection error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

[mburdukov] 2023.10.17 10:00:22.769662 [ 2904597 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> PostgreSQLConnectionPool: Connection error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

[mburdukov] 2023.10.17 10:00:22.769758 [ 2904597 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> PostgreSQLConnectionPool: Connection error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

[mburdukov] 2023.10.17 10:00:22.776743 [ 2904205 ] {306d1b9b-a8b4-4756-8aad-a992738e127f} <Error> executeQuery: Code: 614. DB::Exception: Try 5. Connection to `127.121.0.1:5432` failed with error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

: While executing Tables. (POSTGRESQL_CONNECTION_FAILURE) (version 23.10.1.1018 (official build)) (from [::1]:33352) (comment: 02888_system_tables_with_inaccsessible_table_function.sql) (in query: SELECT name, engine, engine_full, create_table_query, data_paths, notEmpty([metadata_path]), notEmpty([uuid]) FROM system.tables WHERE name like '%tablefunc%' and database=currentDatabase() ORDER BY metadata_modification_time;), Stack trace (when copying this message, always include the lines below):

0. ./build_docker/./src/Common/Exception.cpp:103: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000c7944b7 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
1. ./build_docker/./contrib/llvm-project/libcxx/include/string:1499: DB::Exception::Exception(PreformattedMessage const&, int) @ 0x0000000010b1dacc in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
2. ./build_docker/./src/Core/PostgreSQL/PoolWithFailover.cpp:135: postgres::PoolWithFailover::get() @ 0x0000000010efda4b in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
3. ./build_docker/./src/Storages/StoragePostgreSQL.cpp:98: DB::StoragePostgreSQL::getTableStructureFromData(std::shared_ptr<postgres::PoolWithFailover> const&, String const&, String const&, std::shared_ptr<DB::Context const> const&) @ 0x000000001294d907 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
4. ./build_docker/./src/Storages/StoragePostgreSQL.cpp:0: DB::StoragePostgreSQL::StoragePostgreSQL(DB::StorageID const&, std::shared_ptr<postgres::PoolWithFailover>, String const&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, String const&, std::shared_ptr<DB::Context const>, String const&, String const&) @ 0x000000001294d3e0 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
5. ./build_docker/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:1460: std::shared_ptr<DB::StoragePostgreSQL> std::allocate_shared[abi:v15000]<DB::StoragePostgreSQL, std::allocator<DB::StoragePostgreSQL>, DB::StorageID, std::shared_ptr<postgres::PoolWithFailover> const&, String const&, DB::ColumnsDescription, DB::ConstraintsDescription, String, std::shared_ptr<DB::Context const>&, String const&, String const&, void>(std::allocator<DB::StoragePostgreSQL> const&, DB::StorageID&&, std::shared_ptr<postgres::PoolWithFailover> const&, String const&, DB::ColumnsDescription&&, DB::ConstraintsDescription&&, String&&, std::shared_ptr<DB::Context const>&, String const&, String const&) @ 0x0000000010b6ff5a in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
6. ./build_docker/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:962: DB::TableFunctionPostgreSQL::executeImpl(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>, String const&, DB::ColumnsDescription, bool) const @ 0x0000000010b6ee81 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
7. ./build_docker/./src/TableFunctions/ITableFunction.cpp:45: std::shared_ptr<DB::IStorage> std::__function::__policy_invoker<std::shared_ptr<DB::IStorage> ()>::__call_impl<std::__function::__default_alloc_func<DB::ITableFunction::execute(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const>, String const&, DB::ColumnsDescription, bool, bool) const::$_0, std::shared_ptr<DB::IStorage> ()>>(std::__function::__policy_storage const*) @ 0x0000000010dc8087 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
8. ./build_docker/./src/Storages/StorageTableFunction.h:44: DB::StorageTableFunctionProxy::getNestedImpl() const @ 0x0000000010dcbdf0 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
9. ./build_docker/./src/Storages/StorageProxy.h:155: DB::StorageProxy::getDataPaths() const @ 0x0000000010dcb798 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
10. ./build_docker/./contrib/llvm-project/libcxx/include/vector:537: DB::TablesBlockSource::generate() @ 0x0000000010beac82 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
11. ./build_docker/./src/Processors/Chunk.h:90: DB::ISource::tryGenerate() @ 0x00000000133a9fd8 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
12. ./build_docker/./contrib/llvm-project/libcxx/include/optional:344: DB::ISource::work() @ 0x00000000133a9b0a in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
13. ./build_docker/./src/Processors/Executors/ExecutionThreadContext.cpp:0: DB::ExecutionThreadContext::executeTask() @ 0x00000000133c19da in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
14. ./build_docker/./src/Processors/Executors/PipelineExecutor.cpp:273: DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x00000000133b8490 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
15. ./build_docker/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:701: DB::PipelineExecutor::execute(unsigned long, bool) @ 0x00000000133b7720 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
16. ./build_docker/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:0: void std::__function::__policy_invoker<void ()>::__call_impl<std::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>>(std::__function::__policy_storage const*) @ 0x00000000133c53ef in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
17. ./build_docker/./base/base/../base/wide_integer_impl.h:809: void* std::__thread_proxy[abi:v15000]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void ThreadPoolImpl<std::thread>::scheduleImpl<void>(std::function<void ()>, Priority, std::optional<unsigned long>, bool)::'lambda0'()>>(void*) @ 0x000000000c87df67 in /data/disk2/home/mburdukov/workspace/clickhouse_test/clickhouse
18. ? @ 0x00007ff7fb843ac3 in ?
19. ? @ 0x00007ff7fb8d5a40 in ?

Received exception from server (version 23.10.1):
Code: 614. DB::Exception: Received from localhost:9000. DB::Exception: Try 5. Connection to `127.121.0.1:5432` failed with error: connection to server at "127.121.0.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

: While executing Tables. (POSTGRESQL_CONNECTION_FAILURE)
(query: SELECT name, engine, engine_full, create_table_query, data_paths, notEmpty([metadata_path]), notEmpty([uuid])
    FROM system.tables
    WHERE name like '%tablefunc%' and database=currentDatabase()
    ORDER BY metadata_modification_time;)
, result:



stdout:

As none of them override the default implementation of getDataPaths

Yes. The problem is to get the data_paths field StoragePostgeSQL/StorageMySQL class is required. If in the Create ... AS postgresql/mysql(...) statement schema is not specified then we will try to get it from the source in the class constructor( Here for example ). As a result, we will get an exception because the source of the table is unreachable.

@antaljanosbenjamin
Copy link
Member

This is strange. Have tested with build from the master branch:

Okay, based on your example I assume you mean when the data source is not available, right? Because in that case I noticed that issue. It wasn't clear for me from the description of the PR. Thanks for the clarification.

I will try to think about this, but cannot promise anything.

@MikhailBurdukov
Copy link
Contributor Author

@antaljanosbenjamin Hi! Could you review the PR? Thx in advance!

Copy link
Member

@antaljanosbenjamin antaljanosbenjamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed your last commit. Thanks for pinging.

if (nested)
return nested->getName();
return StorageProxy::getName();
return getNested()->getName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change really necessary? It has the consequence of starting up the nested storage and also call renameInMemory compared to previous version. What is the reasoning behind it?

Second, if it stays as is, you don't need to lock the nested_mutex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind it?

Without these changes, the first selection of the engine row from system.tables will return StorageProxy, instead of the actual engine name, because nested class does not created. And also does not matter remote source accessible or not.
Example:

CREATE table test_pg (id Int, value Int) AS postgresql('localhost:5432', 'test_db', 'test_table', 'test1', '123456')
SELECT engine FROM system.tables WHERE name='test_pg'\G

Row 1:
──────
engine: StorageProxy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second, if it stays as is, you don't need to lock the nested_mutex.

Yeh, will fix this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR it was intentionally done like this to avoid constructing a nested storage just to get its type. mostly because we may fail to construct it because the remote source may be unavailable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted it in the last commit

@@ -0,0 +1,34 @@
-- Tags: no-fasttest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it is not suitable for fasttest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understood table function disabled in the Fasttest. In the first commit CI failed because of:

 executeQuery: Code: 46. DB::Exception: Unknown table function postgresql. (UNKNOWN_FUNCTION)

https://s3.amazonaws.com/clickhouse-test-reports/55540/15956a690dd4d2217e8dde383fc40a308630ba04/fast_test.html

Comment on lines 23 to 28
DETACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;


ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DETACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;
DETACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;
DETACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc03;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02;
ATTACH TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc03;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you modified also TableFunctionSQLite, it is good to check that also in my opinion. It shouldn't hurt the test but the extra checks can find some errors (if there is any).

Comment on lines 11 to 15
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc04 (a int) AS mongodb('127.0.0.1:27017','test', 'my_collection', 'test_user', 'password', 'a Int');
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc05 (a int) AS redis('127.0.0.1:6379', 'key', 'key UInt32');

CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01_without_schema AS postgresql('127.121.0.1:5432', 'postgres_db', 'postgres_table', 'postgres_user', '124444'); -- { serverError 614 }
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02_without_schema AS mysql('127.123.0.1:3306', 'mysql_db', 'mysql_table', 'mysql_user','123123'); -- {serverError 279 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc04 (a int) AS mongodb('127.0.0.1:27017','test', 'my_collection', 'test_user', 'password', 'a Int');
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc05 (a int) AS redis('127.0.0.1:6379', 'key', 'key UInt32');
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01_without_schema AS postgresql('127.121.0.1:5432', 'postgres_db', 'postgres_table', 'postgres_user', '124444'); -- { serverError 614 }
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02_without_schema AS mysql('127.123.0.1:3306', 'mysql_db', 'mysql_table', 'mysql_user','123123'); -- {serverError 279 }
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc04 (a int) AS mongodb('127.0.0.1:27017','test', 'my_collection', 'test_user', 'password', 'a Int');
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc05 (a int) AS redis('127.0.0.1:6379', 'key', 'key UInt32');
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc01_without_schema AS postgresql('127.121.0.1:5432', 'postgres_db', 'postgres_table', 'postgres_user', '124444'); -- { serverError 614 }
CREATE TABLE {CLICKHOUSE_DATABASE:Identifier}.tablefunc02_without_schema AS mysql('127.123.0.1:3306', 'mysql_db', 'mysql_table', 'mysql_user','123123'); -- {serverError 279 }

Just tiny cosmetic changes, only necessary if you modify anything, otherwise it doesn't worth to run the CI again just because of these.

@antaljanosbenjamin
Copy link
Member

Maybe one more thing. The changelog item is not the best in my opinion:

if the table is created using `AS table_func'.
I think the important part is the presence of schema when using the table functions. I would rephrase that to something like this:
if the table is created with a table function using explicit column description.

@MikhailBurdukov
Copy link
Contributor Author

@antaljanosbenjamin ping

@tavplubix tavplubix self-assigned this Nov 8, 2023
@tavplubix tavplubix merged commit c391527 into ClickHouse:master Nov 9, 2023
270 of 277 checks passed
@Alex-Burmak
Copy link
Contributor

@tavplubix, propose to back port the fix to supported ClickHouse versions. Thanks in advance!

@tavplubix tavplubix added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Nov 10, 2023
robot-ch-test-poll2 added a commit that referenced this pull request Nov 10, 2023
…462f6499f076cbeee887046694e3e

Cherry pick #55540 to 23.8: Select from system tables when table based on table function.
robot-clickhouse added a commit that referenced this pull request Nov 10, 2023
robot-ch-test-poll2 added a commit that referenced this pull request Nov 10, 2023
…462f6499f076cbeee887046694e3e

Cherry pick #55540 to 23.9: Select from system tables when table based on table function.
robot-clickhouse added a commit that referenced this pull request Nov 10, 2023
robot-ch-test-poll2 added a commit that referenced this pull request Nov 10, 2023
…3462f6499f076cbeee887046694e3e

Cherry pick #55540 to 23.10: Select from system tables when table based on table function.
robot-clickhouse added a commit that referenced this pull request Nov 10, 2023
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 10, 2023
alexey-milovidov added a commit that referenced this pull request Nov 11, 2023
Backport #55540 to 23.10: Select from system tables when table based on table function.
alexey-milovidov added a commit that referenced this pull request Nov 11, 2023
Backport #55540 to 23.9: Select from system tables when table based on table function.
alexey-milovidov added a commit that referenced this pull request Nov 11, 2023
Backport #55540 to 23.8: Select from system tables when table based on table function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants