Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bumpCreated with
brew bump-formula-pr.release notes
Fixes dolthub/dolt#9817
Companion dolthub/go-mysql-server#3208, dolthub/dolt#9824
context cancelederror fordolt_test_run()Changes:
Close()calls missed in fix context cancel indolt_test_run()when runningdolt sql-serverdolthub/dolt#9811dolt_branchessystem tableAllows creating foreign keys on user tables that reference the
namecolumn on thedolt_branchestable.Fixes: Extending Dolt system tables, specifically
dolt_branch, via foreign key dolthub/dolt#9712go-mysql-server
fixes dolthub/dolt#9820
Also rename left and right to primary and secondary to follow the same pattern as other join iterators
bit_lengthFixes dolthub/dolt#9818
Fixes dolthub/dolt#9817
Subquery caching rules onceAfterAll dolthub/go-mysql-server#1470 was supposed to, among other things, add restrictions to when we generate
CachedResultsnodes to cache subquery results. However, the added check is overly broad, and as a result it became impossible to actually cache subquery results. Currently, there is not a single plan test that contains aCachedResultsnode in the output plan.The
cacheSubqueryAliasesInJoinsfunction has a comment://The left-most child of a join root is an exception that cannot be cached.CachedResultsnodes before we finished resolving references in the query, and now we wait until after. So it's possible that this is the reason for the restriction, and the entire check is no longer necessary.Either way, the implementation is more restrictive than the comment would suggest. Due to how the algorithm tracks state via function parameters, it doesn't propagate state from a child node to it's parents/siblings, and the flag for recording that it's encountered a subqeury gets unset. As a result, no Subqueries will actually be cached.
This PR fixes the tree walk to correctly remember once it's encountered a subquery and allow subsequent subqueries to be cached. This is still more broad than the comment would suggest, since it doesn't require that this subquery appear in the left-most child of the join.
Among the changed plan tests, we see that
CachedResultsnodes are now emitted. Most of them are the children ofHashLookups, but there are some that are the children ofInnerJoinandSemiJoinnodes where one of the things being joined is a subquery.Closed Issues
dolt_branch, via foreign keyView the full release notes at https://github.com/dolthub/dolt/releases/tag/v1.59.7.