[FEAT MERGE] Functional_index
This commit is contained in:
@ -234,6 +234,11 @@ public:
|
||||
TWO_OR_THREE = -7,
|
||||
OCCUR_AS_PAIR = -8,
|
||||
};
|
||||
enum ObValidForGeneratedColFlag
|
||||
{
|
||||
VALID_FOR_GENERATED_COL = true,
|
||||
NOT_VALID_FOR_GENERATED_COL = false
|
||||
};
|
||||
|
||||
static const int32_t NOT_ROW_DIMENSION = -1;
|
||||
static const bool INTERNAL_IN_MYSQL_MODE = true;
|
||||
@ -242,6 +247,7 @@ public:
|
||||
ObExprOperatorType type,
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
ObValidForGeneratedColFlag valid_for_generated_col,
|
||||
int32_t row_dimension = NOT_ROW_DIMENSION,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false);
|
||||
@ -565,6 +571,8 @@ public:
|
||||
common::ObExprTypeCtx &type_ctx) const;
|
||||
public:
|
||||
virtual common::ObCastMode get_cast_mode() const;
|
||||
virtual int is_valid_for_generated_column(const ObRawExpr*expr, const common::ObIArray<ObRawExpr *> &exprs, bool &is_valid) const;
|
||||
static int check_first_param_not_time(const common::ObIArray<ObRawExpr *> &exprs, bool ¬_time);
|
||||
protected:
|
||||
ObExpr *get_rt_expr(const ObRawExpr &raw_expr) const;
|
||||
|
||||
@ -667,6 +675,7 @@ protected:
|
||||
// 上面的限制而无法实现。因此在ObExprOperator中添加extra_serialize_,每个子类可以对它进行解释。
|
||||
// 例如对于ObExprCast, 它的含义是is_implicit_cast, 即是否为隐式cast
|
||||
int64_t extra_serialize_;
|
||||
bool is_valid_for_generated_col_;
|
||||
bool is_internal_for_mysql_;
|
||||
bool is_internal_for_oracle_;
|
||||
};
|
||||
@ -682,6 +691,7 @@ inline ObExprOperator::ObExprOperator(common::ObIAllocator &alloc,
|
||||
ObExprOperatorType type,
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
ObValidForGeneratedColFlag valid_for_generated_col,
|
||||
int32_t row_dimension,
|
||||
bool is_internal_for_mysql,
|
||||
bool is_internal_for_oracle)
|
||||
@ -700,6 +710,7 @@ inline ObExprOperator::ObExprOperator(common::ObIAllocator &alloc,
|
||||
raw_expr_(NULL),
|
||||
is_called_in_sql_(true),
|
||||
extra_serialize_(0),
|
||||
is_valid_for_generated_col_(valid_for_generated_col == 1),
|
||||
is_internal_for_mysql_(is_internal_for_mysql),
|
||||
is_internal_for_oracle_(is_internal_for_oracle)
|
||||
{
|
||||
@ -963,9 +974,9 @@ inline void ObExprOperator::calc_result_flagN(ObExprResType &type,
|
||||
class ObFuncExprOperator : public ObExprOperator
|
||||
{
|
||||
public:
|
||||
ObFuncExprOperator(common::ObIAllocator &alloc, ObExprOperatorType type, const char *name, int32_t param_num, int32_t dimension,
|
||||
ObFuncExprOperator(common::ObIAllocator &alloc, ObExprOperatorType type, const char *name, int32_t param_num, ObValidForGeneratedColFlag valid_for_generated_col, int32_t dimension,
|
||||
bool is_internal_for_mysql = false, bool is_internal_for_oracle = false)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension, is_internal_for_mysql, is_internal_for_oracle)
|
||||
: ObExprOperator(alloc, type, name, param_num, valid_for_generated_col, dimension, is_internal_for_oracle)
|
||||
{};
|
||||
|
||||
virtual ~ObFuncExprOperator() {};
|
||||
@ -997,7 +1008,7 @@ public:
|
||||
int32_t dimension = NOT_ROW_DIMENSION,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension, is_internal_for_mysql, is_internal_for_oracle),
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension, is_internal_for_mysql, is_internal_for_oracle),
|
||||
cmp_op_func2_(NULL)
|
||||
{
|
||||
}
|
||||
@ -1347,7 +1358,7 @@ public:
|
||||
int32_t dimension = NOT_ROW_DIMENSION,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension, is_internal_for_mysql, is_internal_for_oracle),
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension, is_internal_for_mysql, is_internal_for_oracle),
|
||||
subquery_key_(T_WITH_NONE),
|
||||
left_is_iter_(false),
|
||||
right_is_iter_(false)
|
||||
@ -1493,11 +1504,12 @@ public:
|
||||
ObResultTypeFunc result_type_func,
|
||||
ObCalcTypeFunc calc_type_func,
|
||||
const ObArithFunc *arith_funcs)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension),
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension),
|
||||
result_type_func_(result_type_func),
|
||||
calc_type_func_(calc_type_func),
|
||||
arith_funcs_(arith_funcs)
|
||||
{};
|
||||
{
|
||||
};
|
||||
|
||||
virtual ~ObArithExprOperator() {};
|
||||
|
||||
@ -1618,7 +1630,7 @@ public:
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
int32_t dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension)
|
||||
{
|
||||
}
|
||||
virtual ~ObVectorExprOperator()
|
||||
@ -1656,7 +1668,7 @@ public:
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
int32_t dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1749,10 +1761,11 @@ public:
|
||||
ObExprOperatorType type,
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
ObValidForGeneratedColFlag valid_for_generated_col,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false)
|
||||
:ObExprOperator(alloc, type, name, param_num, NOT_ROW_DIMENSION,
|
||||
is_internal_for_mysql, is_internal_for_oracle)
|
||||
:ObExprOperator(alloc, type, name, param_num, valid_for_generated_col, NOT_ROW_DIMENSION,
|
||||
is_internal_for_mysql, is_internal_for_oracle)
|
||||
{}
|
||||
virtual ~ObStringExprOperator() {}
|
||||
static int convert_result_collation(const ObExprResType &result_type,
|
||||
@ -1782,7 +1795,7 @@ public:
|
||||
const char *name,
|
||||
int32_t param_num,
|
||||
int32_t dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension)
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension)
|
||||
{
|
||||
}
|
||||
virtual ~ObBitwiseExprOperator()
|
||||
@ -1872,7 +1885,7 @@ public:
|
||||
int32_t dimension,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false)
|
||||
: ObExprOperator(alloc, type, name, param_num, dimension, is_internal_for_mysql, is_internal_for_oracle), need_cast_(true)
|
||||
: ObExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension, is_internal_for_mysql, is_internal_for_oracle), need_cast_(true)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1955,8 +1968,9 @@ public:
|
||||
int32_t dimension,
|
||||
bool is_internal_for_mysql = false,
|
||||
bool is_internal_for_oracle = false)
|
||||
: ObFuncExprOperator(alloc, type, name, param_num, dimension, is_internal_for_mysql, is_internal_for_oracle)
|
||||
{};
|
||||
: ObFuncExprOperator(alloc, type, name, param_num, VALID_FOR_GENERATED_COL, dimension, is_internal_for_mysql, is_internal_for_oracle)
|
||||
{
|
||||
};
|
||||
|
||||
virtual ~ObLocationExprOperator() {};
|
||||
virtual int calc_result_type2(ObExprResType &type,
|
||||
|
||||
Reference in New Issue
Block a user