Forum

Problem with tempup...
 
Notifications
Retirer tout

Problem with tempupdate table

5 Posts
3 Utilisateurs
0 Reactions
779 Vu
(@fxandrei)
Posts: 45
Trusted Member
Début du sujet
 
[#9672]

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 ? 


 
Posté : 17/12/2024 11:31 pm
(@maxime)
Posts: 268
Membre Admin
 

Hello ???
Yes, this is a technical table and there will be no primary key.


 
Posté : 19/12/2024 12:00 pm
(@fxandrei)
Posts: 45
Trusted Member
Début du sujet
 

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.


 
Posté : 19/12/2024 12:46 pm
(@babynus)
Posts: 14952
Membre Admin
 

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...


 
Posté : 19/12/2024 1:18 pm
(@fxandrei)
Posts: 45
Trusted Member
Début du sujet
 

I think will add that composite pk, i think its better then to mess with the group replication.
Thanks


 
Posté : 19/12/2024 3:21 pm
Share:
Retour en haut