Merge branch 'master' into more_compatible_read

This commit is contained in:
mergify[bot] 2022-03-06 12:05:47 +00:00 committed by GitHub
commit 086b8e147a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 4 deletions

View File

@ -1 +0,0 @@
../../../../en/sql-reference/statements/alter/row-policy.md

View File

@ -0,0 +1,19 @@
---
toc_priority: 47
toc_title: 行策略
---
# 操作行策略 {#alter-row-policy-statement}
修改行策略.
语法:
``` sql
ALTER [ROW] POLICY [IF EXISTS] name1 [ON CLUSTER cluster_name1] ON [database1.]table1 [RENAME TO new_name1]
[, name2 [ON CLUSTER cluster_name2] ON [database2.]table2 [RENAME TO new_name2] ...]
[AS {PERMISSIVE | RESTRICTIVE}]
[FOR SELECT]
[USING {condition | NONE}][,...]
[TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
```

View File

@ -664,6 +664,10 @@ void ConfigProcessor::savePreprocessedConfig(const LoadedConfig & loaded_config,
new_path.erase(0, main_config_path.size());
std::replace(new_path.begin(), new_path.end(), '/', '_');
/// If we have config file in YAML format, the preprocessed config will inherit .yaml extension
/// but will contain config in XML format, so some tools like clickhouse extract-from-config won't work
new_path = fs::path(new_path).replace_extension(".xml").string();
if (preprocessed_dir.empty())
{
if (!loaded_config.configuration->has("path"))

View File

@ -62,8 +62,19 @@ void StorageSystemAsynchronousInserts::fillData(MutableColumns & res_columns, Co
size_t i = 0;
res_columns[i++]->insert(queryToString(insert_query));
res_columns[i++]->insert(insert_query.table_id.getDatabaseName());
res_columns[i++]->insert(insert_query.table_id.getTableName());
/// If query is "INSERT INTO FUNCTION" then table_id is empty.
if (insert_query.table_id)
{
res_columns[i++]->insert(insert_query.table_id.getDatabaseName());
res_columns[i++]->insert(insert_query.table_id.getTableName());
}
else
{
res_columns[i++]->insertDefault();
res_columns[i++]->insertDefault();
}
res_columns[i++]->insert(insert_query.format);
res_columns[i++]->insert(time_in_microseconds(elem->data->first_update));
res_columns[i++]->insert(time_in_microseconds(elem->data->last_update));

View File

@ -446,7 +446,7 @@ class TestCase:
else:
os.environ['CLICKHOUSE_URL_PARAMS'] = self.base_url_params + '&' + '&'.join(self.random_settings)
new_options = "--allow_repeated_settings --" + " --".join(self.random_settings)
new_options = " --allow_repeated_settings --" + " --".join(self.random_settings)
os.environ['CLICKHOUSE_CLIENT_OPT'] = self.base_client_options + new_options + ' '
return client_options + new_options

View File

@ -1,3 +1,5 @@
-- Tags: no-random-settings
SET max_rows_to_read = 1000000;
SET read_overflow_mode = 'break';
SELECT concat(toString(number % 256 AS n), '') AS s, n, max(s) FROM system.numbers_mt GROUP BY s, n, n, n, n, n, n, n, n, n ORDER BY s, n;

View File

@ -1,3 +1,5 @@
-- Tags: no-random-settings
DROP TABLE IF EXISTS order_by_desc;
CREATE TABLE order_by_desc (u UInt32, s String)

View File

@ -1,10 +1,13 @@
#!/usr/bin/env bash
# Tags: no-random-settings
set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
function insert1()
{
url="${CLICKHOUSE_URL}&async_insert=1&wait_for_async_insert=0"
@ -24,6 +27,14 @@ function insert2()
done
}
function insert3()
{
url="${CLICKHOUSE_URL}&async_insert=1&wait_for_async_insert=0"
while true; do
${CLICKHOUSE_CURL} -sS "$url" -d "INSERT INTO FUNCTION remote('127.0.0.1', $CLICKHOUSE_DATABASE, async_inserts) VALUES (7, 'g') (8, 'h')"
done
}
function select1()
{
while true; do
@ -53,6 +64,7 @@ TIMEOUT=10
export -f insert1
export -f insert2
export -f insert3
export -f select1
export -f select2
export -f truncate1
@ -60,6 +72,7 @@ export -f truncate1
for _ in {1..5}; do
timeout $TIMEOUT bash -c insert1 &
timeout $TIMEOUT bash -c insert2 &
timeout $TIMEOUT bash -c insert3 &
done
timeout $TIMEOUT bash -c select1 &