Skip to content

opt: fix ResolvedType() for aggregateInfo in the optbuilder#50815

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rytaft:comparison-error
Jun 30, 2020
Merged

opt: fix ResolvedType() for aggregateInfo in the optbuilder#50815
craig[bot] merged 1 commit intocockroachdb:masterfrom
rytaft:comparison-error

Conversation

@rytaft
Copy link
Copy Markdown
Collaborator

@rytaft rytaft commented Jun 30, 2020

Prior to this commit, it was possible that calling ResolvedType()
on an aggregateInfo object returned the wrong type. This was because
aggregateInfo did not implement ResolvedType(), and was therefore
passing the call to the embedded tree.FuncExpr, which may have been
stripped of its original type information. This commit fixes the
problem by adding an implementation of ResolvedType() to aggregateInfo,
which simply returns the type of the aggregation column represented by
the struct.

Fixes #46914

Release note (bug fix): Fixed an internal error that could happen
during planning for some queries with aggregate functions embedded in
complex scalar expressions.

@rytaft rytaft requested a review from RaduBerinde June 30, 2020 12:54
@rytaft rytaft requested a review from a team as a code owner June 30, 2020 12:54
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)

Prior to this commit, it was possible that calling ResolvedType()
on an aggregateInfo object returned the wrong type. This was because
aggregateInfo did not implement ResolvedType(), and was therefore
passing the call to the embedded tree.FuncExpr, which may have been
stripped of its original type information. This commit fixes the
problem by adding an implementation of ResolvedType() to aggregateInfo,
which simply returns the type of the aggregation column represented by
the struct.

Fixes cockroachdb#46914

Release note (bug fix): Fixed an internal error that could happen
during planning for some queries with aggregate functions embedded in
complex scalar expressions.
@rytaft rytaft force-pushed the comparison-error branch from 2efb785 to bcc89ba Compare June 30, 2020 15:52
@rytaft
Copy link
Copy Markdown
Collaborator Author

rytaft commented Jun 30, 2020

TFTR!

bors r+

craig bot pushed a commit that referenced this pull request Jun 30, 2020
50709: sql,execinfrapb: DistSQLPlanner and related changes for inverted join r=sumeerbhola a=sumeerbhola

Release note: None

50760: backupccl: fix formatting of backup jobs in jobs table r=pbardea a=pbardea

When adding cluster backup/restore, the method which generated the job
description was not updated to handle cluster backups. Previously, a
cluster backup job would appear in the jobs table as `BACKUP TABLE TO`
rather than `BACKUP TO`.

Release note (bug fix): Cluster backup would previously appear as
`BACKUP TABLE TO` rather than `BACKUP TO` in the jobs table.

50770: roachtest: update version map and create fixtures r=jlinder a=asubiotto

This commit adds the recently released 19.1.10, 19.2.8, and 20.1.3 to the
version map in PredecessorVersion.

Release note: None (testing change)

50815: opt: fix ResolvedType() for aggregateInfo in the optbuilder r=rytaft a=rytaft

Prior to this commit, it was possible that calling `ResolvedType()`
on an `aggregateInfo` object returned the wrong type. This was because
`aggregateInfo` did not implement `ResolvedType()`, and was therefore
passing the call to the embedded `tree.FuncExpr`, which may have been
stripped of its original type information. This commit fixes the
problem by adding an implementation of `ResolvedType()` to `aggregateInfo`,
which simply returns the type of the aggregation column represented by
the struct.

Fixes #46914

Release note (bug fix): Fixed an internal error that could happen
during planning for some queries with aggregate functions embedded in
complex scalar expressions.

Co-authored-by: sumeerbhola <sumeer@cockroachlabs.com>
Co-authored-by: Paul Bardea <pbardea@gmail.com>
Co-authored-by: Alfonso Subiotto Marques <alfonso@cockroachlabs.com>
Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 30, 2020

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 30, 2020

Build succeeded

@craig craig bot merged commit a6a58f4 into cockroachdb:master Jun 30, 2020
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.

Internal error: lookup for ComparisonExpr ((@2)[float] != ('NaN')[string])[bool]'s CmpOp failed

3 participants