Merged PRs
dolt
- 10248: Return nil lookupMapping if type conversion is not in range for lookup key
fixes #10233
Not checking if a value is in the converted range was causing us to use incorrect keys. For example, if the literal-87840was used as a key for a boolean/tinyint column, it would get converted to-128and match rows with-128, even though that's not the same value.
This change checks for if a conversion isInRange, and if it's not, it returns a nillookupMapping. The nillookupMappingwill then return false when*lookupMapping.valid()is called.
Test added in dolthub/go-mysql-server#3357 - 10247: use pointer for TupleComparator
This PR changes theDefaultTupelComparatorto be a pointer receiver, and changesFixedAccessto only use half the number of indices. - 10237: avoid map in
GetFieldValue
Some of the runtime is taken up bymapaccess, which isn't necessary; this PR gets rid of it. - 10228: Add support for merge --ff--only
Fixes: #10151 - 10220: bug fix: stop including all root objects when getting tables on the search path
In Doltgres,SHOW TABLESwas returning table names as well as other root object names, like sequence names. This PR changes theTablesOnSearchPathfunction to stop returning the other root object names.
Related to:
dolthub/doltgresql#1743
go-mysql-server
- 3358: condense
time.Timelibrary calls
Instead of callingYear(),Month(),Day(),Hours(),Minutes(), andSeconds()individually, just usetime.Date()andtime.Clock().
Benchmarks: #10249 (comment) - 3356: Return boolean literal when simplifying
ANDandORfilters
fixes #10243
Previously, if one of the children of anANDorORexpression was a literal that evaluated tofalseortrue(respectively), we would return the child. However, this caused a typing issue sinceANDandORare booleans while its children can be of any type. Take the expression19 or 's'for example; the left child19evaluates totrue, making the expression true every time, but returning the left child19as a simplification would be incorrect since we would want the expression to simplify to a booleantrue, not the number 19.
Now, instead of returning the child that determines the result of anANDorORexpression, we return the boolean value that the expression results to. - 3355: Do not use nullable columns as null filter when converting antijoins to left joins
fixes #10234
When converting an antijoin to a left join, it is normally okay to use a nullable GetField in a null filter. However, we cannot do so if GetField is both nullable and part identifying an expression's parent during InspectExpr so we have to be extra safe by not allowing nullable GetFields in null filters at all. - 3352: Use concurrency in groupby
compute
Splits up thecomputeingroupByGroupingIterinto two threads:- That reads rows off disk into a
sql.Rowbuffer - That processes each row and updates the aggregation buffer
Benchmarks: #10232 (comment)
- That reads rows off disk into a
- 3350: Updated
IsNullablefor all functions to matchEvaloutput
fixes #10161 - 3349: Add User Variable discards and fix per-row field to column indices for
LOAD DATA
LOAD DATAhas been ingesting user variable related fields into the rows used to evaluate set expressions. This fix resolves this issue, and as a result adds the feature to use user variables to discard fields from a parsed file line.
Default initialization of expressions has also been updated to follow MySQL's "zero value" behavior for non-nullable columns. - 3348: avoid heap allocs in
transform.Inspectandtransform.InspectExpr
Changes:transform.Inspectswitches onUnaryNodeandBinaryNodeto avoid heap allocations fromnode.Children()transform.InspectExprswitches onUnaryExpressionandBinaryExpressionto avoid heap allocations fromexpression.Children()- remove
UnaryExpressionimplementation fromunaryAggBaseand some functions that can return multiple children.
Benchmarks: #10222 (comment)
- 3347: Customizable filter walk for costed index scan
This is to support Doltgres, which has extra nodes in its expression trees in some cases. - 3345: various
analyzerandplanbuilderoptimizations
Changes:- rewrote
convertIntto call strings library fewer times - use casting to detect rounding in index builder
- separate code for
InspectExpr() - simplify
isEvaluableinto single pass - replace more
Sprintfwith simple string concatenation - have
iScanAndcount children as they are added
benchmarks: #10210 (comment)
- rewrote
- 3343: Check if key is convertible before memoizing lookup join
fixes #10186
Numeric types cannot be used as keys for String type columns due to the way the types convert. For example, a String with a value "i" is equivalent to 0; however, 0 converts to "0" as a String and therefore cannot be used as key to index to "i".
Doltgres companion PR dolthub/doltgresql#2121 - 3342: Set
SubqueryAlias.OuterScopeVisibilityto true if inside trigger scope
Fixes #10175
Trigger scopes were being included when determining exec indexes forSubqueryAliaschild nodes but were not actually passed down to child iterators during rowexec (code). As a result, we were getting index out of bounds errors since the trigger scopes were not included in the parent row.
Since there's no easy way to separate the trigger scope columns out from the rest of the parent row during rowexec, it was easier to just markSubqueryAlias.OuterScopeVisibilityinside triggers to true. I think it technically does make sense here because the trigger scope is an outer scope that theSubqueryAliasdoes have visibility of, but I added a TODO comment in case this is incorrect.
Closed Issues
- 10233: Lookup Join returns incorrect result due to out-of-range key conversion
- 10250: LookupJoin not getting picked when join order hint is applied
- 10246: Unexpected LEFT JOIN Result
- 10243: Unexpected Anti Join Result
- 10234: Unexpected Anti Join Result
- 10151: Support
merge --ff-onlyflag - 10099: Audit
IsNullablefor functions and expressions - 10161: Audit
IsNullablefor all functions - 9974: support JSON diff function
- 10186: Unexpected Result Under Hint
- 10180: Performance regression in queries with multiple JOINs between versions 1.76.6 and 1.78.5