Test a query which has no itemid.
Add CHistory::getItems() to abstract details of fetching itemids.
I'll implement it using SQL through CItem class.