[CP] [GIS] fix srs_guard reuse
This commit is contained in:
@ -79,7 +79,8 @@ private:
|
|||||||
sub_g->set_data(wkb_nosrid);
|
sub_g->set_data(wkb_nosrid);
|
||||||
sub_g->set_srid(g->get_srid());
|
sub_g->set_srid(g->get_srid());
|
||||||
}
|
}
|
||||||
if (OB_FAIL(eval_envelope_collection(sub_g, context, tmp_result))) {
|
if (OB_FAIL(ret)) {
|
||||||
|
} else if (OB_FAIL(eval_envelope_collection(sub_g, context, tmp_result))) {
|
||||||
LOG_WARN("failed to eval sub geo from collection", K(sub_type), K(ret));
|
LOG_WARN("failed to eval sub geo from collection", K(sub_type), K(ret));
|
||||||
} else {
|
} else {
|
||||||
if (result.is_empty() && !tmp_result.is_empty()) {
|
if (result.is_empty() && !tmp_result.is_empty()) {
|
||||||
|
|||||||
@ -138,7 +138,10 @@ int ObSrsCacheGuard::get_srs_item(uint64_t srs_id, const ObSrsItem *&srs_item)
|
|||||||
int ObTenantSrs::get_tenant_srs_guard(ObSrsCacheGuard &srs_guard)
|
int ObTenantSrs::get_tenant_srs_guard(ObSrsCacheGuard &srs_guard)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (OB_FAIL(try_get_last_snapshot(srs_guard))) {
|
if (!srs_guard.empty()) {
|
||||||
|
// do nothing
|
||||||
|
LOG_TRACE("guard isn't empty");
|
||||||
|
} else if (OB_FAIL(try_get_last_snapshot(srs_guard))) {
|
||||||
if (ret == OB_ERR_EMPTY_QUERY) {
|
if (ret == OB_ERR_EMPTY_QUERY) {
|
||||||
ret = OB_ERR_SRS_EMPTY;
|
ret = OB_ERR_SRS_EMPTY;
|
||||||
LOG_WARN("srs table might be empty", K(ret), K(MTL_ID()));
|
LOG_WARN("srs table might be empty", K(ret), K(MTL_ID()));
|
||||||
@ -304,12 +307,16 @@ void ObTenantSrs::recycle_last_snapshots()
|
|||||||
last_sys_snapshot_->~ObSrsCacheSnapShot();
|
last_sys_snapshot_->~ObSrsCacheSnapShot();
|
||||||
allocator_.free(last_sys_snapshot_);
|
allocator_.free(last_sys_snapshot_);
|
||||||
last_sys_snapshot_ = NULL;
|
last_sys_snapshot_ = NULL;
|
||||||
|
} else if (OB_NOT_NULL(last_sys_snapshot_)) {
|
||||||
|
LOG_INFO("unexpected srs snapshot ref count", K(last_sys_snapshot_->get_ref_count()));
|
||||||
}
|
}
|
||||||
if (OB_NOT_NULL(last_user_snapshot_) &&
|
if (OB_NOT_NULL(last_user_snapshot_) &&
|
||||||
last_user_snapshot_->get_ref_count() <= 0) {
|
last_user_snapshot_->get_ref_count() <= 0) {
|
||||||
last_user_snapshot_->~ObSrsCacheSnapShot();
|
last_user_snapshot_->~ObSrsCacheSnapShot();
|
||||||
allocator_.free(last_user_snapshot_);
|
allocator_.free(last_user_snapshot_);
|
||||||
last_user_snapshot_ = NULL;
|
last_user_snapshot_ = NULL;
|
||||||
|
} else if (OB_NOT_NULL(last_user_snapshot_)) {
|
||||||
|
LOG_INFO("unexpected srs snapshot ref count", K(last_user_snapshot_->get_ref_count()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,7 @@ public:
|
|||||||
virtual ~ObSrsCacheGuard();
|
virtual ~ObSrsCacheGuard();
|
||||||
int get_srs_item(uint64_t srs_id, const common::ObSrsItem *&srs_item);
|
int get_srs_item(uint64_t srs_id, const common::ObSrsItem *&srs_item);
|
||||||
void set_srs_snapshot(ObSrsCacheSnapShot *srs_cache) { srs_cache_ = srs_cache; }
|
void set_srs_snapshot(ObSrsCacheSnapShot *srs_cache) { srs_cache_ = srs_cache; }
|
||||||
|
inline bool empty() { return srs_cache_ == nullptr; }
|
||||||
private:
|
private:
|
||||||
ObSrsCacheSnapShot *srs_cache_;
|
ObSrsCacheSnapShot *srs_cache_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user