Hi,
in MdamColumn::buildDisjunct() at ../executor/ex_mdam.cpp:
587 ex_expr::exp_return_type errorCode =
predPtr->getValue(atp0,workAtp);
588
589 Int32 dcErrFlag1 = dataConvErrorFlag;
590 Int32 dcErrFlag2 = 0;
591 if (errorCode == ex_expr::EXPR_OK &&
592 predPtr->getPredType() == MdamPred::MDAM_BETWEEN)
593 {
594 dataConvErrorFlag = 0;
595 errorCode = predPtr->getValue2(atp0,workAtp);
596 dcErrFlag2 = dataConvErrorFlag;
597 }
when errorCode is not OK on line 587, it is not checked immediately and is then
reused.
So I suggest to change the interface of function MdamColumn::buildDisjunct(),
making the return value type from NABoolean to int, to
distingush the normal value and error code.
And in function keyMdamEx::buildNetwork(), which calls buildDisjunct(), the
current logic requires the returned value must be true, why?
If there is an error occurred, we can ignore that ex_assert() and just return
the errorCode, right?
Another problem, ExHbaseAccessTcb::initNextKeyRange() in
core/sql/executor/ExHbaseAccess.cpp:
2430 Lng32 ExHbaseAccessTcb::initNextKeyRange(sql_buffer_pool *pool,
2431 atp_struct * atp)
2432 {
2433 if (keyExeExpr())
2434 keyExeExpr()->initNextKeyRange(pool, atp);
2435 else
2436 return -1;
2437
2438 return 0;
2439 }
which does not check the returned value of initNextKeyRange(), so if there is
something wrong in it, but keyExeExpr() is fine, this function returns 0,
indicating success.
Regards,
Wenjun Zhu