未验证 提交 188224d7 编写于 作者: W Wan 提交者: GitHub

modify the version info (#421)

上级 b86bf6ed
......@@ -8,6 +8,7 @@ target_compile_definitions(ob_base INTERFACE
PACKAGE_NAME="${PROJECT_NAME}"
PACKAGE_VERSION="${PROJECT_VERSION}"
PACKAGE_STRING="${PROJECT_NAME} ${PROJECT_VERSION}"
PACKAGE_VERSION_INFO="${PROJECT_VERSION}-${PROJECT_NAME}"
RELEASEID="${OB_RELEASEID}"
)
target_compile_options(ob_base INTERFACE
......
......@@ -69,7 +69,7 @@ ObSpecialSysVarValues::ObSpecialSysVarValues()
ObSpecialSysVarValues::VERSION_MAX_LEN,
pos,
"%s",
PACKAGE_VERSION))) {
PACKAGE_VERSION_INFO))) {
LOG_ERROR("fail to print version to buff", K(ret));
}
......
......@@ -27,7 +27,7 @@ int ObExprVersion::calc_result_type0(ObExprResType& type, ObExprTypeCtx& type_ct
{
UNUSED(type_ctx);
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_collation_level(CS_LEVEL_SYSCONST);
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
{
UNUSED(expr_ctx);
result.set_varchar(common::ObString(PACKAGE_VERSION));
result.set_varchar(common::ObString(PACKAGE_VERSION_INFO));
result.set_collation(result_type_);
return OB_SUCCESS;
}
......@@ -45,7 +46,7 @@ int ObExprVersion::eval_version(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& exp
{
UNUSED(expr);
UNUSED(ctx);
expr_datum.set_string(common::ObString(PACKAGE_VERSION));
expr_datum.set_string(common::ObString(PACKAGE_VERSION_INFO));
return OB_SUCCESS;
}
......
select version();
version()
3.1.1-OceanBase CE
show variables like 'version';
Variable_name Value
version 3.1.1-OceanBase CE
select version();
show variables like 'version';
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册