[BUG] Fixed some uninitialized variables (#5850)

Fixed some potential bugs caused by uninitialized variables
This commit is contained in:
stdpain
2021-05-25 10:34:35 +08:00
committed by GitHub
parent 63662194ab
commit 1ec615c562
23 changed files with 334 additions and 300 deletions

View File

@ -51,7 +51,11 @@ const std::string ERROR_MEM_LIMIT_EXCEEDED =
"$1 bytes for $2.";
EsScanNode::EsScanNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs)
: ScanNode(pool, tnode, descs), _tuple_id(tnode.es_scan_node.tuple_id), _scan_range_idx(0) {
: ScanNode(pool, tnode, descs),
_tuple_id(tnode.es_scan_node.tuple_id),
_tuple_desc(nullptr),
_env(nullptr),
_scan_range_idx(0) {
if (tnode.es_scan_node.__isset.properties) {
_properties = tnode.es_scan_node.properties;
}
@ -217,7 +221,7 @@ Status EsScanNode::get_next(RuntimeState* state, RowBatch* row_batch, bool* eos)
// convert
VLOG_CRITICAL << "begin to convert: scan_range_idx=" << _scan_range_idx
<< ", num_rows=" << result.rows.num_rows;
<< ", num_rows=" << result.rows.num_rows;
std::vector<TExtColumnData>& cols = result.rows.cols;
// indexes of the next non-null value in the row batch, per column.
std::vector<int> cols_next_val_idx(_tuple_desc->slots().size(), 0);
@ -420,7 +424,8 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
TExtLiteral literal;
if (!to_ext_literal(context, expr, &literal)) {
VLOG_CRITICAL << "get disjuncts fail: can't get literal, node_type=" << expr->node_type();
VLOG_CRITICAL << "get disjuncts fail: can't get literal, node_type="
<< expr->node_type();
return false;
}
@ -446,7 +451,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
TExtLiteral literal;
if (!to_ext_literal(context, conjunct->get_child(1), &literal)) {
VLOG_CRITICAL << "get disjuncts fail: can't get literal, node_type="
<< conjunct->get_child(1)->node_type();
<< conjunct->get_child(1)->node_type();
return false;
}
@ -497,7 +502,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
if (!to_ext_literal(slot_desc->type().type, const_cast<void*>(iter->get_value()),
&literal)) {
VLOG_CRITICAL << "get disjuncts fail: can't get literal, node_type="
<< slot_desc->type().type;
<< slot_desc->type().type;
return false;
}
in_pred_values.push_back(literal);
@ -523,7 +528,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
return true;
} else {
VLOG_CRITICAL << "get disjuncts fail: node type is " << conjunct->node_type()
<< ", should be BINARY_PRED or COMPOUND_PRED";
<< ", should be BINARY_PRED or COMPOUND_PRED";
return false;
}
}