So i can see that there is a tempupdate table that has this structure:
CREATE TABLE `${prefix}tempupdate` (
`id` int(12),
`refType` varchar(100) DEFAULT NULL,
`refId` int(12)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ;
I can see that it does not have a primary key.
Is there any reason for that ?
Im asking this because it causes problems if i want to use it in a mysql cluster for example, where it is required for all tables to have pk.
Could it have a primary key ?
Hello ???
Yes, this is a technical table and there will be no primary key.
This is a big problem. Because of this it cant be used in a mysql cluster. For that it is required for any table to have primary keys.
This is from the docs: MySQL :: MySQL 9.0 Reference Manual :: 20.3.1 Group Replication Requirements
Primary Keys. Every table that is to be replicated by the group must have a defined primary key, or primary key equivalent where the equivalent is a non-null unique key. Such keys are required as a unique identifier for every row within a table, enabling the system to determine which transactions conflict by identifying exactly which rows each transaction has modified.
You can remove thos table from replication group.
This is a temporary table that will be used only for some migration updates (not used for long)
If you please you can add a PK on (id, refType, refId)
Yes, all columns...
I think will add that composite pk, i think its better then to mess with the group replication.
Thanks