Closed
Bug 757565
Opened 13 years ago
Closed 13 years ago
Wrong charsets on several tables
Categories
(Participation Infrastructure :: Phonebook, defect)
Participation Infrastructure
Phonebook
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: jsocol, Assigned: scabral)
References
Details
(Whiteboard: [qa-])
This may be a duplicate of a traceback bug, but we've got a couple tables with latin1 charsets.
* groups_skill (column: name)
* profile_skills (no text columns)
* thumbnail_kvstore (column: value)
| Reporter | ||
Comment 1•13 years ago
|
||
See also bug 757567.
| Assignee | ||
Comment 2•13 years ago
|
||
The database itself should be set to utf8 when it's created, for example:
CREATE DATABASE db_name
DEFAULT CHARACTER SET utf8
DEFAULT COLLATION utf8_ci;
(if that's what you want, a case-insensitive utf8 collation. I think there's also a case sensitive utf8-collation (utf8-cs) and I know there's a case-sensitive binary collation (utf8-bin). A binary collation is one that will preserve everything, even trailing spaces in a varchar or text field.
| Assignee | ||
Comment 3•13 years ago
|
||
mysql> show create database mozillians_dev_allizom_org;
+----------------------------+---------------------------------------------------------------------------------------+
| Database | Create Database |
+----------------------------+---------------------------------------------------------------------------------------+
| mozillians_dev_allizom_org | CREATE DATABASE `mozillians_dev_allizom_org` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------------------------+---------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> ALTER DATABASE mozillians_dev_allizom_org DEFAULT CHARACTER SET utf8 ;
Query OK, 1 row affected (0.03 sec)
mysql> show create database mozillians_dev_allizom_org;
+----------------------------+-------------------------------------------------------------------------------------+
| Database | Create Database |
+----------------------------+-------------------------------------------------------------------------------------+
| mozillians_dev_allizom_org | CREATE DATABASE `mozillians_dev_allizom_org` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------------------------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Now any new tables created in this database will be utf8 by default.
| Assignee | ||
Comment 4•13 years ago
|
||
[root@dev1.db.phx1 ~]# time mysqldump --no-data mozillians_dev_allizom_org > schema.sql
real 0m0.069s
user 0m0.007s
sys 0m0.005s
[root@dev1.db.phx1 ~]# time mysqldump --no-create-info --default-character-set=latin1 mozillians_dev_allizom_org > data.sql
real 0m0.278s
user 0m0.113s
sys 0m0.024s
[root@dev1.db.phx1 ~]# vi schema.sql
-- here is where I edited the table to have the proper charset
[root@dev1.db.phx1 ~]# mysql mozillians_dev_allizom_org < schema.sql
[root@dev1.db.phx1 ~]# mysql mozillians_dev_allizom_org < data.sql
Assignee: nobody → scabral
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•13 years ago
|
||
Working on stage now:
[root@dev1.db.phx1 ~]# time mysqldump --no-data mozillians_stage > schema.sql
real 0m0.067s
user 0m0.005s
sys 0m0.006s
[root@dev1.db.phx1 ~]# vi schema.sql
[root@dev1.db.phx1 ~]# time mysqldump --no-create-info --default-character-set=latin1 mozillians_stage > data.sql
real 0m0.113s
user 0m0.029s
sys 0m0.013s
[root@dev1.db.phx1 ~]# mysql mozillians_stage < schema.sql
[root@dev1.db.phx1 ~]# time mysql mozillians_stage < data.sql
real 0m2.385s
user 0m0.026s
sys 0m0.007s
| Assignee | ||
Comment 6•13 years ago
|
||
Left to do: production. This should take about 5 mins or less.
| Reporter | ||
Comment 7•13 years ago
|
||
-dev is down. Let's investigate tomorrow before we greenlight production.
Production target is Monday the 28th. It's a holiday so traffic should be low. Sheeri and I will find a time.
| Assignee | ||
Comment 8•13 years ago
|
||
James - what do you mean by "down"?
| Reporter | ||
Comment 9•13 years ago
|
||
(In reply to Sheeri Cabral [:sheeri] from comment #8)
> James - what do you mean by "down"?
When I made that comment, the site wasn't loading. Now it is. Must've been a restart or other transient effect.
| Assignee | ||
Comment 10•13 years ago
|
||
phew!
| Assignee | ||
Comment 11•13 years ago
|
||
[root@generic1.db.phx1 ~]# mysqldump --no-data mozillians_org > schema.sql
[root@generic1.db.phx1 ~]# mysqldump --no-create-info --default-character-set=latin1 mozillians_org > data.sql
[root@generic1.db.phx1 ~]# vi schema.sql
#### changed latin1 to utf8
[root@generic1.db.phx1 ~]# mysql mozillians_org < schema.sql
[root@generic1.db.phx1 ~]# time mysql mozillians_org < data.sql
real 0m9.248s
user 0m0.187s
sys 0m0.015s
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•