Phpmyadmin: Check referential integrity' not present for InnoDB tables without foreign key, but with configured phpMyAdmin relation

Created on 26 Sep 2019  ·  3Comments  ·  Source: phpmyadmin/phpmyadmin

Describe the bug

phpMyAdmin supports custom relations between rows as stored in pma__relation table. The GUI calls them internal relationships. If the tables are of MyISAM, the operations tab shows a Check referential integrity section. If the tables are InnoDB, the operations tab does not contain a Check referential integrity section.

To Reproduce

  1. Create two tables using the following queries: relation_test.sql.log
  2. Open relation_test.table1.
  3. Click on Structure in the top navigation.
  4. Click on Relation view.
  5. Open Internal relationships and add a relation for table2_id to relation_test.table2.table2_id.
  6. Open relation_test.table1.
  7. Click on Operations.
  8. No Check referential integrity section is shown.
  9. Change the engine for table1 from InnoDB to MyISAM.
  10. Check referential integrity section is shown.

Note: Clicking the links does not properly work right now due to #14598.

Expected behavior

I expect the Check referential integrity section to be shown even when using InnoDB as table engine.

Server configuration

Additional context

InnoDB foreign keys come at a performance cost. But InnoDB supports transactions. So in order to use transaction, I am using InnoDB without foreign keys. But I like to configure relations in phpMyAdmin to be able to easily navigate around.

bug has-pr

Most helpful comment

I'm pretty sure that the decision was made 16 years ago because phpMyAdmin did not allow internal relations for InnoDB types. It didn't make sense to run the referential integrity at the time on an InnoDB table. The ability to add internal relations on other table types was added a few years ago and I feel this change, while beneficial, was completely overlooked at the time. I agree about fixing this.

All 3 comments

Hi @aschuch247 I fixed #14598 and opened #15517

@lem9 Made the choice to not show for InnoDB 16 years ago, so I think the choice can be re-evaluated

I'm pretty sure that the decision was made 16 years ago because phpMyAdmin did not allow internal relations for InnoDB types. It didn't make sense to run the referential integrity at the time on an InnoDB table. The ability to add internal relations on other table types was added a few years ago and I feel this change, while beneficial, was completely overlooked at the time. I agree about fixing this.

This works for me in phpMyAdmin 4.9.2. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mauriciofauth picture mauriciofauth  ·  3Comments

AlexeyKosov picture AlexeyKosov  ·  3Comments

Imrulkais picture Imrulkais  ·  3Comments

ChrisHSandN picture ChrisHSandN  ·  3Comments

barkermn01 picture barkermn01  ·  3Comments