Prevent relation builder generate null for array of ranges on 3.2

Patch fixing issue #9171 on 3.2