Oracle 5.0 Reference Manual page 166

Table of Contents

Advertisement

2. Dump all trigger definitions using the following
SELECT CONCAT('CREATE TRIGGER ', t.TRIGGER_SCHEMA, '.', t.TRIGGER_NAME,
' ', t.ACTION_TIMING, ' ', t.EVENT_MANIPULATION, ' ON ',
t.EVENT_OBJECT_SCHEMA, '.', t.EVENT_OBJECT_TABLE,
' FOR EACH ROW ', t.ACTION_STATEMENT, '//' )
INTO OUTFILE '/tmp/triggers.sql'
FROM INFORMATION_SCHEMA.TRIGGERS AS t;
The statement uses
be created on the server host. Use a different file name if you like. To be 100% safe, inspect the
trigger definitions in the
3. Stop the server and drop all triggers by removing all
Change location to your data directory and issue this command:
shell>
rm */*.TRG
4. Start the server and re-create all triggers using the
mysql>
delimiter // ;
mysql>
source /tmp/triggers.sql //
5. Use the
SHOW TRIGGERS
• Incompatible change: The indexing order for end-space in
tables has changed. Starting from 5.0.3,
(just as MySQL sorts CHAR,
should run
CHECK TABLE
table if it is an
InnoDB
• Incompatible change. As of MySQL 5.0.3, trailing spaces no longer are removed from values
stored in
and
VARCHAR
columns in MySQL 5.0.3 and later are 65,535 characters and 65,535 bytes, respectively.
When a binary upgrade (file system-level copy of data files) to MySQL 5.0 is performed for a table
with a
column, the column is space-padded to the full permissible width of the column.
VARBINARY
This causes values in
extra trailing spaces after the upgrade, which means that the data in the column is different.
In addition, new rows inserted into a table upgraded in this way will be space padded to the full width
of the column.
This issue can be resolved as follows:
1. For each table containing
is the name of the table and
tbl_name
currently used by tbl_name:
ALTER TABLE
tbl_name
In other words, if the table named
use this statement:
ALTER TABLE mytable ENGINE=MYISAM;
This rebuilds the table so that it uses the 5.0
2. Then you must remove all trailing spaces from any
column varbinary_column, execute the following statement, where
VARBINARY
the name of the table containing the
UPDATE
tbl_name
Upgrading MySQL
OUTFILE, so you must have the
INTO
triggers.sql
statement to check that all triggers were created successfully.
TEXT
and
VARCHAR
TEXT
on it. If the check reports errors, rebuild the indexes: Dump and reload the
table, or run
OPTIMIZE TABLE
columns. The maximum lengths for
VARBINARY
columns that do not occupy the full width of the column to include
VARBINARY
columns, execute the following statement, where
VARBINARY
ENGINE=engine_name;
mytable
VARBINARY
SET
varbinary_column
146
statement:
SELECT
FILE
file, and perhaps make a backup of the file.
files in your database directories.
.TRG
triggers.sql
TEXT
indexes are compared as space-padded at the end
fields). If you have an index on a
or
REPAIR TABLE
is the name of the storage engine
engine_name
uses the
storage engine, then you would
MyISAM
format.
VARBINARY
VARBINARY
column:
= RTRIM(varbinary_column);
[577]
privilege. The file will
file:
columns for
and
InnoDB
column, you
TEXT
if it is a
MyISAM
and
VARCHAR
VARBINARY
column values. For each
tbl_name
MyISAM
table.
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents