I ran into a problem where field_purge_batch() was called during cron, and expecting to delete all data related to field_xyz. The problem was that the table field_data_field_xyz did not exist on my site, so an exception was thrown.
Here are some symptoms:
(1) field_purge_batch(10) returns an exception
(2) field_read_instances(array('deleted' => 1), array('include_deleted' => 1)) returns field_xyz, but field_xyz's corresponding field_data_field_xyz table does not exist.
(3)
$ drush cron;
WD cron: PDOException: SQLSTATE[42S02]: Base table or view not found:[error]
1146 Table 'field_data_field_xyz' doesn't exist:
SELECT DISTINCT field_data_field_xyz0.entity_type AS
entity_type, field_data_field_xyz0.entity_id AS
entity_id, field_data_field_xyz0.revision_id AS
revision_id, field_data_field_xyz0.bundle AS bundle
FROM
{field_data_field_xyz}
field_data_field_xyz0
WHERE (field_data_field_xyz0.deleted =
:db_condition_placeholder_0) AND
(field_data_field_xyz0.bundle =
:db_condition_placeholder_1)
LIMIT 10 OFFSET 0; Array
(
[:db_condition_placeholder_0] => 1
[:db_condition_placeholder_1] => stm_tarif_page
)
in field_sql_storage_field_storage_query() (line 585 of
/path/to/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module).
Table 'stm.field_data_field_stm_tarifs_lignes' doesn't exist
I have no idea why field_data_field_xyz did not exist, perhaps because of an interrupted previous cleanup attempt, but at this point if the table does not exist, might it be OK to simply assume that there is no data?