fix create index on column default sequence bug
This commit is contained in:
@ -1649,8 +1649,19 @@ int ObRawExprUtils::build_seq_nextval_expr(ObRawExpr *&expr,
|
|||||||
uint64_t seq_id,
|
uint64_t seq_id,
|
||||||
ObDMLStmt *stmt)
|
ObDMLStmt *stmt)
|
||||||
{
|
{
|
||||||
return build_seq_nextval_expr(expr, session_info, expr_factory, q_name.database_name_,
|
int ret = OB_SUCCESS;
|
||||||
q_name.tbl_name_, q_name.col_name_, seq_id, stmt);
|
if (OB_ISNULL(session_info)) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("session info is NULL", K(ret));
|
||||||
|
} else {
|
||||||
|
const ObString &database_name = q_name.database_name_.empty() ?
|
||||||
|
session_info->get_database_name() : q_name.database_name_;
|
||||||
|
if (OB_FAIL(build_seq_nextval_expr(expr, session_info, expr_factory, database_name,
|
||||||
|
q_name.tbl_name_, q_name.col_name_, seq_id, stmt))) {
|
||||||
|
LOG_WARN("build seq nextval expr failed", K(ret));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build oracle sequence_object.currval, sequence_object.nextval expr
|
// build oracle sequence_object.currval, sequence_object.nextval expr
|
||||||
@ -1669,7 +1680,7 @@ int ObRawExprUtils::build_seq_nextval_expr(ObRawExpr *&expr,
|
|||||||
ObConstRawExpr *col_id_expr = NULL;
|
ObConstRawExpr *col_id_expr = NULL;
|
||||||
if (OB_ISNULL(session_info) || OB_ISNULL(expr_factory)) {
|
if (OB_ISNULL(session_info) || OB_ISNULL(expr_factory)) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_WARN("session info is NULL", K(session_info), K(expr_factory));
|
LOG_WARN("session info is NULL", K(ret), K(session_info), K(expr_factory));
|
||||||
} else if (NULL != stmt && OB_FAIL(stmt->get_sequence_expr(exists_seq_expr,
|
} else if (NULL != stmt && OB_FAIL(stmt->get_sequence_expr(exists_seq_expr,
|
||||||
tbl_name,
|
tbl_name,
|
||||||
col_name,
|
col_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user