Bug #37400 mysql: Bad help message for charset command

Submitted: 13 Jun 2008 17:11 Modified: 18 Mar 2009 14:30
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0 and up OS:Any
Assigned to: Tatiana Azundris Nuernberg CPU Architecture:Any

[13 Jun 2008 17:11] Paul DuBois
Description:
The mysql command line client has a charset command. If you use the command without an argument, you get a help message:

mysql> charset
ERROR: 
Usage: \C char_setname | charset charset_name

The argument is named inconsistently in the help message. "char_setname" should be "charset_name".

How to repeat:
See above

Suggested fix:
Fix this function:

static int
com_charset(String *buffer __attribute__((unused)), char *line)
{
  char buff[256], *param;
  CHARSET_INFO * new_cs;
  strmake(buff, line, sizeof(buff) - 1);
  param= get_arg(buff, 0);
  if (!param || !*param)
  {
    return put_info("Usage: \\C char_setname | charset charset_name",
            INFO_ERROR, 0);
  }
  new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));
  if (new_cs)
  {
    charset_info= new_cs;
    mysql_set_character_set(&mysql, charset_info->csname);
    default_charset= (char *)charset_info->csname;
    default_charset_used= 1;
    put_info("Charset changed", INFO_INFO);
  }
  else put_info("Charset is not found", INFO_INFO);
  return 0;
}
[13 Jun 2008 19:46] Valeriy Kravchuk
Thank you for a bug report.
[19 Feb 2009 4:06] 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/66826

2752 Tatiana A. Nurnberg	2009-02-19
      Bug#37400: mysql: Bad help message for charset command
      
      Typo existed in help-text for command "charset" in mysql
      client, making the parameter-name different for long and
      short forms of the command for no good reason.
      
      Fixed.
     @ client/mysql.cc
        Make parameter-name in help-text the same for
        long and short forms, for consistency.
[24 Feb 2009 8:50] Tatiana Azundris Nuernberg
patch queued for 5.0.79, 5.1.33, 6.0.10 in -bugteam
[9 Mar 2009 14:14] Bugs System
Pushed into 5.0.79 (revid:joro@sun.com-20090309135922-a0di9ebkxoj4d4wv) (version source revid:aelkin@mysql.com-20090224143545-7xc77386o8mg623c) (merge vers: 5.0.79) (pib:6)
[13 Mar 2009 1:53] Paul DuBois
Cosmetic change. No changelog entry needed.

Setting report to NDI pending push into 5.1.x/6.0.x.
[13 Mar 2009 19:05] Bugs System
Pushed into 5.1.33 (revid:joro@sun.com-20090313111355-7bsi1hgkvrg8pdds) (version source revid:azundris@mysql.com-20090224083304-dv80z1sz26w1uluv) (merge vers: 5.1.33) (pib:6)
[13 Mar 2009 20:30] Paul DuBois
Setting report to NDI pending push into 6.0.x.
[18 Mar 2009 13:20] Bugs System
Pushed into 6.0.11-alpha (revid:joro@sun.com-20090318122208-1b5kvg6zeb4hxwp9) (version source revid:azundris@mysql.com-20090224083517-muuvvuqkd25m2d1v) (merge vers: 6.0.10-alpha) (pib:6)
[18 Mar 2009 14:30] Paul DuBois
Cosmetic change. No changelog entry needed.
[9 May 2009 16:43] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508100057-30ote4xggi4nq14v) (merge vers: 5.1.33-ndb-6.2.18) (pib:6)
[9 May 2009 17:40] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090508175813-s6yele2z3oh6o99z) (merge vers: 5.1.33-ndb-6.3.25) (pib:6)
[9 May 2009 18:37] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509073226-09bljakh9eppogec) (merge vers: 5.1.33-ndb-7.0.6) (pib:6)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.065 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.