> ## 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.

# mysql_* 会话设置

> ClickHouse 在 mysql_* 生成的组中的会话设置。

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="mysql_datatypes_support_level">
  ## mysql\_datatypes\_support\_level
</div>

<SettingsInfoBlock type="MySQLDataTypesSupport" default_value="decimal,datetime64,date2Date32,geometry" />

定义如何将 MySQL 类型转换为对应的 ClickHouse 类型。它是一个由逗号分隔的列表，可以是 `decimal`、`datetime64`、`date2Date32`、`date2String` 或 `geometry` 的任意组合。默认启用所有现代映射 (`decimal`、`datetime64`、`date2Date32`、`geometry`) 。

* `decimal`：在精度允许的情况下，将 `NUMERIC` 和 `DECIMAL` 类型转换为 `Decimal`。
* `datetime64`：当精度不为 `0` 时，将 `DATETIME` 和 `TIMESTAMP` 类型转换为 `DateTime64`，而不是 `DateTime`。
* `date2Date32`：将 `DATE` 转换为 `Date32`，而不是 `Date`。其优先次序高于 `date2String`。
* `date2String`：将 `DATE` 转换为 `String`，而不是 `Date`。会被 `datetime64` 覆盖。
* `geometry`：将 MySQL 的空间类型 (`LINESTRING`、`POLYGON`、`MULTILINESTRING`、`MULTIPOLYGON`) 转换为对应的 ClickHouse 几何类型，并将通用的 `GEOMETRY` 类型转换为总括类型 `Geometry`。无论是否启用此选项，`POINT` 始终都会转换为 `Point`。由于通用的 `GEOMETRY` 列可以保存任意子类型，如果读取到某个子类型在 ClickHouse 中没有对应类型的值 (`MULTIPOINT`、`GEOMETRYCOLLECTION`) ，会在读取时抛出异常；声明为 `MULTIPOINT` 或 `GEOMETRYCOLLECTION` 的列会映射为 `String`。

<div id="mysql_max_rows_to_insert">
  ## mysql\_max\_rows\_to\_insert
</div>

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

MySQL 存储引擎进行 MySQL 批次插入时的最大行数
