New
1.81.5
Merged PRs
dolt
- 10405: dolt_commit respects foreign key checks
When
foreign_key_checksis set to 0,dolt_commitshould allow staged working states with foreign key violations. Fixes issue #5605 - 10401: go: sqle: Fix CREATE DATABASE ... COLLATE ... when a non-Dolt database is the current connection's database.
- 10384: Add
editsupport to rebase. This changes adds the abilityeditin the middle of arebase --interactivesession.
go-mysql-server
- 3410: Replace
Time.Subcall inTIMESTAMPDIFFwithmicrosecondsDifffixes dolthub/dolt#10397Time.Subdoesn't work for times with a difference greater than 9,223,372,036,854,775,807 (2^63 - 1) nanoseconds, or ~292.47 years. This is becauseTime.Subreturns aDuration, which is really anint64representing nanoseconds. MySQL only stores time precision to the microsecond so we actually don't care about the difference in nanoseconds. However, there's no easy way to directly expose the number of microseconds or seconds since epoch using the public functions forTime-- this is because seconds since epoch are encoded differently with different epochs depending on whether the time is monotonic or not (Jan 1, 1885 UTC or Jan 1, 0001 UTC).Time.SubusesTime.secto normalizeTimeobjects to seconds since the Jan 1, 0001 UTC epoch. ButTime.secisn't public so we can't call it ourselves. AndTime.SecondandTime.Nanosecondonly give the second and nanosecond portion of a wall time, not the seconds/nanoseconds since an epoch. However,Time.UnixMicrodoes give us the microseconds since Unix epoch (January 1, 1970 UTC)...by callingTime.secand then converting that to Unix time. SomicrosecondsDiffcalculates the difference in microseconds between twoTimeobjects, getting their microsecond values by callingTime.UnixMicroon both of them. This isn't the most efficient but it's the best we can do with public functions. - 3409: Calculate
monthandquarterfor timestampdiff based on date and clock time values fixes dolthub/dolt#10393 Refactors logic foryearinto separate functionmonthDiffso that it can be reused formonthandquarter - 3408: Added runner to hooks
This adds a
sql.StatementRunnerto all hooks, as they may want to execute logic depending on the hook statement. For example, cascade table deletions could literally just runDROPon the cascading items when dropping a table rather than trying to manually craft nodes which are subject to change over time. - 3407: Calculate
yearfortimestampdiffbased on date and clock time values fixes dolthub/dolt#10390 Previous calculation incorrectly assumed every year has 365 days (doesn't account for leap years) and month has 30 days (doesn't account for over half the months). The offset from this wasn't noticeable with smaller time differences but became apparent with larger time differences. This still needs to be fixed formonthandquarter(#10393) - 3400: Allow pushing filters past Project nodes
The analyzer tries to improve query plans by moving filter expressions to be directly above the table that they reference. Previously, this had a limitation in that it would treat references to aliases in Project nodes as opaque: if the alias expression references a table, the analysis wouldn't consider the filter to reference that table.
As a result, it wasn't possible to push a filter into multiple subqueries unless a previous optimization eliminated the Project node.
This PR enhances the analysis with the following steps:
- Every alias on a Project node has a unique column id, so we walk the plan tree to build a map from Project column ids to the underlying expressions.
- When computing which filter expressions can be pushed to which tables, we normalize the filter expressions by replacing GetFields on a Project with the underlying expression.
- When pushing a Filter above a table or into a subquery, we also replace GetFields on a Project with the underlying expression. Reasoning about the safety is tricky here. We should replace a GetField with the underlying expression if and only if we're actually moving the Filter beneath the Project. The main concerns would be:
- If a join plan has two Project nodes without an opaque node (like a SubqueryAlias) between them, then a Filter might only get pushed beneath one Project, but references to both Projects in the filter expression could get unwrapped.
- If a join plan has a Project node in one child, and a Table in the other, then a filter expression could get pushed to be above the Table even if it references the Project In practice I don't think the first concern can happen because it would require that the filter is getting pushed to some nameable-but-not-opaque node between the Projects, which I don't think exists. The second concern requires that the project aliases an expression that doesn't reference any tables but can't be replaced with its underlying expression in a filter, and I don't think that's possible either.
vitess
- 453: Add support for serializing optional table map metadata
To support
@@binlog_row_metadata = 'FULL', we need support for serializing optional table map metadata. - 452: Bump google.golang.org/grpc from 1.24.0 to 1.56.3 Bumps google.golang.org/grpc from 1.24.0 to 1.56.3.