diff --git a/system-variables.md b/system-variables.md index 52673a6ffc2ee..695e5aba03fc8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -429,6 +429,16 @@ This variable is an alias for `last_insert_id`. - Default value: `ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION` - This variable controls a number of MySQL compatibility behaviors. See [SQL Mode](/sql-mode.md) for more information. +### sql_require_primary_key New in v6.3.0 + +- Scope: SESSION | GLOBAL +- Persists to cluster: Yes +- Type: Boolean +- Default value: `OFF` +- This variable controls whether to enforce the requirement that a table has a primary key. After this variable is enabled, attempting to create or alter a table without a primary key will produce an error. +- This feature is based on the similarly named [`sql_require_primary_key`](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_require_primary_key) in MySQL 8.0. +- It is strongly recommended to enable this variable when using TiCDC. This is because replicating changes to a MySQL sink requires that tables have a primary key. + ### sql_select_limit New in v4.0.2 - Scope: SESSION | GLOBAL