[ticket/12570] Include select into transaction

PHPBB3-12570