1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
Sergei Golubchik
2017-07-20 15:08:24 +02:00
parent 2fcd8c1252
commit 7e507f262a
3 changed files with 55 additions and 2 deletions

View File

@ -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");