Bug #78413 5.6 base64 functions in help tables should not have ()
Submitted: 11 Sep 2015 21:34 Modified: 18 Sep 2015 7:50
Reporter: Domas Mituzas Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[11 Sep 2015 21:34] Domas Mituzas
Description:
HI!

So, help tables have entries for functions like:

   SOUNDEX
   SOUNDS LIKE
   SPACE
   STRCMP
   SUBSTR
   SUBSTRING

Which is fine. 

Unfortunately, some functions have parentheses next to them, which makes usage of help subsystem not intuitive:

mysql> PAGER grep '()'
PAGER set to 'grep '()''
mysql> help string functions
For more information, type 'help <item>', where <item> is one of the following
topics:
   FROM_BASE64()
   TO_BASE64()

mysql> select name FROM help_topic where name like '%()';
+---------------+
| name          |
+---------------+
| FROM_BASE64() |
| TO_BASE64()   |
+---------------+
2 rows in set (0.01 sec)

That makes BASE64 function usage in MySQL very confusing. 

How to repeat:
> HELP TO_BASE64
> HELP TO_BASE64()

Suggested fix:
remove ()
[12 Sep 2015 5:53] MySQL Verification Team
Hello Domas,

Thank you for the report.

Thanks,
Umesh
[12 Sep 2015 5:54] MySQL Verification Team
// 5.6.28

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select name FROM mysql.help_topic where name like '%()';
+---------------+
| name          |
+---------------+
| FROM_BASE64() |
| TO_BASE64()   |
+---------------+
2 rows in set (0.00 sec)

mysql> HELP TO_BASE64

Nothing found
Please try to run 'help contents' for a list of all accessible topics

mysql> HELP TO_BASE64()
Name: 'TO_BASE64()'
Description:
Syntax:
TO_BASE64(str)

Converts the string argument to base-64 encoded form and returns the
result as a character string with the connection character set and
collation. If the argument is not a string, it is converted to a string
before conversion takes place. The result is NULL if the argument is
NULL. Base-64 encoded strings can be decoded using the FROM_BASE64()
function.

URL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html

Examples:
mysql> SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'));
        -> 'JWJj', 'abc'

mysql> PAGER grep '()'
PAGER set to 'grep '()''
mysql> help string functions
For more information, type 'help <item>', where <item> is one of the following
topics:
   FROM_BASE64()
   TO_BASE64()
mysql> \q
Bye

// 5.7.9

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.9-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select name FROM mysql.help_topic where name like '%()';
+---------------+
| name          |
+---------------+
| FROM_BASE64() |
| TO_BASE64()   |
+---------------+
2 rows in set (0.00 sec)

mysql> HELP TO_BASE64

Nothing found
Please try to run 'help contents' for a list of all accessible topics

mysql> HELP TO_BASE64()
Name: 'TO_BASE64()'
Description:
Syntax:
TO_BASE64(str)

Converts the string argument to base-64 encoded form and returns the
result as a character string with the connection character set and
collation. If the argument is not a string, it is converted to a string
before conversion takes place. The result is NULL if the argument is
NULL. Base-64 encoded strings can be decoded using the FROM_BASE64()
function.

URL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html

Examples:
mysql> SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'));
        -> 'JWJj', 'abc'

mysql> PAGER grep '()'
PAGER set to 'grep '()''
mysql> help string functions
For more information, type 'help <item>', where <item> is one of the following
topics:
   FROM_BASE64()
   TO_BASE64()
mysql>
[18 Sep 2015 7:50] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.