Skip to content

fix a bug for psql tab-completion showing INVISIBLEINCREMENT - #1139

Merged
gaoxueyu merged 1 commit into
IvorySQL:masterfrom
yuanyl630:master
Dec 30, 2025
Merged

gaoxueyu merged 1 commit into
IvorySQL:masterfrom
yuanyl630:master

Conversation

@yuanyl630

@yuanyl630 yuanyl630 commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

This PR fixes a bug for psql tab-completion showing INVISIBLEINCREMENT.
Fixes #1135

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved command-line completion suggestions for ALTER TABLE ALTER COLUMN operations. Users will now see a more complete list of available options when using the tab-completion feature in the PostgreSQL interactive terminal.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The pull request fixes a bug in psql tab-completion where a missing comma caused string literal concatenation in C. The change adds a comma after "INVISIBLE" in the COMPLETE_WITH macro argument list in tab-complete.in.c, preventing "INVISIBLE" and "INCREMENT" from being merged into "INVISIBLEINCREMENT" as a single completion suggestion.

Changes

Cohort / File(s) Summary
Tab-completion bug fix
src/bin/psql/tab-complete.in.c
Added trailing comma after "INVISIBLE" string literal to prevent unintended concatenation with subsequent string literals in the COMPLETE_WITH argument list for ALTER TABLE ALTER COLUMN SET command completions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line fix with clear intent
  • Bug cause is explicitly documented in the linked issue
  • No logic, control flow, or functional changes
  • Straightforward string literal syntax correction

Suggested reviewers

  • jiaoshuntian

Poem

🐰 A comma lost, two words became one—
Our whiskers twitched when tab-complete went wrong!
But now with just a wee punctuation mark,
INVISIBLE and INCREMENT shine bright and stark! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly describes the bug being fixed: a psql tab-completion issue showing 'INVISIBLEINCREMENT' as one token instead of two separate options.
Linked Issues check ✅ Passed The code change (adding a comma after 'INVISIBLE') directly addresses the root cause identified in issue #1135, fixing the C string literal concatenation bug.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to fixing the specific bug: adding a trailing comma in the COMPLETE_WITH macro call to prevent unintended string concatenation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bcdd6f and 9f27463.

📒 Files selected for processing (1)
  • src/bin/psql/tab-complete.in.c (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: contrib_regression
  • GitHub Check: meson_build (ubuntu-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: pg_regression (ubuntu-latest)
  • GitHub Check: oracle_regression (ubuntu-latest)
  • GitHub Check: oracle_pg_regression (ubuntu-latest)
🔇 Additional comments (1)
src/bin/psql/tab-complete.in.c (1)

2904-2908: Fix correctly separates INVISIBLE and INCREMENT completions

Adding the comma so that "INVISIBLE" and "INCREMENT" are distinct arguments to COMPLETE_WITH fixes the concatenation bug and will now surface two separate completion options instead of INVISIBLEINCREMENT, without impacting the rest of the ALTER TABLE ... ALTER [COLUMN] ... SET completion list.


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.

@gaoxueyu
gaoxueyu merged commit 25feade into IvorySQL:master Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

psql tab-completion shows "INVISIBLEINCREMENT" instead of separate "INVISIBLE" and "INCREMENT" options

3 participants