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

# mysql_* セッション設定

> mysql_* 生成グループに属する 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](/ja/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" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "decimal,datetime64,date2Date32,geometry"},{"label": "MySQL の具体的な空間型（LINESTRING、POLYGON、MULTILINESTRING、MULTIPOLYGON、MULTIPOINT）と汎用の GEOMETRY 型を、既定で対応する ClickHouse のジオメトリ型にマッピングします。汎用の GEOMETRY カラムは包括的な Geometry 型にマッピングされます。サブタイプに対応する ClickHouse の型がない値（GEOMETRYCOLLECTION）を読み取ると、読み取り時に例外が発生します。"}]}, {"id": "row-2","items": [{"label": "26.3"},{"label": "decimal,datetime64,date2Date32"},{"label": "既定で最新の MySQL 型マッピングを有効にします。"}]}]} />

MySQL 型を対応する ClickHouse 型にどのように変換するかを定義します。`decimal`、`datetime64`、`date2Date32`、`date2String`、`geometry` を任意に組み合わせ、カンマ区切りで指定します。最新のマッピング (`decimal`、`datetime64`、`date2Date32`、`geometry`) はすべて既定で有効です。

* `decimal`: 精度が許す場合、`NUMERIC` 型と `DECIMAL` 型を `Decimal` に変換します。
* `datetime64`: 精度が `0` でない場合、`DATETIME` 型と `TIMESTAMP` 型を `DateTime` ではなく `DateTime64` に変換します。
* `date2Date32`: `DATE` を `Date` ではなく `Date32` に変換します。`date2String` より優先されます。
* `date2String`: `DATE` を `Date` ではなく `String` に変換します。`datetime64` によって上書きされます。
* `geometry`: MySQL の空間型 (`LINESTRING`、`POLYGON`、`MULTILINESTRING`、`MULTIPOLYGON`、`MULTIPOINT`) を対応する ClickHouse のジオメトリ型に変換し、汎用の `GEOMETRY` 型を包括的な `Geometry` 型に変換します。`POINT` はこのオプションに関係なく、常に `Point` に変換されます。汎用の `GEOMETRY` カラムは任意のサブタイプを保持できるため、対応する ClickHouse の型がないサブタイプの値 (`GEOMETRYCOLLECTION`) を読み取ると、読み取り時に例外が発生します。一方、`GEOMETRYCOLLECTION` として宣言されたカラムは `String` にマッピングされます。`POINT` 以外の nullable な空間カラムも `Nullable(String)` にマッピングされます。これは、`Nullable` 内にネストできるジオメトリ型は `Point` のみであるためです。このような文字列はすべて、MySQL から返される 4 バイトの SRID プレフィックスに WKB ペイロードが続く形式です。上記はすべて、MySQL テーブルのカラム型からスキーマを推論する場合に適用されます。ソースがクエリ (`mysql` テーブル関数または `MySQL` テーブルエンジンの `query(...)` 引数) の場合、MySQL はすべての空間結果カラムを具体的なサブタイプなしの汎用 `GEOMETRY` として報告するため、`POINT` を含むそのようなカラムは `String` (nullable の場合は `Nullable(String)`) にマッピングされます。

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

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

MySQL ストレージエンジンで MySQL バッチ挿入時に指定できる最大行数
