Table forum_index needs a primary key to work on Percona

Created on 13 June 2018, over 6 years ago
Updated 29 June 2023, over 1 year ago

Problem/Motivation

On an environment running on Percona as the database backend, we get an error of the following form when creating a new forum topic:

{{General error: 1105 Percona-XtraDB-Cluster prohibits use of [error]
DML command on a table ([redacted].forum_index) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER: INSERT
INTO
{forum_index}
(nid, title, tid, sticky, created, comment_count, last_comment_timestamp) VALUES (:db_insert_placeholder_0,
:db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4,
:db_insert_placeholder_5, :db_insert_placeholder_6); Array
(
[:db_insert_placeholder_0] => 96349
[:db_insert_placeholder_1] => [redacted]
[:db_insert_placeholder_2] => 5314
[:db_insert_placeholder_3] => 0
[:db_insert_placeholder_4] => 1366366923
[:db_insert_placeholder_5] => 0
[:db_insert_placeholder_6] => 1366366923
)}}

Proposed resolution

Add a primary key for nid, tid (tid needs to be included because creating a shadow topic will create an extra entry for the same nid, with a different tid).

Remaining tasks

Create patch
Review
Commit

User interface changes

None.

API changes

None.

Data model changes

Primary key [nid,tid] on the forum_index table.

🐛 Bug report
Status

Closed: duplicate

Version

9.5

Component

forum.module

Created by

🇳🇱Netherlands eelkeblok Netherlands 🇳🇱

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024