HappenLee commented on a change in pull request #5516:
URL: https://github.com/apache/incubator-doris/pull/5516#discussion_r594289096



##########
File path: be/src/olap/schema_change.cpp
##########
@@ -1518,16 +1521,17 @@ OLAPStatus 
SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletRe
             break;
         }
 
-        _reader_context.reader_type = READER_ALTER_TABLE;
-        _reader_context.tablet_schema = &base_tablet->tablet_schema();
-        _reader_context.need_ordered_result = true;
-        _reader_context.delete_handler = &delete_handler;
-        _reader_context.return_columns = &return_columns;
+        RowsetReaderContext reader_context;
+        reader_context.reader_type = READER_ALTER_TABLE;
+        reader_context.tablet_schema = &base_tablet->tablet_schema();
+        reader_context.need_ordered_result = true;
+        reader_context.delete_handler = &delete_handler;
+        reader_context.return_columns = &return_columns;
         // for schema change, seek_columns is the same to return_columns
-        _reader_context.seek_columns = &return_columns;
+        reader_context.seek_columns = &return_columns;
 
         for (auto& rs_reader : rs_readers) {
-            rs_reader->init(&_reader_context);
+            rs_reader->init(&reader_context);

Review comment:
       I check again. the `rowset_reader` and `reader_context` have the same 
lifetime in schema change handler, So do not need to afraid to wild pointer 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to