Bug 3454 - Initscript fails to find proper charset
Summary: Initscript fails to find proper charset
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: MySQL-server (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Kachalov Anton
QA Contact: qa-sisyphus
URL:
Keywords:
: 3709 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-09 23:42 MSK by Dmitry Vukolov
Modified: 2005-08-29 14:49 MSD (History)
6 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Vukolov 2004-01-09 23:42:55 MSK
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 Dmitry Vukolov 2004-01-09 23:44:33 MSK
Created attachment 327 [details]
initscript-charset.patch
Comment 2 Kachalov Anton 2004-01-10 16:54:51 MSK
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 Dmitry Vukolov 2004-01-10 20:57:14 MSK
$ 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 Kachalov Anton 2004-01-12 16:18:31 MSK
It won't to reproduce.
I'll apply this patch as workaround. Wait for alt2.
And what is your system name/version?
Comment 5 Dmitry Vukolov 2004-01-13 09:18:44 MSK
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 Dmitry Vukolov 2004-01-13 09:34:28 MSK
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 Dmitry V. Levin 2004-02-17 19:06:10 MSK
Proposed change from Alexey Morozov 
 
default_charset="$(. /etc/sysconfig/i18n && locale | 
sed -ne 's/^LC_COLLATE="\?[^".]\+\.\([^"]\+\)"\?$/\1/p')" 
 
Comment 8 Dmitry V. Levin 2004-02-17 19:08:47 MSK
*** Bug 3709 has been marked as a duplicate of this bug. ***
Comment 9 Kachalov Anton 2004-02-18 17:00:06 MSK
fixed in 4.0.18-alt1