You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use buffering to avoid situations where a query processing error occurred after the response code and HTTP headers were sent to the client. In this situation, an error message is written at the end of the response body, and on the client-side, the error can only be detected at the parsing stage.
327
327
328
+
## Setting a role with query parameters {#setting-role-with-query-parameters}
329
+
330
+
In certain scenarios, it might be required to set the granted role first, before executing the statement itself.
331
+
However, it is not possible to send `SET ROLE` and the statement together, as multi-statements are not allowed:
332
+
333
+
```
334
+
curl -sS "http://localhost:8123" --data-binary "SET ROLE my_role;SELECT * FROM my_table;"
335
+
```
336
+
337
+
Which will result in an error:
338
+
339
+
```
340
+
Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed)
341
+
```
342
+
343
+
To overcome this limitation, you could use the `role` query parameter instead:
344
+
345
+
```
346
+
curl -sS "http://localhost:8123?role=my_role" --data-binary "SELECT * FROM my_table;"
347
+
```
348
+
349
+
This will be an equivalent of executing `SET ROLE my_role` before the statement.
350
+
351
+
Additionally, it is possible to specify multiple `role` query parameters:
352
+
353
+
```
354
+
curl -sS "http://localhost:8123?role=my_role&role=my_other_role" --data-binary "SELECT * FROM my_table;"
355
+
```
356
+
357
+
In this case, `?role=my_role&role=my_other_role` works similarly to executing `SET ROLE my_role, my_other_role` before the statement.
Allow suspicious `PRIMARY KEY`/`ORDER BY` for MergeTree (i.e. SimpleAggregateFunction).
5483
+
5484
+
## mysql_datatypes_support_level
5485
+
5486
+
Defines how MySQL types are converted to corresponding ClickHouse types. A comma separated list in any combination of `decimal`, `datetime64`, `date2Date32` or `date2String`.
5487
+
-`decimal`: convert `NUMERIC` and `DECIMAL` types to `Decimal` when precision allows it.
5488
+
-`datetime64`: convert `DATETIME` and `TIMESTAMP` types to `DateTime64` instead of `DateTime` when precision is not `0`.
5489
+
-`date2Date32`: convert `DATE` to `Date32` instead of `Date`. Takes precedence over `date2String`.
5490
+
-`date2String`: convert `DATE` to `String` instead of `Date`. Overridden by `datetime64`.
Copy file name to clipboardExpand all lines: docs/en/sql-reference/functions/rounding-functions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,12 +36,12 @@ Alias: `truncate`.
36
36
37
37
**Parameters**
38
38
39
-
-`input`: A float type [Float](/docs/en/sql-reference/data-types/float.md).
40
-
-`precision`: A decimal type [Decimal](/docs/en/sql-reference/data-types/decimal.md).
39
+
-`input`: A numeric type ([Float](/docs/en/sql-reference/data-types/float.md), [Decimal](/docs/en/sql-reference/data-types/decimal.md) or [Integer](/docs/en/sql-reference/data-types/int-uint.md)).
40
+
-`precision`: An [Integer](/docs/en/sql-reference/data-types/int-uint.md) type.
41
41
42
42
**Returned value**
43
43
44
-
- A [Float64](/docs/en/sql-reference/data-types/float.md) value.
Copy file name to clipboardExpand all lines: docs/ru/sql-reference/functions/rounding-functions.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,42 @@ N может быть отрицательным.
24
24
Возвращает наименьшее круглое число, которое больше или равно, чем x.
25
25
В остальном, аналогично функции floor, см. выше.
26
26
27
+
## trunc(x\[, N\]), truncate(x\[, N\])
28
+
29
+
Возвращает круглое число с наибольшим абсолютным значением, абсолютное значение которого меньше или равно значению `x`. Во всех остальных отношениях она аналогична функции 'floor' (см. выше).
30
+
31
+
**Синтаксис**
32
+
33
+
```sql
34
+
trunc(input, precision)
35
+
```
36
+
37
+
Alias: `truncate`.
38
+
39
+
**Параметры**
40
+
41
+
-`input` - число для округления. Может быть в любом чисельном формате ([Float](/docs/en/sql-reference/data-types/float.md), [Decimal](/docs/en/sql-reference/data-types/decimal.md) или [Integer](/docs/en/sql-reference/data-types/int-uint.md)).
Copy file name to clipboardExpand all lines: src/Core/Settings.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -636,7 +636,7 @@ class IColumn;
636
636
M(Bool, allow_experimental_database_materialized_mysql, false, "Allow to create database with Engine=MaterializedMySQL(...).", 0) \
637
637
M(Bool, allow_experimental_database_materialized_postgresql, false, "Allow to create database with Engine=MaterializedPostgreSQL(...).", 0) \
638
638
M(Bool, system_events_show_zero_values, false, "When querying system.events or system.metrics tables, include all metrics, even with zero values.", 0) \
639
-
M(MySQLDataTypesSupport, mysql_datatypes_support_level, MySQLDataTypesSupportList{}, "Which MySQL types should be converted to corresponding ClickHouse types (rather than being represented as String). Can be empty or any combination of 'decimal', 'datetime64', 'date2Date32' or 'date2String'. When empty MySQL's DECIMAL and DATETIME/TIMESTAMP with non-zero precision are seen as String on ClickHouse's side.", 0) \
639
+
M(MySQLDataTypesSupport, mysql_datatypes_support_level, MySQLDataTypesSupportList{}, "Defines how MySQL types are converted to corresponding ClickHouse types. A comma separated list in any combination of 'decimal', 'datetime64', 'date2Date32' or 'date2String'. decimal: convert NUMERIC and DECIMAL types to Decimal when precision allows it. datetime64: convert DATETIME and TIMESTAMP types to DateTime64 instead of DateTime when precision is not 0. date2Date32: convert DATE to Date32 instead of Date. Takes precedence over date2String. date2String: convert DATE to String instead of Date. Overridden by datetime64.", 0) \
640
640
M(Bool, optimize_trivial_insert_select, true, "Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query", 0) \
641
641
M(Bool, allow_non_metadata_alters, true, "Allow to execute alters which affects not only tables metadata, but also data on disk", 0) \
642
642
M(Bool, enable_global_with_statement, true, "Propagate WITH statements to UNION queries and all subqueries", 0) \
@@ -795,6 +795,7 @@ class IColumn;
795
795
M(Bool, throw_on_error_from_cache_on_write_operations, false, "Ignore error from cache when caching on write operations (INSERT, merges)", 0) \
796
796
M(UInt64, filesystem_cache_segments_batch_size, 20, "Limit on size of a single batch of file segments that a read buffer can request from cache. Too low value will lead to excessive requests to cache, too large may slow down eviction from cache", 0) \
797
797
M(UInt64, filesystem_cache_reserve_space_wait_lock_timeout_milliseconds, 1000, "Wait time to lock cache for sapce reservation in filesystem cache", 0) \
798
+
M(UInt64, temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds, (10 * 60 * 1000), "Wait time to lock cache for sapce reservation for temporary data in filesystem cache", 0) \
798
799
\
799
800
M(Bool, use_page_cache_for_disks_without_file_cache, false, "Use userspace page cache for remote disks that don't have filesystem cache enabled.", 0) \
800
801
M(Bool, read_from_page_cache_if_exists_otherwise_bypass_cache, false, "Use userspace page cache in passive mode, similar to read_from_filesystem_cache_if_exists_otherwise_bypass_cache.", 0) \
0 commit comments