Skip to content

feat(oracle): parse subprogram heading clauses and PL/SQL CHARACTER SET (BYT-10301) - #449

Open
rebelice wants to merge 22 commits into
mainfrom
claude/oracle-plsql-subprogram-clauses
Open

rebelice wants to merge 22 commits into
mainfrom
claude/oracle-plsql-subprogram-clauses

Conversation

@rebelice

Copy link
Copy Markdown
Collaborator

Next step of the BYT-10301 plan, after #447. The PL/SQL that ships with Oracle still had 101 units omni could not parse. 38 of them parsed under the ANTLR parser that Bytebase used up to 3.18, so they are regressions users can hit. Almost all came down to clauses in subprogram and package headings. This PR parses those clauses strictly; every rule below was checked on Oracle 23ai.

Heading clauses

Clause Now
ACCESSIBLE BY Accepted on procedures, functions, package specifications, and package and local subprograms. Each accessor is [FUNCTION|PROCEDURE|PACKAGE|TRIGGER|TYPE] [schema.]name. An unquoted kind word is always read as the kind, so (PACKAGE) is PLS-00103, as are (), a missing parenthesis, and an accessor with @dblink. Before, the unit kind failed to parse, procedures and package subprograms did not accept the clause at all, and it had to come before AUTHID
AGGREGATE USING type, PIPELINED ... USING type The type implements the function, so the clause list ends there and there is no IS | AS body. Oracle rejects a following IS or clause, USING without PIPELINED (PLS-00624), and AGGREGATE not followed by USING
PIPELINED { ROW | TABLE } POLYMORPHIC Accepted, with an optional USING package
PARALLEL_ENABLE ( PARTITION arg BY ... ) ANY, or HASH/RANGE/VALUE (expr, ...). LIST, an empty list, and a missing BY are rejected
ORDER arg BY (...), CLUSTER arg BY (...) Oracle treats these streaming clauses as function clauses of their own, accepted with or without PARALLEL_ENABLE. The argument is a plain parameter name
RESULT_CACHE RELIES_ON (...) Accepted; the list may be empty
SQL_MACRO ( [TYPE =>] SCALAR | TABLE ) Parsed strictly; SQL_MACRO () and SQL_MACRO (foo) are rejected
Any clause repeated Rejected: PLS-00371, "at most one declaration for 'AUTHID'". This covers ORDER BY and CLUSTER BY as well

Split. A function that a type implements has no END, so Split used to swallow every statement after it, up to the next END; or /. It now ends the function at its ;, as it already does for call specs. SQL*Plus buffers both forms up to the next / line; Split follows the grammar here, as it does for call specs.

PL/SQL datatypes

Context Now
CHARACTER SET { name | item%CHARSET } Parsed after a PL/SQL datatype. ANY_CS is allowed only on a subprogram parameter (PLS-00551). A record field or collection element takes neither ANY_CS nor %CHARSET (PLS-00552). A built-in non-character type takes none: PLS-00550 for NUMBER, PLS-00554 for NCHAR/NVARCHAR2/NCLOB/LONG. Whether a name is a known character set is left to the engine. SQL (CREATE TABLE) still has no CHARACTER SET
Parameter and function result types Unconstrained. p VARCHAR2(10), p TIMESTAMP(3), RETURN NUMBER(5), a constrained cursor parameter, and a constrained REF CURSOR RETURN type are all PLS-00103 on Oracle, in standalone, package, local, and object type subprograms alike. omni accepted them; it now rejects them

Engine evidence

  • Dictionary gate: failing units drop from 101 to 34, and no unit fails that passed before. Five units now fail further into their source, on unrelated gaps (Oracle-internal .., the package initialization section, and others).
  • ANTLR comparison: of the units the old ANTLR parser accepted, omni rejected 38; now 9. omni parses 841 of the 875 units; ANTLR parsed 676.
  • Reference rows: ref_147 to ref_165 are checked against the pinned Oracle image.
  • Unit tests: TestSubprogramHeadingClauses covers every probed form, including the errors Oracle reports from the text alone after parsing (PLS-00371, -00550, -00551, -00552, -00554, -00624). The reference harness counts only PLS-00103 as a syntax rejection, so those can't be reference rows.
  • Fixture corrected: one existing fixture ended AGGREGATE USING with an IS body, which Oracle rejects; it now ends at the ;.

Verification

  • make test-oracle passes.
  • TestOracleCompatibilityReferenceReport outcome counts are identical to main.
  • go vet reports one finding fewer than main: the unreachable code in the old parseFunctionProperties is gone.
  • go generate ./oracle/ast/... is in sync, and gofmt is clean.

Next

  • CREATE TYPE heading. It accepts none of AUTHID, ACCESSIBLE BY, FORCE, OID or SHARING, and treats AS/IS as optional. The dictionary gate does not cover type specifications yet, so that PR will add them.
  • Remaining dictionary categories: conditional compilation (7), JSON clauses (5), package initialization section (4), REF types (3), and trigger CALL with arguments (3).

🤖 Generated with Claude Code

…ET (BYT-10301)

Oracle-shipped PL/SQL that ANTLR parsed and omni rejected came down to
the clauses of subprogram and package headings. Each rule below was
checked on Oracle 23ai:

- ACCESSIBLE BY ( [unit_kind] [schema.]name, ... ) on procedures,
  functions, package specifications, and package and local subprograms;
  a unit kind word is always the kind, and an accessor takes no dblink.
- AGGREGATE USING type and PIPELINED ... USING type: the type implements
  the function, the clause list ends there, and there is no IS | AS body.
  Split ends such a function at its ';' like a call spec.
- PIPELINED { ROW | TABLE } POLYMORPHIC, PARALLEL_ENABLE ( PARTITION arg
  BY { ANY | HASH | RANGE | VALUE } ... ), the ORDER and CLUSTER
  streaming clauses, RESULT_CACHE RELIES_ON, and SQL_MACRO ( [TYPE =>]
  SCALAR | TABLE ).
- Every heading clause at most once (PLS-00371).
- CHARACTER SET { name | item%CHARSET } after a PL/SQL datatype. ANY_CS
  stands only on a subprogram parameter (PLS-00551), a record field or
  collection element takes neither ANY_CS nor %CHARSET (PLS-00552), and
  built-in non-character types take none (PLS-00550, PLS-00554).
- Parameter and function result types are unconstrained: p VARCHAR2(10)
  and RETURN NUMBER(5) are PLS-00103, as are constrained cursor
  parameters and REF CURSOR RETURN types.

The dictionary manifest drops from 101 to 34 units, with none newly
failing; units ANTLR parsed and omni did not drop from 38 to 9.
Reference rows ref_147 to ref_165.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:39:27.240240Z 7a4b762 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6d65ec8b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/split.go Outdated
Comment thread oracle/parser/type.go Outdated
Comment thread oracle/parser/type.go Outdated
… SET (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- Split ends a function at USING only after RETURN and AGGREGATE or
  PIPELINED: a function or parameter named USING compiles, and its unit
  ran on to END.
- CHARACTER SET is rejected on the PL/SQL predefined non-character types
  too (BOOLEAN, PLS_INTEGER, BINARY_INTEGER, SIMPLE_INTEGER, NATURAL,
  POSITIVE, SIGNTYPE, INT, REAL, DEC, BINARY_*, SIMPLE_*, SYS_REFCURSOR,
  UROWID, BFILE, MLSLABEL, VECTOR: PLS-00550); STRING and CHARACTER take
  one.
- %CHARSET must be unquoted: a%"CHARSET" is PLS-00103.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de7f539ac8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/split.go Outdated
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/create_proc.go Outdated
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
… (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- AUTHID stands only on a schema-level unit (PLS-00157 on packaged,
  nested, and type method subprograms), ACCESSIBLE BY not on a type
  method (PLS-00262), and DEFAULT COLLATION only on a schema-level unit
  (documented). The local-subprogram AUTHID over-accept is retired.
- Clause keywords are unquoted words: "ACCESSIBLE" BY and "AUTHID" are
  PLS-00103.
- RELIES_ON (t1,) and USING impl. or impl@ are PLS-00103; USING takes a
  dotted database link.
- Split skips the result datatype's first word and name parts after '.'
  before looking for PIPELINED or AGGREGATE: RETURN pipelined.using names
  a type.

A polymorphic table function with an IS body compiles on Oracle, so it
stays accepted. Reference rows ref_166 to ref_170.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c58d1228e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/type.go Outdated
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/subprogram_clause.go Outdated
…it names (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- A polymorphic table function takes no DETERMINISTIC, PARALLEL_ENABLE,
  ORDER BY, CLUSTER BY, or AUTHID (PLS-00760) and no RESULT_CACHE
  (PLS-00999, from its TABLE parameter), before or after PIPELINED ...
  POLYMORPHIC. ACCESSIBLE BY and an IS body compile.
- ACCESSIBLE BY accessors, RELIES_ON data sources, and implementation
  type names are not PL/SQL reserved words: (SELECT), (BEGIN), and
  (sys.select) are PLS-00103; (loop) and "SELECT" compile.
- DEFAULT COLLATION is recorded on procedure, function, and package
  statements.

Reference rows ref_171 to ref_173.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56e084dedb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go Outdated
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go Outdated
Comment thread oracle/parser/split.go Outdated
Comment thread oracle/parser/type.go Outdated
…arity (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- ACCESSIBLE BY stands on schema-level and package subprograms only; a
  nested one is PLS-00262 or PLS-00263.
- A SQL macro takes no DETERMINISTIC, PARALLEL_ENABLE, RESULT_CACHE,
  AUTHID, or streaming clause (PLS-00778) and no PIPELINED (PLS-00630),
  and returns a character type: NUMBER, LONG, or %ROWTYPE is PLS-00776,
  NVARCHAR2, CLOB, CHAR, and STRING compile.
- An aggregate needs a parameter (PLS-00652); several, or IN OUT, compile
  against a real ODCIAggregate type.
- %ROWTYPE takes no CHARACTER SET (PLS-00550).
- DEFAULT COLLATION takes USING_NLS_COMP unquoted, as documented.

Reference rows ref_174 and ref_175.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b01856e17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
…s (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- PIPELINED and AGGREGATE exclude each other (PLS-00371) unless the
  function is polymorphic: PIPELINED ROW POLYMORPHIC AGGREGATE USING
  and SQL_MACRO AGGREGATE USING compile.
- An object type method is not polymorphic (PLS-00765); a nested
  polymorphic table function compiles, in a stored unit and an
  anonymous block alike.

PIPELINED POLYMORPHIC without ROW or TABLE stays rejected (PLS-00103).
Reference rows ref_176 to ref_178.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eced1a412

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
…od macros (BYT-10301)

Review follow-up, each checked on Oracle 23ai with real types behind the
names (a strong REF CURSOR, a collection, a PTF implementation package):
- The PARALLEL_ENABLE partition argument is an IN parameter of the
  function (PLS-00626, PLS-00625). An ORDER or CLUSTER BY clause needs
  PARALLEL_ENABLE with PARTITION BY (PLS-00654, PLS-00665) on the same
  argument (PLS-00631). An earlier probe masked by an unresolved return
  type had suggested the streaming clause stood alone.
- The TABLE pseudo-type stands only in a polymorphic table function
  (PLS-00765): not in a procedure, an ordinary function, or a SQL macro.
- An object type method is not a SQL macro (PLS-00781).

A nested function may be an aggregate (it compiles), so it stays
accepted. ref_152 now partitions a declared parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78b65a75b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/split.go Outdated
Comment thread oracle/parser/type.go
…, Split (BYT-10301)

Review follow-up, each checked on Oracle 23ai with real types behind the
names:
- A polymorphic table function returns TABLE (PLS-00767) and takes one
  TABLE parameter (PLS-00773, PLS-00766).
- The PARALLEL_ENABLE argument is a REF CURSOR: a predefined non-cursor
  type, or SYS_REFCURSOR with HASH, RANGE, VALUE, or a streaming clause,
  is PLS-00627; SYS_REFCURSOR BY ANY compiles, and a named type is left
  to the engine.
- item%CHARSET naming a parameter of the same heading needs a character
  parameter (PLS-00550 for NUMBER or DATE); VARCHAR2 without ANY_CS and
  NVARCHAR2 qualify, and items outside the heading are left to the
  engine.
- Split ends a stored unit at a ';' in its head before IS|AS, so a
  malformed bodyless heading (AGGREGATE without USING) no longer runs on
  into the next statement.

Fixtures that partitioned a weak cursor by HASH now use a strong one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c2c339ab7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/type.go
…-10301)

Review follow-up, each checked on Oracle 23ai:
- PARTITION BY VALUE takes one column (PLS-00757); HASH and RANGE take
  several.
- A quoted "TABLE" names a user type, which a procedure or function
  parameter may have; only the unquoted word is the PTF pseudo-type.
- BOOL, the 23ai alias of BOOLEAN, takes no CHARACTER SET (PLS-00550).

A quoted "POLYMORPHIC" or "COLLATION" was already rejected, as Oracle
does (PLS-00103); reference rows ref_179 to ref_181 pin these.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef953c213c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go Outdated
Comment thread oracle/parser/subprogram_clause.go Outdated
…10301)

Review follow-up, each checked on Oracle 23ai:
- COLUMNS, like TABLE, stands only in a polymorphic table function
  (PLS-00765). No type can be named COLUMNS unquoted (CREATE TYPE
  columns is PLS-00103), so the unquoted word is always the pseudo-type;
  a quoted "COLUMNS" names a user type.
- TIMESTAMP WITH [LOCAL] TIME ZONE, INTERVAL ... TO ..., and LONG RAW
  are predefined non-character types: a SQL macro cannot return one
  (PLS-00776), CHARACTER SET is not allowed on one (PLS-00550), and none
  is a partitionable REF CURSOR (PLS-00627).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa2b93bc88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
…-10301)

Review follow-up, each checked on Oracle 23ai:
- Object type procedure methods and ALTER TYPE method signatures take the
  heading checks of other subprograms: no TABLE or COLUMNS pseudo-type
  (PLS-00765), item%CHARSET from a character parameter (PLS-00550), and
  an ALTER TYPE method result is unconstrained like a CREATE TYPE one.
- RESULT_CACHE takes no OUT or IN OUT parameter (PLS-00999), standalone
  and in a package specification alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db99faefb7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/create_proc.go Outdated
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/subprogram_clause.go
… columns (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- A polymorphic table function's TABLE parameter takes no default
  (PLS-00768); a COLUMNS one defaults to NULL if at all (PLS-00769).
- RESULT_CACHE takes no parameter or result of a LOB, BFILE, or
  SYS_REFCURSOR type (PLS-00999); object types are left to the engine.
- AUTHID CURRENT_USER is one word: AUTHID CURRENT and AUTHID CURRENT
  USER are PLS-00103 (a quoted "CURRENT_USER" compiles).
- PARALLEL_ENABLE and streaming items are simple column names
  (PLS-00670): no expression, qualified name, or literal.

Reference rows ref_182 and ref_183.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb4997f097

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/type.go
…(BYT-10301)

Review follow-up, checked on Oracle 23ai: a package with SUBTYPE
"NUMBER" IS VARCHAR2(100) as a SQL macro result, TYPE "SYS_REFCURSOR"
IS REF CURSOR as a hash-partitioned argument, and SUBTYPE "CLOB" IS
NUMBER as a RESULT_CACHE result compiles without errors. A quoted name
is a user type, so the predefined-type checks (CHARACTER SET, SQL macro
result, RESULT_CACHE, partition argument) now leave it to the engine.

A polymorphic USING pkg@link compiles over a loopback link, so it stays
accepted. Reference row ref_184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88f2fa2be0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
… packages (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- An ordinary pipelined function returns a collection: a predefined
  scalar or %ROWTYPE result is PLS-00630, with or without USING; a named
  result type is left to the engine.
- A pipelined function is not result-cached (PLS-00999).
- A package holding a SQL macro cannot be AUTHID CURRENT_USER
  (PLS-00782).

Nested SQL macros and nested RESULT_CACHE functions compile, so they
stay accepted. Two fixtures that returned NUMBER from a pipelined
function now return a collection type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f1030233e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/create_proc.go
…lt cache (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- A dotted %CHARSET source names an item outside the heading: a function
  with a quoted NUMBER formal "K.C" and a k.c%CHARSET result compiles.
- A quoted "*" names a column: PARTITION BY HASH ("*") over such a
  column compiles; only the unquoted * is the wildcard.
- RESULT_CACHE takes no %ROWTYPE record parameter (PLS-00999); a
  %ROWTYPE result compiles, so it stays accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d671057928

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
…s (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- A single quoted %CHARSET source such as "K.C" names the formal of that
  spelling (PLS-00550 when it is numeric); only a qualified k.c source
  names an item outside the heading. The parser records which it was.
- No subprogram in a top-level anonymous block is result-cached
  (PLS-00999, at any nesting depth); a DECLARE block or nested function
  inside a stored unit compiles, so those stay accepted.

ORDER BY and CLUSTER BY together compile with HASH, RANGE, and ANY
partitioning, so they stay accepted. Reference row ref_185.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2edb488fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/type.go Outdated
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
… functions (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- CHARACTER SET is not allowed on the TABLE or COLUMNS pseudo-type,
  parameter or result (PLS-00550).
- A nested function is not parallel-enabled (PLS-00712); a private
  package body function, and nested DETERMINISTIC, PIPELINED, and
  polymorphic functions, compile.

A nested aggregate compiles, in a stored unit and an anonymous block, so
it stays accepted. Reference row ref_186.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29a5f40ebb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/plsql_block.go
…301)

Review follow-up, checked on Oracle 23ai: a cursor parameter whose
character set comes from a NUMBER or DATE cursor parameter is PLS-00550
in an anonymous block and a stored unit alike, while a VARCHAR2 source
compiles. checkCharsetSources now takes cursor parameters as well as
subprogram parameters. Reference rows ref_187 and ref_188.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca834a8e83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go
…BYT-10301)

Oracle 23ai rejects a parenthesized NULL default on a polymorphic table
function's COLUMNS parameter with PLS-00769, as it does any default but
a bare NULL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd0a5938d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/split.go Outdated
Comment thread oracle/parser/plsql_block.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/create_proc.go
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/create_proc.go
…in Split (BYT-10301)

Review follow-up, each checked on Oracle 23ai:
- A declaration in a subprogram body's own declaration section whose
  item%CHARSET source is a formal, or a preceding local variable, of a
  non-character type is PLS-00550; a VARCHAR2 local source compiles.
  Nested blocks are left to the engine.
- An aggregate's implementation type cannot be reached over a database
  link (PLS-00331); a polymorphic function's package can.
- Split no longer reads a streaming argument named USING (ORDER using
  BY ...) as the implementation-type marker.

A scalar result with PARALLEL_ENABLE (PARTITION ...) compiles, so it
stays accepted; DBMS_TF.TABLE_T and COLUMNS_T rules need the name
resolved and are left to the engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25272c6a4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/plsql_block.go
Comment thread oracle/parser/create_proc.go Outdated
Check an item%CHARSET source against every declaration scope Oracle 23ai
resolves it through: package items, enclosing blocks and subprograms,
anonymous blocks, simple trigger bodies, and type-body methods, with an
inner declaration shadowing an outer one. A source of a non-character
type is PLS-00550.

The walk visits each unit once and fills each scope's map as its
declarations are read, replacing the per-declaration rescan that made
long declaration sections quadratic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56c28e40f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/subprogram_clause.go
Comment thread oracle/parser/subprogram_clause.go Outdated
Comment thread oracle/parser/type.go
…pe shadowing (BYT-10301)

The %CHARSET scope walk now also checks subprogram headings, with or
without a body, and cursor formals against the enclosing scopes, and
resolves a source qualified by an enclosing subprogram, package,
labeled block, or type-body method (p.a%CHARSET). Oracle 23ai rejects
each with PLS-00550 when the source has a non-character type.

A TYPE or SUBTYPE may redeclare any predefined type name but DOUBLE,
NUMBER and SYS_REFCURSOR included, and the name then denotes the
user's type. The predefined-type checks (RESULT_CACHE, PIPELINED,
SQL_MACRO, PARALLEL_ENABLE, CHARACTER SET, %CHARSET sources) now skip a
spelling shadowed by a declaration in scope, and every predefined
spelling in a package body, whose specification may shadow it out of
sight. A schema-level type does not shadow STANDARD's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant