abort transaction
update cr_revisions
set title = :title,
description = :description
where revision_id = :revision_id
update images
set width = :width,
height = :height
where image_id = :revision_id
select
i.name, i.latest_revision, r.title
from
cr_items i, cr_revisions r
where
i.item_id = :item_id
and
i.item_id = r.item_id
and
i.latest_revision = r.revision_id
select
latest_revision
from
cr_items
where
item_id = :item_id
select
count(1)
from
cr_revisions
where
revision_id = :revision_id