Upgrade mysql schema problem in rt4

Hi. I am trying to upgrade to rt4.

rt4 is in debian squeeze, db is a mysql 5.1.49-3 (Debian).

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

I think the problem comes from this query returning empty:

mysql> SELECT CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH FROM
information_schema.COLUMNS WHERE TABLE_SCHEMA = ‘rt4’ AND TABLE_NAME =
‘ACL’ AND COLUMN_NAME = ‘RightName’;

yes, this is in mysql-5.1.

I dumped the original rt3 DB, but I had no way to tell the character set
to mysqldump. I restored with --default-character-set=binary
and mysql character-set to Latin1.

any hints ? thank you for your help.

Hi. I am trying to upgrade to rt4.

rt4 is in debian squeeze, db is a mysql 5.1.49-3 (Debian).

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

I think the problem comes from this query returning empty:

mysql> SELECT CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH FROM
information_schema.COLUMNS WHERE TABLE_SCHEMA = ‘rt4’ AND
TABLE_NAME = ‘ACL’ AND COLUMN_NAME = ‘RightName’;

yes, this is in mysql-5.1.

I dumped the original rt3 DB, but I had no way to tell the character set
to mysqldump. I restored with --default-character-set=binary
and mysql character-set to Latin1.

You should look to see if any of your information_schema is filled

-kevin

Al 08/11/11 17:26, En/na Kevin Falcone ha escrit:> On Tue, Nov 08, 2011 at 01:13:41PM +0100, Francesc Guasch wrote:

Hi. I am trying to upgrade to rt4.

rt4 is in debian squeeze, db is a mysql 5.1.49-3 (Debian).

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

You should look to see if any of your information_schema is filled

Hi, thank you Kevin, there is something there:

mysql> select count() from acl;
| count(
) |
| 932 |

select count() from information_schema.columns;
| count(
) |
| 7756 |

Al 08/11/11 17:26, En/na Kevin Falcone ha escrit:

Hi. I am trying to upgrade to rt4.

rt4 is in debian squeeze, db is a mysql 5.1.49-3 (Debian).

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

You should look to see if any of your information_schema is filled

Hi, thank you Kevin, there is something there:

mysql> select count() from acl;
| count(
) |
±---------+
| 932 |

select count() from information_schema.columns;
±---------+
| count(
) |
±---------+
| 7756 |

Then look at the other parts of the where clause. Is the database
name right? Are the column names right?

-kevin

Al 08/11/11 17:39, En/na Kevin Falcone ha escrit:

Al 08/11/11 17:26, En/na Kevin Falcone ha escrit:

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

Then look at the other parts of the where clause. Is the database
name right? Are the column names right?

Ok, I found what happened. Our database has lower_case_table_names=1,
so the script didn’t find the tables. I made this patch to
etc/upgrade/upgrade-mysql-schema.pl:

446,447c446
< ." AND ( TABLE_NAME = “. $dbh->quote($table)
< .” OR TABLE_NAME = “.lc($dbh->quote($table)).”)"

Al 08/11/11 17:39, En/na Kevin Falcone ha escrit:

Al 08/11/11 17:26, En/na Kevin Falcone ha escrit:

I’m stuck upgrading the database. I am trying to upgrade from
an old mysql 4.0.24.

perl etc/upgrade/upgrade-mysql-schema.pl

Can’t use an undefined value as an ARRAY reference at
etc/upgrade/upgrade-mysql-schema.pl line 442.

Then look at the other parts of the where clause. Is the database
name right? Are the column names right?

Ok, I found what happened. Our database has lower_case_table_names=1,
so the script didn’t find the tables. I made this patch to
etc/upgrade/upgrade-mysql-schema.pl:

446,447c446
< ." AND ( TABLE_NAME = “. $dbh->quote($table)
< .” OR TABLE_NAME = “.lc($dbh->quote($table)).”)"

        ." AND TABLE_NAME   = ". $dbh->quote($table)

Try the following patch I want to push into the repo. Thanks for
investigating and returning back to the list.

http://users.bestpractical.com/~ruz/p/2011-11-10AqjN_uH7


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Barcelona, Spain November 28 & 29, 2011

Best regards, Ruslan.