[CBRD-26935] Fix debug-only abort when serial next_value/current_value is used in UNION/CTE#7302
[CBRD-26935] Fix debug-only abort when serial next_value/current_value is used in UNION/CTE#7302jongmin-won wants to merge 8 commits into
Conversation
✅ TC Merge Gate — Merge AllowedAll TC PRs are merged, closed, or not present. TC Repositories & Branches:
|
|
수정 된 내용에 대해 리뷰 해줘 |
🧪 TC Test Environment ReadyCircleCI Testing:
TC Repositories & Branches:
Next Steps:
|
|
Reviews (1): Last reviewed commit: "[CBRD-26935] Fix debug-only abort when s..." | Re-trigger Greptile |
…(debug abort + ER_QPROC_INCOMPATIBLE_TYPES) next_value/current_value 는 결과가 PT_TYPE_NUMERIC 이지만 pt_upd_domain_info() 에 해당 op case 가 없어 semantic 단계에서 data_type 이 NULL 로 남았다. UNION/집합연산/재귀 CTE 의 컬럼 호환성 검사가 NUMERIC 에 data_type 이 있다고 가정하므로 debug 빌드에서 assertion 으로 abort 했다 (release 미발생). 또한 XASL 생성(pt_to_regu_variable)이 serial 의 regu 도메인을 float NUMERIC(40,0) 으로 만들어 semantic 도메인(38,0)과 어긋났다. 이 때문에 파생 서브쿼리로 NUMERIC(38,0) 으로 해석된 serial 컬럼과 bare serial 값을 UNION 하면 list-file 병합(qfile_unify_types)에서 ER_QPROC_INCOMPATIBLE_TYPES 가 발생했다. - type_checking.c (pt_upd_domain_info): NEXT_VALUE/CURRENT_VALUE 에 fixed NUMERIC(38,0) data_type 부여 - xasl_generation.c (pt_to_regu_variable): serial regu 도메인도 fixed NUMERIC(38,0) 으로 정합 serial 저장값(db_serial.current_val)이 NUMERIC(38,0) 이고 값이 정수 <=38자리라 무손실. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Reviews (2): Last reviewed commit: "[CBRD-26935] Fix serial next_value/curre..." | Re-trigger Greptile |
|
/run all |
|
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
/run all |
|
🗑️ TC Branch Finalized for Engine PR was closed (not merged). Cleanup Results:
TC base branch is ready for the next PR. |
|
/run all |
|
/run all |
|
Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
/run all |
|
Reviews (7): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
#7288 PR merge를 기다리는 중 (merge 이후 test_shell(cbrd_26911.sh) 통과 가능). |
|
/run all |
|
Reviews (8): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
/run all |
|
Reviews (9): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
🗑️ TC Branch Finalized for Engine PR was closed (not merged). Cleanup Results:
TC base branch is ready for the next PR. |
|
🗑️ TC Branch Finalized for Engine PR was closed (not merged). Cleanup Results:
TC base branch is ready for the next PR. |
|
/run all |
|
Reviews (10): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
/run all |
|
Reviews (11): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
|
🗑️ TC Branch Finalized for Engine PR was closed (not merged). Cleanup Results:
TC base branch is ready for the next PR. |
|
🗑️ TC Branch Finalized for Engine PR was closed (not merged). Cleanup Results:
TC base branch is ready for the next PR. |
|
Reviews (12): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
http://jira.cubrid.org//browse/CBRD-26935
Purpose
serial 의
next_value/current_value를 UNION·집합연산·재귀 CTE·뷰 정의에서 사용할 때, debug 빌드에서 assertion 으로 abort 하는 문제를 수정합니다.assert_release가 abort 하지 않고 notification 만 남기므로 crash 가 발생하지 않습니다.Implementation
원인
next_value/current_value는 결과 타입이PT_TYPE_NUMERIC이지만, semantic check 단계에서data_type(precision/scale)이 설정되지 않아 NULL 로 남습니다. (도메인은xasl_generation.c의pt_make_prim_data_type단계에서야 부여됨)type_checking.c의pt_upd_domain_info()switch (op)에PT_NEXT_VALUE/PT_CURRENT_VALUEcase 가 없어default로 빠지고,node->data_type이 설정되지 않습니다.pt_union_compatible→pt_to_compatible_cast/pt_is_compatible_without_cast)는 "NUMERIC 이면 data_type 이 있다"고 가정하므로, data_type 이 NULL 인 next_value 가 들어오면 assertion 에서 abort 합니다.수정
pt_upd_domain_info()에서PT_NEXT_VALUE/PT_CURRENT_VALUE에 fixed NUMERIC(38,0) data_type 을 부여합니다.DB_MAX_FIXED_NUMERIC_PRECISION(38), scale =DB_DEFAULT_NUMERIC_SCALE(0)db_serial.current_val)이 모든 버전에서NUMERIC(38,0)(fixed) 이므로 next_value / current_value 도 fixed(38,0) 으로 수정 합니다.PT_UNION_COMP로 판정 → cast 불필요 → 정상 동작.관련 파일
src/parser/type_checking.c—pt_upd_domain_info(수정 지점)src/parser/semantic_check.c—pt_union_compatible,pt_to_compatible_cast,pt_is_compatible_without_cast(assertion 위치)src/parser/xasl_generation.c— next_value 도메인 생성(pt_make_prim_data_type)src/object/schema_system_catalog_install.cpp—db_serial.current_val = NUMERIC(38,0)Remarks
발생 조건 (두 조건의 교집합)
next_value/current_value뿐 (TO_NUMBER,LAST_INSERT_ID는 도메인이 부여되므로 해당 없음)UNION/UNION ALL/INTERSECT/DIFFERENCE(EXCEPT)/ 재귀 CTE / union 을 사용하는 VIEW 정의SELECT s.next_value는 호환성 cast 가 없어 발생하지 않음.영향 빌드