Bug #3754 SET GLOBAL myisam_max_sort_file_size doesn't work as expected
Submitted: 14 May 2004 1:42 Modified: 19 May 2004 14:44
Reporter: Jorge del Conde Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.18 OS:
Assigned to: Konstantin Osipov CPU Architecture:Any

[14 May 2004 1:42] Jorge del Conde
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     |
+---------------------------+-------+
[19 May 2004 1:05] Konstantin Osipov
Fixed in 4.0 tree: bk commit - 4.0 tree (konstantin:1.1838) BUG#3754