morningman commented on a change in pull request #1447: Fix bug that BE crashs 
when insert null value to the not null column
URL: https://github.com/apache/incubator-doris/pull/1447#discussion_r301426993
 
 

 ##########
 File path: be/src/exec/olap_table_sink.cpp
 ##########
 @@ -640,14 +640,25 @@ void OlapTableSink::_convert_batch(RuntimeState* state, 
RowBatch* input_batch, R
 #else
                     state->append_error_msg_to_file("", ss.str());
 #endif
-                    continue;
+                    exist_null_value_for_not_null_col = true;
+                    break;
                 }
             }
             void* slot = dst_tuple->get_slot(slot_desc->tuple_offset());
             RawValue::write(src_val, slot, slot_desc->type(), 
_output_batch->tuple_data_pool());
         }
+
+        if (!exist_null_value_for_not_null_col) {
+            if (output_batch->add_row() != RowBatch::INVALID_ROW_INDEX) {
+                commit_rows++;
+                output_batch->get_row(i)->set_tuple(0, dst_tuple);
 
 Review comment:
   it is not right to use `i` as index

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org
For additional commands, e-mail: dev-h...@doris.apache.org

Reply via email to