Skip to content

[CBRD-26633] match the number and order of SP catalog attributes#6925

Merged
hyunikn merged 11 commits intoCUBRID:developfrom
hyunikn:cbrd-26633-refactoring
Mar 25, 2026
Merged

[CBRD-26633] match the number and order of SP catalog attributes#6925
hyunikn merged 11 commits intoCUBRID:developfrom
hyunikn:cbrd-26633-refactoring

Conversation

@hyunikn
Copy link
Copy Markdown
Contributor

@hyunikn hyunikn commented Mar 19, 2026

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

Purpose

  • SP 관련 세 개 시스템 카탈록그 테이블 _db_stored_procedure, _db_stored_procedure_args, _db_stored_procedure_code 의 attribute 들의 이름 매크로와 인덱스 매크로 간의 순서와 갯수를 맞추는 등 코드 정비
  • 현재 동작 변경 없음. 향후 문제 소지 제거 및 유지 보수 편의성 도모

Implementation

  • attribute 이름을 나타내는 C macro 이름에 일관적인 prefix 를 사용하고 prefix 이후는 실제 이름의 대문자화와 일치하도록 수정 ([c7de7ea])
    • db_stored_procedure 의 attribute 은 SP_ATTR 로 시작하도록
    • db_stored_procedure_args 의 attribute 은 SP_ARG_ATTR 로 시작하도록
    • db_stored_procedure_code 의 attribute 은 SP_CODE_ATTR 로 시작하도록
  • SP 관련 시스템 카탈로그 테이블 세 건에 대해서 attribute 이름 문자열 대신 macro 사용하도록 수정 ([98c7b1b])
    • attribute 이름 매크로 정의 순서롤 테이블 스펙과 일치시킴 (가독성)
    • 이름 문자열이 같은 attribute 에 대해서도 테이블마다 macro 추가
      • 예: SP_ARG_ATTR_IS_SYSTEM_GENERATED, SP_CODE_ATTR_IS_SYSTEM_GENERATED
  • C macro 트릭을 사용하여 attribute 이름 벡터와 index enum 간의 갯수와 순서 일치하도록 보장 ([77726cf])
  • 유사한 트릭을 사용하여 _db_stored_procedure_code attribute 의 이름 to index 매핑에서 갯수와 순서 일치 보장.

Remarks

  • 네 개의 주요 commit 별로 따로 보시는 것이 이해가 더 편하실 것 같습니다.
  • 핵심 변경은 세 번째 commit [77726cf] 입니다.

@hyunikn hyunikn self-assigned this Mar 19, 2026
@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 19, 2026

/run all

@github-actions
Copy link
Copy Markdown

🧪 TC Test Environment Ready

CircleCI Testing:

  • CircleCI will automatically test using the branches below.

TC Repositories & Branches:

Next Steps:

  1. Wait for CircleCI tests to complete
  2. If CircleCI tests failed, please check the test results and fix the issues.
  3. When ready to merge this PR, please merge the TC PR first, then merge this PR.

@hyunikn hyunikn marked this pull request as ready for review March 19, 2026 11:22
@hyunikn hyunikn requested a review from beyondykk9 as a code owner March 19, 2026 11:22
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 19, 2026

Last reviewed commit: "code style"

Comment thread src/sp/sp_code.cpp Outdated
Comment thread src/sp/sp_catalog.hpp Outdated
Comment thread src/object/schema_system_catalog_definition.cpp Outdated
hyunikn and others added 2 commits March 19, 2026 20:32
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 19, 2026

Last reviewed commit: "minor"

Comment thread src/object/schema_system_catalog_definition.cpp Outdated
@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 19, 2026

/run all

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 19, 2026

Last reviewed commit: "refine _db_stored_pr..."

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 19, 2026

/run all

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 20, 2026

/run all

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 20, 2026

Last reviewed commit: "temporary circleci c..."

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 20, 2026

/run shell

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 20, 2026

/run all

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 20, 2026

Last reviewed commit: "Revert "temporary ci..."

@hyunikn hyunikn requested a review from kwangsoochae March 20, 2026 06:21
@kangmin5505
Copy link
Copy Markdown
Contributor

b6075e4 커밋의 내용은 반영하지 않는 것이 좋을 거 같습니다. 현재 SP 3개를 검증하려고 공통 인터페이스를 수정하고 30개가 넘은 호출부에 의미 없는 0이 추가되었습니다. 또한 이미 77726cf 커밋에서 X-macro를 사용하여 순서와 개수를 구조적으로 보장하고 있습니다. 이후 컬럼을 추가할 때마다 불필요하게 신경쓸 부분이 더 생기는 것이므로 코드 반영에 대해서 한 번 더 생각해 봐 주시면 감사하겠습니다.

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 23, 2026

b6075e4 커밋의 내용은 반영하지 않는 것이 좋을 거 같습니다. 현재 SP 3개를 검증하려고 공통 인터페이스를 수정하고 30개가 넘은 호출부에 의미 없는 0이 추가되었습니다. 또한 이미 77726cf 커밋에서 X-macro를 사용하여 순서와 개수를 구조적으로 보장하고 있습니다. 이후 컬럼을 추가할 때마다 불필요하게 신경쓸 부분이 더 생기는 것이므로 코드 반영에 대해서 한 번 더 생각해 봐 주시면 감사하겠습니다.

77726cf 는 attribute의 이름 문자열 벡터와 index enum 간의 순서와 갯수를 일치시키는 것이고,
b6075e4 는 스펙에 정의된 attribute 갯수와 (schema_system_catalog_install.cpp), 스펙 밖에 정의된 index enum 갯수를 일치시킵니다. 하는 일이 같지는 않습니다.
어느 쪽이나 신경 써서 실수하지 않으면 되는 문제이긴 하나 실수로 틀어지면 에러가 나도록 한 것이라 둘 다 어느 정도 의미는 있다고 봅니다.

@kangmin5505
Copy link
Copy Markdown
Contributor

제 의견은 어느 정도의 의미가 일부만 반영함으로써 오는 이후 분석하는 사람의 혼동(다수의 카탈로그가 0으로 존재, 디버깅 코드만을 위한 인터페이스의 변경)에 비하면 미미하고 실제로 실수가 발생하기 어려운 구조(ex. SP의 경우 매크로를 추가하고 schema_system_catalog_install.cpp에 추가하지 않으면 에러가 아닌 원하는 결과가 나오지 않아서 문제를 인식할 수 있음)라 생각합니다.

@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 23, 2026

제 의견은 어느 정도의 의미가 일부만 반영함으로써 오는 이후 분석하는 사람의 혼동(다수의 카탈로그가 0으로 존재, 디버깅 코드만을 위한 인터페이스의 변경)에 비하면 미미하고 실제로 실수가 발생하기 어려운 구조(ex. SP의 경우 매크로를 추가하고 schema_system_catalog_install.cpp에 추가하지 않으면 에러가 아닌 원하는 결과가 나오지 않아서 문제를 인식할 수 있음)라 생각합니다.

네. 그럼 필요성이 낮은 것으로 보고 그 commit 은 빼도록 하겠습니다.
좋은 의견 감사합니다.

Comment thread src/sp/sp_constants.hpp
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 23, 2026

Reviews (6): Last reviewed commit: "Revert "check the number of attributes b..." | Re-trigger Greptile

@kangmin5505
Copy link
Copy Markdown
Contributor

@hyunikn 의견 반영 감사합니다.
@childyouth 컬럼명에 대한 정의를 추가한다는 것이 문자열 리터럴을 사용하는 것이 아닌 매크로를 추가하는 것을 의미하시는 걸까요?

@childyouth
Copy link
Copy Markdown
Contributor

@kangmin5505

넵 현재는 trigger, collation, charset, dual 에서만 정의하고 있고 SP 또한 추가되기에 변경이 필수여야 하는지 궁금하여 여쭤보았습니다.

@kangmin5505
Copy link
Copy Markdown
Contributor

@childyouth 저는 메크로를 사용하는 것이 좋겠으나 그 작업은 리팩토링이기 때문에 기능을 추가할 때는 따로 수정하진 않았습니다.

Comment thread src/sp/sp_code.cpp
Comment thread src/sp/sp_constants.hpp
@hyunikn
Copy link
Copy Markdown
Contributor Author

hyunikn commented Mar 24, 2026

/run all

@hyunikn hyunikn merged commit 149cade into CUBRID:develop Mar 25, 2026
12 checks passed
@hyunikn hyunikn deleted the cbrd-26633-refactoring branch March 25, 2026 01:37
@github-actions
Copy link
Copy Markdown

TC Branch Finalized for cubrid-testcases-private-ex

Engine PR was merged.

Cleanup Results:

TC develop branch is ready for the next PR.

@github-actions
Copy link
Copy Markdown

TC Branch Finalized for cubrid-testcases

Engine PR was merged.

Cleanup Results:

TC develop branch is ready for the next PR.

hyunikn added a commit to hyunikn/cubrid that referenced this pull request Mar 25, 2026
hyunikn added a commit to hyunikn/cubrid that referenced this pull request Mar 25, 2026
youngjun9072 pushed a commit to youngjun9072/cubrid that referenced this pull request Apr 1, 2026
…RID#6925)

* refine macro names of attribute names of _db_stored_procedure, _db_stored_procedure_args, _db_stored_procedure_code
* use macro names for attribute names of SP related tables in system catalog initializer
* match the indexes and names of attributes of sp related catalog tables using C macro trick
* refine _db_stored_procedure_code attributes name to index mapping
kwangsoochae pushed a commit to kwangsoochae/cubrid that referenced this pull request Apr 1, 2026
…RID#6925)

* refine macro names of attribute names of _db_stored_procedure, _db_stored_procedure_args, _db_stored_procedure_code
* use macro names for attribute names of SP related tables in system catalog initializer
* match the indexes and names of attributes of sp related catalog tables using C macro trick
* refine _db_stored_procedure_code attributes name to index mapping
hgryoo pushed a commit to cubrid-systems/cubrid that referenced this pull request Apr 8, 2026
…RID#6925)

* refine macro names of attribute names of _db_stored_procedure, _db_stored_procedure_args, _db_stored_procedure_code
* use macro names for attribute names of SP related tables in system catalog initializer
* match the indexes and names of attributes of sp related catalog tables using C macro trick
* refine _db_stored_procedure_code attributes name to index mapping
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.

8 participants