Commit Graph

1562 Commits

Author SHA1 Message Date
Raúl Marín
b269f87f4c Better text_log with ErrnoException 2023-12-15 19:27:56 +01:00
Yarik Briukhovetskyi
325374c68b
Merge pull request #57342 from bharatnc/ncb/better-hint-if-table-doesnt-exist
provide a better hint if a table doesn't exist
2023-12-15 12:35:13 +01:00
Кирилл Гарбар
e000e0b561 Quotes in include 2023-12-14 23:21:03 +03:00
Кирилл Гарбар
8623a30448 Load MT table as RMT instead of creating new one 2023-12-14 23:19:39 +03:00
Bharat Nallan Chakravarthy
daef2febf3 Merge with 'upstream/master' 2023-12-14 11:19:44 -08:00
joelynch
b4bef78e63
bugfix: addresses_expr ignored for psql named collections 2023-12-14 17:17:14 +01:00
Raúl Marín
efcacd3c34 Merge remote-tracking branch 'blessed/master' into backup_1 2023-12-14 11:08:50 +01:00
Azat Khuzhin
0e86e16a01
Revert "Replace --no-system-tables with loading virtual tables of system database lazily" 2023-12-14 09:07:47 +01:00
jsc0218
78773157b6
Merge pull request #57436 from ryanmjacobs/fix_issue_43186_pg_quote_array_ndims
Fix several issues regarding PostgreSQL `array_ndims` usage.
2023-12-13 13:41:43 -05:00
Raúl Marín
dd405a655e Merge remote-tracking branch 'blessed/master' into backup_1 2023-12-13 13:39:58 +01:00
Kseniia Sumarokova
b1325450e9
Merge pull request #57754 from ClickHouse/fix-loading-dependent-table-materialized-postgresql
Table engine MaterializedPostgreSQL fix dependency loading
2023-12-13 12:17:01 +01:00
Han Fei
a96593c8b1 Merge branch 'master' into feature/more_warnings 2023-12-12 15:25:01 +01:00
Ryan Jacobs
40da568ef9
Merge branch 'master' into fix_issue_43186_pg_quote_array_ndims 2023-12-11 11:17:38 -08:00
kssenii
05e56f76ed Merge remote-tracking branch 'origin/master' into fix-loading-dependent-table-materialized-postgresql 2023-12-11 20:17:26 +01:00
kssenii
76be22e8e8 Fix build without libpqxx 2023-12-11 20:16:13 +01:00
serxa
c1537a8757 Merge branch 'master' into dependency-failure 2023-12-11 16:53:47 +00:00
kssenii
48ce040621 Fix 2023-12-11 17:30:23 +01:00
Raúl Marín
a55a0c068e Merge remote-tracking branch 'blessed/master' into backup_1 2023-12-11 15:27:21 +01:00
kssenii
a06179da00 Merge remote-tracking branch 'origin/master' into fix-materialized-pg-issue-with-generated-columns 2023-12-11 11:15:00 +01:00
Azat Khuzhin
2707e38c69 Fix dead-lock in DatabaseMaterializedPostgreSQL after interface changes
Deadlock for ATTACH:

    /src/ch/clickhouse/src/Common/ThreadFuzzer.cpp:0::pthread_mutex_lock
    /src/ch/clickhouse/contrib/llvm-project/libcxx/src/mutex.cpp:39::std::__1::mutex::lock()
    /src/ch/clickhouse/src/Databases/DatabaseOrdinary.cpp:240::DB::DatabaseOrdinary::waitTableStarted(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const
    /src/ch/clickhouse/src/Databases/DatabasesCommon.cpp:203::DB::DatabaseWithOwnTablesBase::tryGetTable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context const>) const
    /src/ch/clickhouse/src/Databases/PostgreSQL/DatabaseMaterializedPostgreSQL.cpp:335::DB::DatabaseMaterializedPostgreSQL::attachTableUnlocked(std::__1::shared_ptr<DB::Context const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::IStorage> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
    /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__mutex_base💯:DB::IDatabase::attachTable(std::__1::shared_ptr<DB::Context const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::IStorage> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
    /src/ch/clickhouse/contrib/llvm-project/libcxx/include/string:1499::DB::DatabaseMaterializedPostgreSQL::createTable(std::__1::shared_ptr<DB::Context const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::IStorage> const&, std::__1::shared_ptr<DB::IAST> const&)
    /src/ch/clickhouse/contrib/llvm-project/libcxx/include/string:1499::DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&, std::__1::unique_ptr<DB::DDLGuard, std::__1::default_delete<DB::DDLGuard>>&)
    /src/ch/clickhouse/src/Interpreters/InterpreterCreateQuery.cpp:0::DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&)
    /src/ch/clickhouse/src/Interpreters/InterpreterCreateQuery.cpp:1751::DB::InterpreterCreateQuery::execute()
    /src/ch/clickhouse/src/Interpreters/executeQuery.cpp:0::DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*)
    /src/ch/clickhouse/src/Interpreters/executeQuery.cpp:1287::DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum)
    /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:612::DB::TCPHandler::runImpl()
    /src/ch/clickhouse/src/Server/TCPHandler.cpp:2294::DB::TCPHandler::run()
    /src/ch/clickhouse/base/poco/Net/src/TCPServerConnection.cpp:57::Poco::Net::TCPServerConnection::start()
    /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48::Poco::Net::TCPServerDispatcher::run()
    /src/ch/clickhouse/base/poco/Foundation/src/ThreadPool.cpp:202::Poco::PooledThread::run()
    /src/ch/clickhouse/base/poco/Foundation/include/Poco/SharedPtr.h:139::Poco::ThreadImpl::runnableEntry(void*)

CI: https://s3.amazonaws.com/clickhouse-test-reports/55271/ece8c86ebc02908e36786ca32d68f9ce0ddcb35d/integration_tests__tsan__[1_6].html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-10 16:06:18 +01:00
Azat Khuzhin
ece8c86ebc Fix attaching table in Atomic engine after attachTableUnlocked() interface 2023-12-10 08:28:10 +01:00
Azat Khuzhin
c14721bb03 Move lazy table initialization interface into IDatabase
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 23:08:29 +01:00
Azat Khuzhin
f75484a0b1 Make IDatabase::attachTableUnlocked() virtual and use it for overrides (mostly) 2023-12-09 23:08:29 +01:00
Azat Khuzhin
cc9afe6f6e Replace --no-system-tables with loading virtual tables of system database lazily
First of all the problem is that that simple 'SELECT 1' cannot be runned
without system.one, which makes --no-system-tables almost useless:

    $ ./clickhouse-debug local --no-system-tables -q "select 1"
    Code: 81. DB::Exception: Database system does not exist. (UNKNOWN_DATABASE)

Secondly there are just too much flags, and this one
(--no-system-tables) is too damn specific.

This patch should improve startup time of the clickhouse-local almost
3x in debug builds.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 23:08:29 +01:00
serxa
58138861ba fix style 2023-12-08 22:34:47 +00:00
serxa
1e7407f82c Customazable dependency failure handling for AsyncLoader 2023-12-08 20:14:55 +00:00
kssenii
ffd0d16f79 Merge remote-tracking branch 'origin/master' into fix-materialized-pg-issue-with-generated-columns 2023-12-08 12:42:21 +01:00
Mike Kot
4ef9065567 fix conversion error while getting psql table structure for empty array 2023-12-07 13:38:32 +00:00
凌涛
d0675488ac rebase 2023-12-07 11:14:55 +08:00
Ryan Jacobs
6a698d9480
clang-tidy 2023-12-06 18:56:54 -08:00
Ryan Jacobs
b57340bde2
postgresql integration: Throw errors instead of assuming array_ndim == 1 2023-12-06 11:54:45 -08:00
Kseniia Sumarokova
9d8e3f8bd9
Update fetchPostgreSQLTableStructure.cpp 2023-12-06 16:47:58 +01:00
kssenii
806061642a Support GENERATED and DEFAULT columns 2023-12-06 15:01:43 +01:00
凌涛
9e05e79d66
Merge branch 'master' into feature/more_warnings 2023-12-05 11:50:05 +08:00
Alexey Milovidov
02439eee58
Merge pull request #49351 from ClickHouse/async-loader-integration
Asynchronous loading of tables
2023-12-04 17:16:12 +01:00
Ryan Jacobs
17aacda9e5
fix: format code for stylecheck 2023-12-02 06:46:16 -08:00
Bharat Nallan Chakravarthy
efbf39ea06 improve TableNameHints 2023-12-02 00:45:21 -08:00
Ryan Jacobs
a90458eb65
Fix several issues regarding PostgreSQL array_ndims usage.
1. Properly quote column identifiers.
2. Handle empty tables that have array columns.
3. Throw a more user friendly error when column value = NULL
   when calling array_dims(column)
4. Handle column value being the empty array {}
2023-12-01 13:15:24 -08:00
凌涛
0b3cfcc8d4
Update DatabaseLazy.cpp 2023-12-01 11:23:31 +08:00
凌涛
2ae934ec05
Update DatabasesCommon.cpp 2023-12-01 10:51:32 +08:00
Vitaly Baranov
1bc1563e0e Stop using INCONSISTENT_METADATA_FOR_BACKUP that much. If possible prefer to continue scanning instead of stopping and starting the scanning for backup again. 2023-11-30 21:37:42 +01:00
凌涛
d9f4b4d2c0 support parts, tables, databases 2023-11-30 10:56:31 +08:00
Alexander Tokmakov
9f849fbe06 fix 2023-11-29 17:12:04 +01:00
Bharat Nallan Chakravarthy
4ca3d0d5c4 better hints when table doesn't exist 2023-11-28 21:34:02 -08:00
Alexander Tokmakov
67f0a0e3e4 don't throw if noop when dropping db replica in batch 2023-11-28 23:57:55 +01:00
serxa
8d8418ada8 get rid of defaults to make clang-tidy happy 2023-11-28 18:21:47 +00:00
凌涛
98a03ac36c support table 2023-11-28 18:28:29 +08:00
serxa
9d6a9d3573 do not rethrow load errors during db shutdown 2023-11-26 19:31:39 +00:00
Alexey Milovidov
9fa112af9a
Merge pull request #53721 from takakawa/possible_wrong_type_conversion_bugfix
[bugfix] possible postgresql logical replication error: wrong type conversion
2023-11-26 02:48:24 +01:00
serxa
6937c0de19 wait for database to load before shutdown 2023-11-25 15:42:37 +00:00
serxa
0fc25fbda8 Merge branch 'master' into async-loader-integration 2023-11-23 09:32:43 +00:00
Raúl Marín
281060329f Merge remote-tracking branch 'blessed/master' into backup_1 2023-11-22 10:35:18 +01:00
Raúl Marín
a1bb31525a
Merge pull request #57029 from ClickHouse/fix_DatabaseFilesystem_path_validation
Fix file path validation for DatabaseFileSystem
2023-11-22 09:19:19 +01:00
santrancisco
f4d936fc55
Fix style 2023-11-21 17:39:12 +11:00
santrancisco
3eef0601e3
Fix file path validation for DatabaseFileSystem 2023-11-21 16:29:40 +11:00
Raúl Marín
44874859bb Fix style 2023-11-20 12:21:12 +01:00
Raúl Marín
aadb786b2b Merge remote-tracking branch 'blessed/master' into backup_1 2023-11-20 10:53:31 +01:00
santrancisco
f05f572b3c
Fixed trailing whitespace 2023-11-20 13:37:27 +11:00
santrancisco
ab5f3d12b6
Fix sqlite file path validation to make sure it does not skip validation on relative path 2023-11-20 12:51:30 +11:00
serxa
9023f61349 Merge branch 'master' into async-loader-integration 2023-11-19 13:05:58 +00:00
Alexey Milovidov
09f263e281
Update fetchPostgreSQLTableStructure.cpp 2023-11-19 13:20:01 +03:00
Alexey Milovidov
d56cbda185 Add metrics for the number of queued jobs, which is useful for the IO thread pool 2023-11-18 19:07:59 +01:00
Nikolay Degterinsky
3828131dc6
Merge pull request #56828 from evillique/fix-joinget-dependency
Fix failure to start due to table dependency in joinGet
2023-11-18 15:18:22 +01:00
Raúl Marín
210a0ee045 Merge remote-tracking branch 'blessed/master' into backup_1 2023-11-17 18:50:24 +01:00
Alexander Tokmakov
ac31007475
Update DatabaseReplicated.cpp (#56796) 2023-11-16 21:00:39 +01:00
Raúl Marín
19931fee67 Prepare the introduction of more keeper faults 2023-11-16 15:46:39 +01:00
Nikolay Degterinsky
1d7eecaeec Fix failure to start due to table dependency in joinGet 2023-11-16 06:08:12 +00:00
Alexey Milovidov
9bf62dd622 Remove orphan header files 2023-11-14 07:43:11 +01:00
Nikolay Degterinsky
02ce2a0e83
Merge pull request #56489 from evillique/fix-drop-ttl-dependency
Fix startup failure due to TTL dependency
2023-11-13 17:40:19 +01:00
Kseniia Sumarokova
d3b6310fe1
Merge pull request #56609 from jsc0218/LessAggressiveRescheduleWithUnsuccessfulConn
Less aggressive reschedule with unavailable conn of PG
2023-11-13 09:01:23 +01:00
jsc0218
9c954046af style fix again 2023-11-12 23:23:56 +00:00
jsc0218
c63a6f5cf5 change comment style 2023-11-12 19:31:38 +00:00
Robert Schulze
3f49e1c5ed
Merge remote-tracking branch 'rschu1ze/master' into pcg 2023-11-12 11:43:19 +00:00
jsc0218
b5a79b1bda less aggressive reschedule when unavailable connection exists, to avoid repeated interrupting other normal routines 2023-11-11 02:20:58 +00:00
Nikolay Degterinsky
05945ff80d
Merge pull request #56486 from evillique/fix-replicated-database-cluster-port
Fix default port for Replicated database cluster
2023-11-10 13:37:45 +01:00
Kseniia Sumarokova
ecd98006ce
Merge pull request #56306 from ClickHouse/fix-backup-restore-flatten-nested
Fix restore from backup with `flatten_nested` and `data_type_default_nullable`
2023-11-10 11:43:17 +01:00
kssenii
41a880e57c Review fix 2023-11-09 16:03:51 +01:00
Nikolay Degterinsky
895ab2e57a
Fix style 2023-11-09 06:06:26 +01:00
Nikolay Degterinsky
44eb73980f Fix startup failure due to TTL dependency 2023-11-09 04:31:49 +00:00
Nikolay Degterinsky
881dde00b2 Fix default port for Replicated database cluster 2023-11-08 23:40:54 +00:00
Robert Schulze
e46dbcb2f1
Use pcg/randomSeed() random generator/seed instead of std::mt19937/std::random_device 2023-11-07 18:54:50 +00:00
kssenii
9178fd4ad1 Fix case with replicated database 2023-11-07 16:02:51 +01:00
serxa
19aa1375fc Merge branch 'master' into async-loader-integration 2023-11-07 10:25:38 +00:00
serxa
d50747847d rework AsyncLoaderPoolId.h to match settings and metrics 2023-11-06 13:08:27 +00:00
serxa
7e220182eb better 2023-11-03 16:41:32 +00:00
kssenii
ea5796fcb6 Fix 2023-11-03 16:46:55 +01:00
serxa
d0b93d90c7 wait for db to be started iff it was async-started 2023-11-03 15:31:32 +00:00
serxa
9f954ece81 fix 2023-11-02 14:55:53 +00:00
Alexander Tokmakov
977380b171
Update DatabaseReplicated.cpp 2023-11-01 19:53:08 +01:00
serxa
59c0f4c652 remove wrong waits 2023-10-27 10:45:39 +00:00
serxa
be11170a12 implement waits inside tables iterator 2023-10-27 10:08:00 +00:00
Sergei Trifonov
a5d7c2b6a2
Merge branch 'master' into async-loader-integration 2023-10-27 10:39:12 +02:00
Alexander Tokmakov
c588a7f386 Merge branch 'master' into make_code_worse 2023-10-26 17:39:10 +02:00
Alexander Tokmakov
fa963d60d0
Merge pull request #55641 from evillique/resubmit-cluster-groups
Resubmit #54421
2023-10-26 15:53:53 +02:00
Nikolay Degterinsky
d5ee863594 Fix 2023-10-25 19:06:50 +00:00
Nikolay Degterinsky
97c99132e0 Simplify the implementation 2023-10-25 19:02:48 +00:00
Alexander Tokmakov
0f4260bf26 fix some bad code by making it worse 2023-10-25 19:51:51 +02:00
takakawa
fe981ed8db
Merge branch 'ClickHouse:master' into possible_wrong_type_conversion_bugfix 2023-10-25 17:57:58 +08:00
serxa
08e63f2a24 fix build 2023-10-24 21:49:15 +00:00
serxa
02b6497167 get rid of atomics 2023-10-24 12:08:27 +00:00
serxa
749cdb9954 Merge branch 'master' into async-loader-integration 2023-10-24 10:09:49 +00:00
serxa
d3f54a29e3 add startup waits in all DDL queries and global DDL worker 2023-10-24 10:09:10 +00:00
Sergei Trifonov
966f1b6378
Merge pull request #55877 from ClickHouse/serxa-patch-3
Fix digest check in replicated ddl worker
2023-10-23 14:25:20 +02:00
Anton Popov
5819bcd07a
Support asynchronous inserts for native protocol (#54730)
* support async insert for native protocol

* use separate queue for async inserts via native protocol

* fix test

* better logging for async inserts and more tests

* disable mixed internal and external data in async inserts

* fix tests

* fix quota in async inserts

* disable async insert for secondary query of distributed
2023-10-20 18:39:48 +02:00
Sergei Trifonov
fd93bc74bd
Fix digest check in replicated ddl worker 2023-10-20 18:03:16 +02:00
kssenii
4bc32c6387 Fix uncaught exception in background tasj 2023-10-16 17:31:30 +02:00
serxa
0e17da22eb Merge branch 'master' into async-loader-integration 2023-10-16 11:08:29 +00:00
kssenii
3cd175d11d Fix test 2023-10-16 13:01:36 +02:00
Nikolay Degterinsky
b737866d02 Fixes 2023-10-14 19:29:21 +00:00
Nikolay Degterinsky
c1fba94d67 Resubmit #54421
This reverts commit 3e60451ac7.
2023-10-14 19:04:01 +00:00
Kseniia Sumarokova
310e922b40
Merge branch 'master' into materialized-pg-allow-unique-identifier 2023-10-13 19:14:50 +02:00
Alexander Tokmakov
3e60451ac7 Revert "Merge pull request #54421 from evillique/cluster-groups"
This reverts commit 211c80e1a0, reversing
changes made to b53a98217c.
2023-10-13 18:55:51 +02:00
Alexander Tokmakov
83daf766c9 Revert "Merge pull request #55587 from azat/fix-replica-group"
This reverts commit ebfad5c8b8, reversing
changes made to e64abfc557.
2023-10-13 18:55:22 +02:00
Azat Khuzhin
db1b9408f3 Fix replica groups for Replicated database engine
Should fix 02447_drop_database_replica test

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-13 12:32:17 +02:00
robot-clickhouse-ci-1
211c80e1a0
Merge pull request #54421 from evillique/cluster-groups
Add replica groups to Replicated database engine
2023-10-12 18:14:42 +02:00
Nikolay Degterinsky
20e16be27b Fixes & improvements 2023-10-12 15:02:08 +00:00
kssenii
1917a882b7 Better 2023-10-12 16:36:19 +02:00
Vitaly Baranov
d841b8179e
Merge pull request #55060 from vitlibar/fix-detecting-column-default-for-dist-table
Fix detecting DEFAULT for columns of a Distributed table created without AS
2023-09-29 19:54:16 +02:00
kssenii
d1f6888119 Allow unique consumer identifier 2023-09-29 16:17:02 +02:00
Vitaly Baranov
cd2063d154 Fix detecting DEFAULT for a column of a Distributed table created without AS. 2023-09-28 13:00:37 +02:00
Robert Schulze
9fff447716
Re-enable clang-tidy checks 2023-09-26 09:34:12 +00:00
Robert Schulze
f5e8028bb1
Merge pull request #54642 from rschu1ze/broken-re2st
Remove broken lockless variant of re2
2023-09-17 15:30:57 +02:00
robot-ch-test-poll4
5fb8e46967
Merge pull request #54635 from Avogar/cluster-func-names-with-spaces
Fix schema inference for *Cluster functions for column names with spaces
2023-09-15 20:36:33 +02:00
avogar
e647346b36 Better 2023-09-15 11:11:04 +00:00
Robert Schulze
7b378dbad3
Remove broken lockless variant of re2 2023-09-14 16:40:42 +00:00
Sergei Trifonov
12c71be9ca
Merge branch 'master' into async-loader-integration 2023-09-14 15:29:07 +02:00
Val Doroshchuk
6cfbaf9f86 MaterializedMySQL: Introduce Character Set Introducers
If some string literals are used in DDL, they might have `Character Set Introducers`
https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html
f.e. _utf8mb4'1' which is not parsable by current ParserStringLiteral.

Since we use utf8 by default, suggesting to automatically convert the string literals to utf8
before executing the query and avoid any charset introducers there.
Conversion from utf8 to utf8 is not needed and skipped.

Also it might convert double quotes to single quotes if any
which might solve issues with COMMENT and empty string literals "" in DEFAULT expressions.

SELECT _latin1"abc"; -- might be also valid for MySQL
... DEFAULT "",
... COMMENT "abc"

Currently no DEFAULT expressions are supported, not parsable at all,
but using this MR it allows to parse the expressions together with double quotes as string literals.
2023-09-14 08:24:25 +02:00
serxa
fabd23339d fix style 2023-09-13 19:38:26 +00:00
Nikolay Degterinsky
483184cbdb Add cluster groups to Replicated database engine 2023-09-07 16:02:11 +00:00
serxa
a2f8f6bf29 working on review comments 2023-09-07 13:21:43 +00:00
Alexey Gerasimchuck
3a212217a3 Implemented globs to select * from '<file>' 2023-08-31 04:20:44 +00:00
Sergei Trifonov
c10e42ca05
Merge branch 'master' into async-loader-integration 2023-08-28 20:20:31 +02:00
Kseniia Sumarokova
8633b8fbc9
Merge pull request #53832 from kssenii/mat-pg-fix-get-create-table
Materialized postgres: fix uncaught exception in getCreateTableQueryImpl
2023-08-25 18:24:07 +02:00
kssenii
8e3dd4c9d2 Fux 2023-08-25 12:46:28 +02:00
Nikolai Kochetov
ef3489762a Fix typo in cluster name. 2023-08-25 10:00:51 +00:00
root
16275168cb [bugfix] possible postgresql logical replication error: wrong type coversion 2023-08-23 16:13:05 +08:00
Robert Schulze
a20ceef398
Merge pull request #53447 from davvard/master
USearch HNSW index for ANN search
2023-08-21 23:34:26 +02:00
Yarik Briukhovetskyi
af1d23720b
Merge branch 'ClickHouse:master' into fixed_hints_db_name 2023-08-21 13:57:39 +03:00
Nikolay Degterinsky
4c606590a1
Fix tiny thing in Replicated database (#53496)
* Fix tiny thing in Replicated database

* empty commit

---------

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
2023-08-18 17:29:24 +03:00
Davit Vardanyan
ef2957cb91 Add: allow_experimental_usearch_index checks 2023-08-16 17:29:50 +04:00
Alexander Tokmakov
894ec8e0d0 less exceptions with runtime format string 2023-08-14 21:45:59 +02:00
yariks5s
31aa9f459e minor fixes 2023-08-14 09:35:29 +00:00
Alexey Milovidov
a55f9eae84 Merge branch 'master' of github.com:ClickHouse/ClickHouse into allow-creating-system-tables-at-startup 2023-08-11 14:45:03 +02:00
Yarik Briukhovetskyi
a6f89c0546
Added suggestions for mistyped names for db and tables with different… (#49801)
* Added suggestions for mistyped names for db and tables with different scenarios commented

* fixed bugs

* fixed style check

* fixed errors

* fixed errors

* fixed error with exceptions

* fixed exceptions

* fixed exceptions

* fixed exceptions

* added test and fixed bugs

* fixed style check

* fixed style check

* fixed style check

* fixed check black

* Update test.py

* Fixed server crash

* Fixed server crash and style check

* Fixed style check

* Fixed style check

* Fixed style check

* Fixed bugs with drop_db

* fixed fast test

* added tests

* fixed style check

* fixed style check

* fixed bug with lock_db

* fixed bug with lock_db and fixed reviews

* fixed bug with lock_db and fixed reviews

* fixed style check

* fixed fast test

* fixed fast test

* revert to fd582a2

* revert to fd582a2

* Removed unused parameters

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Remove unused parameters

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* resolved arguments issue in assertDatabaseExists

* fixing fast test

* fixed fast test

* fixed stateless test for default db

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Fixing tests.

* resolved problem with mutex

* Fixed mutex in assertDatabaseExists

* changes about assertDatabaseExists

* fixed bugs with file types

* fixed string types

* fixed fast test

* fixed mutex

* fixed mutex

* fixed style check

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update src/Interpreters/DatabaseCatalog.cpp

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* fixed build

* added -unlocked versions of functions

* Revert "fixed build"

This reverts commit 8ce961be21.

* Revert "fixed build"

This reverts commit 8ce961be21.

* changed usage of assertDatabaseExistsUnlocked()

* fixed style check

* style check

* style check

* Revert "style check"

This reverts commit 28a9ee85a0.

* Merge branch 'master' into hints-for-wrong-db-or-table-name

* Changed AssertDatabaseExists and unified exception output

* resolved proposed changes and modified tests

* Revert "resolved proposed changes and modified tests"

This reverts commit d45337d65c.

* resolved requested changes

* fixed tests

* fixed tests

* fixed check black

* Update include brackets

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>

* Update suggested changes

* Update suggested changes

* Fixed style check

* Added test to analyzer_integration_broken

* Update DatabaseCatalog.cpp

* Update test.py

* fixed test

* Revert "fixed test"

This reverts commit ca6d4c17c8.

* fixed test

* Revert "fixed test"

This reverts commit fe6d0d9c86, reversing
changes made to 22f4496704.

* Update test.py

* fixed black check

* Update test.py

* fixed long_log_tinylog_deadlock_race

* Update DatabaseCatalog.cpp

* Update test.py

* style

* Update DatabaseCatalog.cpp

* Fixed test

* implemented for IDatabase

* Style check

* removed const_cast

* Update DatabaseCatalog.h

* Update DatabaseCatalog.h

* Update DatabaseCatalog.cpp

* Update DatabaseCatalog.cpp

* Added db name to hints

* Update 00002_log_and_exception_messages_formatting.sql

* Update 00002_log_and_exception_messages_formatting.sql

---------

Co-authored-by: Yakov Olkhovskiy <99031427+yakov-olkhovskiy@users.noreply.github.com>
2023-08-11 13:24:16 +03:00
Alexey Milovidov
736ff1c127 Merge branch 'master' into allow-creating-system-tables-at-startup 2023-08-11 01:25:49 +02:00
Alexander Tokmakov
48ed54e822
Allow experimantal features when recovering Replicated db replica (#53167)
* allow experimantal features when recovering Replicated db replica

* Automatic style fix

---------

Co-authored-by: robot-clickhouse <robot-clickhouse@users.noreply.github.com>
2023-08-09 14:35:50 +03:00
Sergei Trifonov
f35c68623d
Merge branch 'master' into async-loader-integration 2023-08-07 11:24:19 +02:00
Alexey Milovidov
74a4c9755c Don not produce warning if a system table was created on startup 2023-08-07 02:26:23 +02:00
Sergei Trifonov
432d359a2b
Merge branch 'master' into async-loader-integration 2023-08-04 18:51:06 +02:00
kssenii
4b8b78f220 Revert "Merge pull request #53044 from ClickHouse/revert-52155-database-filesystem-remove-catch"
This reverts commit e71f20891f, reversing
changes made to aa9ab58994.
2023-08-04 12:41:55 +02:00
Alexander Tokmakov
0b312f541a
Revert "Remove try/catch from DatabaseFilesystem" 2023-08-04 13:29:28 +03:00
Kseniia Sumarokova
af610062ec
Merge pull request #52962 from canhld94/fix_mysql_password_leak
Fix password leak in show create mysql table
2023-08-04 10:57:59 +02:00
Alexey Milovidov
95f5d2f37f
Merge pull request #52155 from ClickHouse/database-filesystem-remove-catch
Remove try/catch from DatabaseFilesystem
2023-08-03 23:02:01 +03:00
Alexander Tokmakov
141a3df727 fix 2023-08-03 12:35:14 +02:00
Duc Canh Le
cc7f771093 Fix for postgres as well 2023-08-03 09:15:45 +00:00
Duc Canh Le
06229c1ba6 fix password leak in show create mysql table 2023-08-03 03:50:41 +00:00
Alexander Tokmakov
c4fb0a0cd5 fix two minor issue 2023-08-02 23:36:54 +02:00
Alexey Milovidov
b17e93e78c Merge branch 'master' into database-filesystem-remove-catch 2023-08-02 17:13:12 +02:00
Mike Kot
1335d06b8f
Do not replicate ALTER TABLE t FREEZE on Replicated engine (#52064)
* fix

* do not replicate alter freeze

* fix

---------

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
2023-08-02 14:39:54 +03:00
serxa
7c34fb6a7c fix build 2023-08-01 11:12:23 +00:00
Sergei Trifonov
e4ae2ece7c
Merge branch 'master' into async-loader-integration 2023-08-01 13:04:11 +02:00
Alexey Milovidov
8ce1b87cda Merge branch 'master' of github.com:ClickHouse/ClickHouse into database-filesystem-remove-catch 2023-08-01 07:30:57 +02:00
alesapin
efba3a2113 Add more logging and touch test for materialize mysql 2023-07-31 14:32:09 +02:00
Alexey Milovidov
eae86f603c Fix the test 2023-07-27 06:34:09 +02:00
Alexey Milovidov
f398fe9fe9 Merge branch 'master' into database-filesystem-remove-catch 2023-07-27 05:00:33 +02:00
Alexander Tokmakov
6bbed6262e
Merge branch 'master' into add_delay_for_replicated 2023-07-26 12:48:48 +03:00
Azat Khuzhin
85082ad8f8
Fix data-race DatabaseReplicated::startupTables()/canExecuteReplicatedMetadataAlter() (#52490)
CI founds [1]:

    Exception: Sanitizer assert found for instance ==================
    WARNING: ThreadSanitizer: data race (pid=348)
      Write of size 8 at 0x7b58000044a0 by main thread:
        2 DB::DatabaseReplicated::startupTables(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false>>&, DB::LoadingStrictnessLevel) build_docker/./src/Databases/DatabaseReplicated.cpp:526:16 (clickhouse+0x1ec45092)
        3 DB::TablesLoader::startupTables() build_docker/./src/Databases/TablesLoader.cpp:87:26 (clickhouse+0x1f9258ab) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        4 DB::loadMetadata(std::__1::shared_ptr<DB::Context>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) build_docker/./src/Interpreters/loadMetadata.cpp:234:12 (clickhouse+0x1fff3834) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        5 DB::Server::main() build_docker/./programs/server/Server.cpp:1615:9 (clickhouse+0x163e7f78) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        6 Poco::Util::Application::run() build_docker/./base/poco/Util/src/Application.cpp:315:8 (clickhouse+0x257608fe) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        7 DB::Server::run() build_docker/./programs/server/Server.cpp:391:25 (clickhouse+0x163d7d7c) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        8 Poco::Util::ServerApplication::run(int, char**) build_docker/./base/poco/Util/src/ServerApplication.cpp:131:9 (clickhouse+0x25780114) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        9 mainEntryClickHouseServer(int, char**) build_docker/./programs/server/Server.cpp:196:20 (clickhouse+0x163d4c23) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        10 main build_docker/./programs/main.cpp:487:12 (clickhouse+0xdf8c877) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)

      Previous read of size 8 at 0x7b58000044a0 by thread T27 (mutexes: write M0, write M1):
        1 DB::DatabaseReplicated::canExecuteReplicatedMetadataAlter() const build_docker/./src/Databases/DatabaseReplicated.cpp:1303:12 (clickhouse+0x1ec5c5bd)
        2 DB::ReplicatedMergeTreeQueue::shouldExecuteLogEntry() const build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp:1471:24 (clickhouse+0x2115fb56) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        3 DB::ReplicatedMergeTreeQueue::selectEntryToProcess(DB::MergeTreeDataMergerMutator&, DB::MergeTreeData&) build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp:1676:13 (clickhouse+0x21163c58) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        4 DB::StorageReplicatedMergeTree::selectQueueEntry() build_docker/./src/Storages/StorageReplicatedMergeTree.cpp:3240:26 (clickhouse+0x20823db2) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)
        5 DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&) build_docker/./src/Storages/StorageReplicatedMergeTree.cpp:3304:65 (clickhouse+0x208240fc) (BuildId: 7d4ce55d33d4c3e3df9fd39b304e67e53eb61a63)

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/52395/0b258dda4ee618a4d002e2b5246d68bbd2c77c7e/integration_tests__tsan__[5_6].html

Add ddl_worker_initialized flag to avoid this race.

Note, that it should be enough to check this flag only in
canExecuteReplicatedMetadataAlter() since only it can be run in parallel
with ctor before it had been finished.

v0: initialize ddl before startupTables()
v2: ddl_worker_initialized

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
2023-07-25 17:35:01 +03:00
Alexey Milovidov
3ba47ae0d4 Merge branch 'master' into database-filesystem-remove-catch 2023-07-24 19:53:42 +02:00
Alexander Tokmakov
faca49a905 Merge branch 'master' into add_delay_for_replicated 2023-07-24 16:07:38 +02:00
Val Doroshchuk
efa638ef3c MaterializedMySQL: Support unquoted utf-8 strings in DDL
Since ClickHouse does not support unquoted utf-8 strings but MySQL does.

Instead of fixing Lexer to recognize utf-8 chars as TokenType::BareWord,
suggesting to quote all unrecognized tokens before applying any DDL.

Actual parsing and validating the syntax will be done by particular Parser.

If there is any TokenType::Error, the query is unable to be parsed anyway.
Quoting such tokens can provide the support of utf-8 names.

See `tryQuoteUnrecognizedTokens` and `QuoteUnrecognizedTokensTest`.

mysql> CREATE TABLE 道.渠(...

is converted to

CREATE TABLE `道`.`渠`(...

Also fixed the bug with missing * while doing SELECT in full sync because db or table name are back quoted when not needed.
2023-07-24 11:12:10 +02:00
Azat Khuzhin
8013cb1f78 Remove skip_startup_tables from IDatabase::loadStoredObjects()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-23 08:47:50 +02:00
alesapin
6416fb6eed
Merge branch 'master' into add_delay_for_replicated 2023-07-22 12:11:39 +02:00
Sergei Trifonov
8eaf3b6d94
Merge branch 'master' into async-loader-integration 2023-07-21 21:46:06 +02:00
Nikita Mikhaylov
668062dc29
Merge branch 'master' into no-keep-context-lock-while-calculating-access 2023-07-20 14:42:13 +02:00
Sergei Trifonov
b8a46ff822
Merge branch 'master' into async-loader-integration 2023-07-19 18:45:41 +02:00
serxa
6bca79fdff add auto-resolution for all resolvable deadlock types 2023-07-19 16:19:28 +00:00
Sergei Trifonov
850ab23991
Merge branch 'master' into async-loader-integration 2023-07-17 19:14:54 +02:00
Nikita Mikhaylov
11cc8b4adf
Merge branch 'master' into add_delay_for_replicated 2023-07-17 19:04:29 +02:00
Vitaly Baranov
815a3857de Remove non-const function Context::getClientInfo(). 2023-07-17 15:02:07 +02:00
Val Doroshchuk
4da0782e55 MaterializedMySQL: Add tests to parse db and table names from DDL 2023-07-17 15:01:06 +02:00
Alexey Milovidov
1050fab8de Remove another exception 2023-07-16 23:12:08 +02:00
Alexey Milovidov
72e8303ee7 Remove try/catch from DatabaseFilesystem 2023-07-16 22:49:06 +02:00
Alexander Sapin
30bcc73c63 Merge branch 'master' into add_delay_for_replicated 2023-07-06 14:29:15 +02:00
Alexey Milovidov
5452f2106f
Merge branch 'master' into sunny19930321-fix-attach-table-function-name-normalizer 2023-07-06 03:50:18 +03:00
alesapin
baee73fd96 Make shutdown of replicated tables softer 2023-07-05 18:11:25 +02:00
Sergei Trifonov
bbb5850dec
Merge branch 'master' into async-loader-integration 2023-07-03 20:21:26 +02:00
Kseniia Sumarokova
19508a01a5
Merge branch 'master' into resubmit-51149 2023-07-03 13:12:53 +02:00
Alexey Milovidov
2a7ae8f622
Merge branch 'master' into sunny19930321-fix-attach-table-function-name-normalizer 2023-06-30 12:16:49 +03:00
Alexander Tokmakov
a28728b7e5 Update DatabaseReplicatedWorker.cpp
(cherry picked from commit 43fc1af1b3)
2023-06-29 19:04:49 +02:00
kssenii
44246363e2 Fix test 2023-06-29 15:37:36 +02:00
Alexey Milovidov
a4d7e48bc9
Merge branch 'master' into resubmit-51149 2023-06-29 11:07:01 +03:00
Alexander Tokmakov
1ed104417a fix race between executeMetadataAlter and initializeReplication
(cherry picked from commit 1d47783e85)
2023-06-27 23:24:02 +02:00
serxa
31b4417d34 use current priority for waits from load jobs 2023-06-27 17:44:28 +00:00
Alexey Milovidov
8610ff828e Merge branch 'fix-attach-table-function-name-normalizer' of github.com:sunny19930321/ClickHouse into sunny19930321-fix-attach-table-function-name-normalizer 2023-06-27 07:58:42 +02:00
Sergei Trifonov
e2798b5221
Merge branch 'master' into async-loader-integration 2023-06-26 19:18:23 +02:00
Alexander Tokmakov
8afb8bf13a disable table structure check for secondary queries from Replicated db 2023-06-22 19:06:28 +02:00
Alexander Tokmakov
50ee424148 do not update digest during recovery 2023-06-21 21:07:59 +02:00
Alexander Tokmakov
9240a82c64
Update DatabaseReplicated.cpp 2023-06-21 21:49:00 +03:00
kssenii
0efaecab51 Revert "Merge pull request #51149 from ClickHouse/revert-48821-localfilefunction"
This reverts commit a09e6bbb8e, reversing
changes made to ce38d64c5a.
2023-06-21 00:29:46 +02:00
Sergei Trifonov
02e0d7e204
Merge branch 'master' into async-loader-integration 2023-06-20 12:03:29 +02:00