You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sql_generate_invisible_primary_key=ON, MySQL silently injects a my_row_id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY INVISIBLE column on InnoDB tables that have no PK. The output of SHOW CREATE TABLE then includes that column. Marino currently parses INVISIBLE columns but should be exercised against — and ideally round-trip — the canonical GIPK DDL emitted by the server.
MySQL version
Introduced in MySQL 8.0.30.
Current state in marino
INVISIBLE is supported (parser/parser.y:7225-7229). The composite BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY INVISIBLE declaration is expressible. What is missing is:
A test fixture covering the GIPK column declaration as emitted by SHOW CREATE TABLE so we can guarantee round-trip.
Parsing the related session variables and the new replication option REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE (added in 8.0.32) — which depends on issue Remove stale TiDB references from documentation #12.
Example SQL
Server-side reproduction:
SET sql_generate_invisible_primary_key =ON;
CREATETABLEgipk_t (col1 INT);
SHOW CREATE TABLE gipk_t;
The SHOW CREATE TABLE output (which marino must round-trip) is:
CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE;
Validation
Both DDL forms above run successfully against MySQL 9.2.0 Community with sql_generate_invisible_primary_key=ON.
Notes for the implementer
Add a parser test that ingests the SHOW CREATE TABLE output above (including the /*!80023 INVISIBLE */ version comment) and re-emits an equivalent statement.
Summary
When
sql_generate_invisible_primary_key=ON, MySQL silently injects amy_row_id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY INVISIBLEcolumn on InnoDB tables that have no PK. The output ofSHOW CREATE TABLEthen includes that column. Marino currently parsesINVISIBLEcolumns but should be exercised against — and ideally round-trip — the canonical GIPK DDL emitted by the server.MySQL version
Introduced in MySQL 8.0.30.
Current state in marino
INVISIBLEis supported (parser/parser.y:7225-7229). The compositeBIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY INVISIBLEdeclaration is expressible. What is missing is:SHOW CREATE TABLEso we can guarantee round-trip.REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE(added in 8.0.32) — which depends on issue Remove stale TiDB references from documentation #12.Example SQL
Server-side reproduction:
The
SHOW CREATE TABLEoutput (which marino must round-trip) is:Toggling visibility after creation:
The replication option (depends on issue #12):
CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE;Validation
Both DDL forms above run successfully against MySQL 9.2.0 Community with
sql_generate_invisible_primary_key=ON.Notes for the implementer
SHOW CREATE TABLEoutput above (including the/*!80023 INVISIBLE */version comment) and re-emits an equivalent statement.CHANGE REPLICATION SOURCE TOto acceptREQUIRE_TABLE_PRIMARY_KEY_CHECK = {ON|OFF|STREAM|GENERATE}(blocked on issue Remove stale TiDB references from documentation #12).