Closed Bug 757565 Opened 13 years ago Closed 13 years ago

Wrong charsets on several tables

Categories

(Participation Infrastructure :: Phonebook, defect)

defect
Not set
normal

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)
See also bug 757567.
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.
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.
[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
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
Left to do: production. This should take about 5 mins or less.
Depends on: 735130
-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.
James - what do you mean by "down"?
(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.
phew!
[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
Bumpiing to verified as [qa-]
Status: RESOLVED → VERIFIED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.