Merged PRs
dolt
- 10526: fix dependabot security alerts
go-mysql-server
- 3438: Implement
sql.StringTypeinterface forsystemStringType
fixes #10534
part of #10535 - 3436: Get index column name using offset from table name prefix length
fixes #10527
Using the index of the first found.rune as an offset to get an index column name was causing column names to not be correctly matched when the table name contained periods. Using the length of the table name as an offset avoids this issue and is also slightly more performant. - 3434: /_integration/php: fix cve
- 3433: Correctly compute scopeLen for joins
In a join node, thescopeLenvariable is the total number of columns that represent values from outer scopes.
Previously, we set this value equal to the number of columns in the immediate parent scope. When there are multiple nested scopes, this value is incorrect.
This PR adds an example of when this matters: a non-lateral join in multiple nested scopes would return an incorrect number of columns. A projection above this join would then index into this returned row, resulting in an out-of-bounds error. - 3429: Disallow creating VECTOR indexes on nullable columns
Vector indexes require NOT NULL columns, similar to spatial indexes. Previously, creating a vector index on a nullable column was silently accepted, which could cause runtime panics if any of the elements were NULL.
This adds validation in both the analyzer (CREATE TABLE) and DDL execution (CREATE INDEX / ALTER TABLE) paths, returning a clear error message. - 3428: Refactor how we manage outer scopes in join iteration
There were several problems with the previous join iterator implementation:- Each type of iterator was implemented separately, even though 90% of the logic was identical. But slight variations in how they were written led to bugs that only existed in some but not others.
- The merge join iterator and the full outer join iterator did not correctly handle joins within subqueries.
- Some iterators would not always close child iterators.
The behavior with subqueries is the main motivation for this PR.
Previously, in order to expose values from outer scopes to iterators, we would dynamically inject PrependNodes into subquery build plans. These nodes would insert values into the beginning of returned rows, allowing parent iterators to read them and use them in expressions. To compensate for this, we would also inject StripRowNodes into joins. StripRowNodes are the opposite of PrependNodes, removing columns from their iterators.
This logic was incredibly difficult to reason about correctly: - Injecting values from the outer scope this way inherently complicates iterator logic, particularly for joins.
- StripRowNodes were inserted prior to plan execution (during the assignExecIndexes pass), while PrependNodes were inserted dynamically during plan execution. Both parts of the code had to agree on how many values were being inserted/removed, which required two different packages to understand each other's inner logic. Changes to one would require changes to the other to prevent subtle bugs.
- The current implementation had several bugs in the case of multiple nested scopes:
-- Lateral joins would re-include all the values from the outermost scope in the next scope, effectively doubling the number of columns with each nesting level.
-- StripRowNodes would only be generated based on the innermost scope, resulting in some injected values not being removed.
-- StripRowNodes would be generated under each join node, including between join nodes in a multi-table join. Join nodes would thus would need to re-insert these values in order to compensate... but were expected to not re-insert columns corresponding to values defined by a parent join node, except for lateral joins... reasoning about this correctly quickly becomes untenable.
Ultimately, there's no reason why join nodes can't handle this directly. And removing the StripRowNodes type and replacing it with logic in the join iterators actually makes the logic much more consistent: Parent iterators should assume that all child iterators contain prepended values for outer scopes, and values determined by the node's schema, and nothing else. And the parent iterator returns rows that also have this property.
- 3427: Do not wrap hoisted subquery in Limit node until AFTER checking if it's a SubqueryAlias
Wrapping subquery nodes in aLimitnode before checking if it was aSubqueryAliaswas causing us to not findSubqueryAliasnodes. This was noticed when investigating #10472. We should probably be inspecting the whole node instead of simply checking the node type, but this is a quick fix.
filed #10494 to add better test coverage and address TODOs