Bug #10351 Max_Heap_Table_Size cannot be set to 4 gb
Submitted: 4 May 2005 5:23 Modified: 6 Aug 2005 22:44
Reporter: Disha Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.4 Beta OS:Any (All)
Assigned to: Jim Winstead CPU Architecture:Any

[4 May 2005 5:23] Disha
Description:
On trying to set Max_Heap_table_size to exactly 4 gb, that is 4294967296 in bytes, it does not get correctly set and is set to 0.

How to repeat:
1) set @@max_heap_table_size= 4294967296;
2) select @@max_heap_table_size;

ACTUAL RESULT:
Returns that @max_heap_table_size is 0.

EXPECTED RESULT:
Returns that @max_heap_table_size should be set to 4gb.
[4 May 2005 13:20] MySQL Verification Team
The machine are you tried this are 64 bit machine ?, on Windows for
example a 32 bit machine can't allocates more than 2GB of memory.
[5 May 2005 15:07] Disha
Hi Miguel,
The same behaviour is observed on both 64 as well as 32 bit machines.

On a windows machine, we can allocate close to 4 gb.
That is...
1) When we try to set it as follows: set @@max_heap_table_size= 4294967295;
    ... it actually sets the parameter to 4294966272, which is ok.
2) BUT, When we try to set it as: set @@max_heap_table_size= 4294967296;
    ... it actually sets the parameter to 0!. This is NOT acceptable.

thanks, disha
[5 Jun 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[18 Jun 2005 6:16] Vasily Kishkin
I think only "set @@max_heap_table_size" does't work right . 
Tested on Windows 2000 prof SP4

mysql> set @@max_heap_table_size= 4294967296;
Query OK, 0 rows affected (0.06 sec)

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

mysql> set global max_heap_table_size= 4294967296;
Query OK, 0 rows affected (0.00 sec)

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

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

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

mysql>
[22 Jun 2005 0:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26268
[29 Jun 2005 11:08] Magnus BlÄudd
+    return new Item_int((ulonglong)value, 10);

10 seems a little short, why dont you use the default value 21?
[30 Jun 2005 18:37] Jim Winstead
The length is set to 10 because that is the maximum length of an unsigned 32-bit int as a string.

And this is how it is done in Item_uint::Item_uint(uint32 i), which is what was being used before.
[22 Jul 2005 23:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27507
[28 Jul 2005 19:13] Jim Winstead
Fixed in 5.0.14.
[28 Jul 2005 22:39] Sergey Petrunya
Still happens on x86, 5.0 tree compiled by gcc 3.3.5 with compile-pentium-debug-max. 
variables.test fails:
*** r/variables.result  2005-07-29 01:12:02.000000000 +0300
--- r/variables.reject  2005-07-29 01:29:36.000000000 +0300
***************
*** 528,539 ****
  set @@max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 4294967296
  set global max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 4294967296
  set @@max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 4294967296
--- 528,539 ----
  set @@max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 0
  set global max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 0
  set @@max_heap_table_size= 4294967296;
  select @@max_heap_table_size;
  @@max_heap_table_size
! 0
[29 Jul 2005 1:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27705
[29 Jul 2005 18:14] Jim Winstead
Fixed in 5.0.14.
[6 Aug 2005 22:44] Mike Hillyer
Documented in 5.0.14 changelog:

<listitem><para>
 Unsigned <literal>LONG</literal> system variables may return incorrect value when retreived with a <literal>SELECT</literal> for certain values. (Bug #10351)
</para></listitem>