peter_zaitsev ([info]peter_zaitsev) wrote,

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

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

  • 17 comments

Anonymous

February 23 2005, 08:32:18 UTC 7 years ago

float values got changed

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??

Anonymous

February 11 2006, 01:16:27 UTC 6 years ago

Re: float values got changed

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.

[info]peter_zaitsev

February 11 2006, 01:36:37 UTC 6 years ago

Re: float values got changed

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.

[info]noreenyhuci

July 11 2008, 10:13:15 UTC 3 years ago

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.

[info]peter_zaitsev

February 23 2005, 16:33:44 UTC 7 years ago

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.

[info]biancasotyf

July 16 2008, 21:54:54 UTC 3 years ago

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.

[info]azalio

June 11 2005, 00:25:27 UTC 6 years ago

При обновлении клиента mysql возникла трабла )
Для него требуется обновить перловую библиотеку, а она не собирается и выпадает с ошибкой, которая не лечится ни cpan'ом, ни установкой из портов.
Система FreeBSD-4.10.
Не сталкивался случайно?

[info]peter_zaitsev

June 11 2005, 22:34:27 UTC 6 years ago

Какая точно ошибка

Без конкретно ошибки сказать сложно но я думаю что проблема в том что PERL DBI который во FreeBSD не совместим с 4.1 клиентской либой. Я знаю что тот DBI который в CVS точно должен быть совместим.

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

Anonymous

October 13 2005, 14:44:43 UTC 6 years ago

Upgrading information not available

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.

[info]peter_zaitsev

October 17 2005, 21:21:54 UTC 6 years ago

Re: Upgrading information not available

Hi,

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

Thank you for pointning this out.

Anonymous

October 27 2005, 12:22:47 UTC 6 years ago

Re: Upgrading information not available

Here is the proper link:
http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-4-0.html

Anonymous

July 5 2007, 05:07:15 UTC 4 years ago

Connection failed

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.

Anonymous

July 5 2007, 05:07:53 UTC 4 years ago

Connection failed

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.

Anonymous

July 17 2007, 18:20:32 UTC 4 years ago

Куплю Windows

Куплю Windows Куплю Office -2003/XP softovip@mail.ru
и другой ЛИЦЕНЗИОННЫЙ софт
пишите на е-мейл softovip@mail.ru











































Anonymous

January 17 2008, 07:01:45 UTC 4 years ago

Thank you

Great site! You can find related info on the following sites:

Anonymous

December 15 2007, 14:10:31 UTC 4 years ago

Idetrorce

very interesting, but I don't agree with you
Idetrorce

Anonymous

April 23 2008, 17:33:25 UTC 4 years ago

Free best online.

Hi,good site!

Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…