fixed sql used when updating required_mem_override