diff --git a/.gitignore b/.gitignore index 40124258da024beadfffd6e0fb8517c2d31804c9..478347bc48f8b113751bf1600677c4bc8e7893f9 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,4 @@ deps/3rd compile_commands.json test/tmp test/var +*.ccls-cache/ diff --git a/src/sql/privilege_check/ob_privilege_check.cpp b/src/sql/privilege_check/ob_privilege_check.cpp index 827a91032770e763a154f56518c31b3ddafaff66..94190e62f819d87bafbd79f9ec210868dbcc3d39 100644 --- a/src/sql/privilege_check/ob_privilege_check.cpp +++ b/src/sql/privilege_check/ob_privilege_check.cpp @@ -425,14 +425,14 @@ int get_merge_stmt_ora_need_privs(uint64_t user_id, const ObSqlCtx& ctx, const O OX(source_table = merge_stmt->get_table_item_by_id(merge_stmt->get_source_table_id())); CK(target_table != NULL && source_table != NULL); /* first add target table */ - if (TableItem::BASE_TABLE == target_table->type_ || TableItem::ALIAS_TABLE == target_table->type_ || - target_table->is_view_table_) { + if (OB_SUCC(ret) && (TableItem::BASE_TABLE == target_table->type_ || TableItem::ALIAS_TABLE == target_table->type_ || + target_table->is_view_table_)) { OZ(set_privs_by_table_item_recursively(user_id, ctx, target_table, packed_privs, need_privs, check_flag)); } /* then add source table */ OZ(ObPrivPacker::pack_raw_obj_priv(NO_OPTION, OBJ_PRIV_ID_SELECT, packed_privs)); - if (TableItem::BASE_TABLE == source_table->type_ || TableItem::ALIAS_TABLE == source_table->type_ || - source_table->is_view_table_) { + if (OB_SUCC(ret) && (TableItem::BASE_TABLE == source_table->type_ || TableItem::ALIAS_TABLE == source_table->type_ || + source_table->is_view_table_)) { OZ(set_privs_by_table_item_recursively(user_id, ctx, source_table, packed_privs, need_privs, check_flag)); } return ret; diff --git a/src/sql/resolver/dcl/ob_grant_stmt.h b/src/sql/resolver/dcl/ob_grant_stmt.h index 1f821b4857d494de8427fdf87ce7702755ad9537..a47ce4cd6d40369b7ee30f714ae67b28df0d4f31 100644 --- a/src/sql/resolver/dcl/ob_grant_stmt.h +++ b/src/sql/resolver/dcl/ob_grant_stmt.h @@ -114,15 +114,15 @@ public: { object_id_ = object_id; } - int set_ins_col_ids(ObSEArray col_ids) + int set_ins_col_ids(ObSEArray &col_ids) { return ins_col_ids_.assign(col_ids); } - int set_upd_col_ids(ObSEArray col_ids) + int set_upd_col_ids(ObSEArray &col_ids) { return upd_col_ids_.assign(col_ids); } - int set_ref_col_ids(ObSEArray col_ids) + int set_ref_col_ids(ObSEArray &col_ids) { return ref_col_ids_.assign(col_ids); }