This reverts commit e441847eca. A shallow copy is not enough because querysets can be reused and evaluated in nested nodes, which shouldn't mutate JOIN aliases. Thanks Michal Čihař for the report. Backport of 903aaa35e5 from main
e441847eca
903aaa35e5