Skip to content

read "char" as u8, not char - #358

Merged
serprex merged 1 commit into
mainfrom
qchar-is-u8
Nov 26, 2026
Merged

serprex merged 1 commit into
mainfrom
qchar-is-u8

Conversation

@serprex

@serprex serprex commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Note

Low Risk
Mechanical type and literal churn across catalog, decode, and tests; wire format is unchanged and behavior is stricter for non-ASCII byte values in PG char columns.

Overview
Replaces Rust char with u8 everywhere the code mirrors PostgreSQL’s one-byte "char" catalog fields (relkind, relpersistence, relreplident, attalign, attstorage, and the same on RelDescriptor / RelAttr).

Bridge and SQL paths now treat these as a single raw byte (only_char, pg::char_at) instead of UTF‑8 scalar parsing; user-facing text still uses char::from where needed. Descriptor log encode/decode drops the charlike helper and reads/writes bytes directly. Heap decode alignment uses u8 and removes the old alignment-char validation error.

Call sites, tests, and benches are updated to b'r'-style literals and matches! on byte patterns.

Reviewed by Cursor Bugbot for commit 72f6d16. Bugbot is set up for automated code reviews on this repo. Configure here.

@serprex
serprex requested a review from harshil-goel November 26, 2026 04:34
@serprex
serprex force-pushed the qchar-is-u8 branch 2 times, most recently from 849750a to 14730f0 Compare November 26, 2026 04:36

@security-ai-gate-reviewer security-ai-gate-reviewer 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.

Auto-approved by the AI review gate on 14730f0. Details in the approver's comment on this pull request.

@security-ai-gate-reviewer

security-ai-gate-reviewer Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

AI review gate — auto-approved

72f6d16ce059 is approved by security-ai-gate-reviewer[bot], an automated identity, not a human. The approval stands on the required AI review: Cursor Bugbot concluded green on this commit and the AI review gate is SUCCESS (its own comment has the verdict), and the change touches no path that requires a human reviewer. It is bound to this commit: a new push dismisses it and the approver re-evaluates.

History (latest 5 heads, newest first)

  • 72f6d16ce059 approved — green: Cursor Bugbot
  • 043b33212c14 approved — green: Cursor Bugbot
  • 14730f0bbf68 approved — green: Cursor Bugbot

@security-ai-gate-reviewer security-ai-gate-reviewer 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.

Auto-approved by the AI review gate on 043b332. Details in the approver's comment on this pull request.

@security-ai-gate-reviewer security-ai-gate-reviewer 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.

Auto-approved by the AI review gate on 72f6d16. Details in the approver's comment on this pull request.

@serprex
serprex merged commit 56d53c3 into main Nov 26, 2026
10 checks passed
@serprex
serprex deleted the qchar-is-u8 branch November 26, 2026 05:24
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