Details
-
New Feature
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
Description
Feature request - new option innodb_automatic_pk (default off, global/session)
During CREATE TABLE for InnoDB, automatically translate
-- FROM:
CREATE TABLE t1 (c2 INT) ENGINE=InnoDB; |
-- TO:
CREATE TABLE t1 (_inv_PK SERIAL INVISIBLE PRIMARY KEY, c2 INT) ENGINE=InnoDB; |
-- FROM:
ALTER TABLE t1 ADD PRIMARY KEY (`c2`); |
-- TO:
ALTER TABLE t1 DROP COLUMN IF EXISTS _inv_PK, ADD PRIMARY KEY (`c2`); |
It might be a good idea to modify or suppress warning "Can't DROP COLUMN `_inv_PK`" and to issue a warning that _inv_PK was created.
Here's a question, should the user be able to do
select _inv_PK from t1; |
or should the column be completely internal and "not exist" from the user point of view?
If one can select it, it's be kind of like ROWID in Oracle.
Attachments
Issue Links
- relates to
-
MDEV-28412 Introduce sql_require_primary_key
-
- Open
-
-
MDEV-10177 Invisible columns
-
- Closed
-
-
MDEV-19506 Remove the global sequence DICT_HDR_ROW_ID for DB_ROW_ID
-
- Closed
-
-
MDEV-24001 Implement hidden PK for RBR of no-unique key table
-
- Open
-
-
MDEV-24830 Write a warning to error log if Galera replicates InnoDB table with no primary key
-
- Closed
-
-
MDEV-25551 Assertion `mode_ == m_local || transaction_.is_streaming()` failed in BF abort
-
- Closed
-
-
MDEV-30430 Enabling system versioning on tables without primary key breaks replication
-
- Closed
-
-
MDEV-38011 Forbid RBR Replication and Galera for tables without at least one key (not necessarily unique) OR implement hidden row-key for replication.
-
- Open
-