Bug #94645 the system variable "max_heap_table_size" boundary value may have some problems
Submitted: 14 Mar 2019 2:07 Modified: 15 Mar 2019 2:50
Reporter: JianJun Shi Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.23 & 8.0.13 OS:Linux
Assigned to: MySQL Verification Team CPU Architecture:Any

[14 Mar 2019 2:07] JianJun Shi
Description:
"5.1.8 Server System Variables" chapter in the "MySQL 5.7 & 8.0 Reference Manual" was describe as following:

max_heap_table_size
...
Minimum Value       16384
...

If we set the @@global.max_heap_table_size to 16383 (lower then "Minimum Value"), it will automatic change over to 16384. 
But if we set the @session.max_heap_table_size to 16383, it will execute successful, without any error or warning massage, meanwhile, it will not change over to 16384. 

remarks: "the Maximum Value" has the same problem.

How to repeat:
mysql> select @session.max_heap_table_size;
+------------------------------+
| @session.max_heap_table_size |
+------------------------------+
| NULL                         |
+------------------------------+
1 row in set (0.00 sec)

mysql> set @session.max_heap_table_size=16383;
Query OK, 0 rows affected (0.00 sec)

mysql> select @session.max_heap_table_size;
+------------------------------+
| @session.max_heap_table_size |
+------------------------------+
|                        16383 |
+------------------------------+
1 row in set (0.00 sec)

————————————————————————————————

mysql> select @@global.max_heap_table_size;
+------------------------------+
| @@global.max_heap_table_size |
+------------------------------+
|                     16777216 |
+------------------------------+
1 row in set (0.00 sec)

mysql> set @@global.max_heap_table_size=16383;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> select @@global.max_heap_table_size;
+------------------------------+
| @@global.max_heap_table_size |
+------------------------------+
|                        16384 |
+------------------------------+
1 row in set (0.00 sec)
[15 Mar 2019 2:50] JianJun Shi
The correct variable name is @@session.max_heap_table_size, not @session.max_heap_table_size. It's not a bug, I'm so sorry.
[15 Mar 2019 3:24] MySQL Verification Team
details in Bug #94646