Skip to content

fix: Oracle view crash caused by LONG column type in OracleNIO decoder#568

Merged
datlechin merged 1 commit intomainfrom
fix/oracle-view-crash-v2
Apr 3, 2026
Merged

fix: Oracle view crash caused by LONG column type in OracleNIO decoder#568
datlechin merged 1 commit intomainfrom
fix/oracle-view-crash-v2

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

Fixes #564 — clicking an Oracle view crashes TablePro with EXC_BREAKPOINT (SIGTRAP) in OracleNIO's OracleBackendMessageDecoder.decode.

Root cause: Oracle's data dictionary uses LONG data type columns. OracleNIO 1.0.0-rc.4 crashes with a fatal error (force unwrap/precondition failure) when decoding non-NULL LONG values. When fetchColumns queries ALL_TAB_COLUMNS.DATA_DEFAULT (LONG type), views have non-NULL values (column expressions) that trigger the crash. Tables usually have NULL defaults, so the decoder is never triggered — which is why only views crash.

Three fixes in OraclePlugin.swift:

  • fetchColumns: Removed c.DATA_DEFAULT (LONG type) from the query to avoid triggering OracleNIO's broken LONG decoder. Default values show as nil.
  • fetchViewDefinition: Replaced SELECT TEXT FROM ALL_VIEWS (TEXT is also LONG) with DBMS_METADATA.GET_DDL('VIEW', ...) which returns CLOB (safe).
  • fetchTableMetadata: Added fallback query via ALL_TAB_COMMENTS when ALL_TABLES returns no rows (views are not in ALL_TABLES).

Test plan

  • Connect to Oracle (gvenzl/oracle-free container)
  • Click a view in the sidebar — should load data without crash
  • Right-click view → Edit View Definition — should show DDL
  • Verify table browsing still works (no regression)
  • Check Structure tab for views shows comment metadata

@datlechin datlechin merged commit 674944a into main Apr 3, 2026
2 checks passed
@datlechin datlechin deleted the fix/oracle-view-crash-v2 branch April 3, 2026 11:28
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.

opening an oracle view crashes

1 participant