Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-25762] When a general user performs a trigger unload, remove [user_schema] from condition and action_definition if the owner is the user themselves. #5731

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jongmin-won
Copy link
Contributor

http://jira.cubrid.org/browse/CBRD-25762

Purpose

기존 Trigger의 경우 name과 target_class에서 [user_schema]가 제거되지만, condition 및 action_definition에 사용된 쿼리 내 [user_schema]는 제거되지 않는 문제를 수정 합니다.

Repro

  • trigger 생성
create user u1;

create table u1.t1 (col1 int);
create table u1.t2 (col1 varchar);

CREATE TRIGGER u1.trigger
  STATUS ACTIVE
  PRIORITY 0.000000
  AFTER INSERT ON u1.t1
  IF 100 < (SELECT COUNT(*) FROM (SELECT /*+ NO_MERGE */ col1 as col1, 1 as col2 from u1.t2) as tbl WHERE tbl.col1 is not null)
  EXECUTE insert into u1.t2 select * from u1.t1;
  • unload 수행
cubrid unloaddb -u u1 -s testdb -S

Expected

  • cat testdb_trigger
CREATE TRIGGER [trigger]
  STATUS ACTIVE
  PRIORITY 0.000000
  AFTER INSERT ON [t1]
IF 100<(select count(*) from (select /*+ NO_MERGE */ [col1] as [col1], 1 as [col2] from [t2]) [tbl] where [tbl].[col1] is not null )
  EXECUTE insert into [t2] select * from [t1];

Actual

  • cat testdb_trigger
CREATE TRIGGER [trigger]
  STATUS ACTIVE
  PRIORITY 0.000000
  AFTER INSERT ON [t1]
IF 100<(select count(*) from (select /*+ NO_MERGE */ [col1] as [col1], 1 as [col2] from [u1.t2]) [tbl] where [tbl].[col1] is not null )
  EXECUTE insert into [u1.t2] select * from [u1.t1];

Implementation

N/A

Remarks

N/A

…rom condition and action_definition if the owner is the user themselves.
@jongmin-won jongmin-won self-assigned this Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant