Fix error -4016: output column does not exist in access column ids during DELETE with hidden_column_visible hint
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 339
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 52
Description
Environment
- Version: observer (OceanBase seekdb)
- Source Revision: 1-238f5c615011ad2fc68e204079e924f1afbab4db
- Build Branch: master
- Build Time: Apr 17 2026 14:42:48
- Build Flags: RelWithDebInfo|Sanity
- Build Info: obbuild-sanity-master-100932
Is this an RD-provided temporary version? No.
Reproducibility: Not specified.
Test Changes: Not specified.
Other Environment Anomalies or Changes: No.
Environment Information:
- SSH: work@[INTERNAL_IP]
- Path: /data/1/sqlgen/obm.z1.obs0
- Port: 20035
Description
A DELETE statement executed with the hidden_column_visible optimizer hint fails with error code -4016: "output column does not exist in access column ids".
Steps to Reproduce
- Execute the following SQL:
delete /*+ opt_param('hidden_column_visible', 'true') */ from ddlkitty_1776427074618541 where __pk_increment = 1735322026-04-17
Log Information
The error stack trace from seekdb.log.20260417201824324 is as follows:
[2026-04-17 20:17:59.116450] WDIAG [SQL.CG] generate_das_result_output (ob_tsc_cg_service.cpp:620) [1617430][T1_L0_G0][T1][YB427F000001-00064FA4FB5B6590-0-0] [lt=71][errcode=-4016] output column does not exist in access column ids(ret=-4016, scan_ctdef.access_column_ids_=[1, 45, 17, 20, 28, 38, 30, 32, 35, 33, 47, 48, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 31, 46, 36, 37, 41, 42, 43, 44, 49, 50, 51, 52, 53, 54, 55, 58, 61, 65], output_cids.at(i)=70, output_cids=[1, 45, 17, 20, 28, 38, 30, 32, 35, 33, 47, 48, 70, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 31, 46, 36, 37, 41, 42, 43, 44, 49], scan_ctdef.ref_table_id_=524639, scan_ctdef.ref_table_id_=524639, scan_ctdef.ir_scan_type_=0)
[2026-04-17 20:17:59.116542] WDIAG [SQL.CG] generate_das_scan_ctdef (ob_tsc_cg_service.cpp:1489) [1617430][T1_L0_G0][T1][YB427F000001-00064FA4FB5B6590-0-0] [lt=89][errcode=-4016] failed to init result outputs(ret=-4016)
[2026-04-17 20:17:59.116556] WDIAG [SQL.CG] generate_tsc_ctdef (ob_tsc_cg_service.cpp:221) [1617430][T1_L0_G0][T1][YB427F000001-00064FA4FB5B6590-0-0] [lt=12][errcode=-4016] generate das scan ctdef failed(ret=-4016, scan_ctdef.ref_table_id_=524639)
...
[2026-04-17 20:17:59.119728] WDIAG [SERVER] do_process (obmp_query.cpp:1185) [1617430][T1_L0_G0][T1][YB427F000001-00064FA4FB5B6590-0-0] [lt=9][errcode=-4016] query failed(ret=-4016, session={this:0x1540b66e6858, id:3221558859, client_sid:3221558859, deser:false, tenant:"sys", tenant_id:1, effective_tenant:"sys", effective_tenant_id:1, database:"test", user:"root@%", consistency_level:3, session_state:2, autocommit:true, tx:0x154ffbf36030}, sql=delete /*+ opt_param('hidden_column_visible', 'true') */ from ddlkitty_1776427074618541 where __pk_increment = 173532, retry_ctrl_.need_retry=0)
Other
This issue was reported by an external business unit. Please select the appropriate "Work Item Type" based on the actual situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the DELETE with the hidden_column_visible hint, then start at generate_das_result_output and generate_das_scan_ctdef in ob_tsc_cg_service.cpp, using the provided error stack and column IDs as the trace. Done means the statement completes without error -4016 and the generated access and output column IDs are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100