summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-08-05 14:37:05 +0200
committerSergei Golubchik <sergii@pisem.net>2014-08-05 14:37:05 +0200
commitaafe43b7e049b1537e63eef6509c8a8075533b0e (patch)
treeaf7485fe3096d232db0ad68cc1c73738023bfbf1 /scripts
parentcf4814b39700fc0fe062519ad9090099540f79c0 (diff)
downloadmariadb-git-aafe43b7e049b1537e63eef6509c8a8075533b0e.tar.gz
cleanup (move ALTER TABLE for comment to be applicable again)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables_fix.sql13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index dbfe1fa5c8c..383a534416d 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -648,6 +648,12 @@ DROP TABLE tmp_proxies_priv;
# Convering the host name to lower case for existing users
UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host;
+SET @innodb_index_stats_fk= (select count(*) from information_schema.referential_constraints where constraint_schema='mysql' and table_name = 'innodb_index_stats' and referenced_table_name = 'innodb_table_stats' and constraint_name = 'innodb_index_stats_ibfk_1');
+SET @str=IF(@innodb_index_stats_fk > 0 and @have_innodb > 0, "ALTER TABLE mysql.innodb_index_stats DROP FOREIGN KEY `innodb_index_stats_ibfk_1`", "SET @dummy = 0");
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
# MDEV-4332 longer user names
alter table user modify User char(80) binary not null default '';
alter table db modify User char(80) binary not null default '';
@@ -667,12 +673,5 @@ alter table tables_priv modify Grantor char(141) COLLATE utf8_bin not null
# This should not be needed, but gives us some extra testing that the above
# changes was correct
-set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO');
-SET @innodb_index_stats_fk= (select count(*) from information_schema.referential_constraints where constraint_schema='mysql' and table_name = 'innodb_index_stats' and referenced_table_name = 'innodb_table_stats' and constraint_name = 'innodb_index_stats_ibfk_1');
-SET @str=IF(@innodb_index_stats_fk > 0 and @have_innodb > 0, "ALTER TABLE mysql.innodb_index_stats DROP FOREIGN KEY `innodb_index_stats_ibfk_1`", "SET @dummy = 0");
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
flush privileges;