← Back to team overview

maria-discuss team mailing list archive

Re: ERROR 1071 with mysql_upgrade

 

Le 17 juil. 2019 à 11:22, Erik Cederstrand <erik@xxxxxxxxxxxxxx> a écrit :
> 
> Thanks!
> 
> I couldn't find the mysql_fix_privilege_tables.sql installed anywhere on my system, so I ended up patching mysql_upgrade to print the SQL commands it's executing. There are ca. 200 commands executed at once, so it took a while to pinpoint the failing statement. It would be cool if triple-verbose mysql_upgrade could print the exact statement that matches the error that it prints in https://github.com/MariaDB/server/blob/9a7d96e8326377b92406c09fdcb8bd60c45f901c/client/mysql_upgrade.c#L1063
> 
> Anyway, the failing query is:
> 
> alter table innodb_index_stats modify last_update timestamp not null default current_timestamp on update current_timestamp, modify table_name varchar(199);
> 
> which throws "Specified key was too long; max key length is 1000 bytes".
> 
> Currently, my innodb_index_stats table is defined as:
> 
> CREATE TABLE `innodb_index_stats` (
>  `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
>  `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
>  `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
>  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
>  `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
>  `stat_value` bigint(20) unsigned NOT NULL,
>  `sample_size` bigint(20) unsigned DEFAULT NULL,
>  `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
>  PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
> 
> Does that ring a bell?


Hi Erik!

It seems this table should be in InnoDB format, not MyISAM (same for innodb_table_stats).

HTH,
  Jocelyn



Follow ups

References