peter_zaitsev ([info]peter_zaitsev) wrote,
@ 2005-02-11 11:10:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
MySQL: Upgrading MySQL 4.0 to 4.1
Upgrading to next MySQL version was usually quite safe. I remember quite painlessly uprading from 3.22 to 3.23, Upgrade 3.23 to 4.0 cause a bit of head ache as behavior of substraction was changed, this however was easily fixed by --sql-mode=NO_UNSIGNED_SUBTRACTION option.

With upgrade of 4.0 to 4.1 there are much more surprises, which I still see users and customer running into. We have extensive list of upgrade notes
but the practice shows not everyone has read it before upgrading: http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html

So few highlights, ranging from minor to serve.

- There are various minor but annoying syntax changes. For example you can't use "create table x(i int)" any more as I became function,
you also now need () in your UNION queries when you previously could have skipped them.

- SHOW CREATE TABLE and SHOW TABLE STATUS was changed to use "Engine" instead of "Type" which broke some of my scripts which detect storage engine of the table to decide how to work.

- ENUM values are now case insensitive by default which can give you some surprises,

- TIMESTAMP fomat output has changed significantly so if you parse it in your scripts it is very likely they are broken.

- "Illegal mix of collations" can drive you nuts, for example previously you could compare string to binary string while now you can't

- Sorting order was changed if you have characters with codes less than 32 in the end, for example "\t" and "\n" This can corrupt your tables, and even reported to hang some applications, so it is better to run CHECK TABLE after upgrade or check if you have such data in tables before. There are
few more cases when data dump/reload may be needed for upgrade.

- Authentication changes may break your applications linked to old client library, use --old-passwords option at server or relink

- Client library name (version part) changed so dynamically linked applications may no more work after upgrade. MySQL-Compat RPM package can be used
to cure it. Especially this is frequently reported with PHP

- Limit does not accept -1 as second parameter, use some large number instead (yes find all your queries and fix them)

- I also heard some changes were made in a way meta-data returned (column types etc) - this can affect PHP or JDBC applications getting extensive
use of it.

- Database,Table names and meta data are treated as unicode now, so if you used non-latin1 (ie Russian) table name you better to rename them for
upgrade otherwise you will get garbage where.

I'm sure there are more surprises, these are just I have seem most typically to happen.

Also be careful upgrading/downgrading if you're using UTF8. If you will configure MySQL 4.1 to use utf8 by default and just start it with MySQL 4.0 latin1 tables you're likely to trash your data, as there is no charset information in old tables and MySQL 4.1 will assume the data is in unicode.
So do not change character set straight ahead but run 4.1 with same charset as 4.0 before and use ALTER TABLE to convert tables to 4.1 format - this
has character set information so you should be safe.

And yes... Downgrade from 4.1 to 4.0 is no more safe with this all these changes. Worst of all it is not clearly sure when it is safe and when it is not
(On my dev machine I bounce between 4.1 and 4.0 pretty frequently and it works fine, but I do not do anything advanced wher), so take backup before upgrade and test it well before going to production (which is always good idea anyway).



(Post a new comment)

float values got changed
(Anonymous)
2005-02-23 08:32 am UTC (link)
Hi there. Your article is good- covers quite a few points about upgradation/ downgradation. Here's what we faced in our organisation . We upgraded a database from 4.0 to 4.1, and we observed that float values got converted to nonsense values. eg: a float value of type float(3,2) which had a value of 45 , got converted to 9.99. Similarly, float values of float (4,2) got converted to 99.99 and so on. What was surprising was that all 2 digit numbers eg: 45,32,67 etc got converted to nonsensical values but single digit values i.e. 4, 5 etc remained intact. Any answers for me on why this has happened??

(Reply to this) (Thread)

Re: float values got changed
(Anonymous)
2006-02-11 01:16 am UTC (link)
This is because MySQL follows ANSI standard. float(3,2) means that you have x.xx digits to work with, in that order. The decimal point does not float. Therefore, to hold "45" you would need float(4,2) which would be 45.00.

(Reply to this) (Parent)(Thread)

Re: float values got changed
[info]peter_zaitsev
2006-02-11 01:36 am UTC (link)
Well, it is not the question if the change is right or wrong, just what it may affect your application.

Even when application starve to be ANSI compatible in their expectaions there is good chance something is missed.

(Reply to this) (Parent)


[info]noreenyhuci
2008-07-11 10:13 am UTC (link)
FLOAT(p) now is a true floating-point type and not a value with a fixed number of decimals. When declaring columns using a DECIMAL(length,dec) type, the length argument no longer includes a place for the sign or the decimal point.

(Reply to this) (Parent)


[info]peter_zaitsev
2005-02-23 04:33 pm UTC (link)
Thanks,

Float values change is not expected. Could be bug of course. I would really appreciate if you could send me test case or file it as bug report.

(Reply to this) (Thread)


[info]biancasotyf
2008-07-16 09:54 pm UTC (link)
If you're making a MOD for Unreal which you plan to distribute as a umod file or if you just have a useful MOD preset, could you send me a copy of the information for the mod so that I can include a preset for it.

(Reply to this) (Parent)


[info]azalio
2005-06-11 12:25 am UTC (link)
При обновлении клиента mysql возникла трабла )
Для него требуется обновить перловую библиотеку, а она не собирается и выпадает с ошибкой, которая не лечится ни cpan'ом, ни установкой из портов.
Система FreeBSD-4.10.
Не сталкивался случайно?

(Reply to this) (Thread)

Какая точно ошибка
[info]peter_zaitsev
2005-06-11 10:34 pm UTC (link)
Без конкретно ошибки сказать сложно но я думаю что проблема в том что PERL DBI который во FreeBSD не совместим с 4.1 клиентской либой. Я знаю что тот DBI который в CVS точно должен быть совместим.

Другой подход может быть поставить MySQL 4.0 кликента отдельно (в другую директорию) и собрать с ним - если utf8 не собираешься использовать то он должен работать вполне.

(Reply to this) (Parent)

Upgrading information not available
(Anonymous)
2005-10-13 02:44 pm UTC (link)
We need to upgrade our MySQL servers from 4.0 to 4.1 and it has been very difficult to find information about this subject. Even the MySQL site has deleted all information about release 4.0 and older. Even the Reference Manual for 4.1 is not available.

The link you mention in your page: http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html is broken. I wonder where I could find more info.

We are having at first sight problems with TimeStamp fields. We don't know what to do.

Thanks.

(Reply to this) (Thread)

Re: Upgrading information not available
[info]peter_zaitsev
2005-10-17 09:21 pm UTC (link)
Hi,

Yes this link is broken and I've alerted Web team on fixing it.

Thank you for pointning this out.

(Reply to this) (Parent)

Re: Upgrading information not available
(Anonymous)
2005-10-27 12:22 pm UTC (link)
Here is the proper link:
http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-4-0.html

(Reply to this) (Parent)

Connection failed
(Anonymous)
2007-07-05 05:07 am UTC (link)
Hi, I came across your journal and I hope you can help me with my problem. I'm trying to upgrade mysql 4.0 to 4.1. I didn't uninstall the older version at c:\mysql and install 4.1 directly to c:\program files\mysql. I seem to be confused with so many instructions. When I have sucessfully install the 4.1, I got a connection failed which says - client does not support authentication protocol requested by server; consider upgrading MySql client. Is the installation automatically upgrade that matter. Thank you.

(Reply to this)

Connection failed
(Anonymous)
2007-07-05 05:07 am UTC (link)
Hi, I came across your journal and I hope you can help me with my problem. I'm trying to upgrade mysql 4.0 to 4.1. I didn't uninstall the older version at c:\mysql and install 4.1 directly to c:\program files\mysql. I seem to be confused with so many instructions. When I have sucessfully install the 4.1, I got a connection failed which says - client does not support authentication protocol requested by server; consider upgrading MySql client. Is the installation automatically upgrade that matter. What might be a solution with this? Thank you.

(Reply to this)

Куплю Windows
(Anonymous)
2007-07-17 06:20 pm UTC (link)
Куплю Windows Куплю Office -2003/XP softovip@mail.ru
и другой ЛИЦЕНЗИОННЫЙ софт
пишите на е-мейл softovip@mail.ru











































(Reply to this) (Thread)

Thank you
(Anonymous)
2008-01-17 07:01 am UTC (link)
Great site! You can find related info on the following sites:

(Reply to this) (Parent)

Idetrorce
(Anonymous)
2007-12-15 02:10 pm UTC (link)
very interesting, but I don't agree with you
Idetrorce

(Reply to this)

Free best online.
(Anonymous)
2008-04-23 05:33 pm UTC (link)
Hi,good site!

(Reply to this)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…