Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143834 - MySQL upgrade to 4.1 guide does not mention a "gotcha"
Summary: MySQL upgrade to 4.1 guide does not mention a "gotcha"
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Xavier Neys (RETIRED)
URL: http://www.gentoo.org/doc/en/mysql-up...
Whiteboard:
Keywords:
Depends on:
Blocks: 144999
  Show dependency tree
 
Reported: 2006-08-13 19:04 UTC by Dice Random
Modified: 2006-09-08 03:39 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dice Random 2006-08-13 19:04:09 UTC
The Upgrade guide to MySQL 4.1.x goes through most of the steps required for the upgrade, however I have run across one problem which is not mentioned.  The default character set has changed from latin1 to utf8 during the MySQL 4.0.x to 4.1.x cycle.  In order to get MySQL 4.1.x to be able to properly recognize latin1 data from a mysqldump off a 4.0.x server you must build it with the latin1 USE flag.  This does not apply to all latin1 characters, ASCII standard characters work fine, however other special characters will not be carried over properly.  If this data is in a keyed column it can even result in MySQL halting the import and throwing an error about identical keys in the data set for the table, as happened to me.
Comment 1 nm (RETIRED) gentoo-dev 2006-09-01 08:20:50 UTC
(In reply to comment #0)
> The Upgrade guide to MySQL 4.1.x goes through most of the steps required for
> the upgrade, however I have run across one problem which is not mentioned.  The
> default character set has changed from latin1 to utf8 during the MySQL 4.0.x to
> 4.1.x cycle.  In order to get MySQL 4.1.x to be able to properly recognize
> latin1 data from a mysqldump off a 4.0.x server you must build it with the
> latin1 USE flag.  This does not apply to all latin1 characters, ASCII standard
> characters work fine, however other special characters will not be carried over
> properly.  If this data is in a keyed column it can even result in MySQL
> halting the import and throwing an error about identical keys in the data set
> for the table, as happened to me.
> 

Are you sure this is mysql specific, and not just because the new ebuild may have grabbed/set some environment variables based on your current systemwide locale? Or something besides documentation. :)

CCing a knowledgable mysql guy on this.
Comment 2 Francesco R. (RETIRED) gentoo-dev 2006-09-01 09:05:27 UTC
The dump from the 4.0 MySQL database should have inside the specification of which character set use for the databases and for the tables. Thus overriding the my.cnf default.
To enforce that it's possible to:
sed -i -e "s/utf8/latin1/g" /etc/mysql/my.cnf

Doing the real conversion between latin1 and utf8 may be a real issue^W^W^W^W^W is a royal pain unless the database has only ASCII characters (those < 127)

I'm working on a update of the document for the upcoming mysql 5.0 stabilization:

http://dev.gentoo.org/~vivo/doc/mysql-upgrading.xml

I will try to cover this argument better in the new version.
Comment 3 Francesco R. (RETIRED) gentoo-dev 2006-09-03 10:43:33 UTC
Ok, spent some time installing a fresh new MySQL 4.0 and done some random testing on upgrading and charset convention.

http://dev.gentoo.org/~vivo/doc/mysql-upgrading.xml

now contain a "On charset conversion:" Charapter that is more a brain dump than something else but I do not expect to go further than that.

"docs-team" could you review the document and replace the previous one ?
Comment 4 Xavier Neys (RETIRED) gentoo-dev 2006-09-03 12:56:26 UTC
(In reply to comment #3)
> "docs-team" could you review the document and replace the previous one ?

Is asking for valid XML too much?

$ xmllint --noout --valid mysql-upgrading.xml.dev 2>&1 | wc -l
45
Comment 5 Francesco R. (RETIRED) gentoo-dev 2006-09-04 00:56:04 UTC
Sorry, it render well on d.g.o and I've assumed it's well formed xml
, how do create paragraphs in dd lists ?
Comment 6 Xavier Neys (RETIRED) gentoo-dev 2006-09-04 02:26:53 UTC
(In reply to comment #5)
> Sorry, it render well on d.g.o

Don't assume that it's valid because it renders well, which it does not quite btw.
Some level of invalidity will always be supported, a bit of it because of old files that have become invalid due to GuideXML spec changes, most of it because of the way XSL works.
Besides, validity is assumed because it's checked once at commit-time. I'm not going to burden the XSL with validity checks at render-time.
In short, never rely on XSL not crashing to assume it's 100% OK.

> I've assumed it's well formed xml

It is well-formed, but it's not valid.
FYI, well-formed means it's XML, if it's not, you can't even call it XML.
Valid means it complies with its DTD or schema.

> how do create paragraphs in dd lists ?

You don't.
If you can't or don't want to make it valid, don't worry, we'll do it for you.
Comment 7 Francesco R. (RETIRED) gentoo-dev 2006-09-04 03:28:01 UTC
> > how do create paragraphs in dd lists ?
> 
> You don't.
> If you can't or don't want to make it valid, don't worry, we'll do it for you.
> 

removed all <dd> and related, there is also a small update:

grep -A5 ChangeLog mysql-upgrading.xml

it pass "xmllint  --noout --valid mysql-upgrading.xml" now.
Comment 8 Francesco R. (RETIRED) gentoo-dev 2006-09-08 02:19:47 UTC
ping: status? Tentative timeline on when this will be pushed?
This doc or a better one will be needed before MySQL 5.0 stabilization.
Comment 9 Xavier Neys (RETIRED) gentoo-dev 2006-09-08 02:29:15 UTC
Right, I'll take care of it ASAP
Comment 10 Xavier Neys (RETIRED) gentoo-dev 2006-09-08 03:39:43 UTC
Please ping someone from GDP when -5.x enters stable to have the abstract changed.

Done minor edits, left links to your wiki dump out.

In CVS. Thanks a lot.