Bug #8349 myisamchk: --set-charset does not work
Submitted: 7 Feb 2005 1:28 Modified: 7 Mar 2005 21:34
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:4.1.9 OS:
Assigned to: Alexander Barkov CPU Architecture:Any

[7 Feb 2005 1:28] Christian Hammers
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))
  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 11:27] Aleksey Kishkin
tested on  current 4.1 and 5.0
[22 Feb 2005 12: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 21:34] Paul DuBois
Update the descriptions of the options in the myisamchk

Noted change in 4.1.11, 5.0.3 changelogs.