Description:
When I execute "help MBR" via mysql-client command line, the output below confuses me.
***** my shell *****
mysql> help MBR;
Name: 'MBR'
Description:
MBR DEFINITIONExamples:
N
***** end *****
The reason for this is that in the com_server_help (in client/mysql.cc) function, no distinction is made between the following two MYSQL_RES case when there is only one row in MYSQL_RES:
case1:
---------------------------------
name | description | example
---------------------------------
case2:
-----------------------------------------
source_category | name | is_it_category
-----------------------------------------
When I excuting "help MBR", the MYSQL_RES is just like case2, But the client outputs it in the format of case2.
How to repeat:
Just execute "help MBR" via mysql-client command line to repeat it.
In addition, You can also repeat the bug by the following sql statement.
mysql> INSERT INTO mysql.help_category (help_category_id,name,parent_category_id,url) VALUES (12345,'category1',0,'');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO mysql.help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (11111,12345,'topic1','\n','','');
Query OK, 1 row affected (0.01 sec)
mysql> help category1;
Suggested fix:
Modify the com_server_help function to distincte case1 and case2, or distincte it in mysqld_help(in sql/sql_help.cc) function