modify the version info (#421)

This commit is contained in:
Wan
2021-10-26 18:07:47 +08:00
committed by GitHub
parent b86bf6ed15
commit 188224d79b
5 changed files with 14 additions and 4 deletions

View File

@ -8,6 +8,7 @@ target_compile_definitions(ob_base INTERFACE
PACKAGE_NAME="${PROJECT_NAME}" PACKAGE_NAME="${PROJECT_NAME}"
PACKAGE_VERSION="${PROJECT_VERSION}" PACKAGE_VERSION="${PROJECT_VERSION}"
PACKAGE_STRING="${PROJECT_NAME} ${PROJECT_VERSION}" PACKAGE_STRING="${PROJECT_NAME} ${PROJECT_VERSION}"
PACKAGE_VERSION_INFO="${PROJECT_VERSION}-${PROJECT_NAME}"
RELEASEID="${OB_RELEASEID}" RELEASEID="${OB_RELEASEID}"
) )
target_compile_options(ob_base INTERFACE target_compile_options(ob_base INTERFACE

View File

@ -69,7 +69,7 @@ ObSpecialSysVarValues::ObSpecialSysVarValues()
ObSpecialSysVarValues::VERSION_MAX_LEN, ObSpecialSysVarValues::VERSION_MAX_LEN,
pos, pos,
"%s", "%s",
PACKAGE_VERSION))) { PACKAGE_VERSION_INFO))) {
LOG_ERROR("fail to print version to buff", K(ret)); LOG_ERROR("fail to print version to buff", K(ret));
} }

View File

@ -27,7 +27,7 @@ int ObExprVersion::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_ct
{ {
UNUSED(type_ctx); UNUSED(type_ctx);
type.set_varchar(); type.set_varchar();
type.set_length(static_cast<common::ObLength>(strlen(PACKAGE_VERSION))); type.set_length(static_cast<common::ObLength>(strlen(PACKAGE_VERSION_INFO)));
type.set_default_collation_type(); type.set_default_collation_type();
type.set_collation_level(CS_LEVEL_SYSCONST); type.set_collation_level(CS_LEVEL_SYSCONST);
return OB_SUCCESS; return OB_SUCCESS;
@ -36,7 +36,8 @@ int ObExprVersion::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_ct
int ObExprVersion::calc_result0(ObObj& result, ObExprCtx& expr_ctx) const int ObExprVersion::calc_result0(ObObj& result, ObExprCtx& expr_ctx) const
{ {
UNUSED(expr_ctx); UNUSED(expr_ctx);
result.set_varchar(common::ObString(PACKAGE_VERSION));
result.set_varchar(common::ObString(PACKAGE_VERSION_INFO));
result.set_collation(result_type_); result.set_collation(result_type_);
return OB_SUCCESS; return OB_SUCCESS;
} }
@ -45,7 +46,7 @@ int ObExprVersion::eval_version(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& exp
{ {
UNUSED(expr); UNUSED(expr);
UNUSED(ctx); UNUSED(ctx);
expr_datum.set_string(common::ObString(PACKAGE_VERSION)); expr_datum.set_string(common::ObString(PACKAGE_VERSION_INFO));
return OB_SUCCESS; return OB_SUCCESS;
} }

View File

@ -0,0 +1,6 @@
select version();
version()
3.1.1-OceanBase CE
show variables like 'version';
Variable_name Value
version 3.1.1-OceanBase CE

View File

@ -0,0 +1,2 @@
select version();
show variables like 'version';