SuccessChanges

Summary

  1. [SPARK-31225][SQL][2.4] Override sql method of OuterReference (details)
Commit 1630d64cab216f1404bf0940483ec3ecb86732d1 by wenchen
[SPARK-31225][SQL][2.4] Override sql method of OuterReference

### What changes were proposed in this pull request?

Per https://github.com/apache/spark/pull/32179#issuecomment-822954063 's request to backport SPARK-31225 to branch 2.4

### Why are the changes needed?

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

Closes #32256 from yaooqinn/SPARK-31225.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
The file was modifiedsql/core/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala (diff)
The file was modifiedsql/core/src/test/resources/sql-tests/results/having.sql.out (diff)
The file was modifiedsql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala (diff)
The file was modifiedsql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala (diff)