-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release-20.1: sql: propagate opt types through renders #49353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)
hmmm i think the test this was supposed to fix is not working:
|
Previously, folded expressions would sometimes get improperly typed, because the optimizer type would be lost and replaced with the ResolvedType of the folded expression. Datums can sometimes have imprecise ResolvedTypes if they were created from expressions with non-canonical types of a family. Fixes cockroachdb#48563. Release note (bug fix): improve accuracy of column types returned from queries to improve PostgreSQL compatibility.
07d5ade
to
c83f61f
Compare
@RaduBerinde & @jordanlewis can you think of anything that might be missing here? |
You would also need to backport @RaduBerinde's patch #48652 |
That one has been backported here: #49331 |
I don't get it either.. Without this PR we have
And with this PR we have
So it looks like the top planNode has the correct type.. |
Ah, lol, I think it's this map: cockroach/pkg/sql/pgwire/types.go Line 67 in c83f61f
|
I think we need this: #44471 |
I fell less and less comfortable making these changes in 20.1.x.. |
Ah right I remember seeing that before... Thanks for the find. I'm fine abandoning this backport, if that's the vibe people are having. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that we shouldn't make a backwards-compat breaking change in a point release, unless we had an extraordinary reason to do so, agreement from all stakeholders, thorough documentation and education, etc.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jordanlewis)
Agreed. This was initially intended to be a small bugfix (filling in missing data), but now it's become something more than that. Closing this. |
Backport 1/1 commits from #48619.
/cc @cockroachdb/release
Previously, folded expressions would sometimes get improperly typed,
because the optimizer type would be lost and replaced with the
ResolvedType of the folded expression. Datums can sometimes have
imprecise ResolvedTypes if they were created from expressions with
non-canonical types of a family.
Fixes #48563.
Release note (bug fix): improve accuracy of column types returned
from queries to improve PostgreSQL compatibility.