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)