ClickHouse/tests/queries/0_stateless/01160_table_dependencies.reference
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

51 lines
1.0 KiB
Plaintext

dict1 [] ['dict_src'] ['join','t']
dict2 [] ['join'] ['t']
dict_src [] [] ['dict1']
join [] ['dict1'] ['dict2','s','t']
s [] ['join'] []
t [] ['dict1','dict2','join'] []
=====
dict1 [] ['dict_src'] ['join','t']
dict2 [] ['join'] []
dict_src [] [] ['dict1']
join [] ['dict1'] ['dict2','s','t']
mv [] [] []
s [] ['join'] ['t']
t ['mv'] ['dict1','join','s'] []
dict1
dict2
dict_src
join
mv
s
t
OK
OK
OK
dict1 [] ['dict_src'] ['join','t']
dict2 [] ['join'] []
dict_src [] [] ['dict1']
join [] ['dict1'] ['dict2','s','t']
mv [] [] []
s [] ['join'] ['t']
t ['mv'] ['dict1','join','s'] []
OK
UNKNOWN_DATABASE
dict1 [] ['dict_src'] ['join','t']
dict2 [] ['join'] []
dict_src [] [] ['dict1']
join [] ['dict1'] ['dict2','s','t']
mv [] [] []
s [] ['join'] ['t']
t ['mv'] ['dict1','join','s'] []
dict1 [] ['dict_src'] ['join','t']
dict2 [] ['join'] []
dict_src [] [] ['dict1']
join [] ['dict1'] ['dict2','s','t']
s [] ['join'] ['t']
t [] ['dict1','join','s'] []
=====
dict1 [] ['dict_src'] ['join']
dict_src [] [] ['dict1']
join [] ['dict1'] []