Repository navigation
Fix issue 763 - #796
Fix issue 763#796
Conversation
WalkthroughThis change updates conditional checks throughout the codebase to use new symbolic constants for database compatibility modes. Specifically, occurrences of Changes
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/backend/executor/execExprInterp.c (1)
4101-4120: 💡 Verification agent🧩 Analysis chain
Updated XML update hook check to use ORA_PARSER
This replaces the legacyDB_ORACLEconstant with the newORA_PARSERcompatibility mode. Ensure thatORA_PARSERis defined inora_compatible.hand that all previousDB_ORACLEchecks have been removed across the codebase.Run the following script to verify no residual
DB_ORACLEreferences remain:
🏁 Script executed:
#!/bin/bash # Description: Search for any remaining DB_ORACLE references rg -n 'DB_ORACLE' src/backend/executor/execExprInterp.cLength of output: 55
🏁 Script executed:
#!/bin/bash # Search for any remaining DB_ORACLE references across the entire repository rg -n 'DB_ORACLE' # Locate the ora_compatible.h file and verify that ORA_PARSER is defined file=$(fd -t f ora_compatible.h | head -n1) echo "Inspecting: $file" rg -n 'ORA_PARSER' "$file"Length of output: 4132
Replace all remaining
DB_ORACLEchecks withORA_PARSERfor consistency
ORA_PARSERis correctly defined insrc/include/utils/ora_compatible.h(line 33), but there are still many residualDB_ORACLEreferences across the codebase. Please update or remove these to use the newORA_PARSERmode.Key locations to address (run
rg -n 'DB_ORACLE'for the full list):
src/oracle_fe_utils/ora_string_utils.c:158src/fe_utils/string_utils.c:70src/backend/access/transam/xlog.c:5442src/backend/utils/misc/guc_funcs.c:100, 208src/backend/utils/misc/ivy_guc.c:53, 55, 381, 406, 417src/backend/utils/adt/varlena.c:1921, 2189, 2284src/backend/postmaster/postmaster.c:1170, 1321src/backend/parser/parse_expr.c:1962, 2276, 2281src/backend/parser/parse_clause.c:3921src/backend/oracle_parser/ora_scan.l:931- Various
psql,initdb,pg_dump,pg_resetwalandbootstrapfilesAfter updating, rerun:
rg -n 'DB_ORACLE'to confirm no legacy references remain.
🧹 Nitpick comments (2)
src/backend/parser/parse_clause.c (1)
3923-3926: Update comment to reflectORA_PARSERconstant
The comment above the fallback still referencesDB_ORACLE, but the code now checksORA_PARSER. Please update the comment for consistency and to avoid confusion.Apply this diff:
- * ROWID option was not specified, so use default GUC value, - * but this GUC only valid in DB_ORACLE model + * ROWID option was not specified, so use default GUC value, + * but this GUC only valid in ORA_PARSER modesrc/backend/catalog/namespace.c (1)
4328-4329: ORA_PARSER substitution is correct; typo in inline comment
The condition properly replaces the oldDB_ORACLEcheck withORA_PARSER, aligning with the new compatibility-mode names.
Nit: please correct the inline comment from
/* IvorySQL: case sensitive indentify */
to
/* IvorySQL: case-sensitive identifier handling */
for clarity and correct spelling.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
src/backend/catalog/heap.c(1 hunks)src/backend/catalog/namespace.c(1 hunks)src/backend/commands/explain.c(3 hunks)src/backend/commands/functioncmds.c(1 hunks)src/backend/commands/sequence.c(2 hunks)src/backend/executor/execExprInterp.c(1 hunks)src/backend/executor/nodeModifyTable.c(1 hunks)src/backend/parser/analyze.c(3 hunks)src/backend/parser/parse_clause.c(1 hunks)src/backend/parser/parse_expr.c(1 hunks)src/backend/parser/parse_utilcmd.c(1 hunks)src/backend/tcop/backend_startup.c(2 hunks)src/backend/utils/adt/ri_triggers.c(1 hunks)src/backend/utils/adt/varlena.c(2 hunks)src/backend/utils/misc/ivy_guc.c(3 hunks)src/pl/plisql/src/pl_exec.c(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: contrib_regression
- GitHub Check: oracle_regression (ubuntu-latest)
- GitHub Check: build (ubuntu-latest)
- GitHub Check: pg_regression (ubuntu-latest)
- GitHub Check: oracle_pg_regression (ubuntu-latest)
- GitHub Check: meson_build (ubuntu-latest)
🔇 Additional comments (26)
src/backend/utils/misc/ivy_guc.c (4)
376-376: Changes to compatibility mode check look goodThe symbolic constant
DB_ORACLEhas been replaced withORA_PARSERto use a more specific parser-related identifier, which better reflects the compatibility mode being checked.
384-384: Consistent use of parser-specific identifiersThis is part of the same pattern of replacing database compatibility constants with more specific parser identifiers throughout the codebase.
420-421: Appropriate replacement of compatibility constantThe change from
DB_ORACLEtoORA_PARSERis consistent with other changes and better specifies that this is about the parser mode specifically.
430-430: Consistent constant replacementReplacing
DB_PGwithPG_PARSERmaintains consistency with the other changes throughout the codebase.src/backend/utils/adt/ri_triggers.c (1)
1882-1882: Oracle compatibility check updated correctlyChanged from
DB_ORACLEtoORA_PARSERto align with the more specific parser compatibility constant used elsewhere in the codebase.src/backend/commands/functioncmds.c (5)
610-610: Database compatibility check updated properlyThe symbolic constant
DB_ORACLEhas been replaced withORA_PARSERin the condition that handles Oracle's "deterministic" equivalent to PostgreSQL's "volatility" attribute.
629-629: Oracle compatibility check updatedGood replacement of
DB_ORACLEwithORA_PARSERfor the check handling Oracle's "authid" equivalent to PostgreSQL's "security" attribute.
677-677: Consistent renaming of compatibility constantThe change from
DB_ORACLEtoORA_PARSERmaintains consistency with the other changes in the codebase.
976-977: Oracle security context default properly updatedUpdated the compatibility check for setting the default security context for plisql functions.
2480-2484: Default language selection updated correctlyChanged the condition that determines the default language for anonymous code blocks from
DB_ORACLEtoORA_PARSER, maintaining the same behavior where "plisql" is the default in Oracle mode and "plpgsql" otherwise.src/backend/tcop/backend_startup.c (2)
774-774: Consistent compatibility mode constant update.The change from
DB_ORACLEtoORA_PARSERfor compatibility check is part of a broader update to use more specific constants across the codebase for parser mode checking.
827-827: Consistent compatibility mode constant update.The change from
DB_ORACLEtoORA_PARSERmaintains the same logical behavior while using the more specific identifier for Oracle parser compatibility mode.src/backend/parser/parse_utilcmd.c (1)
306-306: Consistent compatibility mode constant update.The change from
DB_ORACLEtoORA_PARSERaligns with the symbolic constant standardization across the codebase. This maintains the same behavior for detecting "rowid" column name conflicts in Oracle compatibility mode.src/pl/plisql/src/pl_exec.c (1)
7466-7473:Details
❓ Verification inconclusive
Ensure correct Oracle compatibility check
The condition now uses the newORA_PARSERmacro instead of the oldDB_ORACLE, aligning with the updated compatibility-mode identifiers. Please verify that:
compatible_dbis set toORA_PARSERin all relevant contexts before this check.- There are no remaining uses of
DB_ORACLEin this file that could cause inconsistent behavior.Run this script to confirm no
DB_ORACLEreferences remain in this file:
🏁 Script executed:
#!/bin/bash # Description: Search for obsolete compatibility macro in pl_exec.c rg -n "DB_ORACLE" src/pl/plisql/src/pl_exec.cLength of output: 45
🏁 Script executed:
#!/bin/bash # Verify ORA_PARSER usage and 'compatible_db' assignments in pl_exec.c # Confirm no remaining DB_ORACLE references rg -n "DB_ORACLE" src/pl/plisql/src/pl_exec.c # List all uses of the new ORA_PARSER macro rg -n "ORA_PARSER" src/pl/plisql/src/pl_exec.c # Check where compatible_db is assigned or compared rg -n "compatible_db" src/pl/plisql/src/pl_exec.cLength of output: 302
🏁 Script executed:
#!/bin/bash # Search for assignments of ORA_PARSER to compatible_db across the repository rg -n "compatible_db\s*=\s*ORA_PARSER" .Length of output: 42
Verify
compatible_dbinitialization for ORA_PARSER usage
I checkedsrc/pl/plisql/src/pl_exec.cand across the repo:
- No remaining
DB_ORACLEreferences inpl_exec.c.- Only one
ORA_PARSERcheck at line 7446:if (compatible_db == ORA_PARSER && (rec->datatype->typoid == ROWIDOID || …- No direct assignment of
compatible_db = ORA_PARSERfound anywhere.Please confirm that
compatible_dbis properly initialized or set toORA_PARSERbefore this conditional, or add the necessary assignment to ensure this branch can ever be taken.src/backend/commands/sequence.c (2)
2455-2457: Compatibility mode constant updated correctly.The change from
DB_ORACLEtoORA_PARSERis part of a broader refactor to use more precise parser-specific constants throughout the codebase. This helps clarify that the compatibility setting is specifically related to the parser behavior rather than general database compatibility.
2464-2472: Compatibility mode constant updated correctly.The change from
DB_PGtoPG_PARSERmaintains consistency with the updated naming convention for compatibility mode constants. This change aligns with the broader refactoring effort to make compatibility checks more specific to parser behavior.src/backend/catalog/heap.c (1)
501-502: Compatibility mode constant updated appropriately.The code correctly updates from
DB_ORACLEtoORA_PARSERin the condition that checks whether to skip the system attribute name collision check for the "rowid" attribute name. This is part of a systematic update to use parser-specific constants throughout the codebase.src/backend/utils/adt/varlena.c (2)
3922-3930: Use ORA_PARSER in GUC list splitting logic
Updated condition correctly gates case transformation under Oracle compatibility mode (ORA_PARSER) when bothenable_case_switchandidentifier_case_switch == INTERCHANGEare true. This mirrors the change inSplitIdentifierString.
3575-3583:Details
✅ Verification successful
Use ORA_PARSER instead of DB_ORACLE to guard Oracle-compatibility behavior
The updated condition correctly checkscompatible_db == ORA_PARSER(Oracle syntax compatibility mode) before applying case-switch logic on quoted identifiers. This aligns with the broader refactor replacingDB_ORACLEwithORA_PARSERfor parser-mode semantics. Please ensure thatORA_PARSERis defined and documented inutils/ora_compatible.hand that elsewhere in this module no residual checks still useDB_ORACLE.Run:
to confirm no lingering uses of
DB_ORACLE.
🏁 Script executed:
rg -n "compatible_db == .*DB_ORACLE" src/backend/utils/adt/varlena.cLength of output: 70
ORA_PARSER conditional validated
I ranrg -n "compatible_db == .*DB_ORACLE" src/backend/utils/adt/varlena.cand found no matches, confirming there are no leftoverDB_ORACLEchecks in that file. WithORA_PARSERdefined and documented inutils/ora_compatible.h, the quoted‐identifier case‐switch logic is correctly guarded.src/backend/parser/analyze.c (2)
2465-2465: Compatibility constant renamed correctly.The compatibility check now uses the symbolic constant
ORA_PARSERinstead of the previousDB_ORACLE, which aligns with the new naming convention used throughout the codebase.
2603-2603: Compatibility constant renamed correctly.The compatibility check now uses the symbolic constant
PG_PARSERinstead of the previousDB_PG, which is consistent with the renaming pattern throughout the codebase.src/backend/commands/explain.c (3)
4349-4350: Correct replacement of DB_ORACLE with ORA_PARSER for merge skipped-path assertion.The assertion guarding
skipped_path >= 0now correctly checks againstORA_PARSERinstead of the oldDB_ORACLEconstant, matching the updated compatibility-mode enum. This ensures that Oracle-compat mode skips the assertion.
4366-4367: Skip printing "skipped" tuples in Oracle mode.The new guard
if (compatible_db != ORA_PARSER)wrapped aroundappendStringInfoaligns text-format output with PostgreSQL behavior only. In Oracle-compat mode the "skipped" field is intentionally hidden.
4376-4378: Omit JSON "Tuples Skipped" property for ORA_PARSER.The JSON export now conditionally omits the
"Tuples Skipped"property whencompatible_db == ORA_PARSER. This matches the text output change and maintains consistent behavior across formats.src/backend/executor/nodeModifyTable.c (1)
3590-3613: Replace DB_ORACLE with ORA_PARSER to drive MERGE trigger orderingThe updated branch condition now checks
compatible_db == ORA_PARSERinstead of the oldDB_ORACLE. In the ORA_PARSER path, AFTER STATEMENT triggers for MERGE fire in Oracle’s expected order (UPDATE → DELETE → INSERT), while the else branch retains the original PostgreSQL default order (DELETE → UPDATE → INSERT). Theutils/ora_compatible.hinclude ensuresORA_PARSERis defined.This aligns with the wider refactor to use parser-mode constants. Everything looks correct.
src/backend/parser/parse_expr.c (1)
1110-1110: Appropriate constant name change for better semantics.The change from
DB_ORACLEtoORA_PARSERimproves naming precision, using a parser-specific identifier rather than a more general database identifier. This is consistent with similar changes throughout the codebase to better represent Oracle parser compatibility mode.
Fix issue 763
Summary by CodeRabbit