v.23.7Bug Fix

Do not remove inputs after ActionsDAG::merge

Do not remove inputs after ActionsDAG::merge #51947 (Nikolai Kochetov).