[CP] fix bug for px-coord merge sort
This commit is contained in:
		
				
					committed by
					
						
						linzhigang.lzg
					
				
			
			
				
	
			
			
			
						parent
						
							576664f0d3
						
					
				
				
					commit
					649f70dfa7
				
			@ -33,6 +33,7 @@ using namespace oceanbase::sql;
 | 
			
		||||
using namespace oceanbase::sql::dtl;
 | 
			
		||||
 | 
			
		||||
OB_SERIALIZE_MEMBER((ObPxMergeSortCoordInput, ObPxReceiveInput));
 | 
			
		||||
OB_SERIALIZE_MEMBER((ObPxMergeSortCoord, ObPxCoord), sort_columns_);
 | 
			
		||||
 | 
			
		||||
int ObPxMergeSortCoord::ObPxMergeSortCoordEventListener::on_root_data_channel_setup()
 | 
			
		||||
{
 | 
			
		||||
@ -77,6 +78,9 @@ int ObPxMergeSortCoord::inner_open(ObExecContext& ctx) const
 | 
			
		||||
    LOG_WARN("fail init fifo allocator", K(ret));
 | 
			
		||||
  } else if (OB_FAIL(setup_scheduler(*px_ctx))) {
 | 
			
		||||
    LOG_WARN("fail setup scheduler", K(ret));
 | 
			
		||||
  } else if (sort_columns_.empty()) {
 | 
			
		||||
    ret = OB_ERR_UNEXPECTED;
 | 
			
		||||
    LOG_WARN("sort_column could not be empty", K(ret));
 | 
			
		||||
  } else {
 | 
			
		||||
    px_ctx->row_heap_.set_sort_columns(sort_columns_);
 | 
			
		||||
    px_ctx->metric_.set_id(get_id());
 | 
			
		||||
 | 
			
		||||
@ -81,6 +81,9 @@ private:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class ObPxMergeSortCoord : public ObPxCoord, public ObSortableTrait {
 | 
			
		||||
public:
 | 
			
		||||
  OB_UNIS_VERSION_V(2);
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  class ObPxMergeSortCoordCtx;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1085,6 +1085,9 @@ int ObMergeSortReceive::create_op_ctx(ObExecContext& exec_ctx, ObAsyncReceiveCtx
 | 
			
		||||
  } else if (OB_ISNULL(receive_ctx)) {
 | 
			
		||||
    ret = OB_ERR_UNEXPECTED;
 | 
			
		||||
    LOG_WARN("fail to create merge sort receive ctx", K(ret));
 | 
			
		||||
  } else if (sort_columns_.empty()) {
 | 
			
		||||
    ret = OB_ERR_UNEXPECTED;
 | 
			
		||||
    LOG_WARN("sort_column could not be empty", K(ret));
 | 
			
		||||
  } else {
 | 
			
		||||
    receive_ctx->row_comparer_.init(sort_columns_, receive_ctx->child_rows_);
 | 
			
		||||
    op_ctx = receive_ctx;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user