[MDEV-31942] Online alter: support cascade foreign keys Created: 2023-08-17  Updated: 2023-11-06

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Nikita Malyavin Assignee: Nikita Malyavin
Resolution: Unresolved Votes: 3
Labels: None

Issue Links:
Blocks
is blocked by MDEV-29181 Potential corruption on Foreign key u... In Review
Issue split
split from MDEV-16329 Engine-independent online ALTER TABLE Closed
Relates
relates to MDEV-22361 Cross-engine foreign keys support Open

 Description   

Currently, ALGORITHM=COPY, LOCK=NONE is disabled for tables with cascade foreign keys (including SET NULL/SET DEFAULT).

The preliminary patch, 4b758fdc73, was done yet in scope of MDEV-29068 bugfix.

As it was noted by Marko Mäkelä, the implementation would be unaffordably slow. Using table->vc_templ->mysql_table for a backward access to sql-layer table, as noted further, is broken by design. This should be fixed by MDEV-29181.

Additionally, MDEV-30182 should provide an affordably fast (O(1)) FK-prelocked table lookup, which should be made per updated record.



 Comments   
Comment by Sergei Golubchik [ 2023-08-17 ]

When this is done, we'll be able add to support for CASCADE actions and

  • triggers (MDEV-12302)
  • CHECK constraints (MDEV-22880)
  • GENERATED STORED columns
  • WITHOUT OVERLAP
  • long UNIQUE constraints
Generated at Thu Feb 08 10:27:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.