Bug #31900 Wrong confusing comment in mysql_com.h header file
Submitted: 29 Oct 2007 0:06 Modified: 18 Dec 2007 4:58
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Alexey Botchkov CPU Architecture:Any

[29 Oct 2007 0:06] Roland Bouman
Description:
In mysql_com.h, at line 397, this struct is defined:

typedef struct st_udf_init
{
  my_bool maybe_null;			/* 1 if function can return NULL */
  unsigned int decimals;		/* for real functions */
  unsigned long max_length;		/* For string functions */
  char	  *ptr;				/* free pointer for function data */
  /* 0 if result is independent of arguments */
  my_bool const_item;
  void *extension;
} UDF_INIT;

The comment for my_bool const_item seems wrong or is else confusing. It would make more sense that 0 means the function does not return a constant.

The documentation at http://dev.mysql.com/doc/refman/5.1/en/udf-calling.html does seem to describe the expected behaviour, so at least, these two are in contradiction

How to repeat:
mysql_com.h, at line 397; 
http://dev.mysql.com/doc/refman/5.1/en/udf-calling.html

Suggested fix:
Correct comment in source. Alternatively, fix documentation
[29 Oct 2007 5:38] Valeriy Kravchuk
Thank you for a bug report. Verified just as described.
[24 Nov 2007 21:03] 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/38430

ChangeSet@1.2698, 2007-11-25 00:57:34+04:00, holyfoot@mysql.com +1 -0
  Bug #31900 Wrong confusing comment in mysql_com.h header file.
  
  comment fixed as we truly need const_item to be 1 to mark
  constant function
[26 Nov 2007 12:31] 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/38503

ChangeSet@1.2698, 2007-11-26 16:25:18+04:00, holyfoot@mysql.com +1 -0
  Bug #31900 Wrong confusing comment in mysql_com.h header file.
  
  comment fixed as we truly need const_item to be 1 to mark
  constant function
[14 Dec 2007 8:13] Bugs System
Pushed into 4.1.24
[14 Dec 2007 8:15] Bugs System
Pushed into 5.0.54
[14 Dec 2007 8:18] Bugs System
Pushed into 5.1.23-rc
[14 Dec 2007 8:21] Bugs System
Pushed into 6.0.5-alpha
[18 Dec 2007 4:58] Paul Dubois
No changelog entry needed.