Bug #8349 myisamchk: --set-charset does not work
Submitted: 7 Feb 2005 2:28 Modified: 7 Mar 2005 22:34
Reporter: Christian Hammers (Silver Quality Contributor) (SCA)
Status: Closed
Category:Server: MyISAM Severity:S3 (Non-critical)
Version:4.1.9 OS:
Assigned to: Alexander Barkov Target Version:

[7 Feb 2005 2:28] Christian Hammers
Description:
The --set-charset option of myisamchk seems not to work correctly although the mentioned
charset is both, compiled in and specified in the Index.xml file.
"SHOW CHARSET" lists it at least and it works as "mysql --default-character-set"

How to repeat:
# myisamchk --set-character-set=cp1251 foo
myisamchk: Character set 'cp1251' is not a compiled character set and is not specified in
the '/usr/share/mysql/charsets/Index.xml' file

# patched-myisamchk --set-character-set=cp1251 foo
myisamchk: error: File 'foo' doesn't exist

Suggested fix:
In myisamch.c line 1774 replace
  get_charset_by_name(set_charset_name, MYF(MY_WME))
with
  get_charset_by_csname(set_charset_name, MY_CS_PRIMARY, MYF(MY_WME))

I saw examples of both calls in several programs. So maybe whatever is wrong is wrong
on more than just this place.
[7 Feb 2005 12:27] Aleksey Kishkin
tested on  current 4.1 and 5.0
[22 Feb 2005 13:43] Alexander Barkov
The command line switch is changed to --set-collation,
and the error message is changed to "unknown collation".

bk commit - 4.1 tree (bar:1.2185) BUG#8349
[7 Mar 2005 22:34] Paul DuBois
Update the descriptions of the options in the myisamchk
section.

Noted change in 4.1.11, 5.0.3 changelogs.