Refs #31115 -- Added test for nested subquery that references related fields.
Refs #31115 -- Added test for nested subquery that references related fields.

Thanks Dmitriy Gunchenko for the report and Simon Charette for the
analysis and tests.

Regression in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.

Fixed in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.
claudep/django,monetate/django,solarissmoke/django,dsanders11/django,manhhomienbienthuy/django,simonw/django,solarissmoke/django,atul-bhouraskar/django,MarkusH/django,monetate/django,pauloxnet/django,kaedroho/django,wkschwartz/django,apollo13/django,freakboy3742/django,theo-l/django,monetate/django,wkschwartz/django,elena/django,rsalmaso/django,rsalmaso/django,rsalmaso/django,shaib/django,elena/django,django/django,takis/django,freakboy3742/django,apollo13/django,MarkusH/django,auvipy/django,simonw/django,googleinterns/django,googleinterns/django,blighj/django,felixxm/django,dsanders11/django,manhhomienbienthuy/django,takis/django,auvipy/django,atul-bhouraskar/django,elena/django,theo-l/django,atul-bhouraskar/django,elena/django,monetate/django,django/django,dsanders11/django,freakboy3742/django,pauloxnet/django,rsalmaso/django,simonw/django,felixxm/django,simonw/django,dsanders11/django,shaib/django,adamchainz/django,felixxm/django,apollo13/django,googleinterns/django,manhhomienbienthuy/django,claudep/django,atul-bhouraskar/django,adamchainz/django,pauloxnet/django,takis/django,wkschwartz/django,takis/django,felixxm/django,solarissmoke/django,googleinterns/django,django/django,kaedroho/django,claudep/django,koordinates/django,adamchainz/django,theo-l/django,ghickman/django,koordinates/django,koordinates/django,manhhomienbienthuy/django,adamchainz/django,claudep/django,shaib/django,ghickman/django,django/django,MarkusH/django,MarkusH/django,blighj/django,wkschwartz/django,pauloxnet/django,ghickman/django,auvipy/django,solarissmoke/django,theo-l/django,shaib/django,auvipy/django,blighj/django,apollo13/django,blighj/django,ghickman/django,koordinates/django,kaedroho/django