Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upsql: properly support CTEs inside views #31007
Conversation
knz
requested review from
jordanlewis and
BramGruneir
Oct 5, 2018
knz
added this to Triage
in SQL Front-end, Lang & Semantics
via automation
Oct 5, 2018
knz
requested review from
cockroachdb/sql-execution-prs
as
code owners
Oct 5, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jordanlewis
reviewed
Oct 5, 2018
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/logictest/testdata/logic_test/dependencies, line 140 at r4 (raw file):
---- descriptor_id descriptor_name index_id dependedonby_id dependedonby_type dependedonby_index_id dependedonby_name dependedonby_details 63 blog_posts_id_seq NULL 64 sequence 0 NULL Columns: [0]
I don't understand these test changes. Why are the descriptor ids changing?
pkg/sql/logictest/testdata/logic_test/pg_catalog, line 284 at r4 (raw file):
4084598993 primary 393119649 0 NULL NULL 0 0 4084598994 t3_a_b_idx 393119649 0 NULL NULL 0 0 4252432642 v1 393119649 0 NULL NULL 0 0
likewise, what caused these changes?
knz
reviewed
Oct 7, 2018
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/logictest/testdata/logic_test/dependencies, line 140 at r4 (raw file):
Previously, jordanlewis (Jordan Lewis) wrote…
I don't understand these test changes. Why are the descriptor ids changing?
The previous code was performing name resolution of the table names on the AST during the semantic analysis, thereby acquiring a lease. This caused the subsequent transaction that was creating the view and update the leased table desc to abort with a retry error. However since the ID generation is not transactional, we'd "lose" a desc ID this way.
The new code skips this name resolution with lease (the name resolution is performed using uncached/unleased table descs instead) and so the retry error does not occur, so the first generated ID can be used.
pkg/sql/logictest/testdata/logic_test/pg_catalog, line 284 at r4 (raw file):
Previously, jordanlewis (Jordan Lewis) wrote…
likewise, what caused these changes?
ditto
knz
added some commits
Oct 5, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
rebased, RFAL |
knz
moved this from Triage
to Current milestone
in SQL Front-end, Lang & Semantics
Oct 8, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
ping? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
(just a rubber stamp since the same commits were approved in #31051) |
jordanlewis
approved these changes
Oct 11, 2018
Oops, I didn't realize that I hadn't reviewed this before letting the backport go in... this all looks good to me but I wonder if @vivekmenezes should take a look with regards to the simpler lease stuff, which I don't quite understand.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
knz
Oct 11, 2018
Member
I think it's fair that Vivek and I look into this together again, because in truth I do not understand all of it myself.
However since this commit went into 2.1 already I will merge the PR as-is. If there are additional fixes needed I'll make a new PR.
Thanks
bors r+
|
I think it's fair that Vivek and I look into this together again, because in truth I do not understand all of it myself. However since this commit went into 2.1 already I will merge the PR as-is. If there are additional fixes needed I'll make a new PR. Thanks bors r+ |
bot
pushed a commit
that referenced
this pull request
Oct 11, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Sounds good |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
craig
bot
commented
Oct 11, 2018
Build succeeded |
knz commentedOct 5, 2018
•
edited
Fixes #23833.