Bug 3454 - Initscript fails to find proper charset
: Initscript fails to find proper charset
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/MySQL-server)
: unstable
: all Linux
: P2 major
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2004-01-09 23:42 by
Modified: 2005-08-29 14:49 (History)


Attachments
initscript-charset.patch (474 bytes, patch)
2004-01-09 23:44, Dmitry Vukolov
no flags Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-01-09 23:42:55
LC_COLLATE value showed by the locale command is not necessarily quoted. And if
it's not mysqld initscript always sets charset to latin1.

$ rpm -q MySQL-server
MySQL-server-4.0.17-alt1
------- Comment #1 From 2004-01-09 23:44:33 -------
Created an attachment (id=327) [details]
initscript-charset.patch
------- Comment #2 From 2004-01-10 16:54:51 -------
if you setup locale from /etc/sysconfig/i18n or by LC_ALL var, LC_COLLATE var
would be always quoted. But if you run LC_COLLATE=ru_RU.KOI8-R service mysqld
start, charset detection would failed - it's incorrect.
How do you run mysqld? How to reproduce this bug?
Latin1 sets up always in follow cases: if didn't set CHSET var in mysqld
initscript or autodetection didn't find proper charset.
------- Comment #3 From 2004-01-10 20:57:14 -------
$ service mysqld start
Adjusting environment for mysqld:                                       [ DONE ]
Unable to find proper charset from system locale, setting 'latin1'.
Please edit mysqld init script and set proper charset.
Starting safe_mysqld service:                                           [ DONE ]

$ cat /etc/sysconfig/i18n
SYSFONT=UniCyr_8x16
LC_CTYPE=ru_RU.KOI8-R
LC_MONETARY=ru_RU.KOI8-R
LANGUAGE=ru_RU.KOI8-R
LC_TIME=ru_RU.KOI8-R
LC_NUMERIC=ru_RU.KOI8-R
LC_COLLATE=ru_RU.KOI8-R
LC_MESSAGES=ru_RU.KOI8-R
LANG=ru_RU.KOI8-R
SYSFONTACM=koi8-r

$ locale
LANG=ru_RU.KOI8-R
LC_CTYPE=ru_RU.KOI8-R
LC_NUMERIC=ru_RU.KOI8-R
LC_TIME=ru_RU.KOI8-R
LC_COLLATE=ru_RU.KOI8-R
LC_MONETARY=ru_RU.KOI8-R
LC_MESSAGES=ru_RU.KOI8-R
LC_PAPER="ru_RU.KOI8-R"
LC_NAME="ru_RU.KOI8-R"
LC_ADDRESS="ru_RU.KOI8-R"
LC_TELEPHONE="ru_RU.KOI8-R"
LC_MEASUREMENT="ru_RU.KOI8-R"
LC_IDENTIFICATION="ru_RU.KOI8-R"
LC_ALL=
------- Comment #4 From 2004-01-12 16:18:31 -------
It won't to reproduce.
I'll apply this patch as workaround. Wait for alt2.
And what is your system name/version?
------- Comment #5 From 2004-01-13 09:18:44 -------
Originally it was Master 2.0 long ago. Now it's partly old Sisyphus, partly
current Sisyphus.

$ rpm -q glibc-locales sh
glibc-locales-2.2.6-alt0.11
sh-2.05b-alt6
------- Comment #6 From 2004-01-13 09:34:28 -------
BTW, look what I've found:

$ locale | fgrep LC_COLLATE
LC_COLLATE=ru_RU.KOI8-R
$ unset LC_COLLATE
$ . /etc/sysconfig/i18n
$ locale | fgrep LC_COLLATE
LC_COLLATE="ru_RU.KOI8-R"

Weird, isn't it?
------- Comment #7 From 2004-02-17 19:06:10 -------
Proposed change from Alexey Morozov 
 
default_charset="$(. /etc/sysconfig/i18n && locale | 
sed -ne 's/^LC_COLLATE="\?[^".]\+\.\([^"]\+\)"\?$/\1/p')" 
 
------- Comment #8 From 2004-02-17 19:08:47 -------
*** Bug 3709 has been marked as a duplicate of this bug. ***
------- Comment #9 From 2004-02-18 17:00:06 -------
fixed in 4.0.18-alt1