Description:
Setting 'myisam_max_sort_file_size' through a client using big numbers (>4,294,967,295) doesn't work.
The following doesn't work:
mysql> set global myisam_max_sort_file_size=6341787648;
On the other hand, putting the same big value in my.cnf works perfectly:
[mysqld]
set-variable = myisam_max_sort_file_size=6341787648
How to repeat:
mysql> show global variables like 'myisam_max_sort_file_size';
+---------------------------+------------+
| Variable_name | Value |
+---------------------------+------------+
| myisam_max_sort_file_size | 4244635648 |
+---------------------------+------------+
1 row in set (0.00 sec)
mysql> set global myisam_max_sort_file_size=6341787648;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like 'myisam_max_sort_file_size';
+---------------------------+------------+
| Variable_name | Value |
+---------------------------+------------+
| myisam_max_sort_file_size | 2046820352 |
+---------------------------+------------+
1 row in set (0.00 sec)
Suggested fix:
Use an unsigned 64 bit data type (ulong) to save the value of the variable when one modifies it via the SQL engine.
mysql> set global myisam_max_sort_file_size=4294967295;
mysql> show global variables like 'myisam_max_sort_file_size';
+---------------------------+------------+
| Variable_name | Value |
+---------------------------+------------+
| myisam_max_sort_file_size | 4293918720 |
+---------------------------+------------+
mysql> set global myisam_max_sort_file_size=4294967296;
mysql> show global variables like 'myisam_max_sort_file_size';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| myisam_max_sort_file_size | 0 |
+---------------------------+-------+