From 01fb6894fc71c11ca7402b6154d949e0138c8880 Mon Sep 17 00:00:00 2001 From: joey-yez <104608045+joey-yez@users.noreply.github.com> Date: Mon, 25 Dec 2023 18:07:01 +0800 Subject: [PATCH] Update use-tidb-to-read-tiflash.md --- tiflash/use-tidb-to-read-tiflash.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tiflash/use-tidb-to-read-tiflash.md b/tiflash/use-tidb-to-read-tiflash.md index 325f1e25d5f74..9bcc1440683b4 100644 --- a/tiflash/use-tidb-to-read-tiflash.md +++ b/tiflash/use-tidb-to-read-tiflash.md @@ -143,4 +143,7 @@ In the above three ways of reading TiFlash replicas, engine isolation specifies > **Note:** > -> Before v4.0.3, the behavior of reading from TiFlash replica in a non-read-only SQL statement (for example, `INSERT INTO ... SELECT`, `SELECT ... FOR UPDATE`, `UPDATE ...`, `DELETE ...`) is undefined. In v4.0.3 and later versions, internally TiDB ignores the TiFlash replica for a non-read-only SQL statement to guarantee the data correctness. That is, for [smart selection](#smart-selection), TiDB automatically selects the non-TiFlash replica; for [engine isolation](#engine-isolation) that specifies TiFlash replica **only**, TiDB reports an error; and for [manual hint](#manual-hint), TiDB ignores the hint. +> - Before v4.0.3, the behavior of reading from TiFlash replica in a non-read-only SQL statement (for example, `INSERT INTO ... SELECT`, `SELECT ... FOR UPDATE`, `UPDATE ...`, `DELETE ...`) is undefined. +> - In versions between v4.0.3 and v6.3.0, internally TiDB ignores the TiFlash replica for a non-read-only SQL statement to guarantee the data correctness. That is, for [smart selection](#smart-selection), TiDB automatically selects the non-TiFlash replica; for [engine isolation](#engine-isolation) that specifies TiFlash replica **only**, TiDB reports an error; and for [manual hint](#manual-hint), TiDB ignores the hint. +> - In versions between v6.4.0 and v7.0.0, if the TiFlash replica is enabled, you can use the variable [tidb_enable_tiflash_read_for_write_stmt](/system-variables.md#tidb_enable_tiflash_read_for_write_stmt-new-in-v630) to decide whether to use the TiFlash replica for a non-read-only SQL statement. +> - In v7.1.0 and later versions, if the TiFlash replica is enabled and the [SQL Mode](/sql-mode.md) of the current session is not STRICT Mode(the variable `sql_mode` does not include `STRICT_TRANS_TABLES` or `STRICT_ALL_TABLES`), TiDB will decide automatically whether to use the TiFlash replica based on cost estimation for a non-read-only SQL statement.