Table key_value do not have a primary key.

Created on 2 May 2023, over 1 year ago
Updated 3 May 2023, over 1 year ago

Problem/Motivation

With D10.1.0-alpha1 10.5.18-MariaDB, see in reports status,

Transaction isolation level
For this to work correctly, all tables must have a primary key.
The following table(s) do not have a primary key: key_value.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: works as designed

Version

10.1

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇫🇷France Chris64 France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Chris64
  • key_value does have a primary key: 'primary key' => ['collection', 'name'].

  • Status changed to Postponed: needs info over 1 year ago
  • I can't reproduce this on 10.1.x-dev. Table key_value has had a primary key for as long as it has existed.

  • 🇫🇷France Chris64 France

    You are right @cilefen. Line 318 in core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php. So it is our own problem. Our databases are not regular. Problem solves with sql command,
    ALTER TABLE `<database>`.`key_value` DROP INDEX `collection`, ADD PRIMARY KEY (`collection`, `name`) USING BTREE;
    No Drupal error message any more after that. Those databases come from D8 through D9.

  • Status changed to Closed: works as designed over 1 year ago
Production build 0.71.5 2024