Fix type-checking of range_hashed dictionary with mysql as a source. Parenthesise all expressions to avoid errors.