Skip to content

[YSQL] Fix tuple to string utility functions #26288

Closed
@arpang

Description

@arpang

Jira Link: DB-15633

Description

Tuple to string utility functions (YbHeapTupleToString(), YbHeapTupleToStringWithIsOmitted(), YbTupleTableSlotToStringWithIsOmitted()) have multiple issues:

  • Code duplication across YbHeapTupleToString() and YbHeapTupleToStringWithIsOmitted()
  • YbTupleTableSlotToStringWithIsOmitted() calls YbHeapTupleToStringWithIsOmitted(), but it should be the other way around.
    • Even the implementation is incorrect. YbTupleTableSlotToStringWithIsOmitted() incorrectly asserts that shouldFree should be false. This is not the case for virtual and minimal tuple table slots.
    • ExecFetchSlotHeapTuple() expects the slot to be non-empty. YbTupleTableSlotToStringWithIsOmitted() doesn't make any such check before calling it.

Rework these functions.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions