detect_database_corruption function

Detect potentially corrupted database data