Skip to content

Commit

Permalink
fix: List tables from ALL_TABLES with TABLESPACE_NAME = 'USERS' (#…
Browse files Browse the repository at this point in the history
…11163)



#### Summary

Fixes #10964

See explanation in #10964 (comment)

<!--
  • Loading branch information
erezrokah committed Jun 5, 2023
1 parent 436a5fb commit 865639b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/source/oracledb/client/list_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ func (c *Client) updateTableConstraints(ctx context.Context, table *schema.Table

func (c *Client) listTables(ctx context.Context) (schema.Tables, error) {
// Please note we don't use ORDER BY here because it's slower than sorting in memory via Go sort.SliceStable
query := `SELECT TABLE_NAME, COLUMN_ID, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE FROM USER_TAB_COLS`
query := `
SELECT ALL_TAB_COLS.TABLE_NAME, COLUMN_ID, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE FROM ALL_TABLES
LEFT JOIN ALL_TAB_COLS ON ALL_TABLES.TABLE_NAME = ALL_TAB_COLS.TABLE_NAME
WHERE ALL_TABLES.TABLESPACE_NAME = 'USERS'
`
rows, err := c.db.QueryContext(ctx, query)
if err != nil {
return nil, err
Expand Down

0 comments on commit 865639b

Please sign in to comment.