yiguolei commented on code in PR #51771:
URL: https://github.com/apache/doris/pull/51771#discussion_r2151161381
##########
be/src/olap/rowset/segment_v2/column_reader.cpp:
##########
@@ -805,9 +805,10 @@ Status ColumnReader::new_struct_iterator(ColumnIterator**
iterator,
// create default_iterator for schema-change behavior which increase column
for (size_t i = child_size; i < tablet_column_size; i++) {
TabletColumn column = tablet_column->get_sub_column(i);
- std::unique_ptr<ColumnIterator>* it = new
std::unique_ptr<ColumnIterator>();
- RETURN_IF_ERROR(Segment::new_default_iterator(column, it));
- sub_column_iterators.push_back(it->get());
+ std::unique_ptr<ColumnIterator> it;
+ RETURN_IF_ERROR(Segment::new_default_iterator(column, &it));
+ sub_column_iterators.push_back(it.get());
+ it.release();
Review Comment:
cpp could not make sure the execute order of the input parameter. If the
intput parameter for this function has 2 parameter, it maybe some errors. In
the past, I have make a mistake by writing a code like this:
_stub->tablet_writer_open(open_closure->cntl_.get(),
open_closure->request_.get(),
open_closure->response_.get(),
open_closure.release());
open_closure.release may execute before open_closure->cntl_.get(). So I
write a seperate line to call release here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]