This patch makes sure a Lua result has a domain_id, a domain_id of -1 should not overlap with SQL