diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-20 15:08:24 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-20 20:13:28 +0200 |
commit | 7e507f262a826c9c799355755541120be8c7352a (patch) | |
tree | dda2d012104befc97426c91aa1623257550ee4df /scripts | |
parent | 2fcd8c12522f5f935066b661c42b5b7cb416d148 (diff) | |
download | mariadb-git-7e507f262a826c9c799355755541120be8c7352a.tar.gz |
MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars
InnoDB fix will come in MDEV-13360.
Here I just fix upgrades from old unfixed InnoDBs - bad data
makes the following copying ALTER TABLE to fail.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_system_tables_fix.sql | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index f034af4f898..1bb601ef5f9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -667,6 +667,15 @@ DROP PROCEDURE mysql.count_duplicate_host_names; # Convering the host name to lower case for existing users UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; +# fix bad data when upgrading from unfixed InnoDB (MDEV-13360) +set @str="delete from innodb_index_stats where length(table_name) > 64"; +set @str=if(@have_innodb <> 0, @str, "set @dummy = 0"); +prepare stmt from @str; +execute stmt; +set @str=replace(@str, "innodb_index_stats", "innodb_table_stats"); +prepare stmt from @str; +execute stmt; + # update timestamp fields in the innodb stat tables set @str="alter table mysql.innodb_index_stats modify last_update timestamp not null default current_timestamp on update current_timestamp"; set @str=if(@have_innodb <> 0, @str, "set @dummy = 0"); |