I have updated the patch with some bug-fixes after having run Smith's
test with lateral and null elements.
To detect lateral elements I left the check that there are no one outer
references left in the subquery after the mutator transformation.
Everything looks well now. I currently continue testing my patch to
detect more corner-cases.
Feel free to review my patch!
-----------
Best regards,
Yandex Cloud
Alena Rybakina