Skip to content

[CBRD-26096] Feature/add replication option 병합#6884

Open
youngjun9072 wants to merge 27 commits intodevelopfrom
feature/add-replication-option
Open

[CBRD-26096] Feature/add replication option 병합#6884
youngjun9072 wants to merge 27 commits intodevelopfrom
feature/add-replication-option

Conversation

@youngjun9072
Copy link
Copy Markdown
Contributor

@youngjun9072 youngjun9072 commented Mar 3, 2026

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

Purpose

복제 시 PK제약 feature를 병합하기위한 branch 입니다.

Implementation

N/A

Remarks

N/A

youngjun9072 and others added 16 commits September 14, 2025 17:23
Support replication option in CREATE/ALTER TABLE

- Add replication option handling for table creation and alteration
- Implement replication option lookup functionality
- Add error message to forbid toggling replication (off→on) via ALTER TABLE in HA mode
…abled (#6467)

- Add a function to retrieve the replication option of a class.
- Change the replication log generation condition from primary key presence to replication option setting and existence of a replication key candidate.
- During update and delete operations, change the B-tree search key in the slave’s pre-apply preparation function from the primary key (PK) to the replication key (RK), and rename the related functions accordingly.
* Fix missing user spec and other updates

- Disallow creation of replication tables without replication key in HA mode
- Prevent REPLICATION ON <-> OFF switching via ALTER in HA mode
  (expected complexity increase with foreign key implementation)
- Rename related macros
* add replication option

* lint

* fix typo

* Add variable intialization

* add "alter table ... replication" option

* lint

* add "TODO" comment

* Code changes

- Changed the location where replication option is handled
- Simplified condition logic to check only default or "on"
- Added explanatory comments

* lint

* 리뷰 반영
 - 매크로 이름 변경
 - 불필요 공백 삭제

* add tab

* Flag and condition changes for backward compatibility with older backups

- replace SM_CLASSFLAG_REPLICATION with SM_CLASSFLAG_NO_REPLICATION.
- change handling condition from IS_REPLICATION_ON to !IS_REPLICATION.

* Add macro for alter condition branch

* add replication opt handling and select catalog

* replication 저장 및 조회 구현

* add alter table handling

* 에러 핸들링 추가

* add comment

* Code modification

- Rename flag from SM_CLASSFLAG_REPLICATION to SM_CLASSFLAG_NO_REPLICATION
- Update return values to reflect the new flag naming
- Add error handling when attempting to alter replication tables in HA mode

* Add error message

* remove unused error log

* Macro refactoring and lint

* Refactoring

* lint

* Apply review feedback
- fix indentation
- rename SM_CLASSFLAG_NO_REPLICATION to SM_CLASSFLAG_REPLICATION_OFF and update comment
- check replication status at function entry to avoid unnecessary operations
- adjust error message and parameter from 1 to 0
- add error handling

* replication pk only

* Implementation of unique key insert, delete, and update

* fix(pgbuf): prevent assertion in pgbuf_is_valid_page during UPDATE/DELETE

* lint

* refectoring

* lint

* Fix missing user spec and other updates

- Disallow creation of replication tables without replication key in HA mode
- Prevent REPLICATION ON <-> OFF switching via ALTER in HA mode
  (expected complexity increase with foreign key implementation)
- Rename related macros

* Review applied

* Support adding FK constraints on table creation

* Adding constraints when using ALTER TABLE to add a foreign key (FK) constraint to a column in HA mode.

* Fix: incorrect replication key detection logic

- Previously, the logic checked constraints and attributes separately.
- This caused a table to be recognized as having a replication key
  even when "UNIQUE" and "NOT NULL" were defined on different columns.
- Updated the logic to require both conditions on the same set of columns.

* add error handling

* indent

* Apply code review feedback

- Renamed function ha_fk_replication_violation() to ha_check_fk_replication_violation()
- Removed unnecessary variables and simplified logic in ha_check_fk_replication_violation()

* Applied review feedback

- Refactored routines for validating replication options and HA-related constraints when creating tables
- Aligned and cleaned up error code definitions
- Updated and clarified related error messages
Modify FK constraint check to RK constraint check in do_alter_one_clause_with_template()

- Updated logic in do_alter_one_clause_with_template() to verify replication key (RK) constraints instead of foreign key (FK) constraints after modifying table column definitions.
- The logic for modifying FK constraints is now unified with the logic for removing RK constraints.
* Refactor HA constraint verification to support multiple ALTER TABLE clauses

- Moved replication key (HA constraint) check from do_alter_one_clause_with_template() to do_alter()
  to properly handle multiple ALTER TABLE clauses within a single statement.
- Ensures HA constraint verification is performed once after all clauses are processed.
* Add replication attributes for partitions and inherit constraints on promotion

- On CREATE TABLE ... PARTITION BY, child partitions inherit the parent's replication option.
- On ALTER TABLE ... PROMOTE PARTITION, the child inherits the parent's attributes and constraints.
* drop pk and fk bug fix

* add tab

* er_set()

* chage error message

* refactoring

* Apply code review feedback
* Introduce the rkcheck admin utility to check replication key constraints before starting HA processes.

- Add replication key (RK) and foreign key (FK) constraint checks when invoking utilities
  - Provide options to selectively check specific constraint types
- Invoke utilities during heartbeat execution
  - Always check all replication-related constraints regardless of options
- Enhance constraint check output handling
  - Print a summary result to the terminal
  - Write detailed results to a .err file
  - Generate a .list file containing the list of constraint violations
* [CBRD-26233] Prevent buffer overflow in error logging (snprintf) (#6378)

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

* fix(error_manager.c): buffer overflow build failure due to 128 + 255, fix with dynamically calculating the remaining size

* [CBRD-26239] refine synchronization in cubpl::session (#6377)

* remove m_is_running from cubpl::session
* separate m_mutex into three mutexes - m_mutex_stack, m_mutex_connection, m_mutex_cursor
* remove m_is_interrupted from cubpl::session
* . separate m_cond_var into two condition variables - m_cond_target_stack_at_top and m_cond_pl_session_done
  . remove a function session_notify_pl_task_completion()
  . refine stack manipulation logic
* remove cubpl::session::notify_waiting_stacks because it is redundant
* . merge session::destroy_cursor_internal to its call site
  . simplify boolean returning code
* . remove an unused method cubpl::session::get_depth()
  . take the cubpl:session as an argument of the constructor of cubpl::execution_stack
* minor rename - cubpl::session::is_running --> cubpl::session::is_sp_running
* use lock_guard in as many cases as possible which is more lightweight than unique_lock

* [CBRD-26247] reflect changes authorization.grants to CMS (#6380)

reflect reflect authorization.grants to CMS since 11.4

* [CBRD-26227] Improve WITH ROLLUP to handle non-GROUP BY columns without NULL output (#6343)

Fix the issue where non-grouped columns return NULL in GROUP BY WITH ROLLUP queries by making them output values from the last tuple read for each group by key.

* [CBRD-26221] Adjust evaluation threshold for Hash Group By to Sort Group By transition (#6356)

Modify HASH_AGGREGATE_VH_SELECTIVITY_TUPLE_THRESHOLD to 2000

* [CBRD-26240] Core dump occurs when using like_match_upper_bound(empty-string) in a query (#6407)

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

* [CBRD-26282] Fixed an issue where the string output from unloaddb would break when the length was longer than the remaining space in the buffer (#6406)

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

* Fixed an issue where the string output from unloaddb would break when the length was longer than the remaining space in the buffer.

* [CBRD-26244] parallel query performance optimization with __builtin_*() (#6379)

Purpose

When using both Parallel heap scan and Parallel subquery execution within a single query, the performance improvement does not scale proportionally with the number of allocated parallel workers, and bottlenecks are observed.
To address this, performance profiling was conducted, and key bottlenecks were optimized to improve the efficiency of parallel execution.

Implementation
	•	Optimization of fetch_val_list
	•	Bottleneck occurs in clear calls when the db_value type is set.
	•	Inserted a macro assuming the default case is non-set and applied __builtin_expect to prevent branch misprediction.
	•	Modification of heap scan regu_var array clear routine
	•	Memory stalls occur during db_value need_clear checks inside regu_var before row scanning.
	•	Changed to perform the clear check and execution at the row fetch stage.
	•	Simplification of qfile_save_tuple branching
	•	Overhead occurs at the function entry.
	•	Modified so that in the case of T_NORMAL, qfile_save_normal_tuple is called directly.
	•	Optimization of mergable list writer memcpy
	•	Previous: tuple created in tpl_buf and then copied with memcpy.
	•	Improvement: directly write to list_file temp page when it is not an overflow tuple.
	•	Optimization of QPROC_TPLDESCR_SUCCESS prediction
	•	Applied __builtin_expect assuming the default case is no overflow tuple.
	•	Optimization of scan_init_filter_info
	•	Overhead occurs during function call.
	•	Inlined the function to directly initialize variables.
	•	Branch optimization in qdata_copy_valptr_list_to_tuple
	•	Branch misprediction occurs in hidden column checks.
	•	Improved prediction accuracy with __builtin_expect and continue.
	•	Applied the same optimization to qdata_generate_tuple_desc_for_valptr_list.
	•	Optimization of DEDUPLICATE_KEY_ATTR_ID check
	•	Usually false; modified to assume false prediction by default.
	•	Optimization of heap_scan_get_visible_version
	•	Memory stalls occur when accessing scan_cache.
	•	Modified to return immediately if mvcc_header is valid and all_visible.
	•	Build configuration cleanup
	•	Modified CMakeLists and removed SERVER_MODE.
	•	Excluded parallel heap scan feature from non-SERVER_MODE binaries, reducing binary size (approx. 1MB reduction).

* [CBRD-25717] Support PARALLEL HASH JOIN (#6247)

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

### SQL Hint
- Added `NO_PARALLEL_HASH_JOIN` hint.

### Hash Table
- Added `mht_calculate_htsize_for_pow2`.
  - Determines hash table size as the nearest prime greater than a power of two.

### Partitioning
1. Store the hash key in the first column of each partitioned outer/inner result.
2. Refactored functions:
   - `hjoin_try_partition`
   - `hjoin_check_partition`
   - `hjoin_prepare_partition`
   - `hjoin_init_split_info`, `hjoin_clear_split_info`
   - `hjoin_init_shared_split_info`, `clear_shared_split_info`
   - `hjoin_build_partitions`
   - `hjoin_split_qlist`
   - `hjoin_merge_qlist`

### Parallel Execution
1. Added `worker_manager_reserver` for reserving parallel workers in `worker_manager_global`.
   - `class worker_manager_reserver`
2. New directory `src/query/parallel/px_hash_join`:
   - `px_hash_join.cpp`
      - `class entry_manager`
      - `class worker_pool_manager`
      - `build_partitions`
      - `execute_partitions`
   - `px_hash_join_task_manager.cpp`
      - `class task_manager`
      - `class base_task`
      - `class split_task`
      - `class join_task`
   - `px_hash_join_spawn_manager.hpp`
      - `class spawn_manager`
3. Concurrency Management for `PRED_EXPR`, `REGU_VARIABLE`, `DB_VALUE`
   - Implemented in `src/xasl/xasl_spawner.hpp` and `xasl_spawner.cpp`.
   - Each thread creates its own clone for independent use.
   - Clones are allocated and freed by `join_task` and stored in thread-local storage (TLS).

### Resource Tracker
1. Skip resource tracking on parallel thread recycle.
   - Added `bool skip_end_resource_tracks_in_recycle` to `cubthread::entry`.
   - Checked only on thread termination when the flag is set.
2. Updates to `m_qlist_count` in parallel threads are reflected in the main thread.
   - Set `m_px_orig_thread_entry` in `cubthread::entry` to the main thread.

### Merging Join Results from Partitions
- Merge join results by connecting `QFILE_LIST_ID` (`qfile_connect_list`) instead of copying records or pages.

### SQL Trace
1. Renamed `PARTITIONING` output to `SPLIT`.
2. Removed `part_time`, `build_time`, `probe_time`, `fetch_time`, `skew`.
3. Separated outer/inner result scans into `SUBQUERY (uncorrelated)`.
4. Removed `OUTER` and `INNER` outputs.
5. In `BUILD` output, removed `build: inner/outer`.
6. In `PROBE` output, removed `max_collisions: #`.
7. For parallel partitioned hash join, moved `BUILD` and `PROBE` under `PARALLEL`.

### Restrictions
- Hash join is not allowed when using Click Counter functions:
   - INCR/DECR
   - WITH INCREMENT/INCREMENT FOR

* [CBRD-26283] shorten the string stored in _db_stored_procedure.target_method (#6427)

* [CBRD-26283] shorten the string stored in _db_stored_procedure.target_method when it exeeds column length 1024 (#6410)

* resize the column _db_stored_procedure.target_method : varchar(1024) --> varchar(4096)
* shorten the text stored in _db_stored_procedure.target_method column when it exceeds 4096 characters
* add short form of java.lang.Integer[][] and java.lang.Float[][] to argClassMap
* remove an unused macro (not related to this PR)

* [CBRD-26280] An error occurs when encountering data of a specific format when executing with the loaddb -C option (#6402)

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

* Fixed an issue where an error would be thrown if a string literal contained a newline and the first string after the newline began with %id or %class.
* Fixed an issue where string literals contained a newline and trimmed blank lines or lines containing only whitespace after the newline.
* Resolved duplicate error messages.

* [CBRD-26293] Fixed a bug that caused "order by" to be deleted when merging and resulted in incorrect results.

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

- Fix to prevent view merging when the subquery contains an "order by" clause and the main query contains rownum, even if the predicate is only rownum, and contains distinct or aggregate functions.
- Since distinct or aggregate functions cannot add columns to the select list, the order by clause of the subquery may be deleted.

* [CBRD-26240] rev: Core dump occurs when using like_match_upper_bound(empty-string) in a query (#6447)

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

- Fix the coredump error that occurred when executing the 3th query after running the two queries (1th, 2th).
(1) select like_match_upper_bound('') from dual;
(2) select like_match_upper_bound('abcd') from dual;
(3) select /*+ RECOMPILE */ like_match_upper_bound('') from dual

* [CBRD-26249] Fix diagdb disk bitmap output bug and add function to check empty volume (#6430)

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

- add disk_volume_is_empty() function to check if a volume is unused for delvoldb utility.
- fix a bug where disk bitmaps were displayed incorrectly when outputting them with diagdb -d 6. (errors that appear as used for unused bitmaps)

* [CUBRIDQA-1266] run only failed case with same commit. (#6431)

http://jira.cubrid.org/browse/CUBRIDQA-1266

* migrate tests split to tests run
* fix timings-type parameter

* [CBRD-26290] When inserting into a bit or bit varying type on a remote server using the prepare statement via dblink, an incorrect value is entered. (#6456)

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

- fix error that inserted wrong data, when preparing and executing insert query used bit data type as following.
prepare st from 'insert into type_support@srv1 (T_BIT,T_BITVARYING) values (?,?)';
execute st using B'1',0xbb;

* [CBRD-26289] Remove unused mysql and oracle code from CAS (#6436)

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

Remove unused mysql and oracle code from CAS

* [CBRD-26267] refine cubpl::get_session() (#6417)

* . create PL_SESSION while creating SESSION_STATE in order to be thread-safe
     . create PL_SESSION  not in session_get_session() but in session_state_create()
     . delete PL_SESSION not in session_stop_attached_threads() but in session_state_uninit()

* remove session_has_pl_session because it is always true unless session has not been expired

* handle the cases when cubpl::get_session returns the NULL pointer

* destroy PL context only when connection has been made at least once

* [CBRD-26257] Issue with view merging optimization being restricted when using the BETWEEN operator (#6396)

In Oracle-style partial range processing, view merging optimization is applied, but the BETWEEN operator is not optimized. Modify the behavior to include this operator in the optimization.

* [CBRD-26264] Rewrite count(column) as count(*) when the column has a not null constraint (#6400)

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

Purpose

Rewrite count(column) as count(*) when the column has a not null constraint (PK, not null, …).

* [CBRD-26307] fix coredump in perfmon_add_at_offset (#6463)

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

- When thread p, an argument of logtb_set_tran index interrupt(), is NULL, it is modified to obtain thread_p by train_index, and call perfmon_inc_stat() is only if thread_p is not NULL.

* [CBRD-25717] Fix errors in SQL Trace output for collision_rate and join input (#6429)

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

Fix `collision_rate` and Join Input errors, and remove `collision_rate` from hash join SQL Trace output

* [CBRD-26292] refine Java type name to Java class mapping (#6432)

* add omitted 2-dimensional array types to possible JSP argument types

* removed boolean, Boolean, char, Character types from Java types supported for SP parameter types

* [CBRD-26215] Incorrect NULL value ordering when using GROUP BY with ROLLUP and ORDER BY (#6365)

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

Prevent ORDER BY removal for ROLLUP operations during rewrite and execution phases

* [CBRD-26313] View-merging issue even when there is a query condition other than rownum

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

View-merging is prohibited if there is a query condition other than rownum.

* [CBRD-26101] error on the PL/CSQL semantic check request of zero length

to identify a possible cause of CBRD-26101

* [CBRD-26240] rev2: Core dump occurs when using like_match_upper_bound(empty-string) in a query (#6472)

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

- fix to return correct results when executing the following queries sequentially.
select /*+ RECOMPILE / like_match_upper_bound('') from t; 
select /+ RECOMPILE / like_match_upper_bound('') from t; 
select /+ RECOMPILE */ like_match_upper_bound('') from t;

* [CUBRIDQA-1301] increase core file size to 10mb (#6488)

* [CBRD-26151] Modify the db_auth catalog view to output only the privileges that correspond to the grantor–grantee relationship of the logged-in user. (#6387)

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

During test case (TC) modification, the following issue was identified. (CBRD-25923)

In CUBRID versions 9.3 ~ 11.4, the db_auth view has a problem where if a logged-in user holds only the SELECT privilege on a table, all privileges on that table are displayed.
The same issue occurs for stored procedures, where all privileges are shown if the user only has the EXECUTE privilege.

To resolve this, the db_auth view was modified to restrict the scope so that only the privileges in which the logged-in user (CURRENT_USER) is involved as either the grantor or the grantee are returned.

After the fix, behavior is classified into the following four cases:
1. DBA or DBA group member
- Can check privileges on all objects.
2. OWNER or OWNER group member
- Can check all privileges on objects owned by the user.
- OWNER group members can check all privileges on the OWNER’s objects.
3. Grantor
- Can check privileges granted by the logged-in user.
4. Grantee
- Can check privileges granted to the logged-in user.

* [CBRD-26318] Index scan unavailable for subqueries introduced after view merging

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

The root cause was that the correlation_level was not readjusted after view merging. The fix ensures that the optimizer performs the readjustment before creating the relevant term.

* [CBRD-26314] Clean up code related DO_NOT_USE_CUBRIDENV define (#6479)

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

* Clean up code related DO_NOT_USE_CUBRIDENV define

* [CBRD-26247] avoid NULL mop for revoke (#6485)

avoid NULL mop for revoke (cms lib)

* [CBRD-26319] fix core dump left join or use function index (#6497)

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

* Fixed a core dump issue that occurred when reusing a BITSET variable that had been cleared using bitset_delset().

* [CBRD-26315] Refactoring code related to locale_support (#6487)

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

* Designate const to explicitly ensure that the values ​​of structure global variables do not change in relation to locale.
* Restrict structures and functions used only in SA mode to be built only in SA_MODE.

* [CBRD-26214] add an omitted null check while closing a cursor (#6450) (#6483)

* [CBRD-26214] fix a omitted null check while closing a cursor (#6450)

. fix an omitted null check while closing a cursor
. close all cursors of the session in the callback for ROLLBACK

* [CBRD-26308] [Regression] Core dumped in or_advance at src/base/object_representation.h:1485 (#6473)

- Partially revert CBRD-20497
- When `compressed_string` is changed from y→n, building an index and then reading via `qdata_copy_db_value_to_tuple_value` can corrupt data if the same column appears multiple times in a GROUP BY output. The compressed buffer/state was cleared/shared across duplicates, causing a mismatch between the tuple’s total length and each value’s length.

* [CBRD-26104] Support uncorrelated subquery parallel execution (refactor) (#6442)

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

Purpose

In parallel hash join, there are many changes to common functions, variables, and data structures used for implementing and executing parallel queries. These changes improve maintainability.

Previously, the parallel subquery execution code created multiple XASLs as tasks and pushed them into the worker pool task queue of cubthread. However, the push process caused performance overhead due to mutex usage. To address this, the structure was refactored into a single-task model, and a thread-safe job queue was implemented so that tasks could be pushed without performance degradation.

After switching parallel subquery execution to the single-task structure, performing a parallel heap scan revealed an issue where worker_manager only allowed one parallel query processing per thread. Additional refactoring was done to resolve this.

In addition, when setting m_qlist_count or m_px_lock (a lock for IS_LOCK), if the actual query-executing main thread was not recursively traversed, errors occurred when parallel query threads executed operations such as parallel heap scans. This problem has been fixed.

For query profiling, information was originally collected per tran_index, but the data type was int, which was not thread-safe. This was refactored so that trace information is collected per thread (m_px_stats), merged in the parent thread (which may itself be a parallel execution thread), and finally aggregated into the main thread through a recursive merge structure.

Lastly, xasl_iteration and xasl→header.id were implemented to allow locating a specific XASL in the XASL tree based on its ID, and the code was refactored so that parallel query threads can access specific XASLs from an XASL clone.

* [CBRD-26314] Modify CMakeLists.txt because USE_CUBRID_ENV is always defined (#6503)

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

* Fixed an issue where the demodb creation script would fail after applying #6479 of [CBRD-26314]
*Clean up code related DO_NOT_USE_CUBRIDENV define #6479 was modified based on the fact that USE_CUBRID_ENV is always set, but some parts were omitted, so I am modifying them.

* [CBRD-26302] raise INVALID_CURSOR when cursor fetch failed due to prior ROLLBACK (#6504)

* [CBRD-26302] raise INVALID_CURSOR when cursor fetch failed due to prior ROLLBACK (#6482)

* raise INVALID_CURSOR when cursor fetch failed due to prior ROLLBACK
  . change the error message too: fetch failed --> cursor closed

* [CBRD-26320] Handling serial next value in trigger insert with dblink (#6492)

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

- fix an error that occurs when the following query is executed.

CREATE TRIGGER tbl_before_insert_trg_01
        BEFORE INSERT ON tbl
        EXECUTE INSERT INTO 
           trigger_tbl@srv1(col1, col2, col3, col4) 
        VALUES ( trigger_serial.next_value, 'insert tbl, trigger data ', new.a, new.b );
INSERT INTO tbl (a, b) VALUES (1, 2);

* [CBRD-26284] add elapsed time log to event log when expading/adding volume. (#6476)

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

* [CBRD-26326] [Regression] Core dumped in cubbase::restrack_assert at src/base/resource_tracker.hpp:455 (#6524)

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

fix to release resources, after executing sql included "connect by"

* [CBRD-26229] move PL related log files into a separate directory (#6494) (#6507)

* move PL related log files <dbname>_pl.(access|err|log|log.lck) into a separate directory under the log directory

* [CBRD-26304] fix error to unloaddb: Empty component list in class (#6521)

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

* When checking whether the class has an index in an inheritance relationship, the ER_OBJ_NO_COMPONENTS error is set, and this value affects when downloading the object. 
* Clear it with er_clear().

* [CBRD-26328] suppress quote for SP unique name (#6519) (#6523)

* suppress bracket printing when getting a unique name of a stored procedure/function

* [CBRD-26306] bracket removal in insert columns (#6530)

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

backport it from develop.

* [CBRD-26335] Adds some improvements and validation to the handling of BITSET variables (#6527)

http://jira.cubrid.org/browse/CBRD-26335
* 
BITSET 변수를 bitsert_delset()으로 클리어 한 이후에 다시 사용되는지 여부 검출을 위한 assert() 추가
add_local_subquery() 함수 일부 수정
Implementation

* slip

* [CUBRIDQA-1313] remove plcsql from  comment_trigger.yml

* [CBRD-25575] [refactoring] The compressed_size setting uses a defined string to improve readability (#6538)

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

* [CBRD-26236] add version info to csql title (#6553)

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

- add version information to csql title as following
$> csql demodb
CUBRID SQL Interpreter (version 11.5.0)

Type ';help' for help messages, or ';exit' to quit.

* [CBRD-26236] add csql option for QA (#6561)

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

* [CBRD-26348] Fix incorrect error message when performing a level restore with an incorrect full backup. (#6558)

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

* [CBRD-26310] fix error of ha_make_slave.sh

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

* [CBRD-26346] Encryption when master key is lost (#6557)

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

* [CBRD-26347] Adding the owner name to the error message when the server is not found (#6560)

* [CBRD-25447] Support parallel heap scan (refactor) (#6512)

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

- refactoring of the initial parallel heap scan code

* [CBRD-26139] Call Context Manager's stop_execution() method in the daemon threads

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

- fix a segfault that occurred when stopping the sp daemon in certain cases.

* [CBRD-24156] Clean up NCHAR and VARNCHAR related codes (#6420)

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

* We are organizing the deprecated NCHAR-related codes by removing them from the source code.
* However, the expression is still allowed in terms of syntax. However, only the expression is allowed and it is recognized as an alias of the CHAR type.
* Accordingly, the same expression as before can be used when inputting, but when displayed, it will be shown in the same format as the CHAR type.
* The maximum size of VARNCHAR is limited from 536870911 to 1073741823 (the maximum size of VARCHAR).

* [CUBRIDQA-1294] merge plcsql to sql in circle ci's config file

* [CBRD-26265] Remove redundant IS NOT NULL predicates on columns declared NOT NULL (#6401)

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

* Remove IS NOT NULL predicates on columns declared NOT NULL

* Remove LIKE clauses that can be rewritten to IS NOT NULL

* For host-variable patterns (e.g., col LIKE ?, col LIKE '%' || ? || '%'), add a hidden parameter; when enabled, the predicate may be removed if it rewrites to IS NOT NULL.

* [CBRD-26355] [Regression] Core dumped in qexec_execute_query at src/query/query_executor.c:16009 (#6584)


Fix resource leaks introduced during the parallel heap scan refactor.


Resolved a resource tracker assert() triggered during domain resolution of GROUP BY aggregate results, caused by cloning a DB_VALUE and not clearing it.
Fixed an issue where, on error, the process exited without returning temporary files, leaving them open; temporary files are now properly cleaned up on error.
In parallel subquery execution, fixed hangs and segmentation faults where threads waiting in job execution queue pop referenced invalidated pointers (destructors already invoked).

* [CBRD-25842] Insert fails when partition key contains functions requiring val_descr (#6468)

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

* Prevent segmentation fault when partition key expressions use val_descr-required functions (TZ_OFFSET, RAND, RANDOM) in DML (INSERT/DELETE/UPDATE).

* [CBRD-26295] Terminate transactions suspended in THREAD_PGBUF_SUSPENDED state when killed by killtran or client shutdown

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

- modify to allow transactions suspended in THREAD_PGBUF_SUSPENDED status to be stopped when performing killtran or client is forcibly terminated.

* [CBRD-26344] An error occurs when inserting numeric data into a heterogeneous database through binding in the gateway. (#6559)

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

Change the precision and scale values ​​of numeric in SQLSetDescField() to integer pointers.

* [CBRD-26361] heap_attrinfo_transform_to_disk_internal refactoring (#6586)

* [CBRD-26365] [Regression] Core dumped in cub_free at src/base/memory_cwrapper.h:85 (#6593)

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

* [CBRD-26340] Incorrect rewrite query when dblink DELETE query is executed by trigger (#6539)

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

- fix an error that occurred when an alias was added to the table name of the rewritten query when using a db link DELETE query in a trigger.

* [CUBRIDQA-1263] modify pattern for accurate matching (#6603)

http://jira.cubrid.org/browse/CUBRIDQA-1263

* [CUBRIDQA-1263] block baseline related code, accept multiple test comment (#6608)

accept multiple test comment

* [CUBRIDQA-1263] fix regular expression (#6609)

fix regular expression

* [CBRD-26369] refactoring of heap_attrvalue_read function

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

* [CBRD-26336] Incorrect error 'multi-remote DML is not allowed' in DBLINK DML query (#6531)

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

- modify to ensure success when executing the following query.
insert into t1@srv1 select a+10, b from t1@srv1 t1 where t1.a > 1;

* [CBRD-25728] Support parallel sort for ORDER_BY (#5694)

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

Support parallel sort for ORDER_BY

* [CBRD-26368] [Regression] Remove redundant IS NOT NULL predicates on columns declared NOT NULL (#6601)

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

Resolve the assertion failure that occurred in sql_debug

* [CBRD-26355] [Regression] Core dumped in qexec_execute_query at src/query/query_executor.c:16009 (#6612)

resolve isolation test bugs

* [CBRD-26279] Exclude pager time from CSQL's query time display (#6581)

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

* [CBRD-26324] use LZ4_compress_fast_extState instead of LZ4_compress_default and add compression interface. (#6513)

change the compress format.

* [CBRD-26260] fix to allow view merging when the view is a single table and connected with a left outer join.

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

fix to allow view merging when the view is a single table and connected with a left outer join.

* [CBRD-26297] refactoring of thread_suspend_* function family

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

- The thread_suspend_timeout_wakeup_and_unlock_entry() and thread_suspend_wakeup_and_unlock_entry()  release the thread_entry lock acquired by the caller before exiting the function.
- Since the lock acquirer and releaser are different, developers may encounter errors when analyzing or modifying the function, so change it so that the caller acquires and releases the lock.

* [CBRD-26366] change delimiter (' ' -> '\t') of cubrid_ha.conf

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

- In the cubrid_hosts.conf file, spaces (' ') and tabs ('\t') were used interchangeably as separators for IP and hostname. 
- change spaces to tabs.

* [CBRD-26379] remove .nvim.lua file (#6631)

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

- remove unnecessary file (nvim indent config file)

* [CBRD-26316] [BugFix] [Regression] Core dumped in cdc_loginfo_producer_execute at src/transaction/log_manager.c:11151 (#6619)

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

* [CBRD-26150] eliminate mutual calls between double write buffer and fileio during sync

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

* [CBRD-26364] fix an issue where disk_size() was not stable when using a session variable

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

* When assigning a varchar type to a session variable, ensure that the compressed data follows the enable_string_compression parameter

* [CBRD-26349] Do not use the master-key for SERVER password encryption

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

- change the encryption for the password column in SERVER to use a separate key instead of the TDE key.

* [CUBRIDQA-1318] modify split type from timing to name refer to reduce flakey tests (#6634)

* modify split type from timing to name refer to reduce flakey tests

http://jira.cubrid.org/browse/CUBRIDQA-1318

* [CBRD-26258] Improve to allow Skip ORDER BY even for joins without index scan predicates (#6464)

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

### Purpose

Improve to allow skip ORDER BY even for joins without index scan predicates.

### Implementation

1. Skip ORDER BY is not discarded when the index scan plan is not the top plan; it is decided based on cost comparison.
2. Allows applying Skip ORDER BY together with SORT LIMIT.
3. When comparing plan costs, a plan with both SORT LIMIT and Skip ORDER BY is preferred over a sequential scan plan (rule-based).
4. Skip ORDER BY cannot be applied to the leading table in RIGHT OUTER JOIN.

### Remarks

1. Added code to print the cost of generated plans for debugging.
   - `TEST_DUMP_PLAN_SCAN_COST`
   - `TEST_DUMP_PLAN_SORT_COST`
   - `TEST_DUMP_PLAN_JOIN_COST`
   - `TEST_DUMP_PLAN_FOLLOW_COST`
2. Added code to release `plan->iscan_sort_list` in `qo_top_plan_new` when it is no longer needed.
3. Fixed an issue where a comma (,) was printed even when no key range term existed in index scans (`qo_plan_scan_print_text`).

* [CBRD-25576] refactoring to enhance mr_readval_string_internal function (#6549)

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

* refactoring

* [CBRD-26378] hang occurs while performing unloaddb (#6630)

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

* Fixed an issue where unloaddb would hang during execution.

* [CBRD-26381] error on floating-number expressed as exponents (#6635)

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

* When executing unloaddb, prevent decimal points from being added when outputting float and double types in exponential format.
* When executing loaddb, allow decimal points at the end of exponents when inputting real numbers (e.g., 1e+12).

* [CBRD-26377] When loading an objects file online without the user name option, loaddb fails to find the target tables (#6626)

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

Fix the issue where target tables cannot be found when loading an objects file online without the user name option.

* [CBRD-26345] Implement memoize (#6555)

Purpose
Introduce PostgreSQL’s Memoize feature (https://www.enterprisedb.com/blog/boosting-query-performance-memoize-postgresql
) into CUBRID, allowing reuse of cached row information for identical join keys.

Implementation

During the qexec_execute_scan phase, check the memoize hash map to determine whether a cached row exists for the given join key.

Cache hit: Use the cached row instead of performing a table/index scan.

Cache miss: Perform the table/index scan, then store the resulting row in the cache.

Cache full: Disable the cache.

Cache size configuration: memoize_hash_size (default: 2MB)

* [CBRD-26385] An assertion core occurs because the parallel query execution does not wait for its workers.

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

fix to wait until the workers have finished.

* [CBRD-26372] When a VIEW query contains an uppercase stored procedure name, an SP undefined error occurs when running loaddb with the --no-user-specified-name option. (#6622)

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

Fix an issue where an undefined error occurs when a VIEW query contains an uppercase SP name and loaddb is executed with the --no-user-specified-name option.

* [CBRD-26351] MERGE 조인 수행 시 statdump에서 Num_query_mjoins 통계가 증가하지 않음

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

Fix missing Num_query_mjoins increments during merge joins and correct improper Num_query_selects increments.

* [CBRD-26341] Erase Clear Compressed String Logic (#6588)

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

refactor compressed string clear logic

* [CUBRIDQA-1211] fix jenkins bug for test result analysis (#6655)

fix bug for sending test result

* [CBRD-25717] Fix incorrect results when using a PL/CSQL function in a hash join predicate (#6628)

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

1. Fix incorrect results when using a PL/CSQL function in a hash join predicate.
2. Fix missing copy of the PARALLEL hint value to inline views rewritten for aggregate-function optimization.

* [CBRD-26373] After parallel sorting, the output file is returned in a closed state, reopen the file.

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

After parallel sorting, the output file is returned in a closed state, causing an issue in the analytical function logic. Reopen the file to maintain the same state as before.

* [CBRD-26266] Support ORDER BY skip optimization when using function-based indexes on multi-column

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

Improved the issue where ORDER BY skip was not applied when using a function-based multi-column index with an equality condition on the leading column and the trailing column appearing in the ORDER BY clause.

* [CBRD-26382] refactor scope_exit (#6636)

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

Purpose

refactor CUBRID's own implementation of scope_exit<>.
Basically, remove unnecessary std::function wrapping, and prevent copy constructor of f_ to be called.

* [CBRD-26370] Optimize COUNT queries during parallel heap scan (#6606)

Purpose

We implemented optimizations for COUNT(*) and COUNT(column) aggregate operations in parallel heap scans.
Previously, COUNT queries were processed in a row-by-row manner, but now they are executed in parallel to improve performance.
In particular, we enhanced the system so that the COUNT DISTINCT operation used during UPDATE STATISTICS can also be processed in parallel.

* [CBRD-24483] Fix: restoredb -d backuptime incorrectly restored transactions committed after backup (#6484)

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

- fix an issue where transactions performed after the backup was completed were included when restoring to the backup point in time (restoredb -d backuptime).

* [CBRD-25698] Enable preprocessor macro information in debug build by adding the -ggdb3 option (#6669)

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

* [CUBRIDQA-1211] fix feature branch filter logic (#6672)

fix feature branch filter logic

* [CBRD-26391] refactor: use EP_LIBS in sa/CMakeLists.txt (#6640)

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

* [CBRD-26345] Implement memoize (#6652)

http://jira.cubrid.org/browse/CBRD-26345
Purpose

Apply the following three modifications:
	1.	Change the memoize storage clearing point to the end of the query (do not clear when the storage becomes full).
	2.	Allocate memoize storage using malloc() (because clearing in parallel aptr does not produce traces, and freeing memory at runtime adds overhead).
	3.	Instead of blocking memoize based on NDV, execute 1,000 attempts and block memoize if the hit ratio falls below 50% (because when the number of joined tables is three or more, the expected duplication ratio cannot be reliably estimated).

* [CBRD-26404] IS NOT NULL condition incorrectly removed for inner table columns in outer join queries (#6668)

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

Prevent removal of IS NOT NULL conditions on inner table columns in outer join queries

* [CBRD-26413] [Regression] Core dumped in locator_attribute_info_force at src/transaction/locator_sr.c:7514 (#6682)

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

Purpose

disable memoize when mvcc_select_lock_needed

* [CBRD-26396] enhance throughput performance when scan multi-key index using domain caching (#6661)

Purpose

In a t1 → t2 join where a multi-key index scan on t2 is required, if an equality condition with a host variable triggers a coerce operation, and this requires rebuilding the multi-key index domain, then the domain is reconstructed for every row of t1 during the index scan on t2.
As a result, tp_domain_alloc is invoked t1 result row count × number of multi-key index columns times. When multiple sessions execute concurrently, this leads to increased area_alloc calls and causes performance bottlenecks.
By caching the domain rebuilt after the coerce operation within the index scan ID, the tp_domain_alloc calls can be reduced to a single invocation at the first index scan.

⸻

Implementation

Add isidp->outer_table_midxkey_build_domains to cache the coerced domains built for each key_range.

* [CBRD-26252] prohibit stored procedures from being invoked SQL statements other than CALL statements (#6673)

* consider that stored procedures (not stored functions) do not return a result
  . restrict them to be invoked only through CALL statements
  . semantic error when a CALL statement has an INTO clause when it invokes a stored procedure

* [CBRD-26398] Modify covering index scan reset to truncate list_id instead of destroying and opening it. (#6662)

Purpose

In an a→b table NL join, the index scan on b is reset whenever the current row of a changes. In the case of a covering index scan, the temporary file (list_id) that stores the value-materialized index keys is destroyed and reopened. During this process, accessing tempcache requires acquiring a mutex. As a result, when multiple sessions/clients perform covering-index-based NL joins concurrently, the mutex contention becomes a performance bottleneck. This change aims to eliminate that bottleneck.

Implementation
	•	Implement file_temp_truncate() and qfile_truncate_list().
	•	When resetting the index scan, if indx_cov_p->list_id != NULL, replace the existing destroy→open routine with a call to qfile_truncate_list().

* [CBRD-26375] Disable view merging when JOIN conditions are eliminated in LEFT OUTER JOIN views.

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

View merging must be prevented if a LEFT OUTER JOIN view loses its ON-clause join conditions during the merge process.

* [CBRD-26420] Restore the tde_er_log()

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

The tde_er_log() function was deleted, so this change restores it.

* [CBRD-26403] Adjust the cost formula for correlated subqueries in the optimizer

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

as-is : subquery cost * Number of rows expected after scanning
to-be : subquery cost * Number of rows required for scanning

* [CBRD-26075] subquery in 'EXISTS' operation retrieves the entire data and degrades the performance. 

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

Revert the single-row lookup logic for EXISTS. Queries using HAVING + predicate is excluded from optimization.

* [CBRD-26418] [Regression] Core dumped in db_get_int at src/compat/dbtype_function.i:155 (#6694)

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

Purpose

In debug builds, concurrent access to vd can trigger a race condition that causes an assert() failure. To prevent this, the implementation is modified so that vd is copied to a separate space and used from there.

* [CUBRIDQA-1326] Enhance CircleCI configuration (#6697)

http://jira.cubrid.org/browse/CUBRIDQA-1326

* Remove shell configuration for using default option '-eo pipeline'

* [CBRD-26155] prohibit bind parameters in PL/CSQL Static SQL statements (#6686)

* prohibit bind parameters in PL/CSQL Static SQL statements

* [CUBRIDQA-1326] fix bug for test run steps. (#6705)

Added checks to ensure that if no tests are assigned to a node, the process halts gracefully, preventing unnecessary execution.

http://jira.cubrid.org/browse/CUBRIDQA-1326?focusedCommentId=4773121&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-4773121

* [CBRD-26428] upgrade two Java libraries (#6701)

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

* org.apache.commons:commons-compress
* org.apache.commons:commons-lang3

* [CBRD-26049] disk image incompatibilty with the previous version. (#6706)

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

* [CBRD-25862] Improve and refactor System Catalog for Information Schema (#6443)

http://jira.cubrid.org/browse/CBRD-25862
http://jira.cubrid.org/browse/CBRD-26036
 
Summary
 
This work enhances the CUBRID System Catalog prior to the introduction of Information Schema.
It adds missing metadata, updates and refactors existing catalog structures, removes obsolete components, and improves performance and consistency.
In addition, newly added system catalog information is exposed through corresponding system catalog views.
 
Additions
- Added time-related columns (created_time, updated_time, checked_time) to system catalog classes
- Added start_val to the serial system catalog class
- Added is_loginable and is_system_created to the user system catalog class
- Added sql_data_access to the stored procedure system catalog class
- Added class_partition_type to the partition system catalog class
- Added referential and index-related metadata to the index system catalog class (referential_match_option, referential_index, delete_rule, update_rule, index_type, options)
- Added statistics_strategy to the class system catalog class
- Reflected newly added system catalog class information in system catalog views
 
Modifications
- Separated multiple flag-related attributes from is_system_class into a new flags column
 
Removals
- Removed the obsolete db_authorizations catalog

* [CBRD-26428] upgrade Netty version (#6707)

upgrade Netty version

* [CBRD-26400] support correlated subquery cache on exists clause (#6663)

Purpose

The existing correlated subquery cache only supports scalar subqueries. This change extends the support to EXISTS subqueries as well.

Implementation

Modify subquery_cache.c and xasl_generation to add subquery cache support for regu_var of type srlist_id.

* [CUBRIDQA-1326] Revert "[CUBRIDQA-1326] Enhance CircleCI configuration (#6697)" (#6713)

http://jira.cubrid.org/browse/CUBRIDQA-1326

fix bug

only check tc.list.
Pipefail occurs when unscheduled pods fail.

Revert "[CUBRIDQA-1326] Enhance CircleCI configuration (#6697)"
This reverts commit 24cf2127f989fd686abc0aad32fdcd500430d252.

* [CBRD-26299] The fn_xxx functions commonly used in CAS and CGW are separated into their own dedicated functions. (#6461)

CAS and CGW shared the same code, so they were separated only at build time.
This resulted in poor code readability and difficult maintenance.
To address these issues, we refactored the CAS and CGW code to improve readability and maintainability.

* [CBRD-26427] incorrect result when large record-size in plcsql (#6702)

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

* Resolves an issue where the result value is not guaranteed when the size of the result record executed with PL/CSQL exceeds one page.
* Resolves a malfunction when a column with a NULL value is included during PL/CSQL processing.

* [CBRD-26432] remove an unnecessary call of pack_all (#6711)

* remove an unnecessary call of pack_all during the recursion of pack_all_recursive

* [CBRD-26131] Use fdatasync when a metadata of the volume is unchanged. (#6670)

Add a member `metadata` to DWB slot and DWB flush volume structure. that member indicates whether there is need to sync a metadata of OS file (Volume in CUBRID) when syncing the data.

* Revert "[CBRD-26297] Refactor: unlock thread_entry after thread_suspend_timeout_wakeup_and_unlock_entry()/thread_suspend_wakeup_and_unlock_entry() returns" (#6718)

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

This reverts commit b3a0c2dac4fb2a20743c8d549b9c0566ed93d54f.

* [CBRD-26431] Fixes an issue where count(expr) was not handled correctly during the optimization of COUNT() in parallel heap scans (#6710)

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

Purpose

Fixes an issue where count(expr) was not handled correctly during the optimization of COUNT() in parallel heap scans.

* [CBRD-25649] Remove inefficient TDE related functions (#5580)

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

Remove inefficient TDE related functions

* [CBRD-26415] join elimination is prohibited when the unique is broken by a function expression. (#6683)

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

Join elimination optimization excludes all functions other than REVERSE, CONCAT, PLUS, MINUS, and automatically generated CAST functions.

* [CBRD-26299] Missing cgw initialization (#6724)

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

Changed the name of the CGW initialization function

* [CBRD-26434] refactor packer code (#6712)

* remove unused code
* overload pack code for const char*
* add omitted const modifiers
* renaming : get_packed_int_vector_size --> get_packed_int_array_size
* update unit_test/packing according to the Packer and Unpacker updates

* [CBRD-26429] support to change csql prompt using enviornment variable (#6703)

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

The CSQL (CUBRID SQL Interpreter) prompt display can be modified using the user environment variable CUBRID_CSQL_PROMPT.
This environment variable supports special user-defined characters (escape sequences) that the CSQL interpreter will replace with specific runtime values to build the customized prompt string.

The user-defined characters (escape sequences) are the follows.
  - /u or /U : replaced with the user name (currently logged in)
  - /d or /D : replaced with the database name (currently connected)
  - /h or /H : replaced with the host name (currently connected)

 - if the prompt contains multi-byte character and LANG and db codeset do not match, a warning message is output and the prompt is changed to use "csql>".

* [CBRD-26445] Fixing an issue where dblink queries fail after changing a password with ALTER SERVER (#6721)

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

* Changed to prevent the existing XASL cache from being used when changing a password using the ALTER SERVER statement.

* [CBRD-26299]  Socket timeout due to incorrect file descriptor used in poll() (#6730)

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

Fix issue with using incorrect file descriptor in poll()

* [CBRD-26311] Improve parallel query execution rules (#6674)

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

1. Add throughput-based rules to control parallel execution and its degree.
2. Revise server parameters related to parallelism, including new parameters and updated defaults and limits.
3. Fix errors related to parallel heap scan and Partition Hash Join.

* [CUBRIDQA-1266] fix rerun failed test bug (#6754)

http://jira.cubrid.org/browse/CUBRIDQA-1266

Purpose
add exit code to avoid hang situation.

* [CBRD-26476] Incorrect Value Reads in UPDATE Uncorrelated Subqueries Caused by Hidden Columns (#6751)

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

Prevent column count mismatch by excluding hidden columns from the select list of uncorrelated subqueries used for UPDATE assignments.

* [CBRD-26479] [Regression][ha_repl] Core dumped in sort_exphase_merge at src/storage/external_sort.c:3792 (#6756)

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

Check the number of tuples and parallel count

* [CBRD-26386] Evaluating analytic functions in qexec_end_one_iteration for OVER clauses without PARTITION BY or ORDER BY (#6639)

Evaluate analytic functions during processing phase and skip post-processing when all functions are already evaluated. 
Stop reading tuples early when LIMIT/ROWNUM is specified and full scan is unnecessary.

The conditions are as follows:
- LIMIT clause or ROWNUM condition must be present
- Analytic functions: ROW_NUMBER, RANK, DENSE_RANK, or FIRST_VALUE without IGNORE NULLS
- OVER clause must not contain PARTITION BY or ORDER BY

* [CBRD-26481] Restrict Parallel Hint to System Core Count (#6758)

http://jira.cubrid.org/browse/CBRD-26481
http://jira.cubrid.org/browse/CBRD-26311 (https://github.com/CUBRID/cubrid/pull/6758)

Limit the parallel hint to the system core count in parallel_query::compute_parallel_degree().

* [CUBRIDQA-1323] use ramdisk for ci test_shell (#6688)

http://jira.cubrid.org/browse/CUBRIDQA-1323

use ramdisk to avoid disk pressure on test_shell

* [CBRD-26419] The entire table join order is unintentionally fixed when the ordered hint is copied in the view merge.

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

The behavior of the LEADING hint has been changed from PostgreSQL to Oracle. The LEADING hint in a subquery is copied to the merged query only if the main query does not contain a LEADING hint and thus does not cause a conflict. The ORDERED hint in a subquery is removed during view merge.

* [CBRD-26479] [Regression][ha_repl] Core dumped in sort_exphase_merge at src/storage/external_sort.c:3792 (#6759)

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

The minimum sort buffer size has been changed from 4 to 16.
In parallel sorting, up to four temporary files are merged, requiring eight pages: four for the inbuff and four for the outbuff.

* [CBRD-26443] [Regression] Server restart repeatedly when querying partitioned table with functions requiring val_descr (#6727)

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

In HA environment, there is an issue where fetch_peek_arith() is called with NULL val_descr when inserting into partitioned tables. 
To prevent this, functions that require val_descr are now restricted from being used as partition keys.

Restricted functions:
- SYS_DATE
- SYS_TIME
- SYS_DATETIME
- SYS_TIMESTAMP
- CURRENT_DATE()
- CURRENT_TIME()
- CURRENT_TIMESTAMP()
- CURRENT_DATETIME()
- UTC_TIME()
- UTC_DATE()
- UTC_TIMESTAMP()
- TZ_OFFSET(timezone_string)

* [CBRD-26125] Coordinator for distributed transaction (#6279)

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

- Implements a coordinator for distributed transactions in dblink.

* [CBRD-26440] Compatibility for performance db (#6725)

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

Purpose
Adding new system tables (e.g., system catalog classes/views) makes existing QA performance DB images incompatible. Rebuilding the performance DB takes a long time (about 3 days), so this change adds functionality to preserve compatibility with existing performance DB images.

Implementation
System catalog updates are disabled before altering system catalog classes. After all changes are completed, the system catalog is compiled. Once compilation finishes, system catalog updates are re-enabled and all changes are applied.

* [CBRD-26425] Replace bcb mutex lock into atomic_latch (#6704)

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

Purpose

Atomic latch has been introduced to improve the page buffer performance of CUBRID.

* [CBRD-26374] Improve adaptive handling of loaddb compatibility options for versions with partial User Schema support (#6677)

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

1. Infer unload-time version during loaddb and apply --no-user-specified-name only when required.
2. Add safeguards against cross-schema and duplicate-name ambiguity.

* [CBRD-26474] Refactor lock conversion and compatibility checks into inline helpers (#6740)

http://jira.cubrid.org/browse/CBRD-26474
 
This change refactors direct accesses to lock_Conv and lock_Comp tables into centralized inline helper functions. 
	• Introduce lock_table.h providing inline helpers:
		* lock_conv() for lock mode conversion
		* lock_compat() for lock compatibility checks
		* LOCK_TO_LOCKMODE_STRING() backed by a lookup table
	• Replace widespread direct indexing of lock_Conv and lock_Comp with the corresponding helper functions across transaction, locator, storage, parser, and query modules.
	• Remove duplicated assert patterns at call sites and consolidate validation inside the helper functions.
	• Refactor the macro-based LOCK_TO_LOCKMODE_STRING with a inline function contains switch-case
implementation for improved type safety and readability.
         • Move lock conversion and compatibility tables behind a dedicated header to improve encapsulation and consistency.

* [CBRD-26494] remove a code that prints a semicolon at the end of SP bodies (#6775)

remove a code that prints a semicolone at the end of SP bodies

* [CBRD-26474] Fix inconsistent error message formats (#6777)

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

When printing lock modes as strings in error messages, the following issues were identified:
- The longest lock mode string is 10 characters (SCH_S_LOCK, SCH_M_LOCK), but the output is formatted with a fixed width of 8 characters, resulting in misaligned messages.
- The existing function that returns lock mode strings includes leading spaces, which, when combined with the error message format specifiers, produces inconsistent and confusing output.

Changes:
- Revise alignment of error messages
- Return raw lock mode strings without alignment padding except for error message output.

* [CBRD-26496] Fix inconsistent and mixed Korean translations of LOCK in error messages ("락" / "로크") (#6784)

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

Unify the Korean translation of LOCK-related error messages to "락".

* [CBRD-26497] add a blank before COMMENT at the end of the SP body while unloading schema (#6781)

add a blank before COMMENT at the end of the SP body while unloading schema

* [CBRD-26465] Fix error when setting min page to 0 in parallel heap scan (#6736)

Fixed an issue where parallel heap scan open() fails because neither an XASL clone nor xasl_unpack_info_ptr exists under certain conditions, causing a double free of worker_manager_p during the process.
	•	Fixed an issue where, if an error occurs during query execution, the main query thread terminates before tasks are properly terminated and cleaned up, resulting in loss of query IDs and subsequent errors during task shutdown. (Applied a signal-to-task followed by a spin-wait mechanism.)
	•	Refactored the PHS checker: previously, operations such as COUNT(*) were processed row by row, but after applying count optimization, the count fast path is taken. This caused queries with predicates containing ROWNUM or Java stored procedures to follow the same path, leading to errors or hangs. This issue has been resolved.
	•	Fixed an issue where parallel heap scan was not applied to scalar subqueries in the VALUES clause (e.g., INSERT INTO t VALUES (SELECT …)), resulting in an invalid xasl content error. (xasl_iteration.hpp modified.)
	•	Fixed an issue where, when an ORDER BY clause exists without a GROUP BY aggregate and the select list expressions include host variables, domain coercion was not performed, causing ORDER BY to malfunction. After populating val_list in the task, fetch_val_list is now called once on the outptr list in the main thread to properly coerce types such as DB_VARIABLE.
	•	Fixed an issue in mergeable lists where calling next() one more time while values already exist in the outptr list caused errors by resetting the private heap ID to 0 and clearing existing values. The behavior was changed to perform a single clear() before task execution when next() is called.
	•	Disabled parallel heap scan when session variables or serials are used. This fixes an issue where the functionality was lost after the checker refactoring, leading to errors.

---------

Co-authored-by: Daehyun Kim <dhkim@cubrid.com>
Co-authored-by: Na, Hyunik <67700070+hyunikn@users.noreply.github.com>
Co-authored-by: Kisoo Han <kisoo-han@cubrid.com>
Co-authored-by: YoungKwon Ham <84824124+Hamkua@users.noreply.github.com>
Co-authored-by: Byungwook Kim <bwkim@cubrid.com>
Co-authored-by: ctshim <78332782+ctshim@users.noreply.github.com>
Co-authored-by: Ilhan <70995854+xmilex-git@users.noreply.github.com>
Co-authored-by: Joo Youngjin <68979537+youngjinj@users.noreply.github.com>
Co-authored-by: SE park <shpark@cubrid.com>
Co-authored-by: joonmin83 <hornetmj@cubrid.com>
Co-authored-by: tw-kang <twkang3219@gmail.com>
Co-authored-by: airnet73 <61675061+airnet73@users.noreply.github.com>
Co-authored-by: Mike MyungHwan Oh <mhoh@cubrid.com>
Co-authored-by: jongmin-won <55681111+jongmin-won@users.noreply.github.com>
Co-authored-by: 정소희 <94791489+sohee-dgist@users.noreply.github.com>
Co-authored-by: Yeoun <yechan0815@naver.com>
Co-authored-by: CUBRID <cubridci@users.noreply.github.com>
Co-authored-by: kim juhyun <157577342+bagus-kim@users.noreply.github.com>
Co-authored-by: Hyung-Gyu Ryoo <hgryoo@cubrid.com>
Co-authored-by: Daniel <chijun@cubrid.com>
Co-authored-by: childyouth <39540545+childyouth@users.noreply.github.com>
Co-authored-by: Hyunuk Lee <41990473+HyunukLee@users.noreply.github.com>
Co-authored-by: kangmin <kangmin5505@gmail.com>
Minor bug fixes

- Update is_replication_class evaluation in db_class
- Revise error handling for ALTER TABLE replication option changes in HA mode
trucate bug fix

Change TRUNCATE DDL replication target from PK-based to RK-based
@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run all

@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run shell

@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run shell

1 similar comment
@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run shell

Comment thread .circleci/config.yml Outdated
- run:
name: Test
environment:
BRANCH_TESTCASES: add-replication-option2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BRANCH_TESTCASES: add-replication-option2
BRANCH_TESTCASES: feature/add-replication-option

medium 실패원입니다.

[debug] Check out testcases and testtools
fatal: Couldn't find remote ref add-replication-option2

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 16, 2026

Last reviewed commit: de3321f

Comment thread src/query/execute_schema.c
Comment on lines +782 to +791
or_class_is_replication_on (RECDES * record)
{
int flags = 0;
int replication_off_flag = 32; /* SM_CLASSFLAG_REPLICATION_OFF = 32 */

/* TODO:
* Consider adding a replication flag to HEAP_CLASSREPR_ENTRY in heap_classrepr to reduce class record interpretation(EPIC CBRD-26096). */
or_class_flags (record, &flags);

return !(flags & replication_off_flag);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하드코딩된 매직 넘버(Magic Number) 및 잘못된 주석 — 유지보수 위험

int replication_off_flag = 32;	/* SM_CLASSFLAG_REPLICATION_OFF = 32 */

두 가지 문제가 있습니다:

  1. 잘못된 주석: 실제 enum 값의 이름은 SM_CLASSFLAG_DATA_REPLICATION_OFF인데 주석에는 SM_CLASSFLAG_REPLICATION_OFF로 잘못 기재되어 있습니다.
  2. 매직 넘버: object_representation_sr.c는 서버 사이드 파일로 class_object.h를 포함할 수 없는 구조이지만, SM_CLASSFLAG_DATA_REPLICATION_OFF의 실제 값인 32를 하드코딩하고 있습니다. 향후 해당 enum 값이 변경될 경우 이 코드는 자동으로 추적되지 않아 조용한 버그(Silent Bug)가 발생합니다.

ORC_CLASS_FLAGS 계열의 매크로나 별도의 공유 상수를 통해 값을 참조하거나, object_representation.h에 서버/클라이언트 공용으로 사용 가능한 상수를 정의하는 방안을 검토해 주세요.

Comment thread src/executables/util_cs.c Outdated
Comment thread src/query/execute_schema.c
Comment thread src/query/execute_schema.c
Comment thread src/transaction/locator_sr.c
Comment thread src/query/execute_schema.c
Comment on lines +4918 to +4942
find_index_catalog_class (const char *index_name)
{
assert (index_name != NULL);

MOP index_class = NULL;
DB_VALUE value;
MOP index_catalog_class = NULL;
int save;

AU_DISABLE (save);

index_class = db_find_class (CT_INDEX_NAME);
if (index_class == NULL)
{
assert (false);
goto end;
}

db_make_string (&value, index_name);
index_catalog_class = db_find_unique (index_class, "index_name", &value);

end:
AU_ENABLE (save);

return index_catalog_class;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

미사용 함수(Dead Code) — find_index_catalog_class

find_index_catalog_class()는 이 파일 외부에 선언(static)되어 있고 PR 전체에서 어디에도 호출되고 있지 않습니다. 미사용 코드를 추가하면 향후 코드 읽기 시 혼란을 주고, 컴파일러 경고(-Wunused-function)를 유발할 수 있습니다. 실제로 사용할 시점에 추가하거나, 현재 PR에 포함되어야 하는 이유가 있다면 주석으로 설명을 추가해 주세요.

@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run medium

Comment thread .circleci/config.yml
name: Test
environment:
BRANCH_TESTCASES: "${TC_BRANCH}"
BRANCH_TESTCASES: feature/add-replication-option
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BRANCH_TESTCASES: feature/add-replication-option
BRANCH_TESTCASES: feature/add-replication-option
BRANCH_TESTTOOLS: add-replication-option

메뉴얼 테스트를 요청했던 이력을 보니 CTP 수정도 했었던 이슈로 확인이 됩니다.
현재 default 는 CTP:develop 브랜치로 수행되어 server start 가 안되는것을 파악됩니다.
재현 및 해당 옵션 적용하여 수행결과 정상수행이 되는것을 확인했습니다.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 17, 2026

Last reviewed commit: e488799

Comment thread .circleci/config.yml
Comment on lines +97 to +98
BRANCH_TESTCASES: feature/add-replication-option
BRANCH_TESTTOOLS: add-replication-option
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 CI 브랜치명 하드코딩 — develop 병합 후 테스트 환경 오동작

BRANCH_TESTCASESBRANCH_TESTTOOLS가 피처 브랜치명으로 하드코딩되어 있습니다. 이 PR이 develop에 병합된 이후에도 CI는 계속 feature/add-replication-option 테스트 케이스 브랜치를 바라보게 됩니다. 향후 다른 PR의 CI 검증이 오염된 테스트 케이스 기준으로 실행될 위험이 있습니다.

병합 전에 원래대로 동적 변수(${TC_BRANCH} 방식)로 되돌리거나, 혹은 develop 기준 브랜치명으로 교체해 주세요.

Suggested change
BRANCH_TESTCASES: feature/add-replication-option
BRANCH_TESTTOOLS: add-replication-option
BRANCH_TESTCASES: "${TC_BRANCH}"

Comment on lines +8421 to 8424
if (rk_btid_index == -1 && repl_info != NULL && repl_info->need_replication == true
&& !LOG_CHECK_LOG_APPLIER (thread_p) && or_is_replication_candidate_key (index)
&& log_does_allow_replication () == true)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 locator_update_indexheap_is_replication_class 미체크로 REPLICATION=OFF 테이블의 변경도 복제 로그 기록

locator_add_or_remove_index_internal(라인 8041)의 수정 조건과 비교해 보면, 해당 함수에는 heap_is_replication_class(thread_p, class_oid) 체크가 명시적으로 추가되어 있습니다. 반면 locator_update_indexrk_btid_index 선정 조건에는 이 체크가 빠져 있습니다.

그 결과, REPLICATION=OFF로 설정된 테이블에 UPDATE가 발생할 경우에도 rk_btid_index가 유효한 값으로 설정되고, 이후 repl_log_insert()를 통해 불필요한(혹은 잘못된) 복제 로그가 기록될 수 있습니다. INSERT/DELETE는 올바르게 처리되는데 UPDATE만 누락된 체크는 DBMS 복제 일관성(Replication Consistency) 측면에서 심각한 불일치를 초래합니다.

Suggested change
if (rk_btid_index == -1 && repl_info != NULL && repl_info->need_replication == true
&& !LOG_CHECK_LOG_APPLIER (thread_p) && or_is_replication_candidate_key (index)
&& log_does_allow_replication () == true)
{
if (rk_btid_index == -1 && repl_info != NULL && repl_info->need_replication == true
&& !LOG_CHECK_LOG_APPLIER (thread_p) && or_is_replication_candidate_key (index)
&& heap_is_replication_class (thread_p, class_oid)
&& log_does_allow_replication () == true)

Comment thread src/executables/util_cs.c
Comment thread src/query/execute_schema.c
@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run medium

@github-actions
Copy link
Copy Markdown

🗑️ TC Branch Finalized for cubrid-testcases-private-ex

Engine PR was closed (not 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 closed (not merged).

Cleanup Results:

TC develop branch is ready for the next PR.

#6934)

* Fix boot_restart_client error with multiple hosts

- Add "@localhost" to database_name when missing '@'
- Replace strcat with snprintf for safer string handling
- Add TODO regarding CUB_MAXHOSTNAMELEN size handling
- Remove redundant/meaningless error logging
Fix missing replication option when creating a table using CREATE TABLE ... LIKE ...
* Exclude view classes from replication constraint checks

* Improve FK/RK constraint check error logging

* Add comment for vclass skip in replication constraint check
@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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 20, 2026

goto exit;
}

error = tran_system_savepoint (UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 잘못된 Savepoint 이름 재사용 — 복합 ALTER 시 부분 롤백 누락

do_alter_change_replication이 테이블 코멘트 변경용 savepoint인 UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT를 그대로 재사용하고 있습니다. ALTER TABLE t COMMENT='...', REPLICATION=OFF 와 같이 두 절을 동시에 실행할 경우, do_alter_change_tbl_comment (line 10822)와 do_alter_change_replication (line 11064)이 동일한 이름으로 tran_system_savepoint를 호출합니다. 두 번째 호출이 첫 번째 savepoint를 덮어쓰므로, 이후 복제 옵션 변경이 실패해 롤백이 수행되더라도 코멘트 변경은 취소되지 않습니다.

전용 savepoint를 정의하여 사용해 주세요:

Suggested change
error = tran_system_savepoint (UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT);
error = tran_system_savepoint ("cHANGErEPLiCaTiON");

그리고 tran_abort_upto_system_savepoint 호출부도 동일하게 수정이 필요합니다.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 20, 2026

Reviews (4): Last reviewed commit: "Merge branch 'develop' into feature/add-..." | Re-trigger Greptile

Comment thread src/storage/heap_file.c
Comment on lines +11132 to +11138
(void) heap_scancache_quick_start_root_hfid (thread_p, &scan_cache);

if (heap_get_class_record (thread_p, class_oid, &recdes, &scan_cache, PEEK) != S_SUCCESS)
{
heap_scancache_end (thread_p, &scan_cache);
assert (false);
return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 heap_scancache_quick_start_root_hfid 실패 시 미초기화 scan_cache 사용 — 메모리 손상 또는 크래시 위험

heap_scancache_quick_start_root_hfid의 반환값을 (void)로 무시하고 있습니다. 바로 위의 heap_get_tde_algorithm_class 함수(line 11099~11103)는 동일한 API를 사용하면서 반환값을 검사하고 실패 시 즉시 반환합니다. 하지만 heap_is_replication_class는 이 패턴을 따르지 않습니다.

heap_scancache_quick_start_root_hfid가 실패할 경우 scan_cache는 미초기화 상태가 되며, 이 상태에서 heap_get_class_record에 전달되면 메모리 손상(memory corruption)이나 크래시로 이어질 수 있습니다. 또한 heap_get_class_record 자체가 실패해도 assert(false) (릴리즈 빌드에서는 no-op) 후 false를 반환하며, 에러 코드가 전파되지 않습니다. 이로 인해 디스크 I/O 오류가 조용히 "해당 클래스는 복제 대상이 아님"으로 처리되어, 복제 로그 누락 → 레플리카 불일치가 발생할 수 있습니다.

같은 파일의 heap_get_tde_algorithm_class 패턴을 따라 수정이 필요합니다:

bool
heap_is_replication_class (THREAD_ENTRY * thread_p, const OID * class_oid)
{
  HEAP_SCANCACHE scan_cache;
  RECDES recdes;
  bool ret;

  assert (class_oid != NULL);

  if (OID_ISNULL (class_oid))
    {
      return false;
    }

  if (heap_scancache_quick_start_root_hfid (thread_p, &scan_cache) != NO_ERROR)
    {
      return false;
    }

  if (heap_get_class_record (thread_p, class_oid, &recdes, &scan_cache, PEEK) != S_SUCCESS)
    {
      heap_scancache_end (thread_p, &scan_cache);
      ASSERT_ERROR ();
      return false;
    }

  ret = or_class_is_replication_on (&recdes);

  heap_scancache_end (thread_p, &scan_cache);

  return ret;
}

@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run all

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 20, 2026

Reviews (5): Last reviewed commit: "Merge branch 'develop' into feature/add-..." | Re-trigger Greptile

Comment on lines +9158 to +9160
if (!sm_is_replication_class (ws_mop (&(tmp_c->fk_info->ref_class_oid), NULL)))
{
return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 ws_mop 반환값 NULL 미체크 — 잘못된 FK 위반 감지 가능성

ws_mop(&tmp_c->fk_info->ref_class_oid, NULL)은 메모리 할당 실패 시 NULL을 반환할 수 있습니다. NULLsm_is_replication_class()에 전달되면 내부적으로 assert(false)return false가 실행됩니다 (릴리즈 빌드 기준).

그 결과 !false == truereturn false (이 함수 시점에서 "참조 대상이 비복제"로 오판)로 이어져, check_ha_repl_constraint()ER_HA_FK_CONSTRAINT_VIOLATION을 반환합니다. 메모리 부족 상황에서 테이블 생성이 엉뚱한 FK 위반 오류로 실패하고, 실제 원인을 추적하기 어렵게 됩니다.

같은 패턴이 log_ha_repl_fk_ref_all_replicated(line ~9207)에도 존재합니다.

@youngjun9072
Copy link
Copy Markdown
Contributor Author

/run all

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.

4 participants