提交 e2f0a8c8 编写于 作者: O obdev 提交者: ob-robot

[to #46686252] fix extend result of unstream cursor

上级 7da540c4
......@@ -5928,6 +5928,7 @@ int ObSPIService::fill_cursor(sqlclient::ObMySQLResult *mysql_result, ObSPICurso
{
int ret = OB_SUCCESS;
if (OB_ISNULL(mysql_result) || OB_ISNULL(cursor)
|| OB_ISNULL(cursor->allocator_)
|| OB_ISNULL(static_cast<observer::ObInnerSQLResult*>(mysql_result)->get_result_set())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("Argument passed in is NULL", K(mysql_result), K(cursor), K(ret));
......@@ -5954,9 +5955,23 @@ int ObSPIService::fill_cursor(sqlclient::ObMySQLResult *mysql_result, ObSPICurso
} else if (OB_ISNULL(inner_result->get_row())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get a invalud row", K(ret));
} else if (OB_FAIL(cursor->row_store_.add_row(*inner_result->get_row()))) {
LOG_WARN("failed to add row to row store", K(ret));
} else { /*do nothing*/ }
} else {
ObNewRow row = *(inner_result->get_row());
for (int64_t i = 0; OB_SUCC(ret) && i < row.get_count(); ++i) {
ObObj& obj = row.get_cell(i);
ObObj tmp;
if (obj.is_pl_extend()) {
if (OB_FAIL(pl::ObUserDefinedType::deep_copy_obj(*(cursor->allocator_), obj, tmp))) {
LOG_WARN("failed to copy pl extend", K(ret));
} else {
obj = tmp;
}
}
}
if (OB_SUCC(ret) && OB_FAIL(cursor->row_store_.add_row(row))) {
LOG_WARN("failed to add row to row store", K(ret));
}
}
}
if (OB_ITER_END == ret) {
ret = OB_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册