Skip to content

engine/schema: fix IDEMPOTENT_ADD_FOREIGN_KEY procedure does not work on mysql8 - #7252

Merged
DaanHoogland merged 1 commit into
apache:mainfrom
weizhouapache:4.18-fix-mysql8-IDEMPOTENT_ADD_FOREIGN_KEY
Feb 17, 2023
Merged

engine/schema: fix IDEMPOTENT_ADD_FOREIGN_KEY procedure does not work on mysql8#7252
DaanHoogland merged 1 commit into
apache:mainfrom
weizhouapache:4.18-fix-mysql8-IDEMPOTENT_ADD_FOREIGN_KEY

Conversation

@weizhouapache

Copy link
Copy Markdown
Member

Description

On centos7 with mysql 5.5, it looks good

MariaDB [cloud]> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected, 2 warnings (0.03 sec)
MariaDB [cloud]> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected, 2 warnings (0.02 sec)

However, it throws an error on ubuntu 22 or rocky8, with mariadb 8

mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
ERROR 1826 (HY000): Duplicate foreign key constraint name 'fk_passphrase_id'
mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
ERROR 1826 (HY000): Duplicate foreign key constraint name 'fk_passphrase_id'

With this PR, everything looks good

mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected (0.00 sec)
mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected (0.00 sec)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

… on mysql8
On centos7 with mysql 5.5, it looks good
```
MariaDB [cloud]> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected, 2 warnings (0.03 sec)
MariaDB [cloud]> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
Query OK, 0 rows affected, 2 warnings (0.02 sec)
```
However, it throws an error on ubuntu 22 or rocky8, with mariadb 8
```
mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
ERROR 1826 (HY000): Duplicate foreign key constraint name 'fk_passphrase_id'
mysql> CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.volumes', 'passphrase', 'id');
ERROR 1826 (HY000): Duplicate foreign key constraint name 'fk_passphrase_id'
```
@weizhouapache

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@weizhouapacheweizhouapache added this to the 4.18.0.0 milestone Feb 17, 2023
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5598

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed! Quality Gate passed

BugA0 Bugs
VulnerabilityA0 Vulnerabilities
Security HotspotA0 Security Hotspots
Code SmellA0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@borisstoyanovborisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, got past that point in my latest upgrade

@DaanHoogland
DaanHoogland merged commit 80c1b6b into apache:mainFeb 17, 2023
@DaanHoogland
DaanHoogland deleted the 4.18-fix-mysql8-IDEMPOTENT_ADD_FOREIGN_KEY branch February 17, 2023 10:46
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Severity:CriticalCritical bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@weizhouapache@blueorangutan@DaanHoogland@borisstoyanov