| Bug #19295 | collation_connection doesn't works all the time | ||
|---|---|---|---|
| Submitted: | 24 Apr 2006 9:26 | Modified: | 12 Jun 2006 9:51 |
| Reporter: | Sylvain | Email Updates: | |
| Status: | No Feedback | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 4.1.11 | OS: | Linux (Debian Sarge) |
| Assigned to: | CPU Architecture: | Any | |
[24 Apr 2006 9:26]
Sylvain
[24 Apr 2006 9:29]
Sylvain
Oops, just for information, I use InnoDB tables
[25 Apr 2006 12:35]
Valeriy Kravchuk
Thank you for a problem report. Please, provide a complete test case, with CREATE TABLE, some data in table, exect PHP application to demonstrate the problem. Then try to repeat with a newer version of MySQL, 4.1.18 (and don't forget to recompile PHP with newer mysqlclient library), and inform about the results.
[27 Apr 2006 7:56]
Sylvain
File for latin1 : ================ CUT HERE ================ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> <head> <title>Bug 19295</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <?php function showError(){ die('#' . mysql_errno() . ' : ' . mysql_error()) ; } mysql_pconnect('bdd','user','pass'); mysql_select_db('db') or showError(); $q = "SET collation_connection = 'latin1_swedish_ci'" ; mysql_query($q) or showError() ; $q = "SELECT data FROM bug19295" ; $rs = mysql_query($q) or showError() ; while($row= mysql_fetch_assoc($rs)){ echo $row['data'] . '<br />' ; } ?> </body> </html> ================ CUT HERE ================ File for UTF-8 : ================ CUT HERE ================ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> <head> <title>Bug 19295</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <?php function showError(){ die('#' . mysql_errno() . ' : ' . mysql_error()) ; } mysql_pconnect('bdd','user','pass'); mysql_select_db('db') or showError() ; $q = "SET collation_connection = 'utf8_general_ci'" ; mysql_query($q) or showError() ; $q = "SELECT data FROM bug19295" ; $rs = mysql_query($q) or showError() ; while($row= mysql_fetch_assoc($rs)){ echo $row['data'] . '<br />' ; } ?> </body> </html> ================ CUT HERE ================ DB ================ CUT HERE ================ CREATE TABLE `bug19295` ( `data` varchar(20) NOT NULL default '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `bug19295` (`data`) VALUES ('Tête'), ('Cassé'); ================ CUT HERE ================ I try this code many times but the bug don't reappear !? I explain my method : - open phpMyAdmin with utf8 collation connection - launch 100 times file for UTF-8 - in phpMyAdmin, make a SHOW PROCESS and keep the pid list - launch 1 time file for latin-1 - in phpMyAdmin, make a SHOW PROCESS and compare the pid list with the old one, if there are the same, latin-1 program reuse surely an UTF-8 collaction connection and normally would bug sometimes..
[27 Apr 2006 13:13]
Sylvain
I don't understand, the problem is still in my own application which force collation connection to latin1 !? I fetch "Dépenses" instead of "Dépenses". The test application works all the time. The problem is very randomized, I can make refresh of my browser many hundred times with no error and one time in more : *boom* :-/ I will use a MySQL 5 backport, I hope the problem will disappear.
[12 May 2006 9:51]
Valeriy Kravchuk
Yes, please, try to repeat with the latest MySQL 5 version, 5.0.21, and PHP5/mysqli, and inform about the results. Is it intended to use DEFAULT CHARSET=latin1; for the table?
[12 Jun 2006 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
