Files
zoneminder/scripts
Isaac Connor 673d5a9336 fix: chunk zmstats bucket-prune DELETE IN-list to avoid packet-size limits
The DELETE WHERE EventId IN (?,?,...) is intentional: it locks each row
via the primary key, keeping the lock range minimal and preserving the
canonical lock order that this PR's deadlock fix relies on. But a single
IN-list with tens of thousands of placeholders (Events_Month after weeks
of accumulation) can hit max_allowed_packet and max_prepared_stmt_count.

Split the EventId list into 1000-row batches and loop. PK-based locking
is preserved; SQL/packet size stays bounded. Switching to a predicate-
based DELETE would re-introduce range locks on the bucket index and
undo the deadlock work.
2026-05-20 08:50:31 -04:00
..
2016-11-07 16:08:43 -05:00
2023-07-05 01:03:48 +02:00
2013-03-17 00:45:21 +01:00
2013-03-17 00:45:21 +01:00
2020-06-30 18:58:46 -04:00
2023-07-05 01:03:48 +02:00
2024-11-05 13:12:12 -05:00