thrownewFieldException('Attempt to create a field with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character');
}
// TODO: check that field_name < 32 chars.
// Field name cannot be longer than 32 characters. We use drupal_strlen()
// because the DB layer assumes that column widths are given in characters,
// not bytes.
if(drupal_strlen($field['field_name'])>32){
thrownewFieldException(t('Attempt to create a field with a name longer than 32 characters: %name',