Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.2, 10.3.0
Description
MySQL 5.7.2 introduced heap memory allocations for every updated row:
if (node->cascade_heap) { |
mem_heap_empty(node->cascade_heap);
|
} else { |
node->cascade_heap = mem_heap_create(128);
|
}
|
|
mem_heap_allocator<upd_node_t*> mem_heap_ator(node->cascade_heap);
|
|
cascade_upd_nodes = new |
(mem_heap_ator.allocate(sizeof(upd_cascade_t))) |
upd_cascade_t(deque_mem_heap_t(mem_heap_ator));
|
|
new_upd_nodes = new |
(mem_heap_ator.allocate(sizeof(upd_cascade_t))) |
upd_cascade_t(deque_mem_heap_t(mem_heap_ator));
|
|
processed_cascades = new |
(mem_heap_ator.allocate(sizeof(upd_cascade_t))) |
upd_cascade_t(deque_mem_heap_t(mem_heap_ator));
|
If the mem_heap_create(128) was replaced with a larger parameter, then these allocations could reuse the same memory heap for every updated row. It would still be unnecessary to allocate the memory when there are no FOREIGN KEY ON (UPDATE|DELETE) (SET NULL|CASCADE) constraints, but we would avoid the multiple calls to mem_heap_create_block_func() on every updated row.
Attachments
Issue Links
- is blocked by
-
MDEV-15219 FOREIGN KEY CASCADE or SET NULL operations will not resume after lock wait
-
- Closed
-
- is duplicated by
-
MDEV-15199 Triangular FKs - Cascade delete causes broken referential integrity
-
- Closed
-
- relates to
-
MDEV-14958 Merge new release of InnoDB MySQL 5.7.21 to 10.2
-
- Closed
-
-
MDEV-15611 Due to the failure of foreign key detection, Galera slave node killed himself.
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 10.3 [ 22126 ] |
Affects Version/s | 10.3.0 [ 22127 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link |
This issue relates to |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Link |
This issue is duplicated by |
Link |
This issue is blocked by |
Fix Version/s | 10.3.5 [ 22905 ] | |
Fix Version/s | 10.2.13 [ 22910 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 83352 ] | MariaDB v4 [ 153081 ] |
Zendesk Related Tickets | 187744 |
As noted in
MDEV-14958, MySQL 5.7.21 removes this code and reverts back to call stack recursion. To compensate for the increased stack memory usage, it limits the maximum depth of FOREIGN KEY constraints from 255 to 15.Bug #26191879 FOREIGN KEY CASCADES USE EXCESSIVE MEMORY