Skip to content

Commit 5afd0df

Browse files
authored
fix: Filter out invisible columns (#11535)
#### Summary Fixes #10964 (comment) <!--
1 parent 83c901c commit 5afd0df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/source/oracledb/client/list_tables.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ func (c *Client) updateTableConstraints(ctx context.Context, table *schema.Table
5858
func (c *Client) listTables(ctx context.Context) (schema.Tables, error) {
5959
// Please note we don't use ORDER BY here because it's slower than sorting in memory via Go sort.SliceStable
6060
// See more about the default namespaces we exclude in https://www.oracletutorial.com/oracle-administration/oracle-tablespace/
61+
// Also invisible columns have COLUMN_ID = NULL so we exclude them as well. See https://forums.oracle.com/ords/apexds/post/oracle-12c-invisible-columns-0462
6162
query := `
6263
SELECT ALL_TAB_COLS.TABLE_NAME, COLUMN_ID, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE FROM ALL_TABLES
6364
LEFT JOIN ALL_TAB_COLS ON ALL_TABLES.TABLE_NAME = ALL_TAB_COLS.TABLE_NAME
6465
WHERE ALL_TABLES.TABLESPACE_NAME NOT IN ('SYSAUX', 'SYSTEM', 'TEMP', 'UNDOTBS1')
66+
AND ALL_TAB_COLS.COLUMN_ID IS NOT NULL
6567
`
6668
rows, err := c.db.QueryContext(ctx, query)
6769
if err != nil {

0 commit comments

Comments
 (0)