Skip to content

Implement ALL_TAB_COLUMNS view and add test case#1290

Open
Adria0615 wants to merge 2 commits intoIvorySQL:masterfrom
Adria0615:add-all-tab-columns
Open

Implement ALL_TAB_COLUMNS view and add test case#1290
Adria0615 wants to merge 2 commits intoIvorySQL:masterfrom
Adria0615:add-all-tab-columns

Conversation

@Adria0615
Copy link
Copy Markdown

@Adria0615 Adria0615 commented Apr 13, 2026

  • Implement ALL_TAB_COLUMNS compatible view
  • Add test case in ora_sysview.sql
  • Update expected output file

Summary by CodeRabbit

  • New Features

    • Added an Oracle-compatible ALL_TAB_COLUMNS view exposing table column metadata and granting public read access.
  • Tests

    • Extended Oracle compatibility tests with a new ALL_TAB_COLUMNS validation: creates/drops a sample table, verifies column metadata mappings (types, lengths, nullability), and cleans up.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Adds an Oracle-compatible ALL_TAB_COLUMNS view and corresponding test that creates/drops a sample table and validates column metadata returned by the new view.

Changes

Cohort / File(s) Summary
Oracle compatibility tests
contrib/ivorysql_ora/sql/ora_sysview.sql, contrib/ivorysql_ora/expected/ora_sysview.out
Appended a test block that creates test_user_cons (columns id int PRIMARY KEY, name varchar(50) NOT NULL), queries ALL_TAB_COLUMNS for that table to validate column metadata (DATA_TYPE, DATA_LENGTH, NULLABLE, etc.), and drops the table before and after.
Sysview extension — ALL_TAB_COLUMNS view
contrib/ivorysql_ora/src/sysview/sysview--1.0.sql
Added CREATE OR REPLACE VIEW ALL_TAB_COLUMNS AS ... mapping PostgreSQL catalogs (pg_class, pg_attribute, pg_type, pg_namespace) into Oracle-style column metadata (calculates data_length/precision/scale), grants SELECT to PUBLIC, and adds a view comment.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Script
    participant DB as Database
    participant View as ALL_TAB_COLUMNS View
    participant Catalog as pg_catalog

    Test->>DB: CREATE TABLE test_user_cons (...)
    Test->>DB: SELECT ... FROM ALL_TAB_COLUMNS WHERE TABLE_NAME='test_user_cons'
    DB->>View: Evaluate ALL_TAB_COLUMNS query
    View->>Catalog: Read pg_class/pg_attribute/pg_type/pg_namespace
    Catalog-->>View: Return attribute/type metadata
    View-->>DB: Return formatted Oracle-style rows
    DB-->>Test: Query result with column metadata
    Test->>DB: DROP TABLE test_user_cons
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • bigplaice

Poem

🐰 I hopped into the catalog, nose all a-twitch,
Mapped columns and lengths without missing a stitch.
A table was born, then I asked it to show,
ALL_TAB_COLUMNS sang the metadata's glow — hop, go! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly summarizes the primary changes: implementing the ALL_TAB_COLUMNS view and adding test coverage, which aligns with all three modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 SQLFluff (4.1.0)
contrib/ivorysql_ora/sql/ora_sysview.sql

User Error: Specified path does not exist. Check it/they exist(s): contrib/ivorysql_ora/sql/ora_sysview.sql.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
contrib/ivorysql_ora/sql/ora_sysview.sql (2)

194-195: Clarify intent of syntax error test.

The backtick after END; appears intentional to test syntax error handling. However, this conflicts with the earlier version of the same test at lines 67-79 which creates the function successfully.

If testing error scenarios is intended, consider adding a comment explaining this is a negative test case, or use a distinct function name to avoid confusion with the earlier successful test.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/sql/ora_sysview.sql` around lines 194 - 195, The test
contains a stray backtick after "END;" (i.e., "END;`") which appears to be an
intentional negative syntax test but conflicts with an earlier successful
function creation; either (1) add an inline comment immediately before the
"END;`" indicating this is a negative/intentional syntax-error test, or (2)
change the function name used here to a distinct name (different from the
earlier successful test) so it's clear this block intentionally verifies syntax
error handling; update the surrounding text to make the intent explicit.

217-229: Test queries PostgreSQL types instead of Oracle types.

The table is initially created with Oracle-style types (NUMBER PRIMARY KEY, VARCHAR2(50)), then dropped and recreated with PostgreSQL types (int primary key, varchar(50)) before querying ALL_TAB_COLUMNS.

To properly test Oracle compatibility, consider querying ALL_TAB_COLUMNS against the Oracle-typed table definition instead:

Proposed fix to test Oracle types
 -- Test ALL_TAB_COLUMNS
 DROP TABLE IF EXISTS test_user_cons;

 CREATE TABLE test_user_cons (
-    id int primary key,
-    name varchar(50) not null
+    id NUMBER PRIMARY KEY,
+    name VARCHAR2(50) NOT NULL
 );

 SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
        DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
        NULLABLE
 FROM ALL_TAB_COLUMNS
 WHERE TABLE_NAME = 'test_user_cons';

Note: The expected output file would need corresponding updates to reflect the Oracle type mappings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/sql/ora_sysview.sql` around lines 217 - 229, The test
creates test_user_cons using PostgreSQL types (int, varchar) but is meant to
exercise Oracle mappings via ALL_TAB_COLUMNS; change the CREATE TABLE for
test_user_cons to use Oracle-style types (e.g., NUMBER PRIMARY KEY and
VARCHAR2(50) NOT NULL), keep the DROP TABLE IF EXISTS test_user_cons and the
subsequent SELECT against ALL_TAB_COLUMNS as-is, and update the expected output
file to reflect Oracle type mappings returned by ALL_TAB_COLUMNS.
contrib/ivorysql_ora/expected/ora_sysview.out (1)

330-334: Consider adding oravarcharbyte to the data_length calculation in the ALL_TAB_COLUMNS view for improved Oracle compatibility.

The view currently returns DATA_LENGTH = -1 for oravarcharbyte columns because the type is not in the special case list that extracts length from atttypmod. Since oravarcharbyte has typmodin/typmodout functions registered and atttypmod is populated for this type (measured in bytes), adding logic similar to the existing varchar handling would return the actual column length (e.g., 50 for VARCHAR2(50)) instead of -1, matching Oracle's behavior. This would require updating the view definition and the corresponding expected test output.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/expected/ora_sysview.out` around lines 330 - 334, The
ALL_TAB_COLUMNS view currently treats oravarcharbyte as a special-case missing
from the atttypmod-based length extraction, causing DATA_LENGTH = -1; update the
view's data_length expression (the same logic used for varchar/varlena typmod
extraction) to include oravarcharbyte in the branch that computes length from
atttypmod, using atttypmod (measured in bytes) and existing typmod decoding
logic so that columns of type oravarcharbyte return the actual length (e.g., 50)
instead of -1; adjust the view definition for ALL_TAB_COLUMNS and regenerate the
expected test output accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@contrib/ivorysql_ora/src/sysview/sysview--1.0.sql`:
- Around line 1310-1311: Update the GRANT and COMMENT statements to reference
the view with its schema-qualified name; change the unqualified references of
ALL_TAB_COLUMNS to SYS.ALL_TAB_COLUMNS in the GRANT SELECT ON and COMMENT ON
VIEW lines so they operate on the SYS schema view (i.e., update the statements
that currently read "GRANT SELECT ON ALL_TAB_COLUMNS TO PUBLIC;" and "COMMENT ON
VIEW ALL_TAB_COLUMNS ..." to use SYS.ALL_TAB_COLUMNS).
- Around line 1279-1308: Rename the view to be created as SYS.ALL_TAB_COLUMNS
(not unqualified ALL_TAB_COLUMNS); wrap owner, table_name and column_name
expressions with SYS.ORA_CASE_TRANS() to match Oracle identifier casing behavior
(replace n.nspname, c.relname, a.attname with SYS.ORA_CASE_TRANS(n.nspname) etc.
and adjust the ORDER BY accordingly); and add the same privilege filtering used
by other ALL_* views (e.g., include the schema/table visibility check using
HAS_SCHEMA_PRIVILEGE/appropriate HAS_* privilege calls on n.nspname/c.oid so
only accessible columns are returned). Ensure references to
pg_class/pg_attribute/pg_type/pg_namespace remain the same and keep the relkind
and att filters.

---

Nitpick comments:
In `@contrib/ivorysql_ora/expected/ora_sysview.out`:
- Around line 330-334: The ALL_TAB_COLUMNS view currently treats oravarcharbyte
as a special-case missing from the atttypmod-based length extraction, causing
DATA_LENGTH = -1; update the view's data_length expression (the same logic used
for varchar/varlena typmod extraction) to include oravarcharbyte in the branch
that computes length from atttypmod, using atttypmod (measured in bytes) and
existing typmod decoding logic so that columns of type oravarcharbyte return the
actual length (e.g., 50) instead of -1; adjust the view definition for
ALL_TAB_COLUMNS and regenerate the expected test output accordingly.

In `@contrib/ivorysql_ora/sql/ora_sysview.sql`:
- Around line 194-195: The test contains a stray backtick after "END;" (i.e.,
"END;`") which appears to be an intentional negative syntax test but conflicts
with an earlier successful function creation; either (1) add an inline comment
immediately before the "END;`" indicating this is a negative/intentional
syntax-error test, or (2) change the function name used here to a distinct name
(different from the earlier successful test) so it's clear this block
intentionally verifies syntax error handling; update the surrounding text to
make the intent explicit.
- Around line 217-229: The test creates test_user_cons using PostgreSQL types
(int, varchar) but is meant to exercise Oracle mappings via ALL_TAB_COLUMNS;
change the CREATE TABLE for test_user_cons to use Oracle-style types (e.g.,
NUMBER PRIMARY KEY and VARCHAR2(50) NOT NULL), keep the DROP TABLE IF EXISTS
test_user_cons and the subsequent SELECT against ALL_TAB_COLUMNS as-is, and
update the expected output file to reflect Oracle type mappings returned by
ALL_TAB_COLUMNS.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3313e89b-2aaf-429f-bf58-53c9b150253a

📥 Commits

Reviewing files that changed from the base of the PR and between 276bd7b and 9f66a05.

📒 Files selected for processing (3)
  • contrib/ivorysql_ora/expected/ora_sysview.out
  • contrib/ivorysql_ora/sql/ora_sysview.sql
  • contrib/ivorysql_ora/src/sysview/sysview--1.0.sql

Comment on lines +1279 to +1308
CREATE OR REPLACE VIEW ALL_TAB_COLUMNS AS
SELECT
n.nspname AS owner,
c.relname AS table_name,
a.attname AS column_name,
a.attnum AS column_id,
t.typname AS data_type,
CASE
WHEN t.typname IN ('varchar', 'char', 'bpchar') THEN (a.atttypmod - 4)
WHEN t.typname = 'numeric' THEN ((a.atttypmod - 4) >> 16)
ELSE a.attlen
END AS data_length,
CASE
WHEN t.typname = 'numeric' THEN ((a.atttypmod - 4) >> 16)
ELSE NULL
END AS data_precision,
CASE
WHEN t.typname = 'numeric' THEN ((a.atttypmod - 4) & 65535)
ELSE NULL
END AS data_scale,
CASE WHEN a.attnotnull THEN 'N' ELSE 'Y' END AS nullable
FROM pg_class c
JOIN pg_attribute a ON a.attrelid = c.oid
JOIN pg_type t ON a.atttypid = t.oid
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE a.attnum > 0
AND NOT a.attisdropped
AND c.relkind IN ('r', 'v')
AND n.nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY n.nspname, c.relname, a.attnum;
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.

🛠️ Refactor suggestion | 🟠 Major

Missing SYS. schema prefix for consistency with other views.

All other views in this file are created under the SYS schema (e.g., SYS.ALL_PROCEDURES, SYS.ALL_SOURCE, SYS.ALL_ARGUMENTS), but ALL_TAB_COLUMNS is created without the schema prefix. Additionally:

  1. Missing SYS.ORA_CASE_TRANS() calls for owner, table_name, and column_name columns to match Oracle identifier casing behavior
  2. Missing privilege checks like HAS_SCHEMA_PRIVILEGE() that other ALL_* views include
Proposed fix for schema and consistency
-CREATE OR REPLACE VIEW ALL_TAB_COLUMNS AS
+CREATE OR REPLACE VIEW SYS.ALL_TAB_COLUMNS AS
 SELECT
-    n.nspname AS owner,
-    c.relname AS table_name,
-    a.attname AS column_name,
+    SYS.ORA_CASE_TRANS(n.nspname::VARCHAR2)::VARCHAR2(128) AS owner,
+    SYS.ORA_CASE_TRANS(c.relname::VARCHAR2)::VARCHAR2(128) AS table_name,
+    SYS.ORA_CASE_TRANS(a.attname::VARCHAR2)::VARCHAR2(128) AS column_name,
     a.attnum AS column_id,
     t.typname AS data_type,
     ...
 WHERE a.attnum > 0
   AND NOT a.attisdropped
   AND c.relkind IN ('r', 'v')
   AND n.nspname NOT IN ('pg_catalog', 'information_schema')
+  AND HAS_SCHEMA_PRIVILEGE(n.oid, 'USAGE')
 ORDER BY n.nspname, c.relname, a.attnum;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/src/sysview/sysview--1.0.sql` around lines 1279 - 1308,
Rename the view to be created as SYS.ALL_TAB_COLUMNS (not unqualified
ALL_TAB_COLUMNS); wrap owner, table_name and column_name expressions with
SYS.ORA_CASE_TRANS() to match Oracle identifier casing behavior (replace
n.nspname, c.relname, a.attname with SYS.ORA_CASE_TRANS(n.nspname) etc. and
adjust the ORDER BY accordingly); and add the same privilege filtering used by
other ALL_* views (e.g., include the schema/table visibility check using
HAS_SCHEMA_PRIVILEGE/appropriate HAS_* privilege calls on n.nspname/c.oid so
only accessible columns are returned). Ensure references to
pg_class/pg_attribute/pg_type/pg_namespace remain the same and keep the relkind
and att filters.

Comment on lines +1310 to +1311
GRANT SELECT ON ALL_TAB_COLUMNS TO PUBLIC;
COMMENT ON VIEW ALL_TAB_COLUMNS IS 'Oracle-style ALL_TAB_COLUMNS view'; No newline at end of file
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.

🛠️ Refactor suggestion | 🟠 Major

Update GRANT to reference the correct schema.

If the view is moved to SYS schema as suggested above, the GRANT and COMMENT statements should also reference SYS.ALL_TAB_COLUMNS.

Proposed fix
-GRANT SELECT ON ALL_TAB_COLUMNS TO PUBLIC;
-COMMENT ON VIEW ALL_TAB_COLUMNS IS 'Oracle-style ALL_TAB_COLUMNS view';
+GRANT SELECT ON SYS.ALL_TAB_COLUMNS TO PUBLIC;
+COMMENT ON VIEW SYS.ALL_TAB_COLUMNS IS 'Oracle-style ALL_TAB_COLUMNS view';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
GRANT SELECT ON ALL_TAB_COLUMNS TO PUBLIC;
COMMENT ON VIEW ALL_TAB_COLUMNS IS 'Oracle-style ALL_TAB_COLUMNS view';
GRANT SELECT ON SYS.ALL_TAB_COLUMNS TO PUBLIC;
COMMENT ON VIEW SYS.ALL_TAB_COLUMNS IS 'Oracle-style ALL_TAB_COLUMNS view';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/src/sysview/sysview--1.0.sql` around lines 1310 - 1311,
Update the GRANT and COMMENT statements to reference the view with its
schema-qualified name; change the unqualified references of ALL_TAB_COLUMNS to
SYS.ALL_TAB_COLUMNS in the GRANT SELECT ON and COMMENT ON VIEW lines so they
operate on the SYS schema view (i.e., update the statements that currently read
"GRANT SELECT ON ALL_TAB_COLUMNS TO PUBLIC;" and "COMMENT ON VIEW
ALL_TAB_COLUMNS ..." to use SYS.ALL_TAB_COLUMNS).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@contrib/ivorysql_ora/sql/ora_sysview.sql`:
- Around line 97-100: Extend the test table definition used by the
ALL_TAB_COLUMNS coverage by adding columns that exercise numeric precision/scale
and nullable cases: keep the existing id (int4) and name (varchar) columns, then
add a numeric/decimal column with explicit precision and scale (e.g.,
NUMERIC(p,s)) to trigger precision/scale handling, and add at least one column
declared NULLABLE (no NOT NULL) to cover the NULLABLE = 'Y' path; update any
assertions in the test to expect the precision/scale values and nullable flag
for the new columns so ALL_TAB_COLUMNS branches are exercised (refer to
test_user_cons and the view logic that reads column_precision/column_scale and
nullable status).
- Around line 102-106: The SELECT against ALL_TAB_COLUMNS is only filtering by
TABLE_NAME ('test_user_cons') which can return rows from other schemas; update
the WHERE clause in the query that references ALL_TAB_COLUMNS to also restrict
OWNER (e.g., OWNER = current_schema or the expected schema name) so the
assertion is scoped to the intended schema and avoids cross-schema flakiness.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b0a2caac-ac9f-48a7-81e8-88651aa49ec3

📥 Commits

Reviewing files that changed from the base of the PR and between 9f66a05 and fe86a98.

📒 Files selected for processing (2)
  • contrib/ivorysql_ora/expected/ora_sysview.out
  • contrib/ivorysql_ora/sql/ora_sysview.sql
🚧 Files skipped from review as they are similar to previous changes (1)
  • contrib/ivorysql_ora/expected/ora_sysview.out

Comment on lines +97 to +100
CREATE TABLE test_user_cons (
id int primary key,
name varchar(50) not null
);
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.

⚠️ Potential issue | 🟠 Major

Expand this test to cover untested ALL_TAB_COLUMNS branches.

Current case validates only int4 and varchar with NOT NULL. It misses numeric precision/scale and NULLABLE = 'Y' paths implemented by the view.

Suggested expansion
 CREATE TABLE test_user_cons (
     id int primary key,
-    name varchar(50) not null
+    name varchar(50) not null,
+    amount numeric(10,2),
+    code char(3)
 );
 SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
        DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
        NULLABLE
 FROM ALL_TAB_COLUMNS
 WHERE TABLE_NAME = 'test_user_cons'
   AND OWNER = current_schema();
+ORDER BY COLUMN_ID;
As per coding guidelines, `**/sql/*.sql`: Test SQL files. Ensure comprehensive coverage of features.

Also applies to: 102-104

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/sql/ora_sysview.sql` around lines 97 - 100, Extend the
test table definition used by the ALL_TAB_COLUMNS coverage by adding columns
that exercise numeric precision/scale and nullable cases: keep the existing id
(int4) and name (varchar) columns, then add a numeric/decimal column with
explicit precision and scale (e.g., NUMERIC(p,s)) to trigger precision/scale
handling, and add at least one column declared NULLABLE (no NOT NULL) to cover
the NULLABLE = 'Y' path; update any assertions in the test to expect the
precision/scale values and nullable flag for the new columns so ALL_TAB_COLUMNS
branches are exercised (refer to test_user_cons and the view logic that reads
column_precision/column_scale and nullable status).

Comment on lines +102 to +106
SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
NULLABLE
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = 'test_user_cons';
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.

⚠️ Potential issue | 🟡 Minor

Scope the assertion to schema to avoid cross-schema flakiness.

At Line 106, filtering only by TABLE_NAME can return extra rows if another schema has the same table name.

Suggested fix
 SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
        DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
        NULLABLE
 FROM ALL_TAB_COLUMNS
-WHERE TABLE_NAME = 'test_user_cons';
+WHERE TABLE_NAME = 'test_user_cons'
+  AND OWNER = current_schema();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
NULLABLE
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = 'test_user_cons';
SELECT OWNER, TABLE_NAME, COLUMN_NAME, COLUMN_ID,
DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE,
NULLABLE
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME = 'test_user_cons'
AND OWNER = current_schema();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@contrib/ivorysql_ora/sql/ora_sysview.sql` around lines 102 - 106, The SELECT
against ALL_TAB_COLUMNS is only filtering by TABLE_NAME ('test_user_cons') which
can return rows from other schemas; update the WHERE clause in the query that
references ALL_TAB_COLUMNS to also restrict OWNER (e.g., OWNER = current_schema
or the expected schema name) so the assertion is scoped to the intended schema
and avoids cross-schema flakiness.

@hs-liuxh
Copy link
Copy Markdown
Collaborator

Thanks for your contribution. We will review it shortly.

@hs-liuxh hs-liuxh self-requested a review April 14, 2026 05:02
@bigplaice
Copy link
Copy Markdown
Collaborator

For issue 1009:
#1009

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.

3 participants