mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Split a delete query to avoid deadlocks TICKETS #3446
This commit is contained in:
parent
6af5225002
commit
403e11e010
@ -710,7 +710,9 @@ sub pandora_checkdb_integrity {
|
|||||||
db_do ($dbh, 'DELETE FROM tagente_modulo WHERE id_agente NOT IN (SELECT id_agente FROM tagente)');
|
db_do ($dbh, 'DELETE FROM tagente_modulo WHERE id_agente NOT IN (SELECT id_agente FROM tagente)');
|
||||||
|
|
||||||
# Delete orphan modules in tagente_estado
|
# Delete orphan modules in tagente_estado
|
||||||
db_do ($dbh, 'DELETE FROM tagente_estado WHERE id_agente NOT IN (SELECT id_agente FROM tagente)');
|
while (defined (get_db_value ($dbh, 'SELECT id_agente FROM tagente_estado WHERE id_agente NOT IN (SELECT id_agente FROM tagente)'))) {
|
||||||
|
db_delete_limit ($dbh, 'tagente_estado', 'id_agente NOT IN (SELECT id_agente FROM tagente)', $BIG_OPERATION_STEP);
|
||||||
|
}
|
||||||
|
|
||||||
# Delete orphan data_inc reference records
|
# Delete orphan data_inc reference records
|
||||||
db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)');
|
db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user