> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# function_* 会话设置

> function_* 生成分组中的 ClickHouse 会话设置。

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["版本", "默认值", "注释"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        版本历史
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置可在 [system.settings](/zh/reference/system-tables/settings) 中查看，并根据[源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)自动生成。

<div id="function_base58_max_input_size">
  ## function\_base58\_max\_input\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="10000" />

函数 `base58Encode`、`base58Decode` 和 `tryBase58Decode` 的单个输入值最大大小，以字节为单位。通用的 `base58` 转换复杂度随输入长度呈二次增长，因此单个较大的值可能会运行很长时间。`base58` 适用于短数据 (密钥、哈希、地址) ，因此默认的 10 KB 是一个较为宽松的安全阈值。对于更大的输入，`base58Encode` 和 `base58Decode` 会抛出 `TOO_LARGE_STRING_SIZE`，而 `tryBase58Decode` 会返回空字符串。值 `0` 会禁用此限制 (即引入此设置之前的行为) 。线性的 `base32` 和 `base64` 函数不受影响。

<div id="function_date_trunc_return_type_behavior">
  ## function\_date\_trunc\_return\_type\_behavior
</div>

<SettingsInfoBlock type="UInt64" default_value="0" />

允许更改 `dateTrunc` 函数返回结果类型的行为。

可能的值：

* 0 - 当第二个参数为 `DateTime64/Date32` 时，返回类型将始终为 `DateTime64/Date32`，与第一个参数中的时间单位无关。
* 1 - 对于 `Date32`，结果始终为 `Date`。对于 `DateTime64`，当时间单位为 `second` 及以上时，结果为 `DateTime`。

<div id="function_implementation">
  ## function\_implementation
</div>

为特定目标或变体选择函数实现方式 (Experimental) 。如果留空，则启用所有实现。

<div id="function_locate_has_mysql_compatible_argument_order">
  ## function\_locate\_has\_mysql\_compatible\_argument\_order
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

控制函数 [locate](/zh/reference/functions/regular-functions/string-search-functions#locate) 的参数顺序。

可能的值：

* 0 — 函数 `locate` 接受参数 `(haystack, needle[, start_pos])`。
* 1 — 函数 `locate` 接受参数 `(needle, haystack, [, start_pos])` (兼容 MySQL 的行为)

<div id="function_range_max_elements_in_block">
  ## function\_range\_max\_elements\_in\_block
</div>

<SettingsInfoBlock type="UInt64" default_value="500000000" />

设置函数 [range](/zh/reference/functions/regular-functions/array-functions#range) 生成数据量的安全阈值。定义该函数每个数据块可生成的最大值数量 (即一个块中每一行数组大小的总和) 。

可能的值：

* 正整数。

**另请参见**

* [`max_block_size`](/zh/reference/settings/session-settings/max#max_block_size)
* [`min_insert_block_size_rows`](/zh/reference/settings/session-settings/min-insert#min_insert_block_size_rows)

<div id="function_sleep_max_microseconds_per_block">
  ## function\_sleep\_max\_microseconds\_per\_block
</div>

<SettingsInfoBlock type="UInt64" default_value="3000000" />

函数 `sleep` 在每个块中允许休眠的最大微秒数。如果用户调用时传入更大的值，就会抛出异常。这是一个安全阈值。

<div id="function_visible_width_behavior">
  ## function\_visible\_width\_behavior
</div>

<SettingsInfoBlock type="UInt64" default_value="1" />

`visibleWidth` 行为的版本。0 - 仅统计码点数量；1 - 正确统计零宽字符和组合字符，将全角字符按两个字符计数，估算制表符宽度，并统计删除字符。
