TT#121854 check delete from non-existing table

* cleanup_data():
    -  print error message when deletion from a table
       fails (usually a non-exiting table is provided)
    - amount of affected rows is set to 0 if undefined

Change-Id: I066041aae5d6a65c766480a2bbaf976c6563d188
mr9.5.1
Kirill Solomko 5 years ago
parent 096ee7def4
commit 1a86ba1286

@ -655,6 +655,8 @@ SQL
DELETE FROM $table WHERE $col < unix_timestamp(date(date_sub(now(), interval ? day))) $limit
SQL
}
$self->error("Cannot delete: $DBI:errstr") if $DBI::err;
$aff //= 0;
$deleted_rows += $aff;
last unless $aff > 0;
}

Loading…
Cancel
Save