Bug #120395 Documentation for enable_cascade_triggers has incorrect Scope and Dynamic attributes
Submitted: 4 May 6:49
Reporter: fander chan Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:9.7.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: documentation, enable_cascade_triggers, innodb, system-variable

[4 May 6:49] fander chan
Description:
The MySQL 9.7 Reference Manual documents the enable_cascade_triggers system variable with the following attributes:

Scope: Global
Dynamic: No

However, based on testing with MySQL 9.7.0, this appears to be incorrect.

The variable can be changed at SESSION scope using SET SESSION, and the change takes effect immediately in the current session. Therefore, the documented attributes should be updated to:

Scope: Global, Session
Dynamic: Yes

This appears to be a documentation bug for the system variable metadata.

How to repeat:
1. Check the MySQL 9.7 Reference Manual page for enable_cascade_triggers:

https://dev.mysql.com/doc/refman/9.7/en/innodb-parameters.html#sysvar_enable_cascade_trigg...

The page currently documents:

Scope: Global
Dynamic: No

2. Start a MySQL 9.7.0 server and run the following statements:

select version();

SET SESSION enable_cascade_triggers=OFF;
show warnings;
select @@enable_cascade_triggers;

SET SESSION enable_cascade_triggers=ON;
select @@enable_cascade_triggers;

3. Example output:

mysql> select version();
+-----------+
| version() |
+-----------+
| 9.7.0     |
+-----------+

mysql> SET SESSION enable_cascade_triggers=OFF;
Query OK, 0 rows affected, 1 warning

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                            |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 4166 | 'enable_cascade_triggers' is deprecated and will be removed in a future release. Triggers on child table will not fire during foreign key cascade. |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+

mysql> select @@enable_cascade_triggers;
+---------------------------+
| @@enable_cascade_triggers |
+---------------------------+
|                         0 |
+---------------------------+

mysql> SET SESSION enable_cascade_triggers=ON;
Query OK, 0 rows affected, 1 warning

mysql> select @@enable_cascade_triggers;
+---------------------------+
| @@enable_cascade_triggers |
+---------------------------+
|                         1 |
+---------------------------+

The SET SESSION statement succeeds and the value changes immediately, which indicates that the variable has SESSION scope and is dynamic.

Suggested fix:
Please update the documentation for enable_cascade_triggers from:

Scope: Global
Dynamic: No

to:

Scope: Global, Session
Dynamic: Yes