Skip to content

Commit 5965a53

Browse files
Null not nilTomShawn
andauthored
system-variables: update noop functions (#3898)
* system-variables: update noop functions * Fix spelling error discovered * Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> * Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
1 parent f1acd27 commit 5965a53

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

system-variables.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,15 @@ Constraint checking is always performed in place for pessimistic transactions (d
324324

325325
- Scope: SESSION | GLOBAL
326326
- Default value: 0
327-
- This variable is used to control whether to enable `get_lock` and `release_lock` functions. These two functions are not implemented, and always return 1 in the current version of TiDB.
327+
- By default, TiDB returns an error when you attempt to use the syntax for functionality that is not yet implemented. When the variable value is set to `1`, TiDB silently ignores such cases of unavailable functionality, which is helpful if you cannot make changes to the SQL code.
328+
- Enabling `noop` functions controls the following behaviors:
329+
* `get_lock` and `release_lock` functions
330+
* `LOCK IN SHARE MODE` syntax
331+
* `SQL_CALC_FOUND_ROWS` syntax
332+
333+
> **Note:**
334+
>
335+
> Only the default value of `0` can be considered safe. Setting `tidb_enable_noop_functions=1` might lead to unexpected behaviors in your application, because it permits TiDB to ignore certain syntax without providing an error.
328336

329337
### tidb_enable_slow_log
330338

@@ -606,7 +614,7 @@ Constraint checking is always performed in place for pessimistic transactions (d
606614
- This variable is used to set whether the optimizer executes the optimization operation of pushing down the aggregate function with `distinct` (such as `select count(distinct a) from t`) to Coprocessor.
607615
- When the aggregate function with the `distinct` operation is slow in the query, you can set the variable value to `1`.
608616

609-
In the following example, before `tidb_opt_distinct_agg_push_down` is enabled, TiDB needs to read all data from TiKV and execute `disctinct` on the TiDB side. After `tidb_opt_distinct_agg_push_down` is enabled, `distinct a` is pushed down to Coprocessor, and a `group by` column `test.t.a` is added to `HashAgg_5`.
617+
In the following example, before `tidb_opt_distinct_agg_push_down` is enabled, TiDB needs to read all data from TiKV and execute `distinct` on the TiDB side. After `tidb_opt_distinct_agg_push_down` is enabled, `distinct a` is pushed down to Coprocessor, and a `group by` column `test.t.a` is added to `HashAgg_5`.
610618

611619
```sql
612620
mysql> desc select count(distinct a) from test.t;

0 commit comments

Comments
 (0)