Skip to content

Wip - Bug fix pg dump "cannot duplicate null pointer" if DB contain packages - #856

Closed
yasir-hussain-shah wants to merge 4 commits into
IvorySQL:IVORY_REL_4_STABLEfrom
yasir-hussain-shah:WIP-bug-fix-pg_dump--cannot-duplicate-null-pointer
Closed

yasir-hussain-shah wants to merge 4 commits into
IvorySQL:IVORY_REL_4_STABLEfrom
yasir-hussain-shah:WIP-bug-fix-pg_dump--cannot-duplicate-null-pointer

Conversation

@yasir-hussain-shah

@yasir-hussain-shah yasir-hussain-shah commented Aug 26, 2025 •

Copy link
Copy Markdown
Contributor
  • Fix the pg_dump bug throwing error "cannot duplicate null pointer" if DB to be dumped contain packages

  • Add TAP tests to pg_dump utility to cover the packages in dump

    • New test file added for oracle compatible packages pg_dump/t/006_pg_dump_ora_specific.pl
    • TAP tests can be executed as:
cd src/bin/pg_dump
make oracle-check PROVE_TESTS='t/006_pg_dump_ora_specific.pl'
or 
make oracle-check PROVE_TESTS='t/006_pg_dump_ora_specific.pl' PROVE_FLAGS='--verbose'
  • Add support for connection to ivorysql.port for TAP tests execution

Fixes Bug#857

@coderabbitai

coderabbitai Bot commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yasir-hussain-shah

Copy link
Copy Markdown
Contributor Author

Bug reproduction steps:

  1. Create a fresh data directory and start the server:
initdb test_data_dir

pg_ctl -D test_data_dir  -l logfile start
  1. Create a fresh database and create a simple package in it:
psql -h localhost -U ivorysql -d ivorysql -p 1521 -c "create database testdb;"

psql -h localhost -U ivorysql -d testdb -p 1521 -c "CREATE OR REPLACE PACKAGE test_pkg AS
  FUNCTION hello() RETURN text;
END test_pkg;
CREATE OR REPLACE PACKAGE BODY test_pkg AS
  FUNCTION hello() RETURN text IS
  BEGIN                          
    RETURN 'Hello from test package';
  END;                               
END test_pkg;"
  1. Take the dump:
pg_dump -h localhost -p 1521 -U ivorysql testdb
or
pg_dump -h localhost -U ivorysql testdb
  1. Notice that following error occurs:
pg_dump -h localhost -p 1521 -U ivorysql testdb
cannot duplicate null pointer (internal error)

@gaoxueyu
gaoxueyu requested a review from bigplaice August 27, 2025 07:04
@yasir-hussain-shah

Copy link
Copy Markdown
Contributor Author

Opened a new PR#871 instead of this. So closing this.

@yasir-hussain-shah
yasir-hussain-shah deleted the WIP-bug-fix-pg_dump--cannot-duplicate-null-pointer branch August 7, 2026 12:47
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