Fix query to call materialize_curr_ptr function.