Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111809 - MySQL 5.0.15 ignores collation-server in my.cnf
Summary: MySQL 5.0.15 ignores collation-server in my.cnf
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-07 11:57 UTC by Timo Maier
Modified: 2005-12-07 15:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
my.cnf (my.cnf,4.02 KB, text/plain)
2005-11-27 07:06 UTC, Timo Maier
Details
/tmp/char-before_mysql-slot.rc6.patch (char-before_mysql-slot.rc6.patch,1.00 KB, patch)
2005-11-29 02:30 UTC, Francesco R. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Maier 2005-11-07 11:57:53 UTC
I have 
[mysqld]
collation-server = latin1_german1_ci
in my /etc/mysql/my.cnf, but mysql ignores this:

mysql> show variables like '%colla%';
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | latin1_swedish_ci |
| collation_server     | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)

If I edit /etc/init.d/mysql and add --collation-server = latin1_german1_ci as
command line parameter, everything is fine:

mysql> show variables like '%colla%';
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | latin1_german1_ci |
| collation_server     | latin1_german1_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)




Reproducible: Always
Steps to Reproduce:
1. echo dev-db/mysql ~amd64 >> /etc/portage/package.keywords 
2. emerge mysql
3. 



Expected Results:  
mysql should read the collation from my.cnd
Comment 1 Timo Maier 2005-11-27 01:19:14 UTC
This problem still exists with mysql-5.0.16-r3
Comment 2 Francesco R. (RETIRED) gentoo-dev 2005-11-27 06:18:37 UTC
very strange, the rc script that start mysql-5.0.16-r3 read itself the
parameters from /etc/mysql/my.cnf and pass them to the server.

1) See if there are differences between
/usr/portage/dev-db/mysql/files/mysql-slot.rc6 and 
/etc/init.d/mysql

2) attach here your my.cnf file
Comment 3 Timo Maier 2005-11-27 07:06:03 UTC
Created attachment 73674 [details]
my.cnf

/usr/portage/dev-db/mysql/files/mysql-slot.rc6 and /etc/init.d/mysql are the
same. I just have checked this with diff.

I have attached my my.cnf
Comment 4 Francesco R. (RETIRED) gentoo-dev 2005-11-27 09:37:21 UTC
Isolated:

This one fail to set the collation:
#/usr/sbin/mysqld [...] \
--collation-server=latin1_german1_ci \
--default-character-set=latin1 \
--character-set-server=latin1


this one succed:
#/usr/sbin/mysqld [...] \
--default-character-set=latin1 \
--character-set-server=latin1 \
--collation-server=latin1_german1_ci 

As you can see the order of the parameters differ.

[random thoughts from here]
probably setting the charset set also a default collation, 
since the order of parameters is "rightmost win" the collation is overrided from
the charset default.
(RightMost on command line corresponds to bottommost in my.cnf)

workaround put all collation% settings after char% settings.

May be nice from you to fill a bug upstream and see theyr thoughts (if you do so
please report bug number here)

Thanks for your patience.
Francesco R.
Comment 5 Timo Maier 2005-11-27 11:06:44 UTC
I have reported this bug on http://bugs.mysql.com/15276
Comment 6 Francesco R. (RETIRED) gentoo-dev 2005-11-29 02:30:57 UTC
Created attachment 73783 [details, diff]
/tmp/char-before_mysql-slot.rc6.patch

patch for /etc/init.d/mysql to pass characther parameters before each other (so
including collations).

This may or may not be included in portage tree, still some research to do on
it.
basically:
- is charset* the only one that need an order ?
- interaction with /etc/conf.d/mysql file
Comment 7 Timo Maier 2005-11-29 09:56:44 UTC
> - is charset* the only one that need an order ?

Currently nothing is documented about an order of parameters. At
http://bugs.mysql.com/15276 it's being discussed if this should be fixed in code
or documented. I really hope they fix their code.
Comment 8 Francesco R. (RETIRED) gentoo-dev 2005-12-07 15:52:02 UTC
the /etc/init.d/mysql script attached at bug #114621 should workaround this issue.

Depending on feedback, it may reach production very soon.