Bug #9048 FUNCTIONS: Creating a function with char binary IN parameter fails
Submitted: 8 Mar 2005 13:01 Modified: 4 Sep 2005 3:11
Reporter: Disha Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:5.0.3-alpha-nt OS:Windows (Windows Server 2003)
Assigned to: Antony Curtis CPU Architecture:Any

[8 Mar 2005 13:01] Disha
Description:
Creating a function that accepts a parameter with data type 'char binary' and has the return value as the data type char binary fails.

How to repeat:
Repro Steps:   
1. Delimiter        //
2. Create database test1//
3. Use test1 //
4. Create function fn2( f1 char binary) returns char binary
	Begin
		set f1= concat( 'hello', f1 );
		return f1;
	End //

			
Expected Results :  Creation of function with the 'char binary' data type should be allowed.
    
Actual Results   :  The creation of function fails stating the following error :
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binary)...' at line 1

Additional Info :  If we try to create a function with the data type 'char byte' it is permitted.
[20 Apr 2005 21:57] Antony Curtis
Perhaps a documentation error...

Permitted syntax for CHAR types are

CHAR [ '(' <number> ')' ] 
  [ ASCII | BYTE | UNICODE | ( CHARSET | CHAR SET ) ( BINARY | <charset-name> ) ]

So, an example which should work is

create function bug9048(v1 char charset binary) returns char charset binary
begin
  set v1= concat( 'hello', v1 );
  return v1;
end|
[21 May 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".
[22 Jul 2005 7:22] Disha
We tried with the new information provided and found that it is working properly. 

However, the information provided does not seem to be documented. If it is then please provide a reference link to the documentation.

If NOT, then this bugs should be reopened and closed after documenting the information.
[18 Aug 2005 19: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/28477
[27 Aug 2005 6:26] 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/28926
[27 Aug 2005 6:35] Antony Curtis
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
[27 Aug 2005 6:45] Antony Curtis
committed to 5.0.12
[4 Sep 2005 3:11] Paul DuBois
Noted in 5.0.12 changelog.