Commit Graph

53 Commits

Author SHA1 Message Date
Raúl Marín
de855ca917 Reduce header dependencies 2024-03-19 17:04:29 +01:00
vdimir
38b8e7ac7e
Maintain list of ASTRenameQuery children 2024-03-11 11:34:10 +00:00
Bharat Nallan
ee37f551a2
independent registration of interpreters (#58443)
* make interpreter factory an instance

* add registerInterpreter

* register interpreters individually

* try wire everything up

* fix style

* fix test
2024-01-08 22:33:48 -08:00
Alexey Milovidov
21382afa2b Check for punctuation 2023-07-25 06:10:04 +02:00
Azat Khuzhin
5277c802f7 Fix table dependencies in case of failed RENAME TABLE
CI found this [1]

    [ 382620 ] {} <Error> Application: Caught exception while loading metadata: Code: 60. DB::Exception: Table test_25.join doesn\'t exist: While processing _CAST(joinGet(test_25.join, \'m\', CAST(\'42\', \'int\')) AS m_tmp_alter1351896088559986425, \'Int32\') AS m: default expression and column type are incomp
    [ 382620 ] {} <Error> Application: Code: 60. DB::Exception: Table test_25.join doesn\'t exist: While processing _CAST(joinGet(test_25.join, \'m\', CAST(\'42\', \'int\')) AS m_tmp_alter1351896088559986425, \'Int32\') AS m: default expression and column type are incompatible.: Cannot attach table `test_25`.`t

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/48670/d7f865037266ed87538cf4df7ec7e8165681871b/stress_test__asan_.html

The problem here is that after failed RENAME dependencies got lost:

    [4e937f39d866] 2023.04.12 00:51:06.833624 [ 13419 ] {61429225-64cb-4fce-b60d-01e0dac6e52c} <Error> executeQuery: Code: 241. DB::Exception: Memory limit (total) exceeded: would use 34.65 GiB (attempt to allocate chunk of 2097419 bytes), maximum: 34.29 GiB. OvercommitTracker decision: Memory overcommit has freed not enough memory. (MEMORY_LIMIT_EXCEEDED) (version 23.4.1.1) (from [::1]:45710) (comment: 01160_table_dependencies.sh) (in query: create database test_25_1), Stack trace (when copying this message, always include the lines below):
    [4e937f39d866] 2023.04.12 00:51:07.351914 [ 5151 ] {66d8bdd4-668e-4239-a8af-6b8f17bb5222} <Error> executeQuery: Code: 81. DB::Exception: Database test_25_1 doesn't exist. (UNKNOWN_DATABASE) (version 23.4.1.1) (from [::1]:45762) (comment: 01160_table_dependencies.sh) (in query: rename table t to test_25_1.t), Stack trace (when copying this message, always include the lines below):

And from the test output:

    OK
    OK
    OK
    OK
    a       []      []      []
    data_02344      []      []      []
    date_table      []      []      []
    dict1   []      ['dict_src']    ['join']
    dict2   []      ['join']        []
    dict_src        []      []      ['dict1']
    dist_02346      []      []      []
    join    []      ['dict1']       ['dict2','s']
                                    ^^^^^^^^^^^^^ no "t"

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-12 11:11:05 +02:00
Nikolay Degterinsky
b9d3160107 Add parameterized RENAME queries 2023-02-14 13:01:06 +00:00
Vitaly Baranov
4869d3806c Add setting check_referential_table_dependencies to check referential dependencies on DROP TABLE. 2023-02-08 23:56:59 +01:00
Alexey Milovidov
9b908a0be0 Fix trash around query kind, part 2 2023-02-01 03:31:31 +01:00
Alexey Milovidov
5c4db119fa Fix trash around query kind, part 1 2023-02-01 03:11:54 +01:00
Vitaly Baranov
e1f7f04752
Referential dependencies for RESTORE (#43834)
* Rename DDLDependencyVisitor -> DDLLoadingDependencyVisitor.

* Move building a loading graph to TablesLoader.

* Implement referential dependencies for tables and use them
when restoring tables from a backup.

* Remove StorageID::operator < (because of its inconsistency with ==).

* Add new tests.

* Fix test.

* Fix memory leak.

Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
2022-12-02 15:05:46 +01:00
Alexander Tokmakov
65474830ac make tryEnqueueReplicatedDDL virtual 2022-09-16 16:25:32 +02:00
Alexander Tokmakov
03c193ccca fix ON CLUSTER with Replicated database cluster 2022-09-15 21:15:57 +02:00
Nikita Mikhaylov
33e530392e
Check grants for databases in case of renaming databases (#40906) 2022-09-05 12:38:44 +02:00
Vitaly Baranov
030f3e488c Add shard_index and replica_index to params of executeDDLQueryOnCluster(). 2022-04-25 16:34:33 +02:00
Alexander Tokmakov
416a82b99a Merge branch 'master' into check_dependencies_on_drop 2021-11-15 13:35:45 +03:00
Alexander Tokmakov
73ab518e97 minor improvements 2021-11-11 19:29:56 +03:00
vicgao
209d1a21e1 code style 2021-11-08 16:51:22 +08:00
vicgao
8e7023cdb4 rename database/table/dictionary support IF EXISTS syntax 2021-11-08 16:27:10 +08:00
vicgao
6020c23145 code review 2021-11-08 15:14:45 +08:00
vicgao
ec2c70ab75 rename/exchange database/table/dictionary support IF EXISTS syntax 2021-11-04 22:35:34 +08:00
Alexander Tokmakov
56aeff734a Merge branch 'master' into check_dependencies_on_drop 2021-11-02 16:15:30 +03:00
Alexander Tokmakov
598dbe04db fix tests, support rename 2021-11-02 15:58:45 +03:00
Vitaly Baranov
3ed7f8f0b3 Move access-rights' source files needed for parser to a separate target. 2021-11-01 19:13:49 +03:00
Alexander Tokmakov
8e1e53fb68 fix 2021-08-05 14:14:50 +03:00
Alexander Tokmakov
d4fbd7107e try make flags more readable 2021-08-04 21:14:59 +03:00
mergify[bot]
dc57254982
Merge branch 'master' into improve_create_or_replace 2021-08-03 11:39:07 +00:00
Alexander Tokmakov
42a8bb6872 fix assertions in Replicated database 2021-08-02 16:19:11 +03:00
Alexander Tokmakov
d9a77e3a1a improve CREATE OR REPLACE query 2021-07-01 16:21:38 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Alexander Tokmakov
2a36d6cb55 review suggestions 2021-02-20 02:41:58 +03:00
Alexander Tokmakov
78c1d69b8c better code 2021-02-08 22:36:17 +03:00
Alexander Tokmakov
18f6b5bbad add timeouts 2021-02-04 22:41:44 +03:00
Alexander Tokmakov
6456ccf0da better test 2021-02-02 22:39:04 +03:00
Alexander Tokmakov
9da445e740 execute initial query in the same thread 2021-02-01 22:29:47 +03:00
Alexander Tokmakov
f20d5e3b41 fix 2021-01-26 20:51:25 +03:00
Alexander Tokmakov
7f97a11c84 Merge branch 'master' into database_replicated 2021-01-18 17:09:39 +03:00
Amos Bird
2a28c127eb
Better code for real 2020-12-18 14:13:59 +08:00
Alexander Tokmakov
2a6c0b9180 try reuse DDLWorker in DatabaseReplicated 2020-11-12 20:35:29 +03:00
Alexander Tokmakov
cbcdee0cf9 split DDLWorker.cpp 2020-11-03 16:47:26 +03:00
Alexander Tokmakov
478eb0b8a5 fix 2020-10-22 23:32:47 +03:00
Alexander Tokmakov
72dbb43235 Merge branch 'master' into fork-valbaturin-replication-db-engine 2020-10-20 19:14:54 +03:00
Alexander Tokmakov
c27de9b424 fixes 2020-07-17 16:11:44 +03:00
Alexander Tokmakov
ebf98ba006 implement reneme dictionary query 2020-07-17 00:41:26 +03:00
Alexander Tokmakov
15b395da51 fixes 2020-07-13 17:24:00 +03:00
Alexander Tokmakov
9c4efa1f36 fix, add test 2020-07-09 01:50:15 +03:00
Alexander Tokmakov
7a5d532c7b implement rename database for atomic 2020-07-07 15:11:58 +03:00
Val
e591fe5014 database replicated feedback mechanism prototype 2020-07-04 19:32:23 +03:00
Val
f928c897cf change replication algorithm, remove zk lock
In this version of the databaseReplicated sequential persistent zk nodes
are used to order DDL queries. Db replicated ddl queries are executed
in the backgrould pool no matter whether it's proposed by the same
replica or not.
2020-06-27 17:02:03 +03:00
Val
31910e9bf1 Use ClientInf::QueryKind to distinguish replicated db log queries 2020-06-27 17:01:18 +03:00
Val
0a860c0c2b log based replicated 2020-06-27 16:51:36 +03:00