-
Notifications
You must be signed in to change notification settings - Fork 134
[CBRD-26447] (Phase-1) Create/Alter invisible column #6687
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
base: feature/invisible_column
Are you sure you want to change the base?
[CBRD-26447] (Phase-1) Create/Alter invisible column #6687
Conversation
…TE, ALTER). can check visibility using SHOW [FULL] COLUMNS or DESC. no visibility functioning now.
Co-authored-by: kangmin <[email protected]>
Co-authored-by: jongmin-won <[email protected]>
Co-authored-by: kangmin <[email protected]>
…tribute's flags column
8eac52a to
03e7707
Compare
|
@childyouth |
jira에 페이즈 단위로 하위 이슈를 생성하고 연결하겠습니다. 감사합니다. |
|
shared 또는 class attribute의 경우에도 invisible 지정이 필요할까요? |
src/query/query_executor.c
Outdated
|
|
||
| /* add whitespace character if saved is not an empty string */ | ||
| const char *is_invisible_string = "invisible"; | ||
| size_t str_len = len + strlen (is_invisible_string) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strlen (is_invisible_string)의 값은 변하지 않는 값이므로 한번만 구할 수 있도록 변경해 두면 좋겠습니다.
static const invisible_str_length = strlen("invisible");와 같이 처리해 주는 것을 검토해 봐 주세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 함수인 qexec_execute_build_columns 내부에 이러한 방식으로 strlen 하는 경우가 많이 있습니다.
아마도 해당 함수를 부르는 DESC / SHOW [FULL] COLUMNS 명령어가 자주 사용될 일이 없다보니 계산 코스트보단 메모리 사용을 없애려 한 것은 아닐까 생각됩니다.
해당 함수내에서 모두 static size_t로 변경을 진행해도 괜찮을까요?
-> shared 와 class attribute 둘 다 invisible을 지원하지 않는 방향으로 수정하겠습니다. 감사합니다. |
| m_buf (" NOT NULL"); | ||
| } | ||
|
|
||
| // If the hidden column flag - 'system added invisible column' - is added to attribute.flags, the hidden column flag must be checked first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주석 내용에 hidden column와 invisible column 두가지 용어가 사용되고 있습니다. 의도한 용어 인지요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네, 오라클에선 system이 생성한 invisible column을 hidden column으로 지칭하고 있습니다. 기능적으로 hidden column은 invisible -> visible 설정이 불가능하게 되어있어 구분되어있습니다.
aad2cf5 to
330ed7b
Compare
|
/run all |
|
/run shell |
http://jira.cubrid.org/browse/CBRD-26447
Purpose
INVISIBLE COLUMN
Invisible Column은 명시적으로 컬럼 이름이 나열되지 않은 명령에 대해 결과를 숨기도록 하는 컬럼 옵션을 말함.
Invisible Column을 설정함으로서 얕은 부분의 보안성을 향상 시킬 수 있음.
다른 버전의 어플리케이션에 대해 정지없이 컬럼 추가가 가능해 지원성을 높일 수 있음.
시스템 측면에서 보여줄 필요가 없는 컬럼에 대해 설정함으로서 명확성을 높일 수 있음.
Phase 1
CREATE TABLE, ALTER TABLE ADD COLUMN / MODIFY / CHANGE 를 통해 컬럼에 Invisible 옵션을 부여할 수 있음.
컬럼에 Invisible 옵션을 확인할 수 있도록 DESC, SHOW COLUMNS 및 시스템 카탈로그에 해당되는 정보를 표시할 수 있음.
Implementation
CREATE 문에서 type 바로 뒤에 visibility를 설정할 수 있도록 함.
ALTER 와 같이 컬럼 내용을 변경하는 명령에 대해 visibility를 수정할 수 있도록 함.
SHOW COLUMNS / DESC 명령에서 표시되는 테이블의 'Extra' 컬럼에 'INVISIBLE' 용어가 추가로 표시될 수 있도록 함.
Object Representation 의 flags 한 개 비트를 invisible로 사용.
시스템 카탈로그 테이블 _db_attribute에 flags 컬럼을 추가함.
시스템 카탈로그 뷰 db_attribute에 is_invisible 컬럼을 추가함.
Remarks
[0a29901] : CREATE, ALTER에 visibility 관련 문법 추가. 기존에 사용되던 opt_invisible에 VISIBLE 용어 확장. SHOW COLUMNS 구문으로 'Extra' 컬럼에서 invisible 값 확인 가능.
error msg를 추가하였으나 경로가 없는 msg라 생각되어 삭제 예정
[1fa31f3] : 시스템 카탈로그 테이블, 뷰에서 flags 및 is_invisible 컬럼 추가하여 값 확인 가능.
[c6110b8] : 시스템 카탈로그 테이블, 뷰에서 flags 정보가 2048부터 시작하는 대신 1부터 시작하도록 수정.