Fixed #22826 -- Improved internal usage of Query.setup_joins.
Removed unnecessary attribute assigment to SQLCompiler.
Improved code style of Query.table_alias() usage.
Merge pull request #2806 from jorgecarleitao/issue22826

Fixed #22826 -- Improved internal usage of Query.setup_joins.