Bug 1490398
Summary: | mysql_upgrade fails when the same stored procedure name to uppercase and lowercase database names exists. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Masahiro Matsuya <mmatsuya> |
Component: | mariadb | Assignee: | Michal Schorm <mschorm> |
Status: | CLOSED ERRATA | QA Contact: | Anna Khaitovich <akhaitov> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | akhaitov, databases-maint, hhorak, mmuzila, mschorm |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause:
mysql_upgrade used to convert all columns of mysql.db to
utf8_general_ci and then back to utf8_bin. In two separate ALTER's.
This failed if UNIQUE indexes in mysql.db contained entries
that differ only in the letter case.
Consequence:
mysql_upgrade fails when the same stored procedure name to uppercase and lowercase database names exists
Fix:
Conversion is not done.
Result:
mysql_upgrade does not fail any more.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2019-08-06 13:18:16 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1346768 |
Description
Masahiro Matsuya
2017-09-11 13:11:31 UTC
Correction to the sql in C#0 to reproduce the problem. # cat /tmp/repro.sql use test DELIMITER | CREATE PROCEDURE getStudents() BEGIN SELECT * FROM students; END| DELIMITER ; create database TEST; use TEST DELIMITER | CREATE PROCEDURE getStudents() BEGIN SELECT * FROM students; END| DELIMITER ; use mysql select db,name,type from proc; ALTER TABLE proc CONVERT TO CHARACTER SET utf8; This issue is reproducible also in Fedora with all versions of MariaDB, including the latest released upstream version - 10.2.8 - in Rawhide I created a bug on upstream side, where I'm going to solve it primarly. https://jira.mariadb.org/browse/MDEV-13912 I'll inform you here, once I'll get any usefull patch or a workaround for the customer. Upstream knows about this issue. They recently released patches for 10.x versions. Unfortunatelly they did not patch this issue in 5.x version and the patch for 10.x version is only partially applicable, which does not resolve the issue fully. I'll cooperate with upstream do delive patch for the 5.x verison too. So far, upstream plans to fix this in next - 5.5.58 - version. The issue was still not fully fixed. Even though 5.5.58 released, the issue still persist. The issue was still not fixed. Even though 5.5.60 released, the issue still persist. The upstream claims the issue with mysql_upgrade is fixed in the 5.5.62 release. I have to dig deeper inside it however, because the SQL reproducer from #c1 still apply. I confirm it fixed the issue with mysql_upgrade. Solution: Rebase to 5.5.62 You test the wrong thing. The issues is that *mysql_upgrade* utility fails. The SQL command itself will fail both times - beforea nd after the fix. But when you run 'mysql_upgrade' afterwards, it will produce: ----------------------------------------- # BEFORE: # mysql_upgrade Phase 1/4: Fixing views Phase 2/4: Fixing table and database names Phase 3/4: Checking and upgrading tables Processing databases information_schema TEST mysql mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.servers OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK performance_schema test Phase 4/4: Running 'mysql_fix_privilege_tables' ERROR 1062 (23000) at line 577: Duplicate entry 'TEST-getStudents-PROCEDURE' for key 'PRIMARY' FATAL ERROR: Upgrade failed # echo $? 1 ----------------------------------------- # AFTER: # mysql_upgrade Phase 1/4: Fixing views Phase 2/4: Fixing table and database names Phase 3/4: Checking and upgrading tables Processing databases information_schema TEST mysql mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.servers OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK performance_schema test Phase 4/4: Running 'mysql_fix_privilege_tables' OK # echo $? 0 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:2327 |