Bug #15634 Runtime stack overflow Windows's compiler warning
Submitted: 9 Dec 2005 12:32 Modified: 2 Feb 2006 13:19
Reporter: Miguel Solorzano Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.17 BK source OS:Windows (Windows)
Assigned to: Bugs System CPU Architecture:Any

[9 Dec 2005 12:32] Miguel Solorzano
Description:
Compiling latest source:

ChangeSet@1.1992, 2005-12-09 00:58:59+03:00, konstantin@mysql.com

Visual Studio 2003 displays the below warning:

e:\builds\mysql-5.0.17\sql\field.cpp(5246) : warning C4717: 'Field_date::store' : recursive on all control paths, function will cause runtime stack overflow

int Field_date::store(double nr)
{
  longlong tmp;
  int error= 0;
  if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
    nr=floor(nr/1000000.0);			// Timestamp to date
  if (nr < 0.0 || nr > 99991231.0)
  {
    tmp= LL(0);
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
                         ER_WARN_DATA_OUT_OF_RANGE,
                         nr, MYSQL_TIMESTAMP_DATE);
    error= 1;
  }
  else
    tmp= (longlong) rint(nr);

  return Field_date::store(tmp);
}

How to repeat:
Compile 5.0 on Windows.
[28 Dec 2005 16:41] 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/commits/445
[27 Jan 2006 18:17] Jim Winstead
Patch looks okay to push to me.
[30 Jan 2006 14:09] Sergey Vlasenko
Fix is available in 5.0.19
[2 Feb 2006 13:19] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 5.0.19 changelog. Closed.