opt: fix panic caused by select from table with no columns#28589
opt: fix panic caused by select from table with no columns#28589craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
This commit fixes a panic caused by running `SELECT *` from a table with no visible columns (e.g., a table with only the hidden rowid column). The bug was caused by the optbuilder creating a Presentation slice even when there are no columns to present. Ensuring that the slice is nil in this case fixes the bug. Fixes cockroachdb#28388 Release note: None
madhavsuresh
left a comment
There was a problem hiding this comment.
would it make sense to add a logictest for this? Ensure that the result is empty?
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale)
rytaft
left a comment
There was a problem hiding this comment.
TFTR!
would it make sense to add a logictest for this? Ensure that the result is empty?
That's a good idea, but I don't think it's possible to test this with the logictest framework. As far as I can tell, the typestring is required (e.g., query III, indicating 3 integer columns), so there's no way to indicate 0 columns (@RaduBerinde, please correct me if I'm wrong). I think this existing test is probably good enough:
Reviewable status:
complete! 1 of 0 LGTMs obtained
madhavsuresh
left a comment
There was a problem hiding this comment.
sgtm!
Reviewable status:
complete! 1 of 0 LGTMs obtained
RaduBerinde
left a comment
There was a problem hiding this comment.
Yeah, I don't know how to write a logictest like that. This seems good enough.
Reviewable status:
complete! 1 of 0 LGTMs obtained (and 1 stale)
24194: RFC: parallel commits r=tschottdorf a=tschottdorf The parallel commits tech note describes a proposal for reducing commit latencies. It comes in a basic and extended flavor, the latter of which requiring more engineering work. I believe we should pursue the former sooner rather than later, and make the latter contingent on the fate of the required second tech note, which suggests a new format for transaction IDs and explores some of the expected benefits. Release note: None 28589: opt: fix panic caused by select from table with no columns r=rytaft a=rytaft This commit fixes a panic caused by running `SELECT *` from a table with no visible columns (e.g., a table with only the hidden rowid column). The bug was caused by the `optbuilder` creating a `Presentation` slice even when there are no columns to present. Ensuring that the slice is nil in this case fixes the bug. Fixes #28388 Release note: None Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com> Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
Build succeeded |
This commit fixes a panic caused by running
SELECT *from a tablewith no visible columns (e.g., a table with only the hidden rowid
column). The bug was caused by the
optbuildercreating aPresentationslice even when there are no columns to present. Ensuring that
the slice is nil in this case fixes the bug.
Fixes #28388
Release note: None