fix build error for ccls build
This commit is contained in:
committed by
wangzelin.wzl
parent
efbed6ee8a
commit
b29a1bfe75
@ -53,6 +53,6 @@ int name##Executor::execute(ObExecContext &ctx, name##Stmt &stmt) \
|
||||
DEF_SIMPLE_EXECUTOR_IMPL(ObCreateContext, do_context_ddl);
|
||||
DEF_SIMPLE_EXECUTOR_IMPL(ObDropContext, do_context_ddl);
|
||||
|
||||
#undef DEF_EXECUTOR_IMPL
|
||||
#undef DEF_SIMPLE_EXECUTOR_IMPL
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -54,6 +54,6 @@ DEF_SIMPLE_EXECUTOR_IMPL(ObCreateSequence, do_sequence_ddl);
|
||||
DEF_SIMPLE_EXECUTOR_IMPL(ObAlterSequence, do_sequence_ddl);
|
||||
DEF_SIMPLE_EXECUTOR_IMPL(ObDropSequence, do_sequence_ddl);
|
||||
|
||||
#undef DEF_EXECUTOR_IMPL
|
||||
#undef DEF_SIMPLE_EXECUTOR_IMPL
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -9915,6 +9915,7 @@ static_assert(ObMaxTC * 2 == sizeof(OB_DATUM_CAST_MYSQL_ENUMSET_IMPLICIT) / size
|
||||
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_CAST_MYSQL_ENUMSET_IMPLICIT,
|
||||
OB_DATUM_CAST_MYSQL_ENUMSET_IMPLICIT,
|
||||
sizeof(OB_DATUM_CAST_MYSQL_ENUMSET_IMPLICIT) / sizeof(void *));
|
||||
#undef CAST_FAIL
|
||||
#undef EVAL_ARG
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
#undef EVAL_ARG
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "objit/common/ob_expr_res_type.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "ob_expr_operator.h"
|
||||
|
||||
|
||||
@ -1685,5 +1685,7 @@ int ObExprJsonValue::get_cast_inttc_len(ObExprResType &type1,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#undef CAST_FAIL
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include "common/ob_accuracy.h"
|
||||
#include "rpc/obmysql/ob_mysql_global.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "objit/common/ob_expr_res_type.h"
|
||||
#include "sql/engine/expr/ob_expr_res_type.h"
|
||||
#include "sql/engine/expr/ob_expr.h"
|
||||
#include "sql/engine/expr/ob_expr_cmp_func.h"
|
||||
#include "sql/engine/expr/ob_expr_extra_info_factory.h"
|
||||
|
||||
@ -342,5 +342,7 @@ int ObExprOracleTrunc::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_ex
|
||||
return ret;
|
||||
}
|
||||
|
||||
#undef GET_SCALE_FOR_CALC
|
||||
|
||||
} //namespace sql
|
||||
} //namespace oceanbase
|
||||
|
||||
@ -100,12 +100,33 @@ public:
|
||||
row_calc_cmp_types_.reset();
|
||||
res_flags_ = 0;
|
||||
}
|
||||
OB_INLINE void set_accuracy(int64_t accuracy) { accuracy_.set_accuracy(accuracy); }
|
||||
// accuracy.
|
||||
OB_INLINE void set_accuracy(const common::ObAccuracy &accuracy)
|
||||
{
|
||||
accuracy_.set_accuracy(accuracy);
|
||||
}
|
||||
OB_INLINE void set_length(const common::ObLength length) { accuracy_.set_length(length); }
|
||||
OB_INLINE void set_length_within_max_length(common::ObLength length, bool is_from_pl)
|
||||
{
|
||||
common::ObLength max_length = length;
|
||||
if (lib::is_oracle_mode()) {
|
||||
if (is_varchar() || is_nvarchar2()) {
|
||||
max_length = common::OB_MAX_ORACLE_VARCHAR_LENGTH;
|
||||
} else if (is_char() || is_nchar()) {
|
||||
max_length = is_from_pl ? common::OB_MAX_ORACLE_PL_CHAR_LENGTH_BYTE
|
||||
: common::OB_MAX_ORACLE_CHAR_LENGTH_BYTE;
|
||||
}
|
||||
} else {
|
||||
if (is_char()) {
|
||||
max_length = common::OB_MAX_CHAR_LENGTH;
|
||||
} else if (is_varchar()) {
|
||||
max_length = common::OB_MAX_VARCHAR_LENGTH;
|
||||
}
|
||||
}
|
||||
set_length(MIN(length, max_length));
|
||||
}
|
||||
//set both length and length_semantics in case of someone forget it
|
||||
OB_INLINE void set_length_semantics(const common::ObLengthSemantics value)
|
||||
{
|
||||
if (lib::is_oracle_mode()) {
|
||||
@ -117,12 +138,12 @@ public:
|
||||
set_length(length);
|
||||
set_length_semantics(length_semantics);
|
||||
}
|
||||
OB_INLINE void set_precision(const common::ObPrecision precision) { accuracy_.set_precision(precision);}
|
||||
OB_INLINE void set_scale(const common::ObScale scale) { accuracy_.set_scale(scale); }
|
||||
OB_INLINE void set_udt_id(uint64_t id)
|
||||
{
|
||||
accuracy_.set_accuracy(id);
|
||||
}
|
||||
OB_INLINE void set_precision(const common::ObPrecision precision) { accuracy_.set_precision(precision);}
|
||||
OB_INLINE void set_scale(const common::ObScale scale) { accuracy_.set_scale(scale); }
|
||||
OB_INLINE const common::ObAccuracy &get_accuracy() const { return accuracy_; }
|
||||
/* character count*/
|
||||
OB_INLINE common::ObLength get_length() const
|
||||
@ -144,20 +165,30 @@ public:
|
||||
{
|
||||
return accuracy_.get_length_semantics();
|
||||
}
|
||||
OB_INLINE uint64_t get_udt_id() const
|
||||
{
|
||||
return accuracy_.get_accuracy();
|
||||
}
|
||||
|
||||
/* meta info for client */
|
||||
OB_INLINE int get_length_for_meta_in_bytes(common::ObLength &length) const
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
length = -1;
|
||||
if (common::ObStringTC == ob_obj_type_class(get_type())
|
||||
&& common::is_oracle_byte_length(lib::is_oracle_mode(), get_accuracy().get_length_semantics())) {
|
||||
length = get_accuracy().get_length();
|
||||
} else if (OB_FAIL(common::ObField::get_field_mb_length(get_type(),
|
||||
get_accuracy(),
|
||||
get_collation_type(),
|
||||
length))) {
|
||||
SQL_RESV_LOG(WARN, "failed to get length of varchar", K(ret));
|
||||
if (is_string_or_lob_locator_type() || is_enum_or_set() || is_enumset_inner_type() || is_json()) {
|
||||
if (OB_FAIL(common::ObField::get_field_mb_length(get_type(),
|
||||
get_accuracy(),
|
||||
get_collation_type(),
|
||||
length))) {
|
||||
SQL_RESV_LOG(WARN, "failed to get length of varchar", K(ret));
|
||||
}
|
||||
} else {
|
||||
if (OB_FAIL(common::ObField::get_field_mb_length(get_type(),
|
||||
get_accuracy(),
|
||||
common::CS_TYPE_INVALID,
|
||||
length))) {
|
||||
SQL_RESV_LOG(WARN, "failed to get length of non-varchar", K(ret), K(common::lbt()), N_TYPE, get_type());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -177,10 +208,7 @@ public:
|
||||
? (lib::is_oracle_mode() ? ORACLE_NOT_FIXED_DEC : NOT_FIXED_DEC)
|
||||
: accuracy_.get_scale());
|
||||
}
|
||||
OB_INLINE uint64_t get_udt_id() const
|
||||
{
|
||||
return accuracy_.get_accuracy();
|
||||
}
|
||||
|
||||
OB_INLINE bool is_column() const { return !is_literal(); }
|
||||
OB_INLINE bool is_literal() const { return get_param().get_type() == get_type(); }
|
||||
OB_INLINE bool is_null() const { return common::ObNullType == get_type(); }
|
||||
@ -188,17 +216,24 @@ public:
|
||||
{ return is_varbinary() && 0 == get_length(); }
|
||||
OB_INLINE bool is_oracle_question_mark_type() const
|
||||
{ return is_char() && common::ObAccuracy::PS_QUESTION_MARK_DEDUCE_LEN == get_length(); }
|
||||
OB_INLINE bool is_oracle_integer() const { return lib::is_oracle_mode() && is_number()
|
||||
&& -1 == get_accuracy().get_precision()
|
||||
&& 0 == get_accuracy().get_scale(); }
|
||||
// calc_accuracy.
|
||||
OB_INLINE void set_calc_accuracy(const common::ObAccuracy &accuracy)
|
||||
{
|
||||
calc_accuracy_.set_accuracy(accuracy);
|
||||
}
|
||||
OB_INLINE void set_calc_scale(common::ObScale scale) { calc_accuracy_.set_scale(scale); }
|
||||
OB_INLINE void set_extend_size(int32_t size) { calc_accuracy_.set_length(size); }
|
||||
OB_INLINE void set_calc_length_semantics(const common::ObLengthSemantics value)
|
||||
{
|
||||
if (lib::is_oracle_mode()) {
|
||||
calc_accuracy_.set_length_semantics(value);
|
||||
}
|
||||
}
|
||||
OB_INLINE void set_calc_length(common::ObLength length) { calc_accuracy_.set_length(length); }
|
||||
OB_INLINE const common::ObAccuracy &get_calc_accuracy() const { return calc_accuracy_; }
|
||||
OB_INLINE common::ObScale get_calc_scale() const { return calc_accuracy_.get_scale(); }
|
||||
OB_INLINE int32_t get_extend_size() const { return calc_accuracy_.get_length(); }
|
||||
OB_INLINE common::ObLength get_calc_length() const { return calc_accuracy_.get_length(); }
|
||||
// obj.
|
||||
OB_INLINE void set_param(const common::ObObj ¶m) { param_ = param; }
|
||||
OB_INLINE const common::ObObj &get_param() const { return param_; }
|
||||
@ -219,6 +254,26 @@ public:
|
||||
OB_INLINE bool is_not_null_for_write() const { return has_result_flag(NOT_NULL_WRITE_FLAG); }
|
||||
// calc_type: 表示表达式计算时,表达式将转换成calc_type后再计算
|
||||
OB_INLINE void set_calc_type(const common::ObObjType &type) { calc_type_.set_type(type); }
|
||||
OB_INLINE void set_calc_collation_utf8()
|
||||
{
|
||||
set_calc_collation_by_charset(common::CHARSET_UTF8MB4);
|
||||
}
|
||||
OB_INLINE void set_calc_type_default_varchar()
|
||||
{
|
||||
set_calc_type(common::ObVarcharType);
|
||||
set_calc_collation_utf8();
|
||||
}
|
||||
OB_INLINE void set_calc_collation_ascii_compatible()
|
||||
{
|
||||
if (ObCharset::is_cs_nonascii(get_collation_type())) {
|
||||
set_calc_type_default_varchar();
|
||||
}
|
||||
}
|
||||
OB_INLINE void set_calc_collation_by_charset(common::ObCharsetType charset_type)
|
||||
{
|
||||
set_calc_collation_type(
|
||||
common::ObCharset::get_default_collation_by_mode(charset_type, lib::is_oracle_mode()));
|
||||
}
|
||||
OB_INLINE common::ObObjType get_calc_type() const { return calc_type_.get_type(); }
|
||||
OB_INLINE common::ObObjTypeClass get_calc_type_class() const
|
||||
{
|
||||
@ -250,6 +305,9 @@ public:
|
||||
OB_INLINE void unset_result_flag(uint32_t flag) { res_flags_ &= (~flag); }
|
||||
OB_INLINE bool has_result_flag(uint32_t flag) const { return res_flags_ & flag; }
|
||||
OB_INLINE uint32_t get_result_flag() const { return res_flags_; }
|
||||
OB_INLINE bool is_oracle_integer() const { return lib::is_oracle_mode() && is_number()
|
||||
&& -1 == get_accuracy().get_precision()
|
||||
&& 0 == get_accuracy().get_scale(); }
|
||||
int init_row_dimension(int64_t count) { return row_calc_cmp_types_.init(count); }
|
||||
uint64_t hash(uint64_t seed) const
|
||||
{
|
||||
@ -277,8 +335,8 @@ public:
|
||||
N_CALC_TYPE,
|
||||
calc_type_);
|
||||
private:
|
||||
common::ObAccuracy accuracy_;
|
||||
common::ObAccuracy calc_accuracy_;
|
||||
common::ObAccuracy accuracy_; //当是Extend类型时,用来表示复杂数据类型的id
|
||||
common::ObAccuracy calc_accuracy_; //当是Extend类型时,length字段用来表示复杂数据类型的size
|
||||
common::ObObj param_;
|
||||
ObExprCalcType calc_type_;
|
||||
uint32_t res_flags_; // BINARY, NUM, NOT_NULL, TIMESTAMP, etc
|
||||
|
||||
@ -40,7 +40,7 @@ using namespace share;
|
||||
namespace sql
|
||||
{
|
||||
|
||||
const int64_t MAX_NUMBER_BUFFER_SIZE = 40;
|
||||
const int64_t MAX_NUMBER_BUFFER_SIZE_IN_TYPE_UTIL = 40;
|
||||
|
||||
using ArithOp = ObArithResultTypeMap::OP;
|
||||
int ObExprResultTypeUtil::get_relational_cmp_type(ObExprResType &res_type,
|
||||
@ -761,7 +761,7 @@ int ObExprResultTypeUtil::deduce_max_string_length_oracle(const ObDataTypeCastPa
|
||||
if (orig_type.is_null()) {
|
||||
// do nothing
|
||||
} else if (orig_type.is_numeric_type()) {
|
||||
ascii_bytes = MAX_NUMBER_BUFFER_SIZE;
|
||||
ascii_bytes = MAX_NUMBER_BUFFER_SIZE_IN_TYPE_UTIL;
|
||||
} else if (orig_type.is_datetime()
|
||||
|| orig_type.is_otimestamp_type()) {
|
||||
// deduce by format
|
||||
|
||||
@ -292,6 +292,6 @@ int ObExprToOutfileRow::copy_string_to_buf(char *buf, const int64_t buf_len, int
|
||||
{
|
||||
return databuff_memcpy(buf, buf_len, pos, str.length(), str.ptr());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,3 +305,8 @@ int ObExprTruncate::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_expr,
|
||||
}
|
||||
} // namespace sql
|
||||
} // namespace oceanbase
|
||||
|
||||
#undef GET_SCALE_FOR_CALC
|
||||
#undef GET_SCALE_FOR_CALC_ORACLE
|
||||
#undef GET_SCALE_FOR_DEDUCE
|
||||
#undef GET_SCALE_FOR_DEDUCE_ORACLE
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "objit/common/ob_expr_res_type.h"
|
||||
#include "sql/engine/expr/ob_expr_res_type.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "ob_expr_operator.h"
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
const int64_t MAX_TO_CHAR_BUFFER_SIZE = 256;
|
||||
const int64_t MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS= 256;
|
||||
|
||||
const ObNFMKeyWord ObNFMElem::NFM_KEYWORDS[MAX_TYPE_NUMBER] =
|
||||
{
|
||||
@ -1434,7 +1434,7 @@ int ObNFMBase::cast_obj_to_num_str(const ObNFMObj &nfm_obj,
|
||||
int64_t num_str_len = 0;
|
||||
number::ObNumber nmb;
|
||||
char *num_str_buf = NULL;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
ObObjType obj_type = nfm_obj.get_obj_type();
|
||||
if (OB_ISNULL(num_str_buf = static_cast<char *>(
|
||||
allocator_.alloc(alloc_size)))) {
|
||||
@ -1689,7 +1689,7 @@ int ObNFMToChar::process_mul_format(const ObNFMObj &nfm_obj, common::ObString &n
|
||||
int64_t origin_str_len = 0;
|
||||
char *origin_str_buf = NULL;
|
||||
int64_t exponent = fmt_desc_.multi_;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
if (OB_ISNULL(origin_str_buf = static_cast<char *>(
|
||||
allocator_.alloc(alloc_size)))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
@ -1764,7 +1764,7 @@ int ObNFMToChar::process_tm_format(const ObNFMObj &nfm_obj, char *buf,
|
||||
char *num_str_buf = NULL;
|
||||
ObString num_str;
|
||||
const int32_t scale = -1;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
if (OB_ISNULL(num_str_buf = static_cast<char *>(
|
||||
allocator_.alloc(alloc_size)))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
@ -1816,7 +1816,7 @@ int ObNFMToChar::process_tme_format(const ObNFMObj &nfm_obj, char *buf,
|
||||
char *num_str_buf = NULL;
|
||||
ObString num_str;
|
||||
const int32_t scale = -1;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
if (OB_ISNULL(num_str_buf = static_cast<char *>(
|
||||
allocator_.alloc(alloc_size)))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
@ -1860,7 +1860,7 @@ int ObNFMToChar::process_sci_format(const common::ObString &origin_str, const in
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t sci_str_len = 0;
|
||||
char *sci_str_buf = NULL;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t alloc_size = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
if (fmt_desc_.pre_num_count_ < 1) {
|
||||
ret = OB_ERR_INVALID_NUMBER_FORMAT_MODEL;
|
||||
LOG_WARN("invalid number fmt model", K_(fmt_str));
|
||||
@ -2224,7 +2224,7 @@ int ObNFMToChar::convert_num_to_fmt_str(const ObObj &obj,
|
||||
char *res_buf = NULL;
|
||||
ObNFMObj nfm_obj;
|
||||
ObSQLSessionInfo *session = expr_ctx.my_session_;
|
||||
const int64_t res_buf_len = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t res_buf_len = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
if (OB_ISNULL(fmt_str) || OB_ISNULL(expr_ctx.calc_buf_) || OB_ISNULL(session)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("Invalid argument", K(ret), K(fmt_str), K(expr_ctx.calc_buf_),
|
||||
@ -2278,7 +2278,7 @@ int ObNFMToChar::convert_num_to_fmt_str(const common::ObObjMeta &obj_meta,
|
||||
int64_t offset = 0;
|
||||
char *res_buf = NULL;
|
||||
ObNFMObj nfm_obj;
|
||||
const int64_t res_buf_len = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t res_buf_len = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
ObSQLSessionInfo *session = ctx.exec_ctx_.get_my_session();
|
||||
if (OB_ISNULL(fmt_str) || OB_ISNULL(session)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
@ -2392,7 +2392,7 @@ int ObNFMToNumber::process_output_fmt(const ObString &in_str,
|
||||
int64_t offset = 0;
|
||||
bool is_negative = false;
|
||||
char *buf = NULL;
|
||||
const int64_t buf_len = MAX_TO_CHAR_BUFFER_SIZE;
|
||||
const int64_t buf_len = MAX_TO_CHAR_BUFFER_SIZE_IN_FORMAT_MODELS;
|
||||
// skip leading spaces
|
||||
while (str_pos < str_len && ' ' == str[str_pos]) {
|
||||
++str_pos;
|
||||
|
||||
@ -19,8 +19,7 @@
|
||||
#include "sql/engine/user_defined_function/ob_udf_registration_types.h"
|
||||
#include "sql/engine/expr/ob_expr.h"
|
||||
#include "rpc/obmysql/ob_mysql_global.h"
|
||||
#include "objit/common/ob_expr_res_type.h"
|
||||
//#include "common/expression/ob_i_sql_expression.h"
|
||||
#include "sql/engine/expr/ob_expr_res_type.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
||||
@ -15,8 +15,7 @@
|
||||
|
||||
#include "ob_udf_registration_types.h"
|
||||
#include "share/schema/ob_udf.h"
|
||||
/* 是不是不应该依赖objit里面的头文件?*/
|
||||
#include "objit/common/ob_expr_res_type.h"
|
||||
#include "sql/engine/expr/ob_expr_res_type.h"
|
||||
#include "sql/engine/expr/ob_expr.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user