HHH-9100 - Improve CAST function support
(cherry picked from commit 6ffbf8f3f3d22a2e65017e4b6a1717a1297a17b9)

Conflicts:
	hibernate-core/src/main/antlr/hql.g
	hibernate-core/src/main/java/org/hibernate/dialect/function/CastFunction.java
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.java
HHH-9100 - Improve CAST function support
(cherry picked from commit 137c2daf8171a9fb47df58cb119d23c10fddf105)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.java
HHH-9100 corrected grammar