Bug #4778 mysql doesn't try to setrlimit to maximum data size
Submitted: 27 Jul 2004 23:38 Modified: 9 Mar 2005 13:01
Reporter: Christopher Kantarjiev Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:4.0.18 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[27 Jul 2004 23:38] Christopher Kantarjiev
Description:
mysql doesn't ever query or set the RLIMIT_DATA value to make sure that it's predicted max data size is reachable. This leads to seg faults, even if the system will allow the program to increase the limit with setrlimit.

How to repeat:
Use limits/ulimit to set the data size limit smaller than the max data size; start the server and run some big queries. It will crash and report its max data size in the log.

Suggested fix:
This could be hacked in to mysql_safe, but it seems that the right thing to do is get the hard limit for RLIMIT_DATA and set the soft limit to be the same - or, to be more conservative, to the predicted max data size.
[9 Mar 2005 13:01] Kent Boortz
I don't think, as the synopsis indicate, that the server should
should try to grab the estimated maximum data size of memory.
It seems more reasobable to honor the limit settings inherited
from the shell it is started from.

But the server should check that the estimated maximum data
size is not larger than the set limit. This way the server will
complain at startup, not later when used.