Hi,

When the Transaction Level in MariaDB is set to READ-COMMITTED, the following warning appears on the report page (/admin/reports/status).

TRANSACTION ISOLATION LEVEL
READ-COMMITTED
For this to work correctly, all tables must have a primary key. The following table(s) do not have a primary key: forum_index, honeypot_user, restrict_ip_paths, restrict_ip_whitelisted_ip_addresses. See the setting MySQL transaction isolation level page for more information.

# My site is on Drupal version 10.1.2.

Reference URL:
https://www.drupal.org/docs/getting-started/system-requirements/setting-the-mysql-transaction-isolation-level

Can you please consider supporting this?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Ryo Ichiyama created an issue. See original summary.

sarwan_verma’s picture

StatusFileSize
new839 bytes

I have fixed this issue
Missing primary key in table `restrict_ip_paths' and `restrict_ip_whitelisted_ip_addresses'
and also attached patch.

ryo ichiyama’s picture

Thank you for responding so quickly.
I have patched and reinstalled the module and have confirmed that the warning is gone.

andikanio’s picture

drush eval "\Drupal\Core\Database\Database::getConnection()->schema()->addPrimaryKey('restrict_ip_whitelisted_ip_addresses', ['ip_address']);"
drush eval "\Drupal\Core\Database\Database::getConnection()->schema()->addPrimaryKey('restrict_ip_paths', ['path']);"

do these if you don't want to reinstall it

mmenavas’s picture

Status: Active » Needs review
StatusFileSize
new1.36 KB
new624 bytes

Here's an updated patch that combines @andikanio's suggestion as a database update hook and @sarwan_verma's patch.

ryo ichiyama’s picture

@andikanio , @mmenavas

Thank you very much.
If I can get my environment back to normal I will try to see if I can update it without reinstalling the module.

anybody’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Please provide the patches as MR instead!

rollins made their first commit to this issue’s fork.

rollins’s picture

Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Needs work

PHPUnit tests are failing

anybody’s picture

Status: Needs work » Needs review

Okay failing tests seem unrelated, but we should fix them first in a separate issue. Meanwhile this can be tested manually.

smustgrave’s picture

Version: 4.0.0-beta1 » 5.0.x-dev
Status: Needs review » Fixed

  • smustgrave committed a9c72085 on 5.0.x
    Issue #3385862 by rollins, mmenavas, sarwan_verma, ryo ichiyama, anybody...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.