Fixed issue #1664: Context has no parent in sun queries executed in LET clause