> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# validate_* 会话设置

> 自动生成的 validate_* 组中的 ClickHouse 会话设置。

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](/docs/zh/reference/system-tables/settings) 中查看，并由 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="validate_enum_literals_in_operators">
  ## validate\_enum\_literals\_in\_operators
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.1"},{"label": "0"},{"label": "新增设置"}]}]} />

启用后，会根据枚举类型检查 `IN`、`NOT IN`、`==` 和 `!=` 等运算符中的枚举字面量；如果字面量不是有效的枚举值，则抛出异常。

<div id="validate_mutation_query">
  ## validate\_mutation\_query
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.11"},{"label": "1"},{"label": "默认启用的新设置，用于验证变更查询。"}]}]} />

在接受变更查询之前先验证其有效性。变更操作在后台执行，运行无效查询会导致变更操作卡住，并需要手动干预。

只有在遇到向后不兼容的 bug 时，才应更改此设置。

<div id="validate_polygons">
  ## validate\_polygons
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "20.4"},{"label": "1"},{"label": "默认情况下，如果 pointInPolygon 函数中的多边形无效，则抛出异常，而不是返回可能错误的结果"}]}]} />

如果多边形存在自相交或自相切，则启用或禁用 [pointInPolygon](/docs/zh/reference/functions/regular-functions/geo/coordinates#pointinpolygon) 函数抛出异常。

可能的值：

* 0 — 禁用抛出异常。`pointInPolygon` 接受无效多边形，并可能返回不正确的结果。
* 1 — 启用抛出异常。
