Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Problem with tempup...
 
Notifications
Clear all

Problem with tempupdate table

5 Posts
3 Users
0 Reactions
811 Views
(@fxandrei)
Posts: 45
Active Member
Topic starter
 
[#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 ? 


 
Posted : 17 Dec 2024 23H31
Maxca
(@maxime)
Posts: 274
Active Member Admin
 

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


 
Posted : 19 Dec 2024 12H00
(@fxandrei)
Posts: 45
Active Member
Topic starter
 

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.


 
Posted : 19 Dec 2024 12H46
babynus
(@babynus)
Posts: 14966
Main Contributor 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...


 
Posted : 19 Dec 2024 13H18
(@fxandrei)
Posts: 45
Active Member
Topic starter
 

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


 
Posted : 19 Dec 2024 15H21
Share:

Scroll to Top