Fixing custom query handling when table isnot defined yet

--HG--
extra : source : e497a642ae95cf8483c336e3212fd5fdc83744c4
Updating changelog for fix originally committed in 1.4
Merging from github