HHH-4700 - ClassCastException with parameter in CaseNode.getFirstThenNode()
(cherry picked from commit efa5dc2f6ca1b4f20725e2d58d6afac00dff10b6)
HHH-9100 - Improve CAST function support
(cherry picked from commit 6ffbf8f3f3d22a2e65017e4b6a1717a1297a17b9)