Skip to content

sql: use a reusable name resolution algo for star expansions#24811

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180415-star-regression
Apr 16, 2018
Merged

sql: use a reusable name resolution algo for star expansions#24811
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180415-star-regression

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Apr 15, 2018

Fixes #24169.

A previous patch has added a reusable name resolution mechanism which
encapsulates all the special cases supported CockroachDB into a single
code path. This covers both the resolution of object names and column
names.

Prior to this patch however, the expansion of qualified stars was
using a separate code path. This proved to be incorrect/insufficient
however, because one of the special cases of name resolution should
apply to star expansion too and the separate code path did not contain
the special case.

To solve this problem, this patch abstracts the resolution of
qualified stars in a common algorithm alongside the others (in
sem/name_resolution.go) and ensures it is used where applicable.

Release note (bug fix): CockroachDB now again allows to use a simply
qualified table name in qualified stars (e.g., SELECT mydb.kv.* FROM kv), for compatibility with CockroachDB v1.x.

A previous patch has added a reusable name resolution mechanism which
encapsulates all the special cases supported CockroachDB into a single
code path. This covers both the resolution of object names and column
names.

Prior to this patch however, the expansion of qualified stars was
using a separate code path. This proved to be incorrect/insufficient
however, because one of the special cases of name resolution should
apply to star expansion too and the separate code path did not contain
the special case.

To solve this problem, this patch abstracts the resolution of
qualified stars in a common algorithm alongside the others (in
`sem/name_resolution.go`) and ensures it is used where applicable.

Release note (bug fix): CockroachDB now again allows to use a simply
qualified table name in qualified stars (e.g., `SELECT mydb.kv.* FROM
kv`), for compatibility with CockroachDB v1.x.
@knz knz requested review from a team, jordanlewis and rytaft April 15, 2018 18:08
@knz knz requested a review from a team as a code owner April 15, 2018 18:08
@knz knz requested review from a team April 15, 2018 18:08
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Apr 15, 2018

@jordanlewis ok to cherry-pick this to 2.0.x?

@knz knz requested a review from justinj April 16, 2018 15:12
@justinj
Copy link
Copy Markdown
Contributor

justinj commented Apr 16, 2018

:lgtm:


Review status: 0 of 7 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@rytaft
Copy link
Copy Markdown
Collaborator

rytaft commented Apr 16, 2018

:lgtm:


Reviewed 7 of 7 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Apr 16, 2018

thanks!

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Apr 16, 2018

bors r+

craig bot pushed a commit that referenced this pull request Apr 16, 2018
24811: sql: use a reusable name resolution algo for star expansions r=knz a=knz

Fixes #24169.

A previous patch has added a reusable name resolution mechanism which
encapsulates all the special cases supported CockroachDB into a single
code path. This covers both the resolution of object names and column
names.

Prior to this patch however, the expansion of qualified stars was
using a separate code path. This proved to be incorrect/insufficient
however, because one of the special cases of name resolution should
apply to star expansion too and the separate code path did not contain
the special case.

To solve this problem, this patch abstracts the resolution of
qualified stars in a common algorithm alongside the others (in
`sem/name_resolution.go`) and ensures it is used where applicable.

Release note (bug fix): CockroachDB now again allows to use a simply
qualified table name in qualified stars (e.g., `SELECT mydb.kv.* FROM
kv`), for compatibility with CockroachDB v1.x.

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 16, 2018

Build succeeded

craig bot pushed a commit that referenced this pull request Apr 16, 2018
24817: cherrypick-2.0: sql: fix qualified index name resolution r=knz a=knz

Picks #24778.
cc @cockroachdb/release 

24842: cherry-pick 2.0: sql: use a reusable name resolution algo for star expansions r=knz a=knz

Picks #24811.
cc @cockroachdb/release 

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig craig bot merged commit 0f4d99f into cockroachdb:master Apr 16, 2018
@knz knz deleted the 20180415-star-regression branch April 27, 2018 18:43
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.

v2.0-beta.20180319: Regression in star queries

4 participants