!898 SelectForUpdateFusion FetchSize场景下use after free问题修复

Merge pull request !898 from gentle_hu/bypasscore
This commit is contained in:
opengauss-bot 2021-04-22 23:52:17 +08:00 committed by Gitee
commit abc1170dc1
1 changed files with 2 additions and 0 deletions

View File

@ -2138,8 +2138,10 @@ bool SelectForUpdateFusion::execute(long max_rows, char* completionTag)
start_row = m_limitOffset >= 0 ? m_limitOffset : start_row;
get_rows = m_limitCount >= 0 ? (m_limitCount + start_row) : max_rows;
if (m_position == 0) {
MemoryContext oldContext = MemoryContextSwitchTo(m_tmpContext);
m_scan->refreshParameter(m_outParams == NULL ? m_params : m_outParams);
m_scan->Init(max_rows);
MemoryContextSwitchTo(oldContext);
}
Relation rel = ((m_scan->m_parentRel == NULL) ? m_scan->m_rel : m_scan->m_parentRel);
Relation partRel = NULL;