#2217 fix ambiguous table references