patch 4.0
This commit is contained in:
@ -15,93 +15,55 @@
|
||||
#include "common/row/ob_row_store.h"
|
||||
#include "sql/optimizer/ob_logical_operator.h"
|
||||
#include "sql/resolver/ob_stmt.h"
|
||||
#include "sql/optimizer/ob_log_plan.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
/**
|
||||
* ObLogValues is currently being used as 'explain' and 'help' operator.
|
||||
*/
|
||||
class ObLogValues : public ObLogicalOperator {
|
||||
public:
|
||||
static const int64_t MAX_EXPLAIN_BUFFER_SIZE = 1024 * 1024;
|
||||
ObLogValues(ObLogPlan& plan)
|
||||
: ObLogicalOperator(plan), explain_plan_(NULL), stmt_(NULL), row_store_(plan.get_allocator())
|
||||
{}
|
||||
virtual ~ObLogValues()
|
||||
{}
|
||||
virtual int allocate_exchange_post(AllocExchContext* ctx) override
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
/**
|
||||
* ObLogValues is currently being used as 'explain' and 'help' operator.
|
||||
*/
|
||||
class ObLogValues : public ObLogicalOperator
|
||||
{
|
||||
UNUSED(ctx);
|
||||
return common::OB_SUCCESS;
|
||||
}
|
||||
virtual int copy_without_child(ObLogicalOperator*& out) override
|
||||
{
|
||||
out = NULL;
|
||||
return common::OB_SUCCESS;
|
||||
}
|
||||
ObLogPlan* get_explain_plan() const
|
||||
{
|
||||
return explain_plan_;
|
||||
}
|
||||
ObStmt* get_stmt() const
|
||||
{
|
||||
return stmt_;
|
||||
}
|
||||
void set_explain_plan(ObLogPlan* const plan)
|
||||
{
|
||||
explain_plan_ = plan;
|
||||
}
|
||||
void set_stmt(ObStmt* stmt)
|
||||
{
|
||||
stmt_ = stmt;
|
||||
}
|
||||
int add_row(const common::ObNewRow& row)
|
||||
{
|
||||
return row_store_.add_row(row);
|
||||
}
|
||||
common::ObRowStore& get_row_store()
|
||||
{
|
||||
return row_store_;
|
||||
}
|
||||
uint64_t hash(uint64_t seed) const override
|
||||
{
|
||||
if (NULL != explain_plan_) {
|
||||
seed = do_hash(*explain_plan_, seed);
|
||||
public:
|
||||
static const int64_t MAX_EXPLAIN_BUFFER_SIZE = 1024 * 1024;
|
||||
ObLogValues(ObLogPlan &plan)
|
||||
: ObLogicalOperator(plan),
|
||||
explain_plan_(NULL),
|
||||
row_store_(plan.get_allocator())
|
||||
{}
|
||||
virtual ~ObLogValues() {}
|
||||
ObLogPlan *get_explain_plan() const { return explain_plan_; }
|
||||
void set_explain_plan(ObLogPlan * const plan) { explain_plan_ = plan; }
|
||||
int add_row(const common::ObNewRow &row)
|
||||
{
|
||||
return row_store_.add_row(row);
|
||||
}
|
||||
seed = ObLogicalOperator::hash(seed);
|
||||
common::ObRowStore & get_row_store() { return row_store_; }
|
||||
uint64_t hash(uint64_t seed) const
|
||||
{
|
||||
if (NULL != explain_plan_) {
|
||||
seed = do_hash(*explain_plan_, seed);
|
||||
}
|
||||
seed = ObLogicalOperator::hash(seed);
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
int set_row_store(const common::ObRowStore& row_store)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(row_store_.assign(row_store))) {
|
||||
SQL_OPT_LOG(WARN, "fail to assign row store, ret=%d", K(ret));
|
||||
return seed;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int64_t get_col_count() const
|
||||
{
|
||||
return row_store_.get_col_count();
|
||||
}
|
||||
|
||||
virtual int inner_append_not_produced_exprs(ObRawExprUniqueSet& raw_exprs) const override
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(raw_exprs.append(output_exprs_))) {
|
||||
SQL_LOG(WARN, "array append failed", K(ret));
|
||||
int set_row_store(const common::ObRowStore &row_store)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(row_store_.assign(row_store))) {
|
||||
SQL_OPT_LOG(WARN, "fail to assign row store, ret=%d", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int64_t get_col_count() const { return row_store_.get_col_count(); }
|
||||
|
||||
private:
|
||||
ObLogPlan* explain_plan_;
|
||||
ObStmt* stmt_;
|
||||
common::ObRowStore row_store_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObLogValues);
|
||||
};
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
private:
|
||||
ObLogPlan *explain_plan_;
|
||||
common::ObRowStore row_store_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObLogValues);
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user