What changed in Dolt from 1 to 2
18 releases numbered after v1.88.2 up to and including v2.7.3, stable releases only. v1.88.2 and v2.7.3 are the newest stable releases of 1 and 2 we track; this page follows them as new ones ship.
- 2 CVEs mentioned
- 2 mention breaking changes
- 3 remove or deprecate something
184 changes across 18 releases
- Add store hooks in nbs so Dolt Enterprise's encryption at rest no longer needs to edit nbs/store.go
- Support unary bitwise complement (~) for numeric and binary operands, preserving full-width masks in mixed signed/unsigned bit operations
- dolt branch --orphan and dolt_branch('--orphan', ...) create a branch whose only commit has no parents and holds the contents of the start point
- Unary bitwise complement (~) is supported for numeric and binary operands, preserving full-width masks in mixed signed/unsigned bit operations.
- PostgreSQL session settings are exposed through Dolt sessions
- Commits can now be made on more than one branch within the same SQL transaction, where previously such transactions failed with an error.
- Multi-branch commits via dolt_commit() are allowed when the new session variable @dolt_multi_branch_commit is set to a true value.
- Normal COMMIT statements can commit to multiple branches when @dolt_transaction_commit is set to a true value.
- A new stored procedure dolt_commit_all() commits all modified branch heads in a single atomic transaction regardless of session variable settings.
- A new dolt_merge_bases() table function returns multiple merge bases.
- The dolt merge-base command accepts an --all flag to list all merge bases.
- Duplicate-key update triggers are executed
- Add git-remote.max-history-commits setting to limit history commits for Git remotes, where 0 means unlimited
- Add git-remote.reset-history-on-prune setting to control whether prune triggers history resets for Git remotes
- Add CSV import regression coverage for update triggers
- Allow DoltgreSQL to override the effective user used for $user substitution in the search path
- Allow DoltgreSQL to provide a branch-control principal
- Add DoltgreSQL transaction lifecycle hooks that report transaction start, the reason a transaction ended (rollback or commit), and savepoint interactions
- Support wildcard table filters REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE for MySQL-to-Dolt binlog replication, including MySQL wildcard matching, precedence, case handling, validation, and SHOW REPLICA STATUS output
- Add native string-list values for REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE with MySQL-compatible format validation and SHOW REPLICA STATUS formatting
- Add parser and AST support for REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE in CHANGE REPLICATION FILTER statements, including empty lists and rejection of unquoted patterns
- Implement NULL ordering so NULLs can be set to sort first or last
- Added a warning when a lone dolt_checkout() call in noninteractive SQL changes only the SQL session's branch, leaving the CLI branch unchanged
- Added virtual name indexes with cached ref lookups for dolt_tags and dolt_branches
- Statement cancellation is supported in the interactive SQL shell via \c, so canceled inserts leave the table empty
- Add DESC indexes and NULL ordering, allowing NULLs to be sorted first or last
- Report branch update, forced update, and tag status with commit transition ranges on dolt push
- Add --prune-with-grace-period flag to dolt backup sync and dolt backup sync-url to remove unreferenced table files from the destination store before a sync when no file there is newer than the grace period
- Defer materializing table writer edits until the working set is read, so pending edits are visible to working set readers
- Read a branch state's working set only through context-taking methods WorkingSet(ctx), WorkingRoot(ctx) and roots(ctx); SessionState WorkingSet and WorkingRoot now take a context and return an error
- Have each DoltTransaction own the branch states it loads, and drop unowned branch states in SetTransaction after checking that no table writers are open
- Keep a session's branch states in a branchStates container that each transaction replaces, instead of per-database maps in DatabaseSessionState
- The quadratic range overlap check is now opt-in via sql.SetFullRangeValidation, and ranges collections of up to 128 are still checked by default
- sql.Session embeds EngineVariablesProvider and ContextAwareSystemVariableRegistry is folded into SystemVariableRegistry as AssignValues, with the old names kept as deprecated aliases
- An Engine built without Config.EngineVariables now gets its own variable bundle instead of sharing package registries, and contexts and sessions are checked against the engine's bundle
- Storage changes support merge conflict resolution, so artifacts persisted to disk by this version are unreadable by older versions of Dolt
- NewSqlEngine and sqlserver.Serve now require a variable bundle
- Dolt's system variable definitions are merged into one list
- The commit_hash column of dolt_rebase plans stores commit addresses, so garbage collection keeps the commits of a paused rebase
- Virtual generated-column values are emitted in FULL binlog row images so CDC consumers receive every column advertised by TABLE_MAP.
- Test setup imports migrated from the deprecated go-mysql-server scriptgen/setup package to enginetest/setup with no behavior change.
- DROP and SHOW statements skip resolving virtual columns so tables with unresolvable generated expressions can be inspected and repaired.
- Lazily allocate chunk journal write buffers and retain a 64 KB baseline across flushes to minimize idle journal memory footprint
- Initialize the range index novel map with zero initial capacity so memory scales with indexed chunks
- The dolt_merge() operation now walks the commit graph fully for long running branches with multiple merges, matching Git's merge behavior, which may surface conflicts that were previously not raised
- dolt_commit_ancestors now marks the commit_hash index as non-unique in the dolt_commit_ancestors system table
- Go toolchain bumped from 1.26.2 to 1.27.3 across go.mods, Bazel, Dockerfiles, and release/build scripts
- The dolt CLI and sql-server run on engine-owned system variable bundles instead of global registries, and persisted globals load from the root environment
- dolt sql and dolt debug restrict LOAD_FILE by setting secure_file_priv in the engine they run
- Bumped dolthub/file-locks dependency in go/go.mod, restoring support for building on *BSDs
- DOLT_LOG system table now projects rows based on the selected columns
- Multi-branch commits are now possible, which is a backwards incompatible behavioral change; clients relying on the previous restriction should update their application logic.
- Concurrent garbage collection runs against different databases on the same server are supported, with each run capturing only the sessions outstanding when it starts.
- Documented the NBS storage lock contract, including the lock file path, advisory flock semantics, acquisition and release lifetime, the 100 ms lock timeout behaviour, and the effects of deleting the LOCK file while a process holds it
- IN predicates respect character set and collation comparison rules, such as accent-insensitivity in utf8mb4_unicode_ci and utf8mb4_0900_ai_ci, for both tuple evaluation and hash lookups
- ANY_VALUE is a scalar function rather than an aggregate, so unaggregated queries no longer synthesize a whole-table GroupBy or collapse rows, and ANY_VALUE(a) OVER () is rejected as a syntax error
- Preserve a persistent Git fetch anchor during teardown so subsequent pulls can negotiate incremental transfers instead of re-downloading the database
- Make dolt log an O(N) operation instead of O(N^2) by querying dolt_branches, dolt_tags, and dolt_log() once instead of for every commit and passing CommitInfo as a pointer
- Bump google.golang.org/grpc from 1.83.1 to 1.83.2
- Several error codes have been changed to match what MySQL returns
- Replace the github.com/dolthub/fslock dependency with github.com/dolthub/file-locks, changing only the import path while the package name remains fslock
- Limit CI deferral and release comments to relevant label changes and draft/ready state transitions to prevent duplicate notifications on commit pushes
- Sample the keeper and GC cycle in beginRead and register every unlocked read so that outstanding reads are tracked and EndGC also waits for reads started before its GC began
- Filter updates are applied atomically and synchronized with replica lifecycle operations
- Recognize the JsonAdaptiveEnc storage encoding in the prolly-row JSON merge path, enabling the structural merger for Doltgres JSON storage
- Simplify replication option handling to use native Go values instead of exported wrapper types
- Validate generated dependency bump PRs, approve the exact dependency-only commit, and enable squash auto-merge with a head-SHA guard
- Disable auto-merge on superseded dependency bumps before closing them, and close stale bumps immediately unless marked keep-alive
- Vector index creation is validated without restricting schema loading, preserving existing vector index schemas
- Coalesce concurrent git remote read fetches into a single fetch and report keys absent from an already-merged cache as absent without fetching
- Bump the java_clients_build Docker image from end-of-life Debian bullseye to maven:3.9-eclipse-temurin-17-noble
- Clone already-open table file sources on Conjoin instead of always opening them anew
- Include the full conflicting ref in ExistingRefError messages and give tag and workspace creation their own already-exists errors
- SearchPath() parses the search path more compliant with Postgres, correctly handling quoted identifiers and lowercasing unquoted ones
- Bumped google.golang.org/grpc to 1.83.1 which restricts memory overhead of buffering small data frames
- Bump the transitive undici dependency from 6.24.0 to 6.28.0 in the SES email action lockfile
- Pin add-and-commit in the GitHub workflows
- Parallelize and coalesce archive chunk fetches
- Bump google.golang.org/grpc from 1.79.3 to 1.82.1 in the Go module
- Fix multi-merge of the same table, reported in issue 12421
- Fix push and clone over ssh remotes whose path contains a '..' component, which the server previously refused
- Primary key change merge failure with multiple merge bases is resolved in dolt
- CALL preserves the caller's transaction so earlier uncommitted row changes are no longer discarded when executing stored procedures
- Procedures invoked by a trigger finish within the firing statement's transaction, preventing them from committing or clearing the outer insert/delete transaction
- Analysis-time hang on large IN lists over a prefix of a multi-column index, and KILL now takes effect during analysis because RemoveOverlappingRanges and analyzer batches check context cancellation
- Keyless index iterator no longer panics with an index out of range when a stored column follows a virtual column
- Preserve the (base, ours, theirs) schema order when binding conflict schemas so merge-preview ancestor rekeying and dolt_preview_merge_conflicts values are no longer shifted after primary key changes on both branches
- Preserve inline indexes on temporary tables when the first write occurs after index creation, including CTAS, subsequent writes, and UNIQUE enforcement
- SHOW FULL COLUMNS reports the effective column collation instead of the default, including for ENUM and SET columns
- Binary SQL types and binary-charset ENUM/SET columns retain NULL collation in SHOW FULL COLUMNS
- Resolve inherited stored defaults before analyzing CREATE TABLE ... SELECT with inline indexes, avoiding the plan is not resolved error
- Preserve IndexedTableAccess nodes during join replanning so indexed-only tables keep their lookup, preventing a panic in DELETE queries combining IN, NOT EXISTS, and ORDER BY ... LIMIT
- Check generated SET target by table rather than by name
- Chained comparisons parse correctly by left-recursing comparison expressions so chains group left without requiring the first comparison to be parenthesized
- Honor GTID payloads in COM_BINLOG_DUMP_GTID regardless of request flags, so checkpoints are no longer discarded when BINLOG_THROUGH_GTID is unset
- Merge succeeds when both branches have applied the same primary key change on both sides
- dolt_preview_merge_conflicts shows the correct base, ours, and theirs schemas instead of swapping them when schemas differ between branches
- dolt_query_diff compares matched row values by column type, comparing text exactly
- Temporary tables are kept across garbage collection
- Savepoint roots are written before being kept in VisitGCRoots
- Flushed edits are rolled back when a statement with no checkpointed edits fails
- Rebase state and the pre-merge head commit remain reachable through working sets, so garbage collection no longer makes the database unreadable
- The read-only access mode check runs inside a GC safepoint session command, fixing a panic when context validation is enabled
- Checkout permission bug addressed
- fsck now validates everything reachable from working sets, including working and staged roots and roots and commits recorded by an in-progress merge or rebase, and reports missing chunks against the referencing working set and field.
- Ghost commits no longer cause a panic during the fsck walk, so fsck passes on a shallow clone.
- Statistics lookup now works correctly for branch-qualified databases.
- A virtual column placed before a stored column no longer causes a panic and server crash on keyless index lookups; rows are sized by projections and panics become query errors.
- gRPC requests arriving during shutdown are now rejected with 503 (Unavailable) instead of causing a WaitGroup misuse panic or blocking grpcSrv.Stop().
- REPLACE no longer panics on keyless tables with unique indexes, because unique indexes are validated before rows are inserted.
- Conflicts in keyless table column types are addressed without panicking.
- Journal reads of flushed chunks now run outside the journal lock, and Close waits for outstanding reads to drain.
- Table files and archives are fsynced before being renamed into the table file directory, so GC no longer writes unsynced files into oldgen ahead of a synced manifest.
- Merge join ranges are fixed for literals of another extended type.
- CHECK constraints now work correctly on tables with virtual columns.
- Queries whose generated column expressions recursively reference their own table now fail with an error instead of overflowing the stack.
- Subqueries, variables, and non-deterministic functions are rejected in functional index expressions, preventing a fatal stack overflow.
- COUNT(1) and COUNT(*) can now be used in the same SELECT.
- Deduplicate archive dictionaries by content in the nbs storage layer
- Build virtual merge bases in UTC so non-deterministic column defaults like CURRENT_TIMESTAMP do not skew dolt_merge_bases ordering, restoring the session time zone afterwards
- Do not hoist filters out of the null side of a lateral join, which previously failed with a hoistOutOfScopeFilters error
- Apply sql_select_limit to simple selects and DISTINCT queries, which previously ignored the session limit
- Execute all statements within stored procedure exit handlers rather than only the first
- Skip costed index scans for fulltext indexes when the filter is not MATCH...AGAINST, treating it as a regular filter instead of erroring
- Check that all joins are included in the new plan during join order planning so filters are no longer dropped in complex joins
- Choose a larger decimal precision and scale when comparing column decimals against literals
- Correct result and comparison type coercion for GREATEST and LEAST functions to more closely match MySQL
- dolt diff FOO...BAR now warns when there are multiple merge bases, and three-dot log output is fixed
- remotesrv verifies MD5 uploads before a table file is added to the store and no longer overwrites a table file already in the store
- remotesrv verifies that chunk addresses in indexes match the content-based hash of uploaded chunks
- Persisted sqlserver.cluster global config options no longer produce warnings
- Removing a remote now clears branch upstream tracking entries that referenced the removed remote, instead of leaving empty remote entries in repo_state.json
- Persisted variable load errors are printed once
- Schema merges resolve CHECK column references case-insensitively, preventing false deleted-column conflicts for mixed-case column names
- SyncRoots no longer returns success when reading the source root fails, so DOLT_BACKUP sync and restore no longer report false success
- Closing a keyless secondary-index scan before it is drained no longer leaves its producer goroutine blocked on a full channel.
- Index lookup joins now allow NULL in the constant lookup key.
- Diff accepts retagged primary keys with the same names and types, so history is preserved when a table is recreated.
- Closing an embedded SQL engine now stops its branch-activity tracker and primary binlog manager, including when engine construction fails.
- Standalone remotesrv rejects path traversal and malformed repository paths in RPC and HTTP file requests.
- Docker containers skip entrypoint setup on restart when already initialized, and bypass provisioning on cluster standbys.
- Foreign keys referencing a renamed index now work correctly, with index renaming logic covering ALTER INDEX as well as RENAME INDEX
- dolt_blame_* view identifiers are quoted using the engine's schema formatter instead of hardcoded MySQL quotes, fixing parsing errors on Doltgres
- Nonlocal tables retain their own schema when absent from a schema-override commit, and conflict updates are no longer redirected to another branch
- Use the local database cache root, remote URL, and effective Git ref as the cache key so databases and custom refs cannot incorrectly share a remote handle
- Allow CREATE TABLE on the target branch of a nonlocal table rule by checking the table name where the nonlocal rule resolves it locally
- Spool newly persisted Git-backed tables and conjoin input reads through NBS spooling to avoid redundant Git reads and decompression
- Fix the license link
- Preserve exact decimal values and result types in GREATEST and LEAST
- HasMany in GenerationalNBS returned nil instead of the absent set when ghostGen is nil, hiding missing hashes
- PersistGhostHashes in GenerationalNBS had its nil check for ghostGen inverted
- Fix generation ordering on reads so a chunk being moved from new to old generation during GC is not missed, by reading new generation first
- Drain outstanding reads before a GC installs its keeper so in-flight reads take read dependencies on chunks and GC cannot collect them
- Fix a lost cancellation wakeup in waitForGC by broadcasting gcCond while holding nbs.mu
- NodeStore and ValueStore caches no longer populate with values fetched before an incoming Purge, using a purge count to prevent a Get-Read-Purge-Put race that could carry stale data through GC
- Fix legacy table name unmarshalling receiver
- Avoid leaking directory handles during LOAD_FILE checks
- Simplify partial join parent for window functions in EXISTS subqueries to fix an internal row-index error
- Implement conversions from DATE, DATETIME, and TIMESTAMP types to numeric types, and fix string output to match date type precision
- Fix EXISTS subqueries containing inner joins nested inside outer joins incorrectly dropping matching rows by preserving correlated conditions on the null-supplying side of an outer join in place
- Fixed a rare race where the journal_writer entered a weird state because its caller context was canceled while bootstrapping
- Persist sql_mode as a string and reload it on server startup
- Generated columns are omitted from SQL diff assignments and updates with no assignable columns are suppressed
- Fixed foreign keys with dropped columns, including a bug where dropping a column used by a foreign key was mishandled
- Fix an error in non-archive push and GC paths in the NBS byte sink that could result in table files being written with missing indexes
- Kill the whole process group when a cancelled git remote push or fetch is interrupted, and bound the wait on inherited pipes so sql-server no longer wedges indefinitely
- Fix misleading paths in the multiple .doltcfg error message
- dolt_backup no longer commits the calling session's open transaction before copying, so syncing an idle database leaves the backup unchanged
- ROLLBACK after backup sync now works correctly
- Authenticate incoming remotesrv HTTP requests against the correct remote peer address instead of defaulting to localhost
- Interrupted backup syncs no longer leave complete, unreferenced archives in the destination store indefinitely
- DefaultSession and NewDetachedSession are deprecated
- SUPER privilege is now required to SET global and persisted variables.
- Standalone remotesrv rejects path traversal and malformed repository paths and validates upload table file IDs before converting them to hashes.
- Cluster role headers are authenticated before applying role transitions.
- Reject gRPC requests missing both :authority and Host headers with HTTP 400 and status Internal
- INSERT ... ON DUPLICATE KEY UPDATE statements now require UPDATE privileges on tables, rather than only INSERT privileges, and upserts without UPDATE privileges are denied
- Bumped google.golang.org/grpc from 1.83.1 to 1.83.2 in the go-sql-server-driver integration tests, which rejects requests missing both :authority and Host headers with HTTP 400
- Bumped google.golang.org/grpc from 1.82.1 to 1.83.1 in integration-tests/go-sql-server-driver, which fixes RBAC rules with nested Principal or Permission matchers and header matchers failing open on DENY rules
- Bumped google.golang.org/grpc dependency fixing host header matcher not being replaced with :authority in nested Principal or Permission rules
- Bumped google.golang.org/grpc dependency fixing case-sensitivity bypass in header matchers that could cause DENY rules to fail open
Original release notes, newest first
The list above is our reading of these notes; the originals from DoltHub are here, one fold per release.
v2.7.32.7.3
Merged PRs
dolt
- 12429: Add store hooks for Dolt Enterprise to nbs
Stacked on #12418. Replaces #12419 with a much smaller change.
Dolt Enterprise's encryption at rest edits
nbs/store.goin 14 places today. Dolt changes that file often, so those edits cause most of Enterprise's merge conflicts. This PR adds the hooks those edits need, so Enterprise no longer editsstore.go. - 12423: multi-merge same table added Fixes: https://github.com/dolthub/dolt/issues/12421
- 12420: Fix ssh remotes whose path contains ..
A push to or clone from an ssh remote whose path has a
..component fails:
The ssh client sends the URL's path to$ dolt remote add origin "ssh://localhost$PWD/../bare" $ dolt push origin main failed to get remote db; ... failed to create chunk store: remote: server error: EOFdolt transferas the repository path, and the server refuses a path with a..component - 12414: Defer materializing table writer edits until the working set is read
#12184 rebased onto the session lifecycle stack (#12413). Table writers leave the edits of completed statements pending, and they're materialized when the working set is read or the transaction commits.
- Port of #12184 (first commit, squashed). A write session's owner now holds its working set, so materializing publishes to the owner.
detach/carryOverPendingare gone: a branch state can't be dropped with open writers (#12400).IsWritingDatabasecounts pending edits, which #12376's restore check needs. - Reading the working set materializes.
branchState.WorkingSet(ctx)materializes pending edits, soGetRoot,GetRoots,GetWorkingSetand the root setters see them without an explicit call. Table resolution and schema reads opt out throughSessionState.UnmaterializedWorkingRoot(schemaRoot,DoltTable.workingRoot), which takes the explicit materialize call sites from 26 to 3. A missed opt-out costs performance rather than reading stale rows;TestReadsLeaveEditsPendingpins that ordinary statements stay deferred. - Deferral regardless of autocommit. The autocommit gate worked around the #7737 stale-writer bug, which ER 1422 and #12400 rule out. Every write in the engine tests now runs deferred.
- Reading pending edits while they're being materialized is an error (a panic under dynamic asserts) instead of a silent stale read.
SequenceTracker.validateBoundsdid this and deadlocked once the read materialized; it now reads only the schema. Tested locally with dynamic asserts: the sqle, merge and prolly Go suites pass. Bats, go-sql-server-driver and Doltgres haven't been run. Not done yet: the GC hazards from the #12184 review, a system variable to turn deferral off, and a TPCC run.
- Port of #12184 (first commit, squashed). A write session's owner now holds its working set, so materializing publishes to the owner.
- 12413: Read a branch state's working set only through methods that take a context
Reads of a branch state's working set go through
WorkingSet(ctx),WorkingRoot(ctx)androots(ctx). Only setters, GC and metadata reads (workingSetRef(), a detached head) use the field directly. Deferred write materialization (#12184) can then materialize in that read path, so every read sees pending edits unless it opts out.SessionState'sWorkingSetandWorkingRootnow take a context and return an error. Doltgres needs a two-line change (core/context.go,core/relations.go) with the bump. - 12412: Have a DoltTransaction own the branch states it loads
Each
DoltTransactionholds the branch states it loads. Those loaded while the session's transaction isn't aDoltTransaction(between transactions under autocommit, afterdolt_commitends one partway through a statement,TransactionsDisabled) go in the session'snoTxBranches.DoltSession.SetTransactionis the one place they're dropped, and it checks that none has open table writers.clear()is gone.- Between transactions, lookups load from the database instead of reusing the last transaction's branch states.
commitBranchStates' refresh loop was dead and is removed: GMS starts a new transaction before each procedure statement after a commit.- A database's temp table directory and its temp tables' GC roots come from the session-scoped
DatabaseSessionState(tmpFileDir, newddb), so they don't depend on a branch state being loaded. #12403 adds the sameddbfield onmain. The first commit is #12410, which the stricter drop check needs. Doltgres's regression suite is clean against this with doltgresql#3799 and go-mysql-server#4136.
- 12411: Keep a session's branch states in a container that each transaction replaces
Moves the per-database branch state maps out of
DatabaseSessionStateinto abranchStatescontainer.DatabaseSessionStatekeeps only what lasts the whole session (checkedOutRevSpec,headCache,tmpFileDir,globalState).clear()swaps in a new container instead of deleting entries, and a branch state is current only while it's in the session's container. No behavior change. The next PR moves the container ontoDoltTransaction. - 12410: Drain TestDropPks's setup queries They were never run, and the setup INSERT's table writer stayed open.
- 12408: go/cmd/dolt: Stop opening sql-server databases in runMain.
Part of removing the process-global store cache in
dbfactory/file.go, so that everyDoltDBhas one owner that closes it. This change stands alone.runMainbuilt aMultiRepoEnvfor every command, so forsql-servereach database was opened once there and again by the server's ownMultiRepoEnv. The second open only worked through the singleton cache.sql-servernow joinscommandsSkippingDBLoad, andbuildLateBinderreturns a binder that errors if a command that skipped the load tries to run a query (sql-servernever does). Release note:dolt --use-db <db> sql-serverno longer errors when<db>does not exist; the server starts, as it does without--use-db. Behaviour is otherwise unchanged across--help, no repo in cwd, configdata_dir,--data-dir, root plus sub-databases, and corrupt databases. Tests: go-sql-server-driverTestServerInMultiDatabaseDirectorystarts a server in a directory with several databases and no root.doltand writes to each. With the cache disabled it fails without this change. - 12407: go/libraries/doltcore/sqle/dprocedures: Read config without opening a database in loadConfig.
Part of removing the process-global store cache in
dbfactory/file.go, so that everyDoltDBhas one owner that closes it. This change stands alone.loadConfig, used bydolt_push,dolt_branchanddolt_checkoutof a remote branch, calledenv.Loadon the process cwd just to read config. That opened (and leaked) the store in the cwd whenever there was one, and only the singleton cache kept it from waiting 100ms on the journal lock and falling back to read-only. Its callers use only.Config, so it now usesenv.LoadWithoutDB. Release note:dolt_push,dolt_branchanddolt_checkoutno longer open the database in the server's working directory to read its config. Tests:TestLoadConfigDoesNotOpenDatabasechecks the config is read and nothing is written under.dolt/noms. - 12404: go: Continue system variable refactoring. Migrate off deprecated
AssignSystemVariablesandAssignValuesWithContextcalls. - 12403: Keep temporary tables' GC roots after ROLLBACK visitTempTableGCRoots took the database's DoltDB from a loaded branch state, and ROLLBACK leaves none until the session's next statement.
- 12401: Have write sessions use their branch state's working set instead of a copy
A branch's write session kept its own copy of the working set, synced by
SetWorkingSet, and flushed through a setter that looked up its branch state by name. So after a transaction boundary it could write into a different branch state. It now reads and writes its branch state's working set directly.DoltSession.SetWorkingSetresets the writers when the working root changes.- Table rewrites and the workspace table start ahead of the branch state. They get a fork from
DoltSession.ForkWorkingSet, which is bound to the branch state it was created from. A flush into a dropped branch state fails, and so does a flush into one that changed since the fork, because the fork replaces the whole root. - Temp tables and the binlog applier keep a private copy via
NewDetachedWriteSession. - User-space system tables (
dolt_ignore,dolt_docs, ...) create their table through the writer instead of pushing the write session ahead, so a failed first write no longer leaves an empty table for the next flush to publish.
- Table rewrites and the workspace table start ahead of the branch state. They get a fork from
- 12400: Refuse to drop a branch state while its write session has open table writers
Dropping a branch state (
clear(),RemoveDbState,RemoveBranchState) while one of its table writers is still open would lose that writer's edits or flush them into the next transaction. This returnsErrOpenTableWritersinstead, and panics under dynamic asserts. A writer is open fromGetTableWriteruntilClose. The forceddolt_backuprestore check from #12376 now checks for open writers. After ER 1422 (previous PR), no SQL path should reach this state. With dynamic asserts on, the sqle suites, bats and go-sql-server-driver don't trip it. The first commit fixes the one leak it found, in auto_increment bookkeeping. - 12399: Reject calls in triggers to Dolt procedures that end the transaction
Dolt's half of dolthub/go-mysql-server#4131. The Dolt procedures that end the transaction (
dolt_commit,dolt_branch,dolt_merge, ...) are markedNotAllowedInSubStatement, so calling one from a trigger, directly or through a procedure, fails with ER 1422 instead of losing the firing statement's rows. Committing from a sub-statement also fails, as a backstop. The skipped #7737 test now asserts ER 1422. Also adds regression tests for #12356. - 12398: Fix main build: pass valDesc to NewMergeArtifactSerializer in ArtifactFlusher
#12334 added a value descriptor parameter to
message.NewMergeArtifactSerializer. #12335 merged after it with a call that still used the old signature, sogo/store/prollydoesn't compile onmain. This passesmut.valDesc, as the other call sites do. - 12397: sqle: use AliasedName and Revision instead of re-splitting database names Sites that hold a database now read its base name and revision from the accessors rather than parsing them back out of RevisionQualifiedName or Name.
- 12396: dtablefunctions: name databases in CheckAuth with plan.CheckPrivilegeNameForDatabase Use the same privilege database name GMS uses for its own nodes instead of re-splitting the revision-qualified name.
- 12393: statspro: ANALYZE TABLE takes the database and revision from the table
GMS passes the session's current database rather than the table's, so revision-qualified tables like
mydb/feature.t were analyzed on the session's branch instead. - 12392: dprocedures: dolt_commit_all uses the revision database's branch when nothing is dirty Previously it passed the revision-qualified name to CurrentHead, which errored with a detached head.
- 12391: branch_control: strip @-delimited revisions from database names
Branch control only stripped
/revisions, so onmydb@branchnamespace checks matched no rules and let any user create restricted branches, while access checks wrongly denied permitted writes. - 12386: Don't flush table writers with no edits on close An unedited writer still hands its write session's root to the session, since a table rewrite's write session starts ahead of it.
- 12376: Refuse a forced dolt_backup restore over a database the transaction is writing to A trigger could restore over its own database while the firing statement's writer was still open, and the statement then failed on chunks missing from the restored database. Also check that the backup exists before dropping anything, so that a forced restore from a missing backup no longer replaces the database with an empty one.
- 12375: Start the import transaction before the insert takes its table writers Start the import transaction before the insert takes its table writers
- 12372: go/store/nbs: Spool git remote table files on their first chunk read. #12328. Delays spooling until a table's chunks are first read.
- 12371: go/cmd/dolt: Clean up git remote spools when the process starts.
#12328. Cleans spools when the
doltprocess starts, which is what removes spools left by dead processes. - 12370: go/store/util/tempfiles: Give up a LockedDir when its git remote store closes.
#12328. Removes a store's spool directory and gives up its lock when the store closes, so a database can be deleted while the process keeps running.
GitBlobstore.Closecloses itsLockedDir, sodbfactoryhas no release calls. - 12369: go/store/util/tempfiles: Add LockedDir, and use it for git remote spools.
#12328. Lays the groundwork for removing spools left by dead processes.
Spool files are only removed when their reader closes or at a clean exit, so an OOM kill or SIGKILL strands them.
tempfiles.LockedDiris a directory of temp files whose owner holds an exclusive lock on the lock file next to it, which the kernel drops however the process exits:spools/locked-123.lock spools/locked-123/nbs-spool-*dbfactorymakes one for each git remote store and passes it toGitBlobstorethroughGitBlobstoreOptions.SpoolDir.tempfiles.CleanDirtries once to take each lock. If it gets one, the owner is gone, so it removes that directory and then the lock file. If not, the owner is alive and it moves on without waiting, so one live process does not keep a dead one's spools around. - 12368: go/store/nbs: Spool git remote table files under the git cache root.
#12328. Moves git remote spool files out of the system temp directory.
Spools now go in
.dolt/git-remote-cache/spools. The blobstore gets aSpoolDiroption, set byGitRemoteFactory.CreateDB. Spooling with no directory is an error rather than a fallback to the temp directory. - 12346: Require permissions on the rebased branch for its rebase working branch. While a rebase is active, a user with write access to the dolt_rebase_ working branch, but not to itself, could edit the rebase plan, commit to the working branch, continue or abort the rebase, or delete the working branch. Branch control checks on the working branch now also require the same permissions on the branch being rebased.
- 12338: Narrow GC roots visitors to func(hash.Hash) and check the keeper once in the safepoint controller. Narrow GC roots visitors to func(hash.Hash) and check the keeper once in the safepoint controller.
- 12336: go: store/prolly/tree: WalkNodes, WalkAddresses: Only descend into child refs of internal nodes. ProllyMap internal nodes also carry key-embedded addresses, such as commit addresses, which are not child nodes.
- 12335: go: store/prolly: Use a MergeArtifacts flusher for ArtifactsEditor. Edits that spilled out of the editor's pending buffer were written as ProllyTreeNode messages, leaving artifact maps with mixed node types and history-dependent hashes. A spill on the final edit produced a ProllyTreeNode root, which artifactIndexFromAddr rejects on load.
- 12331: Fix dolt_commit_all --skip-empty panic with skipped branches
Fixes a panic in
dolt_commit_all('--skip-empty')when a skipped branch sorts before a committed one. Fixes https://github.com/dolthub/dolt/issues/12301 - 12326: Verified constraints for tables on the search path
- 12325: Matched diff table function names by schema
- 12316: Fix storage bounds checks, leaked handles and a few races Eleven small fixes. Each has a test that fails without it, except the one-line git remote cache fix. The Windows mmap test only fails on Windows, and the archive index mapping check only runs on Linux.
- 12314: go: sqle: binlogreplication: Stream unexecuted binlog tail after a restart rotation
Problem
When a Dolt primary restarts, it rotates to a new binlog file, which holds only a Format Description and a Previous GTIDs event until the next write. If a replica reconnects in that window,findLogFileForPositionskips the new file (it has no GTID event), finds every first GTID already executed, and returns the current file. GTIDs at the end of the previous file that the replica has not executed are never streamed. Thefiles[i-1]branch has the same flaw when a file without GTIDs sits between two files that have them. We hit this with Debezium 3.1.1.Final (mysql-binlog-connector-java 0.40.2) against Dolt 2.6.2 on ARM64 Linux, after restarting Dolt and Debezium together:- Debezium resumed with GTID set
<uuid>:1-5and saved skip counts (2 events, 1 row) for GTID 6. - Dolt sent a rotate to
binlog-main.000002, then GTID 7. GTID 6, still inbinlog-main.000001, was never sent. - Debezium applied its skip counts to GTID 7 and dropped that row change with no error.
- This reproduced in 2 of 2 runs, confirmed with a metadata-only protocol
trace, the physical binlog files, and Debezium's log.
TestBinlogPrimary_ReplicaAndPrimaryRestartdoesn't cover this: its replica reconnects after new writes reach the rotated file, so thefiles[i-1]path handles it.
Related
This path became reachable for Debezium in 2.6.2. mysql-binlog-connector-java sendsCOM_BINLOG_DUMP_GTIDwith flags0, and before 2.6.2 Dolt ignored the GTID set in that case (#12241). Dolt then replayed from the first file, andfindLogFileForPositionnever saw a non-empty executed set. dolthub/vitess#502, pulled in by 2.6.2, now honours the set, which exposes the start-file selection fixed here. #12241 still appears open, although that fix has shipped.Change
Track the last file whose first GTID the replica has executed, and start there. This also handles a GTID-less file in the middle. The streamer already skips executed GTIDs (binlog_primary_streamer.go), and earlier files end with a Rotate event, so the only cost is rescanning that one file. Behaviour without GTID-less files is unchanged.Tests
TestFindLogFileForPosition: six table cases, two for this bug and four pinning existing behaviour. Uses the existingnewFileBackedStreamerManagerfixture.TestBinlogStreamResumesTailBeforeRestartRotation: runs the real streaming path over TCP. It requires the unexecuted tail GTID to arrive, and then a GTID written to the rotated file after the client connects.
Validation
- Both tests fail on v2.6.2 without the fix and pass with it, 5 runs under
-race.go vetandgofmtare clean. - The other package tests that need no
mysqldpass. mysqldintegration tests: not run locally. Only MySQL 8.4 was available, and it rejects the harness's--default-authentication-plugin, so I'm relying on CI.- End to end: a binary built from this branch, run behind Debezium 3.1.1 and NATS, delivered the post-restart change that stock 2.6.2 dropped. Debezium-only restarts and VIRTUAL generated columns were also checked.
- Debezium resumed with GTID set
- 11853: Handle unknown download sizes in clone progress Displays unknown download sizes without calculating negative clone progress percentages. Fixes https://github.com/dolthub/dolt/issues/5359
- 11850: Resolve HEAD to the current branch when pushing Resolves HEAD push sources to the current branch while preserving explicit destination refs. Fixes https://github.com/dolthub/dolt/issues/2480
- 11848: Show the login hint for permission-denied push errors Preserves wrapped push errors so permission failures display the login hint and RPC diagnostics. Fixes https://github.com/dolthub/dolt/issues/783
- 11847: Preserve configured identity when login returns empty values Preserves configured names and email addresses when login returns empty identity fields. Fixes https://github.com/dolthub/dolt/issues/425
go-mysql-server
- 4141: Fix StoredProcParam referencing stale values
Stored Procedure parameters were incorrectly getting preserved across
CALLs. This PR makes it so new parameters properly override any existing values in the session. - 4138: Preserve fractional precision in TIME, LEAST, and GREATEST
Preserve six fractional digits for floating-point
TIME()inputs and infer string precision whenLEAST()/GREATEST()compare datetimes, preventing rounding from changing the selected value. Dynamic strings use maximum precision, and invalid datetime minima preserve MySQL's string fallback. These are the last cases left to cover from dolthub/dolt#11944 Fixes dolthub/dolt#11944 - 4136: Leave a statement's autocommit transaction to that statement A failed query run from an interpreted function no longer ends the autocommit transaction, which belongs to the statement running the function. In its place, an autocommit transaction whose statement failed rolls back, after the statement's iterators are closed. Before, a failing nested query ended the outer statement's transaction while that statement's table writers were still open. And a statement that failed while closing left its transaction open for the next statement.
- 4132: Open foreign key editors when a plan runs, not when it's analyzed A plan's foreign key graph now names the tables it edits and reads by slot, and each execution of a ForeignKeyHandler opens and closes its own editors for them, so a plan that never runs, such as EXPLAIN or a trigger that doesn't fire, holds none. Also closes editors that leaked elsewhere: the one ResolveForeignKey checks rows with, an update join's updaters when one fails to close or when only its table names are needed, and those DML and DDL builders take before failing. Memory engine tests now fail a transaction that starts with table editors open.
- 4131: Reject transaction control in triggers with ER 1422 As in MySQL, a trigger and any procedure it calls can't commit, run a statement that commits implicitly, set autocommit, or call an external procedure marked NotAllowedInSubStatement. CREATE TRIGGER rejects such a body and a CALL from a trigger fails before the procedure runs; triggers stored before this fail only when they reach the statement. DoltgreSQL companion: dolthub/doltgresql#3783 (skips the new MySQL-syntax procedure tests).
- 4130: Return SQL NULL for JSON_EXTRACT wildcard misses
JSON_EXTRACT errors on an empty-array wildcard and returns [] when a wildcard property lookup has no matches. Update jsonpath to
131d88a5ca62, picking up two merged fixes so both cases return SQL NULL. Adds regression tests for jsonpath wildcards. Reports: empty-array wildcard, missing wildcard properties. Depends on: jsonpath #9, jsonpath #10 (both merged). - 4127: JSON_TYPE(null) evaluates to null, not "NULL" Fixes https://github.com/dolthub/dolt/issues/12339 The documentation for JSON_TYPE in MySQL is ambiguous, and we misinterpreted it to mean that JSON_TYPE always returns a string, and that both JSON NULL and SQL NULL as inputs evaluate to the string "NULL". This is incorrect, and passing SQL NULL as an input should evaluate to SQL NULL.
- 4126: Remove unnecessary filter conditions from semijoin plans This PR fixes an issue where after optimizing some join expressions, we would not remove the now-redundant filter conditions. Those filter conditions are implicitly expressed by the new join plan, and can be safely removed. Fixes some (but not all) of https://github.com/dolthub/dolt/issues/11231
- 4123: Preserve caller transactions when executing stored procedures
CALLcurrently clears the caller's transaction before executing a stored procedure, causing Dolt to discard earlier uncommitted row changes. This fix preserves two boundaries:- A normal CALL uses the caller's existing transaction. It must not clear that transaction and lose earlier changes. Explicit COMMIT or ROLLBACK inside the procedure remains effective.
- A trigger belongs to the statement that fires it. Procedures called by the trigger must finish within that statement's transaction. The interpreter no longer saves, clears, and restores the transaction around CALL. Trigger execution temporarily suppresses automatic commits, including while its inner iterator closes, then restores the caller's previous setting on success or error. This prevents procedure-body statements from committing or clearing the outer insert/delete transaction before that statement finishes. Fixes Dolt issue #12356
- 4121: Improve functional dependency analysis for inner joins when tables don't have a primary key This is a similar fix to #4064, except that #4064 only updated the logic for cross joins, whereas this handles inner joins. The modified plan is interesting: it no longer generates a unnecessary Project, but now it generates an unnecessary join filter instead. I've not yet determined why this is the case.
- 4112: Preserve datetime precision in INTERVAL arithmetic
DATETIME(6) +/- INTERVALcurrently converts the datetime operand toDATETIME(0)before applying the interval. For example, adding one microsecond to2026-01-02 12:34:56.527248returns2026-01-02 12:34:57, which can also move a WHERE clause's time-window boundary. Preserve the temporal operand's fractional precision, promoting the result to precision 6 for microsecond intervals. Both operand orders use the same inference, TIMESTAMP operands still produce DATETIME results, and externalTimeDeltaExpressionimplementations retain microsecond precision. The reported addition and subtraction now return2026-01-02 12:34:56.527249and2026-01-02 00:34:56.527248. Regression coverage checks evaluated values, serialization, result-column types, zero/millisecond/microsecond precision, carry and borrow across days, NULL columns, reversed and nested arithmetic, a one-microsecond WHERE window, and materialized schema precision. Addresses the precision-loss report in https://github.com/dolthub/dolt/issues/11944#issuecomment-6630350806 (not the original TIME/LEAST/GREATEST report). Validation:- The new precision unit regression fails against unmodified upstream main.
GOWORK=off go test ./...and the complete expression package pass.GOWORK=off go test -race ./...passes.- Built Dolt main with this engine through an external Go workspace; Dolt's
TestTimeQueriespasses. - The resulting Dolt CLI passes the exact report, a stored DATETIME(6) time-window predicate, and CTAS values/precision reopened in separate processes.
The temporal precision rule was checked against MySQL 8.0's
Item_date_add_interval::resolve_type; no live MySQL comparison was run. This change retains existing result-family inference and does not change fractional SECOND interval evaluation. No dependency bumps or local module overrides are included.
- 4110: Fix JSON_TYPE SQL NULL propagation
JSON_TYPE(NULL) and JSON_TYPE applied to a missing JSON_EXTRACT path currently return the string 'NULL', causing type filters to match SQL NULL and missing values as if they were explicit JSON null. Return SQL NULL for a nil document while preserving the 'NULL' type label for explicit JSON null.
Correct the unit expectation and add engine regressions for the issue's predicate queries, nullable JSON columns, and IS NULL / = 'NULL' filters.
Fixes dolthub/dolt#12339.
Validation:
- Confirmed the unit and new engine regressions fail before the fix.
GOWORK=off go test ./sql/expression/function/json/... -count=1GOWORK=off go test ./sql/expression/function/json/... ./enginetest -run 'TestJSON|TestJson' -count=1- Built Dolt at 325e1a6ecf with this GMS worktree through an external Go workspace, then passed
go test ./libraries/doltcore/sqle/enginetest -run '^TestJsonScripts$' -count=1. - Passed eight CLI assertions covering the reported predicates and filters over persisted nullable JSON rows, reopening the database for each query. No dependency overrides or version bumps are included.
- 4084: Truncate strings to the column length under
INSERT IGNOREandUPDATE IGNORETheIGNOREmodifier requires strings that are too long for a column to be truncated to the column length. String conversion now returns the truncated value with its error, allowingINSERT IGNORE,UPDATE IGNOREandON DUPLICATE KEY UPDATEto use the otherwise internally discarded value.- A column length for truncation is now determined by its charset.
- Add
CharSetHandler.MaxByteLengthto calculate the byte length of a string without splitting multibyte characters. - Amend
ConvertToBytesandConvertToStringto follow existing conversion functions return structure. Fix dolthub/dolt#12218 Close #4079
- 3980: Fix INSTR collation handling and wrapped substrings Fixes INSTR collation handling, binary positions, and wrapped substring evaluation. Fixes https://github.com/dolthub/go-mysql-server/issues/3650
vitess
- 506: sqlparser: accept boolean expressions in generated columns
Accept full expressions in generated-column definitions so
AS (value < 8)works without an extra pair of parentheses. Preserve the outerParenExprneeded for DDL formatting and the original regression coverage across CREATE/ALTER, abbreviated/full syntax, and virtual/stored columns. Supersedes https://github.com/dolthub/vitess/pull/503 by @sciyoshi, preserving the original commit authorship. Applied on current main and regeneratedsql.goto resolve the generated-parser merge conflict. The fullsqlparsertest suite andtools/check_make_parser.shpass. Parser generation reports zero shift/reduce and zero reduce/reduce conflicts. Fixes https://github.com/dolthub/dolt/issues/12343. - 505: sqlparser: left-recurse comparisons so chains group left Fix dolthub/dolt#12345 Close #504 Block dolthub/go-mysql-server#4118
Closed Issues
- 12341: CAST to DATETIME and DAY return NULL for a valid JSON string from JSON_EXTRACT
- 10648: Panic during binlog replication
- 12421: Merge fails with "table with same name added in 2 commits" when two merge bases each created the table
- 11084: Implement Lazy Flush
- 11944: MySQL is able to infer Temporal precisions
- 12328: sql-server with a git remote: nbs-spool-* temp files are never cleaned after an unclean stop, and the live set holds a full copy of the remote
- 12218: INSERT IGNORE / UPDATE IGNORE drops the connection when a DATETIME, integer or binary value is too long for a VARCHAR column
- 11439: dump panics with "index out of range" on a table with a generated column
- 12357: Same primary-key change on both sides fails to merge when there are two merge bases
- 12343: Boolean generated column expression requires an extra pair of parentheses
- 12339: JSON_TYPE(SQL NULL) returns the string 'NULL' instead of SQL NULL
- 425: Dolt login overwrites config with bad values
- 783: Prompt user to run "dolt login" on PermissionDenied error on "dolt push"
- 2480:
dolt push origin HEADpushesHEADinstead of the current branch - 7031: Deleting from
dolt_conflicts_can cause a panic when there's a schema change. - 5325: Dolt should support file remotes pointing to dolt checkouts.
- 5359: Dolt prints incorrect table file download percentage when cloning from DoltLab
- 12301: dolt_commit_all('--skip-empty') panics when a skipped branch sorts before a committed one
- 3650: INSTR: case-sensitive for nonbinary strings (should fold), and StringWrapper substring clobbers haystack (returns 1)
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 17.32 | 2.35 | 0.14 |
| groupby_scan | 147.61 | 65.65 | 0.44 |
| index_join | 3.43 | 1.96 | 0.57 |
| index_join_scan | 4.03 | 1.3 | 0.32 |
| index_scan | 344.08 | 186.54 | 0.54 |
| oltp_point_select | 0.19 | 0.26 | 1.37 |
| oltp_read_only | 3.62 | 4.91 | 1.36 |
| select_random_points | 0.35 | 0.54 | 1.54 |
| select_random_ranges | 0.39 | 0.63 | 1.62 |
| table_scan | 344.08 | 189.93 | 0.55 |
| types_table_scan | 733.0 | 419.45 | 0.57 |
| reads_mean_multiplier | 0.82 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 4.1 | 0.53 |
| oltp_insert | 4.03 | 2.11 | 0.52 |
| oltp_read_write | 8.74 | 9.22 | 1.05 |
| oltp_update_index | 4.33 | 2.26 | 0.52 |
| oltp_update_non_index | 4.1 | 2.0 | 0.49 |
| oltp_write_only | 5.18 | 4.18 | 0.81 |
| types_delete_insert | 8.43 | 4.57 | 0.54 |
| writes_mean_multiplier | 0.64 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 96.79 | 71.37 | 1.36 |
| tpcc_tps_multiplier | 1.36 |
| Overall Mean Multiple | 0.94 |
|---|
v2.7.22.7.2
Merged PRs
dolt
- 12360: pk change merge failure with multi-merge-bases Related: https://github.com/dolthub/dolt/issues/12357
go-mysql-server
- 4123: Preserve caller transactions when executing stored procedures
CALLcurrently clears the caller's transaction before executing a stored procedure, causing Dolt to discard earlier uncommitted row changes. This fix preserves two boundaries:- A normal CALL uses the caller's existing transaction. It must not clear that transaction and lose earlier changes. Explicit COMMIT or ROLLBACK inside the procedure remains effective.
- A trigger belongs to the statement that fires it. Procedures called by the trigger must finish within that statement's transaction. The interpreter no longer saves, clears, and restores the transaction around CALL. Trigger execution temporarily suppresses automatic commits, including while its inner iterator closes, then restores the caller's previous setting on success or error. This prevents procedure-body statements from committing or clearing the outer insert/delete transaction before that statement finishes. Fixes Dolt issue #12356
- 4106: Make the quadratic range overlap check opt-in, and check for cancelation during analysis
Fixes the analysis-time hang in dolthub/dolt#12315.
RemoveOverlappingRangesended by checking every pair of its output ranges for overlap (added in #2149 to catch range tree bugs). That check is quadratic, so a largeINlist on a prefix of a multi-column index could spend minutes in analysis, and since analysis never checkedctx,KILLhad no effect.- The full check is now behind
sql.SetFullRangeValidation.enginetestturns it on ininit(), so GMS, Dolt and Doltgres engine tests and the GMS sqllogictest harness keep running it. - Without the flag, collections of up to 128 ranges are still checked.
RemoveOverlappingRangesand analyzer batches now checkctx.Err(). Dolt's sqllogictest harness doesn't importenginetest, so it will need its ownsql.SetFullRangeValidation(true).
- The full check is now behind
- 4104: sql: Tighten the session and registry interfaces around engine variables.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
sql.SessionembedsEngineVariablesProvider.ContextAwareSystemVariableRegistryis folded intoSystemVariableRegistryasAssignValues(ctx, ...); the old names remain as deprecated aliases for now.- Constructors that built components without an engine bundle are removed.
- 4103: sql: Remove the global variable registries.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
sql.SystemVariables,sql.StatusVariablesand theirInit*functions are removed.- Sessions and contexts no longer get a bundle implicitly.
NewBaseSession,NewContextandNewEmptyContextare unbound; the...WithVariablesconstructors require a complete bundle.
- 4102: sql: Make independent variable state the default for Engine.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- An
Enginebuilt withoutConfig.EngineVariablesnow gets its own bundle instead of sharing the package registries. - Every engine checks that contexts and sessions belong to its bundle.
- An
- 4085: enginetest: test index lookups on keyless tables with a virtual column before a stored column Dolt's keyless index iterator sized output rows by stored columns only, so a stored column after a virtual one panicked with an index out of range. These scripts cover an indexed virtual column and an expression index followed by an added column.
Closed Issues
- 12356: CALL inside an explicit transaction undoes the transaction's earlier row changes
- 12315: sql-server: large parameterized IN-list SELECT wedges on a small table; KILL CONNECTION returns OK but the wedged query keeps running (leaked until ~10min self-clear)
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.35 | 0.14 |
| groupby_scan | 132.49 | 66.84 | 0.5 |
| index_join | 3.43 | 1.93 | 0.56 |
| index_join_scan | 4.1 | 1.32 | 0.32 |
| index_scan | 344.08 | 183.21 | 0.53 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 4.91 | 1.36 |
| select_random_points | 0.36 | 0.52 | 1.44 |
| select_random_ranges | 0.39 | 0.62 | 1.59 |
| table_scan | 344.08 | 183.21 | 0.53 |
| types_table_scan | 733.0 | 419.45 | 0.57 |
| reads_mean_multiplier | 0.81 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 3.96 | 0.51 |
| oltp_insert | 4.1 | 2.03 | 0.5 |
| oltp_read_write | 8.74 | 9.91 | 1.13 |
| oltp_update_index | 4.33 | 2.18 | 0.5 |
| oltp_update_non_index | 4.1 | 1.93 | 0.47 |
| oltp_write_only | 5.18 | 5.0 | 0.97 |
| types_delete_insert | 8.28 | 4.49 | 0.54 |
| writes_mean_multiplier | 0.66 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 97.0 | 57.35 | 1.69 |
| tpcc_tps_multiplier | 1.69 |
| Overall Mean Multiple | 1.05 |
|---|
v2.7.12.7.1
Merged PRs
dolt
- 12354: Fix merge-preview schema order when rekeying the ancestor
Preserve the
(base, ours, theirs)order returned byapplySchemaFallbackswhen binding and returning conflict schemas. This letsConflictBaseSchemarekey the actual ancestor and prevents shifted values fromdolt_preview_merge_conflictsafter both branches change the primary key. Existing normal/prepared regressions fail before and pass after; the original schema-layout regressions and the full Dolt engine suite also pass against GMS main. Follow-up to #12333 and #12334. Addresses the inherited Dolt integration failures observed on GMS #4117. - 12348: Preserve inline indexes when writing temporary tables The first write to a temporary table could erase its inline indexes because the row editor still used the pre-index schema. Refresh the schema and write session after creating an index, with MySQL-only regressions for CTAS, subsequent writes, and UNIQUE enforcement.
go-mysql-server
- 4117: Report actual column collations in SHOW FULL COLUMNS
SHOW FULL COLUMNSreports the effective column collation instead of the default, including for ENUM and SET. Binary SQL types and binary-charset ENUM/SET retain NULL. Adds one compact shared regression covering 21 columns, inherited and alternate collations, views, aliases, and filtering. Collation, query, view, and modify-column engine suites pass; metadata was also checked against MySQL 8.4.11 and a locally built Dolt CLI. Fixes dolthub/dolt#12344 - 4109: Resolve inherited defaults in indexed CREATE TABLE ... SELECT
Resolve inherited stored defaults before analyzing
CREATE TABLE ... SELECTwith inline indexes, avoidingplan is not resolvedwhile preserving the defaults. Adds a MySQL-specific regression verified against MySQL 8.4. - 4100: Preserve index lookups during join replanning
Preserve
IndexedTableAccessnodes during join replanning so indexed-only tables retain their lookup. This prevents a panic inDELETEqueries combiningIN,NOT EXISTS, andORDER BY ... LIMIT. Fixes https://github.com/dolthub/dolt/issues/12235 - 4099: sql/expression/function: unwrap out-of-band blob arguments at use Fix dolthub/dolt#12263
- 4098: sql: check generated SET target by table, not name Fix dolthub/dolt#12238
- 4094: Support unary bitwise complement
Support unary
~for numeric and binary operands, preserving full-width masks in mixed signed/unsigned bit operations. Related to dolthub/dolt#12284.
vitess
- 505: sqlparser: left-recurse comparisons so chains group left Fix dolthub/dolt#12345 Close #504 Block dolthub/go-mysql-server#4118
- 502: fix(mysql): honor GTID payloads regardless of request flags
Debezium's MySQL binlog client sends
COM_BINLOG_DUMP_GTIDwith flags0and a valid binary SID block. The parser currently discards that checkpoint unlessBINLOG_THROUGH_GTIDis set; Dolt consequently replays historical transactions, which can fail Debezium when old DDL is applied to its current schema snapshot. See dolthub/dolt#12241 for the wire-level reproduction and MySQL history. This backports vitessio/vitess#17580:- Read the GTID payload independently of the flag, before handling nonblocking EOF.
- Set
BINLOG_THROUGH_GTIDon outgoing requests. - Port the SID and request-flag test changes using this fork's existing test conventions.
The fork requires two adaptations: retain
NewMysql56GTIDSetFromSIDBlockinstead of upstream's historical textual decoder, and omit upstream's filename-dependent flag branch because this sender always uses an empty filename. The backport also bounds-checks the declared payload length and adds parser regressions covering flags0,2, and4, zero-length/empty SID payloads, nonblocking requests, and malformed/truncated payloads. Validation on Apple Silicon macOS: - Passed
go test ./go/mysql -run '^(TestComBinlogDump.*|TestSIDs|TestMysql56GTIDSet.*)$' -count=1with Go 1.27.3. - Built Dolt 2.6.1 with this patch and passed the issue's isolated wire-protocol reproduction for both flags
0and4; each excluded the checkpoint and delivered a new row. Stock 2.6.1 fails by replaying transaction 1. - The complete
go test ./go/mysql -count=1run failedTestServer,TestClearTextServer, andTestDialogServerbecauseVT_MYSQL_ROOTis unset andmysqldis unavailable. Native Linux and full Debezium startup were not tested. Dolt will need to update its Vitess dependency after this is merged.
Closed Issues
v2.7.02.7.0
Minor Version Bump
This release is a minor version bump due to storage changes made to support merge conflict resolution. When conflicts arise in merging schema changes, the artifacts persisted to disk will be unreadable by older versions of Dolt. Since backwards compatibility is not possible in this case, we've bumped minor version number.
Merged PRs
dolt
- 12334: go: Allow merge to work when the two branches have applied the same primary key change on both sides. The merge operation rekeys the altered tables in the common ancestor, so that all three schemas match as required. Conflict readers rekey the same way. Changes MergeArtifacts to store the rekeyed base so that it persists across replication, push and GC in the case that the common ancestor was rekeyed in this way. Fixes #12012
- 12333: dolt_preview_merge_conflicts: fix swapped base, our and their schemas getConflictSchemasFromRoots returned the schemas in the order (ours, theirs, base), but its caller reads them as (base, ours, theirs). When the schemas differed between branches, the preview showed the wrong columns and decoded each side's values with another side's layout. Fixes #12330
- 12319: dolt_query_diff: compare matched row values by column type
- Add
diff.ValuesEqualto use column type'sCompare, and compare text exactly. Equal out-of-band content addresses skip reading both values. Fix dolthub/dolt#12262
- Add
- 12291: sqle: Keep temporary tables across GC. sqle: Keep temporary tables across GC.
- 12290: go/libraries/doltcore/sqle/dsess: Write savepoint roots before keeping them in VisitGCRoots go/libraries/doltcore/sqle/dsess: Write savepoint roots before keeping them in VisitGCRoots
- 12289: go/store/prolly: roll back flushed edits when a statement with no checkpointed edits fails go/store/prolly: roll back flushed edits when a statement with no checkpointed edits fails
- 12279: go: Remove Dolt's dependencies on the global variable registries.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- Dolt no longer falls back to the global registries, and
NewSqlEngineandsqlserver.Servenow require a variable bundle. - Dolt's system variable definitions are merged into one list.
DefaultSessionandNewDetachedSessionare deprecated.
- Dolt no longer falls back to the global registries, and
- 12278: go: Store the commits of a rebase plan as commit addresses. New dolt_rebase plans store commit_hash with CommitAddrEnc, so garbage collection keeps the commits of a paused rebase even when no branch reaches them. Writes to the column reject anything but an existing commit before it reaches the store, where a dangling address would discard the shared memtable. Older clients fail reading these plans with a clean error from a new schema field, and plans they wrote keep working as text.
- 12276: go: Keep rebase state and the pre-merge head reachable through working sets. WalkAddrs skipped a working set's rebase state and pre-merge head commit, so GC could collect them and leave the database unreadable. WorkingSetHashes now also keeps the pre-merge head for in-memory working sets. Fixes #12253.
- 12240: go/cmd/dolt/commands/sqlserver: Run the read-only access mode check inside a GC safepoint session command. With context validation enabled by an earlier engine in the process, as in DoltgreSQL's startup integrity check, loading databases in this check panicked. ConfigureServices now creates one GCSafepointController, shared by this check and the engine through the new SqlEngineConfig.GCSafepointController field.
- 12226: Add dolt branch --orphan to start an unrelated history
dolt branch --orphan <name> [<start-point>]anddolt_branch('--orphan', ...)create a branch whose only commit has no parents and holds the contents of the start point (HEAD by default). The commit message names the start point, so an orphan of the initial commit never hashes to the same commit. Usedolt commit --amendto change the message. Git has the --orphan option in three commands:checkout,switch, andworkspace. I decided to deviate for Dolt because checkout is discouraged in a server context, and there is nothing likeswitchandworkspace. Creating a new branch is actually a better description of what is happening anyway. Additionally: checkout permission bug addressed. Related: https://github.com/dolthub/dolt/issues/4468
Closed Issues
- 12330: dolt_preview_merge_conflicts returns wrong values when a schema changed on either branch
- 12012: Merge should succeed when both sides made the same primary-key change
- 11503:
ORDER BY+ hugeLIMIT(≥ 2^62) panics - 12107:
JSON_EXTRACTpanics when one of several paths matches nothing - 12253: dolt_gc after deleting a branch mid-rebase leaves the database unopenable
- 12235: DELETE ... WHERE a IN (derived table with NOT EXISTS and ORDER BY ... LIMIT) drops the connection (called partitions on a lookup indexed table)
- 12263: md5() and sha2() on a BLOB over 2 KB panic and drop the connection
- 12262: dolt_query_diff reports rows with equal DECIMAL or JSON values as modified
- 11317: panic: index out of range in prolly index writer during ON DELETE CASCADE on a table with an indexed generated column (2.2.0)
- 12238: Multi-table UPDATE assigning a generated column drops the connection (*plan.JoinNode is not sql.NameableNode)
- 11439: dump panics with "index out of range" on a table with a generated column
- 11456: MySQL Binary Prepared Statement (
COM_STMT_EXECUTE) truncates TCP packet payload onJSONcolumns containing multi-line formatted strings - 11638: Wrong results: a scalar subquery's aggregate returns the OUTER query's aggregate when both use the same aggregate expression on the same table
- 10856: Error when LateBindQueryist fails to connect to the running sql-server noted in sql-server.info is confusing
- 11658: sql-server logs expected idle-connection reaps at ERROR (6565 lines/day on a healthy server)
- 11648: git-remote: dolt_remote_info under refs/heads/ makes concurrent
git fetchfail with "incorrect old value provided" - 12284: Unsupported feature: unary operator: ~
v2.6.22.6.2
Merged PRs
dolt
- 12277: go: fsck: Validate everything reachable from working sets. fsck now validates the working and staged roots of every working set, plus the roots and commits recorded by an in-progress merge or rebase, and reports a missing chunk against the working set and field that reference it. Remote refs were already scanned. Ghost commits no longer panic the walk, so fsck passes on a shallow clone. See #12253.
- 12250: Include virtual generated columns in full binlog row images Emit computed virtual generated-column values in FULL row images so CDC consumers receive every column advertised by TABLE_MAP. Convert before-image fields to the target schema before evaluating generated expressions, and preserve direct serialization for nonvirtual tables to avoid repeated schema copies. Includes the original contribution from #12245, with schema-change correctness and allocation fixes. Validated with physical binlog decoding, schema-reset regressions, and real MySQL replication. Fixes #12243.
- 12249: Fix statistics lookup for branch-qualified databases Fixes optimizer statistics lookup for branch-qualified databases with shared regression tests also exercised by https://github.com/dolthub/doltgresql/pull/3694. Fixes https://github.com/dolthub/doltgresql/issues/3692
- 12239: sqle/index: size keyless index lookup rows by projections, not stored columns A virtual column before a stored column gave the stored column an output ordinal past the end of the row, panicking the producer goroutine and crashing the server. Rows are now sized by projections, and the producer runs under errguard.Go so a panic becomes a query error.
- 12230: go/libraries/doltcore/remotesrv: Stop routing new multiplexed gRPC requests to grpcSrv before stopping it. Previously, gRPC requests arriving on the still-open HTTP listener during shutdown could call grpcHttpReqsWG.Add concurrently with Wait, causing a WaitGroup misuse panic, and could keep grpcSrv.Stop() from ever returning. They now get a 503, which gRPC clients see as Unavailable.
- 12225: Fix REPLACE panic on keyless tables with unique indexes Validate unique indexes before inserting rows to prevent orphaned index entries and REPLACE panics on keyless tables with multiple unique keys. Fixes #12219. Depends on: dolthub/go-mysql-server#4078.
- 12217: Import GMS enginetest/setup instead of the deprecated scriptgen/setup package.
- 12212: don't panic when addressing conflicts in keyless table column types. Fixes: https://github.com/dolthub/dolt/issues/12186
- 12176: go/store/nbs: journal getManyCompressed reads flushed chunks and runs callbacks outside the journal lock. Close now waits for those outstanding reads to drain. Fixes #12170.
- 12173: go/store/nbs: fsync byte sink output before it can be renamed into a table file directory. Fixes GC writing unsynced table files and archives into oldgen ahead of a synced manifest (#12172).
- 12164: go/libraries/doltcore/sqle/enginetest: Migrate to enginetest/setup.
Switch imports from the deprecated
go-mysql-server/enginetest/scriptgen/setupre-export package togo-mysql-server/enginetest/setup. No behavior change; the old package only aliased the new one.
go-mysql-server
- 4094: Support unary bitwise complement
Support unary
~for numeric and binary operands, preserving full-width masks in mixed signed/unsigned bit operations. Related to dolthub/dolt#12284. - 4090: Fixed merge join ranges for literals of another extended type Fixes:
- 4086: Fixed CHECK constraints on tables with virtual columns Fixes:
- 4078: Add shared regressions for keyless unique writes Add shared coverage for keyless writes with multiple unique indexes, including REPLACE retries and rejected inserts. Part of dolthub/dolt#12219. Dolt fix: https://github.com/dolthub/dolt/pull/12225.
- 4076: Skip resolving virtual columns for DROP and SHOW statements so tables with unresolvable generated expressions can be inspected and repaired.
- 4075: Fail queries whose generated column expressions recursively reference their own table instead of overflowing the stack.
- 4074: Reject subqueries, variables, and non-deterministic functions in functional index expressions. A subquery reading the indexed table caused unbounded recursion and a fatal stack overflow when resolving the hidden generated column.
- 4072: Require SUPER to SET global and persisted variables Fix dolthub/dolt#12207
- 4070: Allow
COUNT(1)andCOUNT(*)in the sameSELECTUse expression ID to distinguish betweenCOUNT(*)andCOUNT(1). Based off of: https://github.com/dolthub/go-mysql-server/pull/4066 - 4069: Normalize Decimal Hash Value Normalize decimal strings for hashing by trimming trailing 0s and trailing decimal points. Also, normalize negative 0 to positive 0. Based off of: https://github.com/dolthub/go-mysql-server/pull/4068/
- 4064: Improve functional dependency analysis when tables don't have a primary key This PR fixes a bug in functional dependency analysis, where a table without a primary key would mistakenly be treated as a table with no columns in the FD key, instead of the correct interpretation where every column is in the FD key. It also improves the join order planner to handle the case where the FD key requires multiple columns, provided that a single table can provide all the columns.
- 4062: Do not hoist filters out of the null side of a lateral join
fixes dolthub/dolt#11552
hoistOutOfScopeFilterspulls filters that only reference an outer scope out of a derived table. for a lateral derived table on the right of a join that's wrong: inLEFT JOIN LATERAL (SELECT o.id + 1 AS tag WHERE o.id = 1) AS q ON TRUEtheo.id = 1filter decides whetherqhas a row for thato, it shouldn't filteroitself. at the top level there was nothing to hoist it into, so the query failed withrule 'hoistOutOfScopeFilters' tried to hoist filters above root node. hoisted filters from a derived table that is a non-preserved child of a join (IsPreservedTable) now stay inside it as a filter. derived tables insideEXISTSandINsubqueries aren't join children like that, so they still get hoisted as before. the new script inSubqueriesScriptTestscovers the query from the issue, the same thing with an innerJOIN LATERAL, and aLEFT JOIN LATERALover a table that mixes an inner and an outer filter. all three failed with the error above and pass now, and i checked the expected results against mysql 8.4. the rest of./sql/...and./enginetest/...has the same results as main under-tags gms_pure_go. - 4061: Do not apply outer scope index lookups below windows and limits
fixes dolthub/dolt#11548
applyIndexesFromOuterScopeturns a correlated filter likew.id = o.idinto an index lookup on the matching table, but it put that lookup on the table even when aWindow,Limit,TopNorOffsetsat between the filter and the table. the filter itself correctly stays above those nodes, so the window or limit then only saw the one looked up row. in the query from the issue every row gotrn = 1andNOT EXISTSremoved all of them, and the same happens with a derived table that usesORDER BY ... LIMIT. the rule now stops at those nodes, likepushdown.goalready does for filters.
vitess
- 502: fix(mysql): honor GTID payloads regardless of request flags
Debezium's MySQL binlog client sends
COM_BINLOG_DUMP_GTIDwith flags0and a valid binary SID block. The parser currently discards that checkpoint unlessBINLOG_THROUGH_GTIDis set; Dolt consequently replays historical transactions, which can fail Debezium when old DDL is applied to its current schema snapshot. See dolthub/dolt#12241 for the wire-level reproduction and MySQL history. This backports vitessio/vitess#17580:- Read the GTID payload independently of the flag, before handling nonblocking EOF.
- Set
BINLOG_THROUGH_GTIDon outgoing requests. - Port the SID and request-flag test changes using this fork's existing test conventions.
The fork requires two adaptations: retain
NewMysql56GTIDSetFromSIDBlockinstead of upstream's historical textual decoder, and omit upstream's filename-dependent flag branch because this sender always uses an empty filename. The backport also bounds-checks the declared payload length and adds parser regressions covering flags0,2, and4, zero-length/empty SID payloads, nonblocking requests, and malformed/truncated payloads. Validation on Apple Silicon macOS: - Passed
go test ./go/mysql -run '^(TestComBinlogDump.*|TestSIDs|TestMysql56GTIDSet.*)$' -count=1with Go 1.27.3. - Built Dolt 2.6.1 with this patch and passed the issue's isolated wire-protocol reproduction for both flags
0and4; each excluded the checkpoint and delivered a new row. Stock 2.6.1 fails by replaying transaction 1. - The complete
go test ./go/mysql -count=1run failedTestServer,TestClearTextServer, andTestDialogServerbecauseVT_MYSQL_ROOTis unset andmysqldis unavailable. Native Linux and full Debezium startup were not tested. Dolt will need to update its Vitess dependency after this is merged.
- 501: Represent DROP COLUMN IF EXISTS in the DDL AST
Parses and formats
ALTER TABLE ... DROP COLUMN IF EXISTS, with a column-level flag separate from table-levelIF EXISTS. Adds parse/format round-trip coverage; the full parser test package passes. Part of dolthub/doltgresql#3536.
Closed Issues
- 11595: Feature Request:
MAKEDATEfunction - 11741: git remotes: a cancelled push/fetch wedges sql-server indefinitely — CommandContext kills only the direct git child, and the orphaned transport holds the pipe Wait() reads
- 10448: VECTOR INDEX: batch inserts fail with NULL embeddings after ~83 rows
- 11771: EXISTS with a join: a correlated reference in the ON clause is dropped from the plan, and the query returns wrong rows
- 11886: Lookup join drops an AND conjunct when the ON clause also has an OR over indexed columns (wrong results)
- 11984: License link is broken
- 12011: sql-server: git remotes with the same URL but different
--refshare one ref — a push from one database overwrites another database's data - 12243: binlog_row_image=FULL omits virtual generated columns, breaking Debezium CDC
- 12207: A user with only SELECT can run SET GLOBAL / SET PERSIST on dolt sql-server (no SUPER / SYSTEM_VARIABLES_ADMIN check)
- 11739: conjoin opens unbounded concurrent connections — exceeds sshd MaxStartups on git+ssh remotes, so conjoin never completes
- 12219: REPLACE into a keyless table with two UNIQUE keys often drops the connection (malformed tuple)
- 12170: dolt_gc stalls all concurrent queries for most of a large GC (journal read lock held across copy batch, writer holds nbs.mu)
- 12186: DELETE FROM dolt_conflicts_ fails when a column's type differs between base and ours
- 3988: SIGN() returns 0 for non-zero values with magnitude below 0.5
v2.6.12.6.1
Merged PRs
dolt
- 12203: nbs: deduplicate archive dictionaries by content Fix dolthub/dolt#12177
- 12198: Build virtual merge bases in UTC
Column defaults that read the time, like CURRENT_TIMESTAMP, give it in the session's time zone, so a virtual merge base built with a non-deterministic timestamp. This matters because
dolt_merge_basesorders by time stamp. Since no one actually sees the virtual commit, we'll build it with the session time zone set to UTC, and restore the session's own afterwards. - 12194: nbs: allocate chunk journal write buffers and index maps on demand
- Lazily allocate
journalWriter.bufon write and retain a 64 KB baseline (journalWriterMinBuffSize) across flushes to minimize idle journal footprint while preventing allocation churn. - Initialize
rangeIndex.novelwith zero initial capacity to eliminate static map overhead and scale lookup memory strictly with indexed chunks. - Add cross-platform
get_memory_kbbats helper to get PID memory usage. Fix dolthub/dolt#12179
- Lazily allocate
go-mysql-server
- 4062: Do not hoist filters out of the null side of a lateral join
fixes dolthub/dolt#11552
hoistOutOfScopeFilterspulls filters that only reference an outer scope out of a derived table. for a lateral derived table on the right of a join that's wrong: inLEFT JOIN LATERAL (SELECT o.id + 1 AS tag WHERE o.id = 1) AS q ON TRUEtheo.id = 1filter decides whetherqhas a row for thato, it shouldn't filteroitself. at the top level there was nothing to hoist it into, so the query failed withrule 'hoistOutOfScopeFilters' tried to hoist filters above root node. hoisted filters from a derived table that is a non-preserved child of a join (IsPreservedTable) now stay inside it as a filter. derived tables insideEXISTSandINsubqueries aren't join children like that, so they still get hoisted as before. the new script inSubqueriesScriptTestscovers the query from the issue, the same thing with an innerJOIN LATERAL, and aLEFT JOIN LATERALover a table that mixes an inner and an outer filter. all three failed with the error above and pass now, and i checked the expected results against mysql 8.4. the rest of./sql/...and./enginetest/...has the same results as main under-tags gms_pure_go. - 4059: Apply sql_select_limit to simple selects and DISTINCT
fixes dolthub/dolt#11549
a non-default
sql_select_limitwas ignored in two places. the simple-select batch ingetBatchesForNode(aProjectover aResolvedTable, with or without aFilter) did not runapplyDefaultSelectLimit, soset @@sql_select_limit = 2followed byselect * from torselect x from t where y > 1returned every row. the rule now runs in that batch too. separately,applyLimitdid not handle aDistinctroot, which is what the query from the issue plans to:
an explicitselect distinct row_number() over (order by x) as rn from t order by rn;LIMITis still planned above theDistinct, so it keeps taking precedence over the session limit. - 4058: execute multiple statements in stored procedure exit handlers Currently, the stored procedure handler logic assumes there is exactly one statement for exit handlers. This PR fixes the handler to execute all the queries within a stored procedure handler. However, like other parts of the stored procedure logic, the result set is discarded. Related:
- 4057: Skip costed index scan for non
MATCH...AGAINSTfilters on fulltext indexes fixes dolthub/dolt#12175 Costed index scans should only work on full text indexes with aMATCH...AGAINSTfilter. However, we should not be erroring out when the filter is not aMATCH...AGAINST; the filter should instead work like a regular filter. This PR removes emitting an error when a nonMATCH...AGAINSTfilter is on a fulltext index. It also skips calculating the cost in the first place for fulltext indexes with nonMATCH...AGAINSTfilters. - 4056: Fix accidentally dropping filters in complex joins Dolt PR: https://github.com/dolthub/dolt/pull/12193 The join order planner did not properly check that all joins were actually included in the new plan. This PR fixes that. There's potential room for improvement here, both in detecting when filters are redundant and what to do when the current join order planning fails. But this fixes a potential correctness issue.
- 4054: create larger decimal precision during comparisons We were choosing the wrong decimal scale/precision when comparing column decimals against literals. Fixes https://github.com/dolthub/dolt/issues/12185
- 4047: Fix type coercision for
GREATESTandLEASTfunctions This PR fixes the resulting and comparing types forGREATESTandLEASTfunctions to more closely follow MySQL. Combinations of types result in string type output, which we defaulted toDOUBLEin many cases. The presence of DATE/DATETIME/TIMESTAMP types causes other types to be converted and compared as the corresponding temporal type, and then converted to the appropriate output type (usually string). Passing Dolt bump: https://github.com/dolthub/dolt/pull/12187
Closed Issues
- 11548: Dolt mis-evaluates a correlated anti-join over a derived ROW_NUMBER() result
- 11552: Dolt reaches an analyzer internal error for a legal correlated LEFT JOIN LATERAL
- 11549: Dolt drops sql_select_limit
- 12177: DOLT_GC duplicates archive dictionaries once an archive has more than 256, pinning ~137 KB of C memory per duplicate
- 12175: Full-Text index is selected for ordinary equality and IS NULL filters, causing unknown expression errors
- 12185: DECIMAL comparison precision against literals isn't converted correctly
- 12179: sql-server holds about 7.3 MB of memory per open database (chunk journal buffers), limiting how many databases one server can hold
- 12050: Merge and three-dot diff use only the tallest of several merge bases, which breaks the schema-branch pattern
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.3 | 0.14 |
| groupby_scan | 132.49 | 65.65 | 0.5 |
| index_join | 3.43 | 1.96 | 0.57 |
| index_join_scan | 4.1 | 1.3 | 0.32 |
| index_scan | 344.08 | 186.54 | 0.54 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 4.91 | 1.36 |
| select_random_points | 0.36 | 0.51 | 1.42 |
| select_random_ranges | 0.38 | 0.62 | 1.63 |
| table_scan | 344.08 | 186.54 | 0.54 |
| types_table_scan | 733.0 | 427.07 | 0.58 |
| reads_mean_multiplier | 0.81 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 4.03 | 0.52 |
| oltp_insert | 4.03 | 2.07 | 0.51 |
| oltp_read_write | 8.74 | 10.09 | 1.15 |
| oltp_update_index | 4.33 | 2.22 | 0.51 |
| oltp_update_non_index | 4.03 | 1.93 | 0.48 |
| oltp_write_only | 5.18 | 5.0 | 0.97 |
| types_delete_insert | 8.28 | 4.49 | 0.54 |
| writes_mean_multiplier | 0.67 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 97.69 | 57.79 | 1.69 |
| tpcc_tps_multiplier | 1.69 |
| Overall Mean Multiple | 1.06 |
|---|
v2.6.02.6.0
Minor Version Bump
This change introduces changes to the dolt_merge() operation which will alter the merge behavior for long running branches
which have multiple merges. The previous behavior would incorrectly choose merge results without fully walking the commit graph.
The new behavior more correctly matches Git's merge behavior for this rare scenarios.
Applications which automatically merge may run into conflicts in your merge which were previously not raised. The previous behavior would incorrectly choose the newest change, and it's possible an application depends on that behavior. As this behavior is not backwards compatible, we have opted to perform a minor version bump.
Merged PRs
dolt
- 12192: dtables: mark
commit_hashindex non-unique indolt_commit_ancestorsFix dolthub/dolt#12178 - 12182: Warn on three-dot diffs with several merge bases; fix three-dot log
This is the third and final fix for 12050, related to
dolt diff FOO...BARwarning when there are multiple merge bases. Fixes: https://github.com/dolthub/dolt/issues/12050 - 12174: go: remotesrv: Fix some warts in uploaded file handling.
- Fix MD5 upload verification so that it happens before the table file is added to the store. We do this by verifying on the Read() path once we hit EOF or expected-size bytes.
- Fix the upload path to never overwrite a table file that's already in the store. Dolt keeps an invariant when the table file is added to the store that it was able to be opened. Overwriting with new contents can break that invariant.
- Verify that chunk addresses as they appear in indexes match the content-based hash of the uploaded chunks.
- 12168: Do not warn on persisted sqlserver.cluster global config options Fix #12127 Close #12144
- 12154: Bump Go to 1.27.3
Bumps the Go SDK from 1.26.2 to 1.27.3 in go.mods, Bazel, Dockerfiles, and release/build scripts. Also brings the stale SysbenchDockerfile (1.23.3) up to date.
Also adds a direct
apple_supportdep inproto/MODULE.bazelso macOS uses its cc toolchain. Xcode 27's clang listsSDKSettings.jsonin depfiles, which therules_ccauto-configured toolchain rejects as an absolute path inclusion. - 12153: Unset branch upstream tracking when removing remote Fix dolthub/dolt#11529 Close dolthub/dolt#12151
- 12151: Clear branch upstreams when a remote is removed
Fixes #11529.
dolt remote removedeleted the remote but leftbranches.<name>entries inrepo_state.jsonthat still carried theheadmerge ref. Thedolt_remoteprocedure (which the CLI goes through) first rewrote every branch tracking the remote toremote: ""and then removed the remote, so the entry survived with an empty remote. That looks like an upstream on the local repository, which Git expresses with.. Git instead dropsbranch.<name>.remoteand.mergewhen the remote is removed. This removes the loop indolt_remote.gothat blanked the remote name, and clears the branch entries whoseremoteis the removed one inRepoState.RemoveRemote(CLI path) andSessionStateAdapter.RemoveRemote(in memory and the persisted file), through a nil-safe helperClearBranchUpstreamsForRemote. Branches that track a different remote are kept. Testing: a Go test inenvforRemoveRemoteand one for a nil branch map; a bats case inremote-cmd.batsthat follows the repro from the issue (push -u origin b1:other,remote remove origin, no"b1"entry left inrepo_state.json). The bats case fails with the previousdolt_remote.goand passes with this change;remote-cmd.batspasses as a whole andgo vetis clean. The rest of the suites were not run. This change was made with Claude Code. - 12149: go: Run the dolt CLI and sql-server on engine-owned variables.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- The dolt CLI and sql-server run their engines on engine-owned variable bundles instead of the global registries. Persisted globals load into the bundle from the root environment.
dolt sqlanddolt debugrestrict LOAD_FILE by settingsecure_file_privin the engine they run.dolt_log_levelkeeps its value in the server's engine; the logrus level it sets is still process-wide.- Persisted variable load errors print once. Split out of #12134 together with the runtime consumers it builds on in #12148.
- 12148: sql: Bind Dolt runtime to engine variables.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- Runtime consumers read the executing engine's bundle: sessions, transactions, merge, rebase, stats, binlog, nested engines, CREATE DATABASE hooks, engine bootstrap and test harnesses.
- Adds
sqle.NewEngineVariablesForEnv,sqle.AssignSystemVariablesandsqle.DoltSystemVariableNames. - Callers that pass no bundle keep main's behavior on the global registries. The dolt CLI and sql-server still pass none, so their behavior is unchanged here; #12149 switches them over. doltgresql, driver and ld keep working after the auto-bump. Split out of #12134 together with the CLI and sql-server switch-on in #12149.
- 12147: go/cmd/dolt/commands: Close filter-branch's per-commit database. filter-branch creates a new database for each commit it replays and never closed them, so their sequence trackers could still be reading the store when dolt closed it. That panic made filter-branch.bats fail intermittently. The rebased engine now closes the databases it owns, and filter-branch closes the engine. Adds a unit regression test.
- 12146: Stopped quoting extended type column defaults Builds on top of:
- 12144: go/cmd/dolt: Don't warn on persisted sqlserver.cluster config options
Summary
When sql-server runs with aclusterconfig, it persists the cluster role and epoch to the config json undersqlserver.cluster.*(for example afterCALL dolt_assume_cluster_role('standby', 1)). The CLI's config validator only allowed known options and thesqlserver.globalprefix, so every laterdoltcommand printed warnings like:
Fixes #12127Warning: Unknown global config option 'sqlserver.cluster.dolt_cluster_role'. Use `dolt config --global --unset sqlserver.cluster.dolt_cluster_role` to remove.Changes
- Add
env.SqlServerClusterPrefix(sqlserver.cluster) and use it forcluster.PersistentConfigPrefix, so the two can't drift apart. - Add
env.IsKnownConfigOption, which accepts the known options plus thesqlserver.globalandsqlserver.clusternamespaces, and use it for both the local and global config warnings incmd/dolt/dolt.go. dolt config --add/--setvalidation is unchanged.
Testing
- New unit test
TestIsKnownConfigOptioninlibraries/doltcore/env. - New bats test in
config.batsthat writes persisted cluster keys to the global config and checks thatdolt versionprints no warning. It fails onmainand passes with this change. The fullconfig.batsfile passes. - Checked by hand: with a global config containing
sqlserver.cluster.dolt_cluster_role,sqlserver.cluster.dolt_cluster_role_epochand a bogus key, only the bogus key still produces a warning. go test ./libraries/doltcore/env ./libraries/doltcore/sqle/cluster,go vet,gofmt.
- Add
- 12137: dolt assist: default to gpt-5.6-terra before gpt-3.5-turbo shuts down on 2026-10-23
dolt assistfalls back togpt-3.5-turbowhen--modelisn't given. OpenAI shuts that model down on the API on October 23, 2026, and its deprecations page listsgpt-5.6-terraas the replacement. After that date,dolt assiststops working for OpenAI users who rely on the default. This changesopenAiDefaultModeland the--modelhelp text togpt-5.6-terra. The request body only sendsmodelandmessages, so nothing else needs to change.--modelstill overrides the default, and the OrcaRouter provider isn't touched. Close #12161 - 12133: sql: Bind Dolt bootstrap to engine variables.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- Engine, server and CLI bootstrap can carry an engine-owned bundle through variable definition, persisted settings and config application.
- Includes the listener-timeout fix and isolated test-server grants.
- 12132: sql: Add registry-aware Dolt variable bootstrap helpers.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- Add registry-aware Dolt variable definition, persistence and replication-hook helpers alongside the existing global ones.
- 12125: Implement git's ORT merge mechanism Related: https://github.com/dolthub/dolt/issues/12050
go-mysql-server
- 4056: Fix accidentally dropping filters in complex joins Dolt PR: https://github.com/dolthub/dolt/pull/12193 The join order planner did not properly check that all joins were actually included in the new plan. This PR fixes that. There's potential room for improvement here, both in detecting when filters are redundant and what to do when the current join order planning fails. But this fixes a potential correctness issue.
- 4052: Use CharSetHandler for character offsets in
INSERT()Fix #4050 Close #4051 - 4051: Count characters instead of bytes in INSERT()
INSERT(str, pos, len, newstr)slicedstrby byte offsets, soposandlenwere treated as byte counts. On strings with multibyte characters this replaces the wrong range and can cut a character in half, returning invalid UTF-8:
This change convertsSELECT INSERT('héllo', 2, 1, 'X'); -- MySQL 8.4: hXllo -- before: hX\xA9llo (invalid UTF-8) SELECT INSERT('日本語テキスト', 3, 2, 'ab'); -- MySQL 8.4: 日本abキストstrto runes before computing the replaced range, the same waySUBSTRING,LEFT, andRIGHTin this package already count characters. ASCII behavior is unchanged.Tests
sql/expression/function/insert_test.go: multibyte cases (accented, CJK, negative length, position past the character length). Four of them fail before the fix.enginetest/queries/function_queries.go: two end-to-end queries. Both fail before the fix. Expected values were checked against MySQL 8.4. Fixes #4050
- 4049: go.mod: Bump to 1.27.3. Fix some COMPRESS() tests where the behavior changed.
- 4048: build(deps): bump github.com/klauspost/compress from 1.17.8 to 1.18.7 in /_integration/go Bumps github.com/klauspost/compress from 1.17.8 to 1.18.7.
- 4045: Converted extended type column defaults with assignment casts Fixes an issue integrators were running into, as they don't necessarily follow MySQL's rules.
- 4044: Assign column IDs to "Unreferenceable" columns
Fixes dolthub/dolt#12141
"Unreferenceable" columns (columns that have internal names that don't match their aliases) were added to the outscope via
addColumninstead ofnewColumn, which meant they were never assigned a column ID. As a result, view/subquery scopes were not being mapped to the correct columns, causing the wrong filters to be pushed down. Query plan tests changed due to more columns being added to ColSet. - 4041: Clear sign on negative zero during
DecimalModFixes dolthub/dolt#12124 This is done inDecimalDiv, but it seems like the step was skipped forDecimalMod. - 4039: GROUP_CONCAT: concatenate BIT values as raw bytes
GROUP_CONCAT over a BIT column concatenated the decimal text of each value instead of its raw bytes, so
HEX(GROUP_CONCAT(v))returned3335where MySQL returns0305. Root cause:evalExprsonly keepsretTypeasBlobwhen every expression isBlob. A BIT column isBitType, so the result type becameTextandgroupConcatValuestringified each value throughConvertToCollatedString. BIT now takes its own raw big-endian byte form. Fixes dolthub/dolt#11422 Test:TestGroupConcat_BitConcatsRawBytesfails before this change ("35") and passes after ("\x03\x05"). - 4033: Build information_schema column defaults without the parser Package initialization parsed the SQL text of 237 column defaults, each twice, through a context that copies every system variable, to build the literals 0 and "". The package was the most expensive to initialize in a native program (6.6 ms, 20,000 allocations), and a program compiled to JavaScript spent over a second there before its first statement. The schemas now build those literals directly, and a test checks that they equal what the parser returns.
- 4023: Added AggregateCallResolver for functions that share a name with an aggregate
- 4011: Prune unselected columns from
Columns()Doltgres PR: https://github.com/dolthub/doltgresql/pull/3631 There's a potential problem with the plan tree that can lead to correctness issues, and it has to do with how nodes report their ColumnSet (their list of column IDs) and their schema, and how these both interact in the presence of ProjectedTables (table nodes that contain a projection stating which columns are selected). Currently, if a table contains a projection, thenSchema()will return a projected schema with the unselected columns removed, butColumns()will still report the entire column set. This is ostensibly done because we rely on having the full set of columns when computing functional dependencies and when checking if an index can be used for a lookup, although I'm not 100% certain whether this is actually necessary in practice. This descrepency can cause some problems: there are multiple places in the code where we assume that these functions will return results with the same number of elements. In some cases, we detect when there's a mismatch and fetch the Schema of the table's underlying primary key index and use that instead. There are a few cases where we failed to do this check and could panic: I've already submitted a PR that fixes one of these. The reason I've been doing all this is because of an optimization we do that may not be correct. We have an optimization that replaces trivial subqueries with the underlying table. For example:SELECT a from (SELECT a, b FROM table)becomesSELECT a from table. In the plan tree, this means transforming a SubqueryAlias into a TableAlias. Currently, the TableAlias uses the same columnIds as the underlying table, while GetFields in the top-level query will refer to the now non-existent subquery columns. This can theoretically lead to problems in subsequent passes. For example, GetFields that referred to the subqueries now have ColumnIds that no longer appear in the table, and will be resolved by name instead. This is probably safe because I don't think it's possible for the table to have multiple columns with the same name in this specific circumstance. But it does mean that any optimization pass that looks at columnIds to match GetFields to tables will no longer work here, which can inhibit future optimization. This was the problem I initially encountered: I'm rewriting the rowIter to work like a register-machine that uses the columnId as the register number. This meant that these GetFields were reading from a different register than the one being written to. But the bigger problem with the current behavior is what happens when we have a CTE that gets referenced multiple times in the same query. For example:WITH SELECT * FROM test_table AS cte SELECT cte a JOIN cte b ON ...After the optimization runs, the plan will contain two TableAlias nodes that contain the same columnIds, which isn't supposed to happen. GetFields that resolve based on the ColumnId are now ambiguous, and a subsequent analysis pass might behave incorrectly. In order to fix this, we need to ensure that every column in the query has a unique ColumnId after the subquery is inlined. There's a couple ways we could do this:Use the ColumnIds from the original Subquery in the generated TableAlias and the underlying ResolvedTable.
This was my initial approach, but it ran into a problem with ProjectedTables. TableAlias nodes use the same ColumnIds as the underlying table, which means the entire column set even for ProjectedTables. (So, the TableAlias forSELECT x, y FROM x_y_zwould have three ColumnIds, for the above-mentioned reasons.) But the subquery has a ColumnId for each column in the Subquery's schema, so the subquery would only have two ColumnIds. Because of this mismatch, we can't reuse the Subquery ColumnIds for the TableAlias. This PR attempts to make that possible by removing the requirement that tablesColumns()method returns a value for unselected columns. During thepruneColsanalysis pass, it rewrites tables' ColSet to remove columns that aren't actually selected. This simplifies logic in many places and generates different plans with lower costs and row-estimates. However, I have a gut feeling that this may impede functional dependency analysis in some cases and prevent us from selecting an index if we are only selecting a prefix of that index's columns. Some more testing is required. This PR also breaks Dolt because the implementations for Dolt-specific system tables like DoltLog need to be updated for this. It seems like DoltLog implements ProjectedTable but always returns the full schema in calls toDoltLog.Schema(), which is inconsistent with other table implementations. This may be a bug that should be fixed anyway, and I need to understand what's actually happening here.Use the ColumnIds from the original Subquery only in the generated TableAlias, and not the underlying ResolvedTable.
Basically prune ColumnIds from TableAlias but not the underlying table. This allows both ColSets to exist in the plan, and analysis passes can access them both if needed. However this will likely complicate the logic of other optimizations, since it's no longer possible to treat the two node types identically. This PR doesn't attempt this solution, but it's an alternate option. - 4002: Preserve column metadata for parenthesized GROUP BY references Resolve parenthesized GROUP BY column references through the existing column-resolution path, preserving the metadata needed by HAVING. Adds regressions for nested/qualified references, aliases, NULLs, and constant grouping. Found while fixing the HAVING regression in GMS #4001.
- 3932: When replacing a subquery with a table alias, push the subquery columnIds into the underlying table.
When parsing a query, Dolt assigns an ID to every column in the query. These IDs are meant to be unique. But due to an oversight, there are some queries that contain duplicate column IDs.
Dolt attempts to remove trivial subqueries by inlining them into the parent query.
If a common table expression expression is referenced multiple times and inlined multiple times, then each of the inlined Table nodes will have the same column Ids. If a subsequent analysis pass assumes that every table node has unique IDs, it may behave incorrectly. I don't think that this oversight actually results in incorrect behavior: we only inline trivial subqueries that don't contain any filters or projections, so there won't be any GetField expressions referencing any of the columns with duplicate IDs.
However, there's another downside to this operation: By erasing the SubqueryAlias node, we erase the map that maps ColumnIds on the SubqueryAlias to the ColumnIds in the subquery. GetField expressions that referred to columns on the subquery alias will still use those Ids, and subsequent analysis passes won't be able to connect them to the columns in the new TableAlias nodes.
The fix for both of these issues is to modify the set of the ColumnIds in the inlined tables to use the ColumnIds originally assigned to the removed SubqueryAlias. This both prevents the query from containing duplicate IDs while also maintaining the mapping between GetFields in the parent query and the columns they reference.
This PR results in improvements to several PlanTests.
One thing I still need to investigate before merging is what happens if only some of the columns are selected from the table being inlined. It looks like previously the Table node's ColSet contained a element for every column in the table, even the ones that aren't selected, but after this change, it is rewritten to only have an element for every column in the subquery alias. It's not clear what impact this has on analysis passes and needs to be understood before merging.This was fixed with https://github.com/dolthub/go-mysql-server/pull/4011
Closed Issues
- 12178: sql-server:
dolt_commit_ancestorslookup bycommit_hashfails with "max1Row iterator returned more than one row" for a merge commit - 12050: Merge and three-dot diff use only the tallest of several merge bases, which breaks the schema-branch pattern
- 11422: Dolt
GROUP_CONCAT(BIT)concatenates numeric text instead of BIT bytes. - 12127:
dolt sqlwarns on persistedsqlserver.cluster.*global config options - 11529:
dolt remote removeleaves an upstream config behind - 12141: Column field indexes don't seem to be correctly assigned in views
- 4050: INSERT() counts bytes instead of characters on multibyte strings
v2.5.12.5.1
Merged PRs
dolt
- 12152: Fix schema merge conflicts for checks on mixed-case columns Resolve CHECK column references case-insensitively during schema merges, preventing false deleted-column conflicts for mixed-case column names.
- 12136: go/go.mod: Bump dolthub/file-locks. Restores support for building on *BSDs.
- 12131: Project rows in DOLT_LOG LogTable implements ProjectedNode, because it needs to detect which columns have been selected so it knows which values to compute. But it doesn't trim columns based on the projection. This prevents us from being able to remove Project nodes on DOLT_LOG system table queries. When combined with https://github.com/dolthub/go-mysql-server/pull/4011, this would have resulted in pruning the columnSet for DOLT_LOG without pruning the schema, which would result in incorrect offset cacluation during assignExecOffsets. This change prevents that interaction.
- 11934: Expose PostgreSQL session settings through Dolt sessions
Closed Issues
- 12056: SyncRoots returns success when reading the source root fails (DOLT_BACKUP sync/restore report success)
v2.5.02.5.0
This is a minor release because it contains backwards incompatible behavioral changes:
- It is now possible to commit changes on more than one branch in the same SQL transaction. Previously, such transactions would fail with an error message.
- It's also possible to dolt commit to more than one branch via
dolt_commit(), but only if the new session variable@dolt_multi_branch_commitis set to a true value. Previously, such procedure calls would fail with an error message. - The above provisions also apply to normal
COMMITstatements when@dolt_transaction_commitis set to a true value. - A new stored procedure,
dolt_commit_all(), dolt commits all modified branch heads in a single atomic transaction regardless of session variable settings.
Clients relying on the previous restrictions on commits to multiple branches should update their application logic.
Merged PRs
dolt
- 12130: docker: bypass provisioning on cluster standbys and fail fast on invalid init SQL Fix dolthub/dolt#12115
- 12128: docker: skip entrypoint setup on container restart when initialized Fix dolthub/dolt#12115
- 12108: kvexec: allow NULL in the constant lookup key of an index lookup join Fix dolthub/dolt#12106
- 12092: Authenticate cluster role headers before applying transitions Fixes #12090.
- 12091: Fix standalone remotesrv path traversal
- Reject traversal and malformed repository paths in RPC requests and sealed HTTP file requests.
- Use a rooted filesystem for standalone remote store directory creation, and verify the resolved store path stays inside the configured root.
- Validate upload table file IDs before converting them to hashes. Fixes #12089.
- 12088: go: gcctx: GCSafepointController: Explicitly support concurrent Waiters. This adds support for concurrent GC runs against different databases on the same server. Each GC run captures the outstanding sessions that are present when it starts and blocks on visiting only their roots. The sessions themselves can keep track of more than one outstanding waiters. Explicit semantics are added for sessions which are themselves within a GC Safepoint Waiter, in order to prevent a potential deadlock. While the Waiter is outstanding, new Waiters which come to wait on that session can immediately visit its roots, just like the sessionAwareSafepointController would have done for that session itself when creating its own Waiter.
- 12086: merge_base overhaul
- Add new
dolt_merge_bases()table function, allowing for multiple merge bases - Add
--allflag todolt merge-basecli operation. - Existing
dolt_merge_base()behavior remains unchanged. A significant amount of testing git and it'smerge-base --allbehavior led to the testing harness added here. thego/libraries/doltcore/commitgraph/merge_bases_test.gois effectively the git behavior of merge base codified. Behavior of merge-base with shallow clones (ghost commits) was incomplete, and errored in situations it should not have. This area is much more thoroughly tested now. Related: https://github.com/dolthub/dolt/issues/12050
- Add new
- 12077: schema, diff, dtables: keep history across same-key table recreate
- Diff accepts retagged primary keys (same names and types, new column tags) instead of warning, so history survives a recreate. Fix dolthub/dolt#12067
- 12075: Stop embedded SQL engine workers and clean up primary binlog streams Closing an embedded SQL engine now stops and joins its branch-activity tracker and primary binlog manager, including when engine construction fails. Primary shutdown interrupts blocked replica writes and waits for active streams; disconnecting a replica preserves other streams, and stream exit closes the current rotated binlog file. Based on #12068 by Alex Giurgiu; the original contributor commits and authorship are preserved.
- 12066: Stop keyless index producers on Close
Closing a keyless secondary-index scan before it is drained could leave its producer goroutine blocked on a full channel. The scan state and its expanded duplicate rows then stay reachable after the caller stops reading.
Closenow cancels an iterator-owned child context and waits for the producer, without cancelling the caller's context. No public API, SQL syntax or configuration changes.Test
TestKeylessIndexIterCloseStopsProducerinserts ten identical keyless rows, reads one, and closes the iterator insidetesting/synctest, which fails if the producer is still blocked when the test ends. It fails without the fix and passes with it.
The test shows the producer stops. Thatcd go && go test -run '^TestKeylessIndexIterCloseStopsProducer$' -count=1 ./libraries/doltcore/sqle/indexClosealso waits for it comes from the code (eg.Wait()), not from the test.Example
In a manual check (not part of this PR) with a keyless tablek(a BIGINT, b BIGINT), indexidx_b(b)and 20 rows per value ofb:SELECT a FROM k FORCE INDEX (idx_b) WHERE b = 3 LIMIT 1left one blocked producer before the fix and none after.- A correlated subquery with
LIMIT 1over 50 outer rows left 50 blocked producers before the fix and none after.
Checked
- The
indexpackage tests, normal and race; the new test ran 50 times under race. TestIndexes,TestIndexPrefixandTestGeneratedColumns, normal and race.go vet, copyright headers andcheck_fmt.sh. In one of our environments,TestQueries/select_length(compress(repeat('a',_1000)))fails (expected 24, actual 21) on bothmainand this branch. It is outside the index path. We did not run the full Go or SQL engine suites, and we have not measured how often this happens in production.
Generated by Perfloop. Human sponsor: Tomás Senart. - 12062: gitauth: fix Windows FETCH_HEAD lock contention, dedup write fetches, and omit auth hints for file errors Fix dolthub/dolt#11904
- 12061: dbfactory: init the git remote cache repository with the remote's object format Fix dolthub/dolt#12060
- 12057: SyncRoots: return the source root read error instead of reporting success
Fixes #12056.
Close #12072
SyncRootsreturnednilwhensrcDb.NomsRootfailed, soDOLT_BACKUPsync, sync-url and restore reported success without transferring the source root. This returns the wrapped error instead, matching how the destination root read just below already handles its error. - 12052: merge: detect conflicting generated column additions
When both branches add the same generated column, report a schema conflict if its
AS (...)expression orVIRTUAL/STOREDmode differs, instead of silently keeping one definition. Identical additions still merge cleanly. Compare these properties in both column equality methods and add merge tests for each case. Fixes #11367 - 12049: more dolt optimizations to help dumbodb
Three smallish changes:
- capture hash of object rather than recalculating
- allocate in one shot in ReadBytes
- reuse unchanged leaves in adaptive encoding
- 12047: go/store/nbs: journal_file.go: Use .bss allocated zeros slice for the write ahead. This lets us write the zeros without interacting with allocation or GC and without the allocated array needing to RSS (outside the VMM mapping overhead).
- 12041: Return
ErrTableAlreadyExistsfor existing nonlocal tables Fix dolthub/dolt#12039 - 12037: bats: qualify pk in auto_increment_lock_modes check query test1 and ranges both have a pk column, so the unqualified min(pk) and max(pk) are ambiguous. go-mysql-server b4f13d62c36d rejects them, failing the test on every run since #12035.
- 12034: Accelerate lookup joins with SQL row inputs Accelerates lookup joins with SQL row inputs using shared iteration and type-aware key conversion. Fixes https://github.com/dolthub/dolt/issues/11636 Companions: https://github.com/dolthub/doltgresql/pull/3554 and https://github.com/dolthub/go-mysql-server/pull/3997.
- 12031: perf: Use fdatasync on linux with a padded journal
fdatasyncavoid unnecessary metadata updates to the file system, resulting in ~25% improvement in write performance. - 12027: dolt version: cache failed release checks to prevent hanging
- Add 3s HTTP timeout for latest release fetch.
- Cache failed checks under version check file to avoid a second HTTP timeout. Fix dolthub/dolt#12021
- 11928: Support atomic multi-branch transactions and commits Enables atomic updates across branch working sets and heads with dolt_commit_all and the dolt_multi_branch_commit setting. Companion Doltgres PR: https://github.com/dolthub/doltgresql/pull/3615
go-mysql-server
- 4041: Clear sign on negative zero during
DecimalModFixes dolthub/dolt#12124 This is done inDecimalDiv, but it seems like the step was skipped forDecimalMod. - 4040: Fix off-by-one error when finding aggregated column during
replaceSortedMinMaxFixes #4037 - 4034: Set
orderByScope.colsproperties for SetOps using that of the merged columns Fixes dolthub/dolt#11714 Based on #3977 - 4032: Fix nullsafe logic for tuples containing null values
Previously, left and right elements in tuples were converted to a common type before comparing.
For
DATETIMEtypes, certain values would be converted to NULL when they did not need to be converted at all. Fixes: https://github.com/dolthub/dolt/issues/12109 - 4029: sql: Server lifecycle, background work and test harnesses support EngineVariables.
Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- Server lifecycle, background work and test harnesses support EngineVariables.
- Migrate remaining engine variable consumers.
- Keep global-only variables live outside session overlays.
- Bind collation wire harness sessions to their engines.
- Make COMPRESS assertions independent of the zlib byte stream.
- 4028: sql: SQL planning and execution access EngineVariables through Context/Session. Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- 4027: sql: Engine can carry EngineVariables and they are exposed on the Context and Session. Part of a body of work to remove the global SystemVariables and StatusVariables registries and make them state on the Engine itself.
- 4026: sql: Add factories for independent registries of SystemVariables and StatusVariables. Part of a body of work to remove these globals and make them state on the Engine itself.
- 4024: Fix panic for
JSON_PATHs pointing to null objects and null slices This PR adds regression tests forJSON_EXTRACTwhere theJSON_PATHpoints to a nil object and attempts to slice into it. Depends on: https://github.com/dolthub/jsonpath/pull/8 Fixes: https://github.com/dolthub/dolt/issues/12103 - 4022: sql/types: build the JSON_EXTRACT result array only from paths that match Fix dolthub/dolt#12107
- 4021: Do not remove GroupBy node when replacing sorted MIN/MAX aggregates
Based on #4014
Fixes dolthub/dolt#12093
MIN/MAXaggregates without an explicitGROUP BYshould still return a singleNULLrow when no rows match. For such cases whenMIN/MAXwas aggregating over a primary index, we were returning no rows; this was because inreplaceAgg, we were removing theGROUP BYnode, which was still needed to return the correct results via thegroupByIter. This PR does the following:- renames
replaceAggtoreplaceSortedMinMaxto more accurately reflect what the rule does - preserves
GROUP BYnode - have
replaceSortedMinMaxreturn aLIMIT 1over anIndexedTableAccessinstead of aLIMIT 1 ORDER BYnode. Because theGROUP BYnode is preserved, thereplaceIdxSortrule no longer replaces the previously createdLIMIT 1 ORDER BYnode with aLIMIT 1over anIndexedTableAccess1. Instead,replaceIdxSortHelpermust be called directly withinreplaceSortedMinMax.
- renames
- 4020: Handle
locatecase whenstrlength is 0 andpositionis greater than 0 fixes: https://github.com/dolthub/dolt/issues/12102 - 4015: Support conditional column drops in ALTER TABLE plans
Carries column-level
IF EXISTSinto drop plans and skips missing columns during schema validation. Adds coverage for existing/missing columns, repeated drops, and missing-table errors. Uses Vitess main following the merge of dolthub/vitess#501. ALTER TABLE and analyzer tests pass. Part of dolthub/doltgresql#3536. - 4014: Return a NULL row for MAX/MIN without GROUP BY when no row matches
MAX/MINwithoutGROUP BYreturned no row instead of oneNULLrow when no row matched, wheneverreplaceAggcould read the aggregated primary key column in index order:SELECT MAX(i) FROM emptytable; -- no row SELECT MAX(pk3) FROM three_pk WHERE pk1 = 2 AND pk2 = 0; -- no row since #3907replaceAggreplaced theGroupBywithLimit(1)over aSort, so empty input produced no row. It now keeps theGroupByand puts theLimit(1)over theSortbeneath it, so the scan still reads a single row when the index provides the order.replaceIdxSortdoesn't descend into aGroupBy, soreplaceAggconverts thatSortto an index scan itself. The 13 changed plans are the existing MAX/MIN plans, each gaining theGroupBy. The empty-input queries added toQueryTestsfail without the fix. Reported in https://github.com/dolthub/dolt/issues/12093. - 4012: Match MySQL Punctuation for
DATETIMEstring parsing This PR drops the regexes used forDATETIMEstring parsing in favor of regular logic. The new implementation covers many missing warnings, addresses several edge cases, and handles additional delimiters missing from the previous implementation. Additionally, fixes some wire tests that were previously silently failing. Fixes: - 4009: End non-recording spans in NewSpanIter.
- 4008: Make Handler.doQuery start and end the root query span. Remove Context.RootSpan and deprecate WithRootSpan.
- 4007: Stop ending the query in the process list when the top-level row iter is closed. The caller of BeginQuery owns EndQuery.
- 4005: Generate correct GetField expressions when optimizing joins on table aliases with pruned columns.
This PR fixes two related but distinct panics.
We had some duplicated logic when optimizing joins, where each implementation had a different bug that was fixed in the other.
In
convertSemiToInnerJoin, we generated GetField expressions that used the table name of the underlying table, not the table alias. This could cause these expressions to not resolve correctly. InconvertAntiToLeftJoin, we used the pruned table schema instead of the full table schema when calculating ColumnIds, resulting in a potential out-of-bounds access. Dolt PR: https://github.com/dolthub/dolt/pull/12082 Doltgres PR: https://github.com/dolthub/doltgresql/pull/3589 - 4003: Estimate a join of two empty estimates as empty on every architecture A join whose sides both have a row count and a distinct count of 0, as filtered reads of tables without statistics are estimated, made the selectivity 1/0 = +Inf and the cardinality 0 * +Inf = NaN. Converting NaN to uint64 is implementation-defined: arm64 gives 0, amd64 gives 1<<63. So on amd64 such a join was estimated at 2^63 rows, a hash or lookup join over it was priced in the 1e16s, and a nested-loop join won; on arm64 the same statement planned a hash join. The distinct count is now at least 1, so the cardinality is 0 on both, as arm64 already estimated it. The test fails on amd64 without the fix.
- 4001: Preserve aggregate input column IDs for HAVING Preserve GetField column IDs when adding aggregate inputs so HAVING retains grouping columns and evaluates the correct values. Fixes the incorrect result exposed by #3797. Adds the minimal repro and related ordinary/prepared regressions, with a TODO to migrate them after #3990. Engine regressions and planner, analyzer, row execution, and aggregation tests pass; SQL expectations match MySQL and PostgreSQL.
- 4000: Have nested stored procedures reuse existing transaction Nested stored procedure calls should not create a new transaction. Instead their changes are applied to the existing transaction. Fixes: https://github.com/dolthub/dolt/issues/11950
- 3998: Prevent subquery filter pushdown from substituting set-returning functions into scalar predicates Filters on SRF outputs now remain above row expansion, while safe predicates still push down and preserve correlation tracking.
- 3997: Fix extended-type hash key conversion Fixes extended-type hash joins by converting keys into the comparison type. Companions: https://github.com/dolthub/dolt/pull/12034 and https://github.com/dolthub/doltgresql/pull/3554.
- 3995: Fix
SIGNto handle signed floating points < 0.5 and string truncation Fix dolthub/go-mysql-server#3988 - 3994: Improve
TIMEparsing This PR further improves TIME parsing/conversions to more closely match MySQL's behavior. fixes: https://github.com/dolthub/dolt/issues/10000 - 3993: Moved the external function provider into the builder overrides
This moves the
ExternalFunctionProviderso that integrators can set it via overrides. We also add a call to it so that integrators are able to use functions from their provider in column defaults. - 3992: Added view recursion detection This fixes an OOM issue that occurs from recursive views.
- 3991: Optimize wildcard-only LIKE filters
Wildcard-only
LIKEfilters such asLIKE '%'andLIKE '%%%'now simplify toIS NOT NULLfor string operands. The rewrite only runs whenLIKEis the full filter expression, preserving NULL behavior in nested expressions. This also covers non-UTF-8 strings and constant-folded patterns. Tests:go test -tags=gms_pure_go ./sql/expression -count=1go test -tags=gms_pure_go ./sql/analyzer/... -count=1go test -tags=gms_pure_go ./enginetest -run '^TestCharsetCollationEngine$' -count=1Fixes #3943
- 3989: Infer precision for
TIMEfunction based off of: https://github.com/dolthub/go-mysql-server/pull/3986 partially addresses: https://github.com/dolthub/dolt/issues/11944 - 3985: Add regression test for ValueRowIter This PR adds a flag to QueryTests that asserts that the generated row iterator supports the ValueRowIter interface. This interface is typically more performant than the traditional RowIter, so we want to make sure that we don't regress on queries that use it. Dolt PR: https://github.com/dolthub/dolt/pull/12029 Doltgres PR: https://github.com/dolthub/doltgresql/pull/3549
- 3977: Sort set operation ORDER BY by the output column
Fixes dolthub/dolt#11714
A set-op
ORDER BYthat named a projected column re-evaluated the left branch's expression, rather than reading the set op's output column.buildSortConditionsonly rewrites aliases, so an unaliased literal, or a function such asabs(-1000), sorted by a constant. This change points those terms at the output column, typed with the merged column type. Terms that are already aGetFieldare left unchanged, so existing plans don't change. The expected results in the new script test come from MySQL 8.4.11. Without the fix, 10 of the 16 assertions fail. The rest are guards, includingselect 10 union select '9' order by 1, which has to keep sorting as strings.go test ./sql/... ./enginetest/...passes. There are two related problems on main that I left out of scope:select a from t union select 'x' order by 1still sorts the table column with its own int type. MySQL compares as strings here.select a, a from t union select b, 1 from u order by 2sorts by column 1, because both projections share one column id.
- 3916: Prune table columns beneath HAVING Allow projection pruning to traverse HAVING while retaining the columns needed by grouping, aggregates, and joins. HAVING expressions with subqueries continue to keep the outer table unpruned. Part of dolthub/dolt#11923
- 3893: Fix window expression identity collisions Use a structural identity when deduplicating window expressions so distinct resolved columns with colliding rendered names are retained independently. The identity includes expression structure and resolved field IDs plus window partition, order, NULL-ordering, and frame semantics, while excluding the assigned root output ID. Fixes dolthub/dolt#11855
- 3891: Fix implicit peer frames for window functions
Implicit ordered
LAST_VALUE,BIT_AND,BIT_OR, andBIT_XORdid not consistently use the defaultRANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROWpeer semantics. Use the resolved peer group forLAST_VALUEand the shared aggregate default-frame path for the bitwise aggregates. Regression coverage includes peer rows, the exact runningBIT_ORcase, explicit-equivalent frames, descending order, and compound ordering. The new assertions match MySQL 8.0.45 and PostgreSQL 15.17. Fixes dolthub/dolt#11856 Fixes dolthub/dolt#11857 - 3890: Fix nullable RANGE frame boundaries
Nullable numeric
RANGEframes could include unrelated rows when NULL boundary comparisons disagreed with the window's ordering. Preserve the effective NULL placement in RANGE framers and use it when scanning boundaries, supporting both MySQL's NULL-first and PostgreSQL's NULL-last ascending defaults. Regression coverage checks bounded nullable frames and explicitly verifies sorted rows and peer intervals for all four direction/NULL-rank combinations. The shared SQL results match real MySQL 8.4.11 and PostgreSQL 15.17. Fixes dolthub/dolt#11858 - 3797: Resolve correlated aggregates at their outer scope
Correlated aggregates in nested queries could be assigned to the syntactically inner query even when their arguments belonged to an outer query. This could evaluate an aggregate in the wrong scope and produce runtime type errors.
This change determines aggregate ownership from resolved argument columns instead of AST nesting. It:
- Tracks semantic query blocks separately from transient builder scopes.
- Resolves aggregate arguments through the query-block chain while preserving normal name resolution and shadowing.
- Registers each aggregate with the closest query that supplies one of its arguments.
- Replaces correlated argument dependencies with the resulting aggregate dependency.
- Applies the same ownership rules to
GROUP_CONCATand its ordering expressions. - Centralizes aggregate registration and dependency collection to keep IDs and references consistent.
Coverage includes ordinary and prepared execution, nested and parenthesized queries, joins, CTEs, unions, alias shadowing, mixed local and outer arguments, ordered
GROUP_CONCAT, and strict-grouping failures. The related grouped-window validation gap remains tracked in #3856. Fixes #3814
vitess
- 501: Represent DROP COLUMN IF EXISTS in the DDL AST
Parses and formats
ALTER TABLE ... DROP COLUMN IF EXISTS, with a column-level flag separate from table-levelIF EXISTS. Adds parse/format round-trip coverage; the full parser test package passes. Part of dolthub/doltgresql#3536. - 500: Preserve subquery input expressions in
EXPLAINqueries Previously, because Explain parse nodes did not implementWalkableSQLNode, Vitess would not walk them to populate input expressions on subqueries. This let to cases where go-mysql-server would produce a different plan for aDESCRIBE PLANquery compared to the original query.
Closed Issues
- 12115: dolt-sql-server image: a demoted cluster node can't restart (entrypoint setup is rejected on a standby, and the exit is silent)
- 12124: negative dividend in
modyields incorrect negative results - 11714: Top-level
ORDER BYdoes not seem to be applied to unions - 12109: Fix null safe equals for tuple comparisons
- 12106: Lookup join panics on a
NULLliteral key for aNOT NULLcolumn - 12107:
JSON_EXTRACTpanics when one of several paths matches nothing - 12093: Ungrouped MAX/MIN over a primary-key column returns no row when nothing matches
- 12103:
JSON_EXTRACT('{"a": null}', '$.a[0]')panics - 12102:
LOCATEpanics on empty string - 11505: Date-valued window arithmetic appends a zero-time suffix
- 7690: Support MySQL datetime parsing behavior
- 10399:
TIMESTAMPDIFFshould return null for invalid datetimes - 12067: dolt diff cannot track beyond a 'drop & recreate' action with identical index definition
- 11750: Throw warning for non-standard
DATEandDATETIMEdelimiters - 11939: extend delimited datetime regex(es)
- 12060: git+https remote push fails with 'does not support this repository's hash algorithm' against SHA-256 git repos
- 12089: Standalone remotesrv Table-File Upload Endpoint Allows Unauthenticated Path Traversal File Writes on Dolt
- 12090: Dolt Cluster Replication Endpoint Processes Client-Controlled Role Headers Before JWT Authentication, Allowing Persistent Unauthenticated Primary Demotion
- 12056: SyncRoots returns success when reading the source root fails (DOLT_BACKUP sync/restore report success)
- 11367: Merge silently picks one expression when branches add the same generated column with different AS(...) definitions
- 11904: git+https remote: Windows push fails on FETCH_HEAD 'Permission denied'; redundant fetch fan-out, no --no-write-fetch-head, console per git spawn
- 11636: Query is 1.76x slower in Dolt than MySQL
- 11950: Stored procedure that CALLs another procedure inside an explicit transaction silently discards the caller's earlier writes
- 12039:
CREATE TABLE IF NOT EXISTSfails for an existing nonlocal table on a non-target branch - 10000: truncate strings when casting to
time - 12036:
DESCRIBE PLAN {{query}}can result in a different plan than{{query}} - 11858: Nullable numeric
RANGEbounds expand to the whole partition - 11855: Dolt merges two different window operands whose qualified-column strings collide
- 11857: Dolt BIT_OR ignores ORDER BY when selecting its window frame
- 11856: Dolt LAST_VALUE uses a ROWS-like implicit frame instead of the default RANGE peer frame
- 12021:
dolt versionblocks for 30 s or more on every call when api.github.com is slow or unreachable - 4037: Panic
index out of rangeinreplaceAggfor ungrouped MIN/MAX of a non-key column when WHERE fixes the whole primary key - 3943: Simplify
col LIKE '%'tocol IS NOT NULLin analyzer - 3988: SIGN() returns 0 for non-zero values with magnitude below 0.5
- 3814: Plan correlated aggregates correctly across nested semantic scopes
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.35 | 0.14 |
| groupby_scan | 132.49 | 70.55 | 0.53 |
| index_join | 3.43 | 2.0 | 0.58 |
| index_join_scan | 4.18 | 1.32 | 0.32 |
| index_scan | 344.08 | 200.47 | 0.58 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 4.91 | 1.36 |
| select_random_points | 0.35 | 0.52 | 1.49 |
| select_random_ranges | 0.38 | 0.65 | 1.71 |
| table_scan | 344.08 | 200.47 | 0.58 |
| types_table_scan | 746.32 | 450.77 | 0.6 |
| reads_mean_multiplier | 0.84 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 4.03 | 0.52 |
| oltp_insert | 4.1 | 2.07 | 0.5 |
| oltp_read_write | 8.74 | 10.09 | 1.15 |
| oltp_update_index | 4.33 | 2.22 | 0.51 |
| oltp_update_non_index | 4.1 | 1.93 | 0.47 |
| oltp_write_only | 5.18 | 5.18 | 1.0 |
| types_delete_insert | 8.43 | 4.49 | 0.53 |
| writes_mean_multiplier | 0.67 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 97.17 | 57.8 | 1.68 |
| tpcc_tps_multiplier | 1.68 |
| Overall Mean Multiple | 1.06 |
|---|
Footnotes
-
replaceIdxSortdoes not work forGROUP BYnodes due to how it can be nested inside and/or around anORDER BY, i.e.Sort, node. ↩
v2.4.22.4.2
Merged PRs
dolt
- 12025: Fixed foreign keys referencing a renamed index
This fixes the issue presented in:
- https://github.com/dolthub/doltgresql/issues/3517
This moves the index renaming logic so that it also covers
ALTER INDEXinstead of onlyRENAME INDEX.
- https://github.com/dolthub/doltgresql/issues/3517
This moves the index renaming logic so that it also covers
- 12024: Quoted dolt_blame view identifiers with the engine's schema formatter
This moves quoting for the
dolt_blame_*tables to use the quoting function so that Doltgres uses its quotes. Previously we were hardcoding MySQL quotes, which caused parsing errors on Doltgres. - 12023: docs: document the NBS storage lock contract
Closes #11262
go/store/nbs/README.mddescribed NBS's on-disk layout but never mentioned the advisory file lock, so operators had nothing to read when a restart raced a running server. The new "Storage locking" section documents the lock's path (<database dir>/.dolt/noms/LOCK), that it goes throughgithub.com/dolthub/file-locks(flock(2)on unix,LockFileExon Windows), and that it is advisory. It covers the lifetime (newJournalLockacquires,NomsBlockStore.Closereleases; there is no maximum hold time), the 100 mslockFileTimeoutand what happens after it (a silent read-only open by default,ErrDatabaseLockedwithfail_on_journal_lock_timeout, a single non-blocking attempt withskip_journal_lock_timeout), that akill -9cannot leave a stale lock because the kernel releases flocks, that theLOCKfile itself always remains and its presence says nothing about lock state, and that deleting theLOCKfile while a process holds the lock silently breaks mutual exclusion. Everything stated here was read out ofgo/store/nbs/file_manifest.go,go/store/nbs/journal_manifest.goand thegithub.com/dolthub/file-locksAPI (lockFileTimeout,ErrDatabaseLocked, thefail_on_journal_lock_timeout/skip_journal_lock_timeoutoptions). The caveat that the guarantees are only as good as the mount over NFS/SMB is stated as such rather than as a tested claim. Documentation only - no Go code changed.This pull request was prepared with the assistance of an AI coding agent and has not yet been reviewed by a human.
- 12018: Allow schema overrides with ignored nonlocal tables Nonlocal tables now retain their own schema when absent from the schema-override commit. Existing overrides still apply, and ordinary local lookups remain strict. Resolve nonlocal targets through user-table lookup and keep conflict backing tables on the same root, preventing conflict updates from being redirected to another branch. Adds focused regression coverage for ignored tables, cross-branch aliases, committed targets, and conflict updates. Validated normal/prepared nonlocal and rebase engine suites, plus schema-override suites with standard and adaptive encoding. Fixes #11997
go-mysql-server
- 3971: Delegate
INelement evaluation to comparison expressions and apply coercibility to HashInTupleINpredicates respect character set and collation comparison rules (such as accent-insensitivity inutf8mb4_unicode_ciandutf8mb4_0900_ai_ci) for both sequential tuple evaluations and in-memory hash lookups. Fix dolthub/dolt#11907 - 3947: Execute duplicate-key update triggers Executes duplicate-key update triggers, with import regression coverage in https://github.com/dolthub/dolt/pull/11980 and DoltgreSQL compatibility changes in https://github.com/dolthub/doltgresql/pull/3469. Fixes https://github.com/dolthub/dolt/issues/5925
- 3936: Convert
ANY_VALUEfrom an aggregate to a scalar function Unaggregated queries containingANY_VALUEno longer synthesize a whole-tableGroupBynode or collapse rows, and windows invocations likeANY_VALUE(a) OVER ()are properly rejected as a syntax error.- Add
function.AnyValueas a scalarsql.FunctionExpressionto avoid artificialGroupBynode and collapsing rows. - Remove aggregate and window patches now that there's no aggregate function nesting errors.
- Exempt
ANY_VALUEarguments fromONLY_FULL_GROUP_BYvalidation invalidateGroupBy. Fix dolthub/dolt#11911 Fix #3944
- Add
Closed Issues
- 11262: Document the noms LOCK contract (<data_dir>//.dolt/noms/LOCK): acquire timeout, lifetime/staleness, external-waiter flock safety
- 11739: conjoin opens unbounded concurrent connections — exceeds sshd MaxStartups on git+ssh remotes, so conjoin never completes
- 11997: unable to find global table at overridden schema root
- 3944:
ErrIndexOutOfBoundsevaluating correlated scalar subquery in joinedGROUP BY
v2.4.12.4.1
Merged PRs
dolt
- 12016: /{go,integration-tests}: use a more specific cache key Use the local database cache root, remote URL, and effective Git ref as the cache key so databases and custom refs cannot incorrectly share a remote handle. The SQL provider and Git remote factory share key construction, and remote opens and cache lookups share parameter construction. Validated with all eight SQL Git-remote integration tests and targeted remote configuration, factory, and database provider Go tests. Fixes #12011.
- 12002: Fix
CREATE TABLErejected on the target branch of a nonlocal table rule- Add
checkNonlocalTableNameforDatabase.CreateTableandDatabase.CreateIndexedTableto allow a table name where the nonlocal rule resolves it locally. Fix dolthub/dolt#11995
- Add
- 11993: /go/{cmd,libraries,store}: allow configuring git remotes
Add
git-remote.max-history-commitsandgit-remote.reset-history-on-prunesettings so users can trade disk usage for faster incremental transfers. Support local/globaldolt config, environment overrides, and typed options for embedders. Defaults remain unchanged. A history limit of0means unlimited; disabling prune-triggered resets allows obsolete data to remain reachable until the history limit is reached. - 11991: /go/store/blobstore: use fetch anchor ref Preserve a persistent Git fetch anchor during teardown so subsequent pulls can negotiate incremental transfers instead of re-downloading the database. Compare-and-swap protects the anchor from overlapping sessions while allowing private refs to be cleaned up.
- 11990: significantly faster implementation of dolt log
With these optimizations,
dolt logis now anO(N)operation rather than anO(N^2). Optimizations:- Only query
dolt_branches,dolt_tags,dolt_log()once instead of for every commit CommitInfois passed as a pointer Potential improvements:- There are places where we can now add concurrency for long running queryist calls
- Pagination can now be properly implemented, but it is left as a TODO Before:
After:james@macbook beads_sample % time dolt log -n 5000 > out.txt dolt log -n 5000 > out.txt 97.62s user 2.81s system 157% cpu 1:03.60 total
About a 1000x improvement, which scales exponentially as number of commits increase. Fixes: https://github.com/dolthub/dolt/issues/9315james@macbook beads_sample % time dolt log -n 5000 > out.txt dolt log -n 5000 > out.txt 0.09s user 0.13s system 15% cpu 1.422 total - Only query
- 11989: /go/store/nbs: cover missing spooling paths Newly persisted Git-backed tables and conjoin input reads bypassed NBS spooling, causing redundant Git reads and decompression. This change spools persisted tables from bytes already in memory and makes conjoin reuse existing source readers. Adds regression coverage for chunk correctness, blob read counts, and spool cleanup. Full NBS tests and focused race tests pass. Fixes #11916.
- 11985: Fix License Link
- 11980: Test update triggers during CSV imports Adds CSV import regression coverage for update triggers alongside https://github.com/dolthub/go-mysql-server/pull/3947 and https://github.com/dolthub/doltgresql/pull/3469. Fixes https://github.com/dolthub/dolt/issues/5925
- 11756: Bump google.golang.org/grpc from 1.83.1 to 1.83.2 in /go Bumps google.golang.org/grpc from 1.83.1 to 1.83.2.
go-mysql-server
- 3979: Preserve decimal precision in GREATEST and LEAST Preserves exact decimal values and result types in GREATEST and LEAST. Fixes https://github.com/dolthub/dolt/issues/10567
- 3976: Test EXISTS and NOT EXISTS with window functions Adds regression coverage for NOT EXISTS and multiple window functions inside EXISTS subqueries. Fixes https://github.com/dolthub/dolt/issues/11421
- 3975: Test EXISTS over empty scalar aggregate inputs Adds regression coverage for EXISTS and NOT EXISTS over scalar SUM aggregates with empty inputs and grouped controls. Fixes https://github.com/dolthub/dolt/issues/11489
- 3974: Test listener shutdown with pending connections Adds regression coverage for TCP and Unix listener shutdown races and Accept after Close.
- 3973: Preserve literal defaults during ALTER table rewrites ALTER rewrites starting from persisted schema could reclassify literal defaults as expressions, causing datetime COLUMN_DEFAULT values to gain quotes after subsequent column changes. Resolve defaults in the current schema before rewriting, preserving literal metadata and existing multi-column ALTER behavior. Adds shared engine coverage for metadata, SHOW CREATE, and default insertion. All 50 Dolt default-value BATS cases, Dolt MODIFY tests, and relevant GMS suites pass; expectations were checked against MySQL 8.4.11. Addresses the Lambda BATS failure in Dolt #11994.
- 3970: Support PostgreSQL UPDATE row counts Add an engine override to support PostgreSQL UPDATE row count behavior, where all matched rows are counted. Also simplifies INSERT ON DUPLICATE UPDATE handling. Addresses https://github.com/dolthub/doltgresql/issues/3113. Doltgres PR: https://github.com/dolthub/doltgresql/pull/3468.
- 3967:
INexpr: compare every element of the right tuple this changes the previous assumption of all tuple elements being of the same type. Fixes: dolthub/dolt#11968 - 3965: Reject out-of-range INET_NTOA arguments Returns NULL with a warning for INET_NTOA arguments outside the IPv4 range. Fixes https://github.com/dolthub/dolt/issues/11510
- 3964: Validate twelve-hour STR_TO_DATE inputs Validates twelve-hour STR_TO_DATE inputs and normalizes midnight and noon consistently with MySQL. Fixes https://github.com/dolthub/dolt/issues/11544
- 3963: Reset regular expressions between window partitions Reinitializes disposed regular expressions when they are reused across window partitions. Fixes https://github.com/dolthub/dolt/issues/11550
- 3962: Clamp unsigned MEDIUMINT serialization to its maximum value Clamps unsigned MEDIUMINT serialization to 16777215.
- 3961: Store binary collation metadata explicitly Stores binary collation metadata explicitly instead of deriving it from collation names. Fixes https://github.com/dolthub/go-mysql-server/issues/3838
- 3960: Preserve NULL semantics for indexed NOT IN subqueries Avoids lookup and merge joins that discard NULL semantics in nullable NOT IN subqueries.
- 3959: Recompute stored generated columns after definition changes Recomputes stored generated columns and their dependents when MODIFY or CHANGE alters their definitions. Fixes https://github.com/dolthub/dolt/issues/11781
- 3958: Reject malformed UTF-8 in CONVERT USING utf8mb4 Returns NULL with a warning when CONVERT USING utf8mb4 receives malformed UTF-8. Fixes https://github.com/dolthub/go-mysql-server/issues/3837
- 3957: Preserve unsigned bits when casting to SIGNED Reinterprets BIGINT UNSIGNED values as signed integers when evaluating CAST AS SIGNED. Fixes https://github.com/dolthub/dolt/issues/11906
- 3956: Preserve NOT IN predicates that cannot be unnested Preserves negation on residual NOT IN predicates when sibling subqueries become anti joins. Fixes https://github.com/dolthub/dolt/issues/11913
- 3955: Convert STR_TO_DATE arguments to strings Accepts binary and numeric arguments to STR_TO_DATE using MySQL-compatible string conversion. Fixes https://github.com/dolthub/dolt/issues/11919
- 3954: Respect context cancellation errors during group by aggregation Cancels blocked grouping producers when the grouping consumer returns an error.
- 3953: Allow grouped expressions without column dependencies Allows column-free expressions and correlated subqueries that reference only grouped columns under ONLY_FULL_GROUP_BY.
- 3952: Account for COUNT DISTINCT memory usage Tracks COUNT DISTINCT allocations through the session memory manager after the grouping cancellation fix in #3954.
- 3951: Validate temporal cast precision Validates temporal cast precision before constructing the target type.
- 3950: Fix correlated subquery dependencies in grouped joins Preserves correlated subquery column dependencies when grouping over joins.
- 3949: Fix column statistics queries without initialized privileges Returns an empty iterator when column statistics are queried without initialized session privileges.
- 3948: Implement numeric converts to
TIMEwith precision Implement conversion for numeric types toTIMEincluding precision parameters. Also includes conversion logic forbooleantypes and small fixes for string conversions. - 3947: Execute duplicate-key update triggers Executes duplicate-key update triggers, with import regression coverage in https://github.com/dolthub/dolt/pull/11980 and DoltgreSQL compatibility changes in https://github.com/dolthub/doltgresql/pull/3469. Fixes https://github.com/dolthub/dolt/issues/5925
- 3941: Resolved table and CTE authorization Fixes a bug where subqueries could bypass permissions in some instances (test cases are now returning errors), and also adds an interface for:
- 3940: Require UPDATE privileges for duplicate-key inserts INSERT ... ON DUPLICATE KEY UPDATE could rewrite rows without UPDATE privileges. Require UPDATE authorization and return the MySQL-compatible error code when access is denied.
- 3918: Support escaped
LIKEwildcard in analyzer prefix extraction and pattern matching Fix dolthub/dolt#11903 Fix dolthub/dolt#11910 Blocked by dolthub/vitess#497 Block dolthub/dolt#11937 Close dolthub/go-mysql-server#3972
vitess
- 498: Removed parse-time CTE authorization CTEs are properly handled in GMS now, so this removes the check. Is a dependency of:
- 494: Support Dolt executable SQL comments Parses DOLT executable comments for the SQL integration in https://github.com/dolthub/dolt/pull/11851. Fixes https://github.com/dolthub/dolt/issues/3096
Closed Issues
- 11911: ONLY_FULL_GROUP_BY: uncorrelated scalar subqueries in grouped SELECT lists — intended behavior or oversight?
- 11995: Creating a table that matches a dolt_nonlocal_tables rule fails on the rule's target branch, depending on how the primary key is declared
- 12011: sql-server: git remotes with the same URL but different
--refshare one ref — a push from one database overwrites another database's data - 11558: Dolt ignores default backslash escaping for wildcard characters in a window child
- 11907: IN predicate ignores utf8mb4_unicode_ci for accent-insensitive comparisons
- 5925: Update triggers do not fire on
INSERT INTO...ON DUPLICATE KEY UPDATE... - 11968: WHERE returns a row for an IN predicate that evaluates to FALSE
- 10567:
GREATESTandLEASTfunctions should return decimal type when args are decimal types - 8961: Generated Columns deleted the VECTOR index.
- 11949: git remote: since v2.1.2 a pull can re-download the whole database, because each process deletes its fetch ref
- 11910: LIKE does not honor MySQL's default backslash escape
- 11903: String literals drop the backslash in % and _, so LIKE '%_%' matches every row (differs from MySQL)
- 9315:
dolt logtakes really long time. - 11916: GitBlobstore: every ranged read re-inflates the git object from byte 0 — pulls from git remotes are O(reads × part size) (40 min → 2 min with an OID cache)
- 11781: ALTER TABLE MODIFY COLUMN does not recompute a STORED generated column, leaving rows and indexes stale
- 11984: License link is broken
- 11550: Dolt returns a wrong result for REGEXP_LIKE across partitions
- 11913: Planner drops the NOT from the first of two ANDed NOT IN (subquery) predicates when its subquery is a UNION — query returns exactly the excluded rows
- 11919: STR_TO_DATE() with BLOB argument errors with "invalid type: []uint8"
- 11906: Incorrect CAST from BIGINT UNSIGNED to SIGNED
- 8657: Vector index lookup errors when index is non-covering.
- 3838: Add explicit metadata flag on
Collationfor binary collations - 3837: Emit
ER_INVALID_CHARACTER_STRINGon malformed multi-byte character strings instead of returningErrCollationMalformedString
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 18.61 | 2.35 | 0.13 |
| groupby_scan | 134.9 | 74.46 | 0.55 |
| index_join | 3.49 | 1.93 | 0.55 |
| index_join_scan | 4.25 | 1.34 | 0.32 |
| index_scan | 356.7 | 200.47 | 0.56 |
| oltp_point_select | 0.19 | 0.26 | 1.37 |
| oltp_read_only | 3.68 | 5.0 | 1.36 |
| select_random_points | 0.36 | 0.52 | 1.44 |
| select_random_ranges | 0.39 | 0.65 | 1.67 |
| table_scan | 356.7 | 200.47 | 0.56 |
| types_table_scan | 759.88 | 458.96 | 0.6 |
| reads_mean_multiplier | 0.83 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 6.21 | 0.81 |
| oltp_insert | 4.1 | 3.19 | 0.78 |
| oltp_read_write | 8.9 | 11.24 | 1.26 |
| oltp_update_index | 4.33 | 3.36 | 0.78 |
| oltp_update_non_index | 4.1 | 3.07 | 0.75 |
| oltp_write_only | 5.18 | 6.32 | 1.22 |
| types_delete_insert | 8.43 | 6.79 | 0.81 |
| writes_mean_multiplier | 0.92 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 97.33 | 53.48 | 1.82 |
| tpcc_tps_multiplier | 1.82 |
| Overall Mean Multiple | 1.19 |
|---|
v2.4.02.4.0
In line with our versioning policy, 2.4.0 is a minor version release because it contains potentially breaking changes in behavior:
INSERT INTO .. ON DUPLICATE KEY UPDATEstatements were incorrectly enforcing onlyINSERTprivileges on tables, rather thanUPDATEprivileges. Applications that relied on a client havingINSERTprivileges but notUPDATEwill now fail with an error.- Several error codes have been changed to match what MySQL returns.
Merged PRs
dolt
- 11956: Fix upsert authorization and add protocol regression coverage Upserts could rewrite rows without UPDATE privileges. Update GMS to require UPDATE authorization and add protocol regression coverage for denied and permitted upserts.
- 11935: Replace github.com/dolthub/fslock with github.com/dolthub/file-locks The new library keeps the interface - New, Lock, TryLock, LockWithTimeout, Unlock, Close, ErrLocked and ErrTimeout - so nothing here changes but the import line. The package is still named fslock, imported under that name from a path that no longer matches it.
- 11933: Allow DoltgreSQL to override effective user in search path $user substitution.
- 11921: Allow DoltgreSQL to provide branch-control principal
- 11920: Add DoltgreSQL transaction lifecycle hooks These allow Doltgres to see transaction start, why a transaction ended (rollback, commit) and interact with savepoints as well.
- 11896: Limit CI deferral comments to label and draft state changes Limits CI deferral and release comments to relevant label changes and draft/ready transitions, preventing duplicate notifications on commit pushes.
- 11893: go/store/nbs: Fix two nil-ghostGen bugs in GenerationalNBS
Two pre-existing bugs on the
ghostGen == nilpath, both only reachable outside the Dolt server (dbfactoryalways supplies a ghost store):HasManyreturnednilinstead of the absent set, hiding missing hashes. Regression test included.PersistGhostHasheshad its nil check inverted.
- 11892: go/store/nbs: Fix generation ordering on reads to avoid missing a chunk which is being moved from new to old gen. When GC moves chunks from new to old gen, it publishes them into old gen and then, eventually, drops them from new gen. If the Reads check old gen first, and then fall back to new gen, they can miss a chunk which is actually retained --- the entire GC can run in between the return from the old gen Read and before the new gen Read. Reading new gen first is the fix. If the chunk isn't in new gen and it does exist, it has guaranteed already been published to old gen by the time we ask for it.
- 11891: go/store/nbs: Drain outstanding reads before a GC installs its keeper. An unlocked read samples |nbs.keeperFunc| under |nbs.mu| and then runs against a table set with the lock released, so a read already in flight when BeginGC installed its keeper could return chunks having taken no read dependency on them, leaving the GC free to collect them. BeginGC now sets |gcInstallPending| and waits for |outstandingReads| to drain before installing, and every read path parks on that flag at the top of its locked section. Parking there, rather than in |beginRead|, keeps a read which spans the memtable and the table files from being split across the barrier. A BeginGC whose context is cancelled during the drain clears the flag and restores conjoin, so it leaves no reads parked and no conjoin disabled.
- 11889: go/store/nbs: Sample the keeper in |beginRead|, and register every unlocked read. |beginRead| now samples |nbs.keeperFunc| and |nbs.gcCycleCounter| itself and registers every unlocked read, rather than each call site sampling them separately and only reads which started during a GC being registered. A read's keeper and cycle therefore come from the same locked section which registers it, |nbs.outstandingReads| counts every read running against a table set, and |endRead| is never nil. This is the plumbing for making a keeper installation a barrier: the follow-up drains those registrations before it installs a keeper. The costs are that a read with no GC running reacquires |nbs.mu| once at completion, where before it did not, and that EndGC now also waits out reads which started before its GC began.
- 11888: go/store/nbs: Fix a lost cancellation wakeup in |waitForGC|.
Now take
nbs.muwhen we broadcastgcCond, so that our waiter is definitely already parked if they need to see our wakeup. - 11887: go: NodeStore, ValueStore: Avoid caching things that might have been read before an incoming Purge request.
The NodeStore and the ValueStore cache have the structure where they are queried and, if there is a miss, a fetch is made the underlying ChunkStore. They are then populated with the result. GC runs a Purge operation on these caches. This makes all future read operations reach the ChunkStore layer during the GC operation, so that proper dependencies can be taken on them.
This change fixes a race where
Get -> Read -> Purge -> Putcould result in the cache carrying data throughout and after the GC which might have been read before the Purge operation itself. The caches now carry a purge count and they refuse to populate with values which were fetched based on a Get at a previous purge count. - 11872: integration-tests/go-sql-server-driver: Add machinery to run
dolt fsckon the database directories anytime these tests fail. - 11854: Print SQL boolean results as numeric values Prints boolean SQL results as 1 and 0 in text and CSV output to match MySQL. Fixes https://github.com/dolthub/dolt/issues/6044
- 11852: Validate destination branch names before pushing Rejects invalid destination branch names before pushing to remotes. Fixes https://github.com/dolthub/dolt/issues/5341
- 11851: Enable Dolt executable comments in SQL scripts Enables DOLT executable comments with the parser support in https://github.com/dolthub/vitess/pull/494. Fixes https://github.com/dolthub/dolt/issues/3096
- 11849: Support JSON Lines output for SQL queries Adds jsonl SQL result formatting with one JSON object per row. Fixes https://github.com/dolthub/dolt/issues/1844
- 11844: Show
ON UPDATE CURRENT_TIMESTAMPacross schemas and table alterations inEXTRAcolumn Fix dolthub/dolt#11774 Blocked by dolthub/go-mysql-server#3862 - 11773: go/store/nbs: Add validation and sanity checks on the index data when a NomsBlockStore opens a table file. Two types of checks are added. Simple checks are run on every index parse. They assert that prefixes are in sorted order, that ordinals are within range, that offsets (dervied from the lengths) are not too small. The more expensive checks only run when we add new table files to the store, typically as part of GC, a pull or receiving a push. These further assert that recorded ordinals are unique and that the hash of the suffixes table matches the file name, which is how the table file name is derived on all write paths. These sanity checks are added to make Dolt more robust in the face of bugs in Dolt or unexpected behavior from I/O interactions. If these validation checks fail, Dolt has a chance to fail a write operation which is attempting to take a new dependency on the corrupted data.
- 11643: dynamic merge conflict handling This change allows for more flexible row merge behavior, in particular the ability to detect conflict on matching values and create rows dynamically based on the callers requirements. DumboDB is the direct consumer of this change. This allows us to match Dumbo's standard compare-and-set query pattern, and to also enable collection specific merge modes. There may be cleaner ways to implement this, but I opted to touch the common (dolt) code path as little as possible since this could have significant perf impacts. nil rowMergePolicy is the dolt way as a result.
- 11618: {proto,go/serial}/.bazelversion: Bump to 9.2.0. Bump some module versions.
go-mysql-server
- 3946: Default to
InternalDecimalTypeforCONVERTwith decimal arguments Fix regression from https://github.com/dolthub/go-mysql-server/pull/3939 dolt bump in https://github.com/dolthub/dolt/pull/11915 doltgres bump in https://github.com/dolthub/doltgresql/pull/3421 - 3940: Require UPDATE privileges for duplicate-key inserts INSERT ... ON DUPLICATE KEY UPDATE could rewrite rows without UPDATE privileges. Require UPDATE authorization and return the MySQL-compatible error code when access is denied.
- 3939: fix panic for
CASTandCONVERTto types with invalid precision/scale Ideally,CAST/CONVERTshould only require the destinationsql.Typeto make the proper conversion. However, a significant portion of our conversion and comparison logic is so dependent on existing hackiness that it would require an entire rewrite to properly implement. As a result, this is a minimal change that fixes the panic and leaves the logic in a slightly better place. - 3924: Fix panic on nil decimal values in
VALUESderived tables Fix dolthub/dolt#11942 - 3923: Resolve untyped
NULLcolumns in CTAS toVARBINARY(0)Fix dolthub/dolt#11941 - 3921: Fix non-literal evaluation in
unix_timestampFix dolthub/dolt#11917 - 3920: Fix panic converting strings with a dangling exponent Fix dolthub/dolt#11918
- 3919: implement precision for TIME types
Add support for precision parameter for
TIMEtypes. Implements proper rounding and string output according to the precision. fixes: https://github.com/dolthub/dolt/issues/10661 - 3911: Add delimited time regex
Fixes a regression from #3901 that breaks the dolt bats test
import-create-tables: table import -c infers types from data(dolthub/dolt#11922). - 3908: Unwrap
ANY_VALUEfor aggregates and window functions Fix dolthub/dolt#11912 - 3907: Optimize aggregate functions and remove sort nodes on multi-column indexes provided that any columns before the aggregated/sorted column are constant
Dolt attempts to remove ORDER BY nodes from the plan when the chosen index is guaranteed to already produce rows in the desired order. But currently, it's limited to cases where the sort expressions are a prefix of the index. This means that we don't currently remove the sort in examples like this one:
We can optimize this by using the primary index, because even thought we're not ordering byCREATE TABLE test (pk1 int, pk2 int); SELECT pk2 FROM test WHERE pk1 = 64 ORDER BY pk2 LIMIT 1;pk1, the value ofpk1is constant for all results. Additionally, Dolt tries to optimize MIN and MAX functions into the above. This also currently requires that that the column being aggregated is the first column in the index, meaning that we can't optimize the following:
The second SELECT is unlikely to be written by hand but could be produced procedurally or as the result of other optimizations.CREATE TABLE test (pk1 int, pk2 int); SELECT MIN(pk2) FROM test WHERE pk1 = 64; SELECT MIN(pk2) FROM test WHERE pk1 = 64 GROUP BY pk1; - 3904: Fix
ONLY_FULL_GROUP_BYvalidation for window functions - 3901: handle no delimiter datetime string parsing Fix support for parsing non-delimited datetime strings to DATE, DATETIME, and TIMESTAMPS. Additionally, fixes parsing for weirdly delimited datetime strings. Fixes: https://github.com/dolthub/dolt/issues/10278
- 3900: Fixed duplicate window columns Fix required for:
- 3899: Fix dropped residual filters and false branch matching in concat lookup join Fix dolthub/dolt#11886
- 3898: Use common extended type for VALUES rows Delegate VALUES common-type selection to the extended-type hook when both row expressions use extended types. This lets dialect integrations resolve unknown NULL literals against typed VALUES rows while preserving existing built-in type handling. Includes focused schema inference coverage. Part of dolthub/doltgresql#3388
- 3897: Optimize
SPACEwithstrings.RepeatFix dolthub/dolt#11408 - 3889: Filled generation_expression and extra for generated columns in information_schema.columns
information_schema.columns now reports the generation expression and STORED/VIRTUAL GENERATED extra for generated columns instead of leaving them empty. Although this was found and fixed in the Doltgres integrator, GMS requires a different fix as Doltgres uses its own
information_schematable implementation. - 3885: Support wildcard replication filter values Adds native string-list values for REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE, including MySQL-compatible format validation and SHOW REPLICA STATUS formatting. Simplifies replication option handling to use native Go values instead of exported wrapper types. Companion Dolt PR: github.com/dolthub/dolt/pull/11842 Companion: dolthub/dolt#11842
- 3867: Resolve
order bycolumns using column ID instead of name to avoid ambiguity fixes dolthub/dolt#11418 - 3862: Always generate format column
ON UPDATEclauses inEXTRAFixEXTRAcolumn to always generate onDESCRIBE,SHOW COLUMNS, andinformation_schema.columns. Block https://github.com/dolthub/dolt/pull/11844
vitess
- 494: Support Dolt executable SQL comments Parses DOLT executable comments for the SQL integration in https://github.com/dolthub/dolt/pull/11851. Fixes https://github.com/dolthub/dolt/issues/3096
- 493: Add wildcard replication filter syntax
Adds parser and AST support for
REPLICATE_WILD_DO_TABLEandREPLICATE_WILD_IGNORE_TABLEinCHANGE REPLICATION FILTERstatements. Wildcard values are represented as ordered quoted-string lists, including support for explicitly empty lists. Parser coverage includes multiple patterns, wildcard escapes, quotes, Unicode, empty lists, and rejection of unquoted patterns. Part of dolthub/dolt#11787
Closed Issues
- 11418: Dolt rejects a repeated window expression in
ORDER BYas ambiguous. - 11942: Dolt panics on a
NULLDECIMAL in aVALUES-derived table - 11941: Dolt panics when CTAS materializes an untyped
NULL - 11917: Server panic kills the connection on SELECT UNIX_TIMESTAMP(IFNULL(SIN(WEEKDAY(UUID())), (SELECT 1)))
- 10661:
timeprecision is not respected - 11918: Server panic in decimal conversion on aggregate query with WHERE ROUND(HEX(int_col))
- 11912:
ANY_VALUEnested inside another aggregate fails: misleadingtable not found: <alias>(1146) and internalunable to find field with index N in row of M columns. This is a bug.(1105) - 11886: Lookup join drops an AND conjunct when the ON clause also has an OR over indexed columns (wrong results)
- 11408:
SPACE(n)results in a hang whennis large - 11490: Wrong results / internal error: a window function + correlated scalar subquery corrupts CREATE TABLE AS (persists 0/NULL) and crashes INSERT .. SELECT
- 11774: bug/compatibility-mysql: "information_schema.columns.EXTRA" omits "on update CURRENT_TIMESTAMP"
- 6044: dolt returns boolean values sometimes
- 6612: DOLT_COMMIT_DIFF_table is missing data when there's a schema collation change merged in
- 3096: Dolt should support it's own flavor of special comments.
- 7905: JSON functions return incorrect values when an object key path is used on an array value.
- 6236:
dolt_checkout()to change branches doesn't work in stored procedures - 6318: Checks when creating/altering a FK need to correctly handle revision DBs
- 8323: Incorrect results for virtual column in
WHEREorORDER BY - 5341:
pushshould validate branch name likecheckoutorbranch - 1844: Allow jsonl result format
- 8389: Exporting line breaks interrupts CSV formatting
- 8388: Exporting table replaces empty string with NULL values
- 6500: Missing insert source aliases parsing
- 6152:
dolt_procedurestable does not exist until a procedure is created - 4501: GRANT wildcard support
- 6918: the row result is not printed when there is
IFclause used in the stored procedure when using sql server - 7196: JSON ordering is not well-ordered.
- 6742: DECLARE CONTINUE HANDLER failure in dolt
- 4233: order of CTEs defined matters
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.35 | 0.14 |
| groupby_scan | 134.9 | 64.47 | 0.48 |
| index_join | 3.36 | 1.96 | 0.58 |
| index_join_scan | 4.25 | 1.37 | 0.32 |
| index_scan | 344.08 | 200.47 | 0.58 |
| oltp_point_select | 0.19 | 0.26 | 1.37 |
| oltp_read_only | 3.68 | 5.09 | 1.38 |
| select_random_points | 0.36 | 0.52 | 1.44 |
| select_random_ranges | 0.39 | 0.67 | 1.72 |
| table_scan | 344.08 | 204.11 | 0.59 |
| types_table_scan | 759.88 | 458.96 | 0.6 |
| reads_mean_multiplier | 0.84 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.28 | 6.21 | 0.75 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.06 | 11.45 | 1.26 |
| oltp_update_index | 4.41 | 3.36 | 0.76 |
| oltp_update_non_index | 4.18 | 3.07 | 0.73 |
| oltp_write_only | 5.18 | 6.32 | 1.22 |
| types_delete_insert | 8.58 | 6.79 | 0.79 |
| writes_mean_multiplier | 0.9 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 96.45 | 53.18 | 1.81 |
| tpcc_tps_multiplier | 1.81 |
| Overall Mean Multiple | 1.18 |
|---|
v2.3.52.3.5
Merged PRs
dolt
- 11842: Support wildcard table filters for binlog replication Adds REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE support for MySQL-to-Dolt binlog replication, including MySQL wildcard matching, precedence, case handling, validation, and SHOW REPLICA STATUS output. Filter updates are applied atomically and synchronized with replica lifecycle operations. Part of #11787 Depends on: dolthub/go-mysql-server#3885
- 11804: Enable fine-grained merging for adaptive JSON Recognize the JsonAdaptiveEnc storage encoding in the prolly-row JSON merge path, enabling the existing structural merger for Doltgres JSON storage. Part of dolthub/doltgresql#2018
- 11802: Fix legacy table name unmarshalling receiver
go-mysql-server
- 3888: Fix LOAD_FILE directory handle leaks Avoids leaking directory handles during LOAD_FILE checks, with the regression exercised by Dolt #11838. Fixes https://github.com/dolthub/dolt/issues/8785
- 3886: Simplify partial join parent for window functions in
existssubqueries fixes dolthub/dolt#11421 - 3885: Support wildcard replication filter values Adds native string-list values for REPLICATE_WILD_DO_TABLE and REPLICATE_WILD_IGNORE_TABLE, including MySQL-compatible format validation and SHOW REPLICA STATUS formatting. Simplifies replication option handling to use native Go values instead of exported wrapper types. Companion Dolt PR: github.com/dolthub/dolt/pull/11842 Companion: dolthub/dolt#11842
- 3864: Implement conversions from
DATE,DATETIME, andTIMESTAMPto numbers Properly implement conversion fromDATE,DATETIME, andTIMESTAMPtypes to numeric types. Additionally, fixes string output to match precision of date type. Partially fixes: https://github.com/dolthub/dolt/issues/10278 - 3863: Decorrelate inner join subqueries in
EXISTSsubqueries FixEXISTSsubqueries containing inner joins nested inside outer joins incorrectly dropped matching rows. Correlated conditions on null-supplying side of an outer join are now preserved in place rather than hoisted.- Add
(JoinType) IsPreservedTable(childNum int) booland unified usage withfilterPushdownSelector. - Add
decorrelateSelectorto stop decorrelation traversal from entering null-supplied join branches. - Add
decorrelateConditionto decorralate inner join filters alongsideWHEREfilters. Fix dolthub/dolt#11771
- Add
- 3842: Automate dependency bump approval and merge
Validate generated dependency bump PRs, approve the exact dependency-only commit, and enable squash auto-merge with a head-SHA guard. Disable auto-merge on superseded bumps before closing them, and standardize stale bump cleanup to close immediately unless marked
keep-alive.
vitess
- 493: Add wildcard replication filter syntax
Adds parser and AST support for
REPLICATE_WILD_DO_TABLEandREPLICATE_WILD_IGNORE_TABLEinCHANGE REPLICATION FILTERstatements. Wildcard values are represented as ordered quoted-string lists, including support for explicitly empty lists. Parser coverage includes multiple patterns, wildcard escapes, quotes, Unicode, empty lists, and rejection of unquoted patterns. Part of dolthub/dolt#11787 - 491: Added NULLs ordering This implements NULL ordering (nulls can be set to be first or last) Related PRs:
Closed Issues
- 8822: False positive for incompatible schema change on non-ff merge when indexes on overlapping columns exist
- 11421: Dolt raises an internal row-index error for
EXISTSwith a window expression. - 10278: Properly handle conversions between
datetime,date, andtimetypes and Numeric Types - 8275:
SHOW CREATEdoesn't show indexes on virtual generated columns: - 4989: using hex string as bindvar for decimal type column in prepared statement causes panic
- 5942: Unexpected and incorrect
is too large for columnerror - 7130: bad
doubleconversion - 7668:
decimal.Decimalloses precision when prepared - 8785: md5 function does not recognize
binarykeyword - 5414: Argument parser seems to grab prefix
- 8855: Support cosine vector distance function
- 8658: Create
VECTORtype. - 11416: Dolt
JSON_EXTRACTdoes not preserve large JSON integer values. - 8477: dolt sql
\commituses static time stamp - 8325: panic during
dolt dumpif db contains a (non-empty) table with virtual columns - 8193: inserts with specified fields should error on empty insert values
- 7402:
dolt cherry-pick --abortreverts ignored tables. - 11771: EXISTS with a join: a correlated reference in the ON clause is dropped from the plan, and the query returns wrong rows
- 7022: Dolt's
reset --softbehavior doesn't match Git's - 6300: Prepared statements don't work with
as of - 6124: dolt diff after change primary key and adding a column gets error
- 5821: Column in SELECT list is allowed when it is not present in the GROUP BY clause
- 1894: Statement boundaries do not work across tables
- 123: Extension mechanism for the parser
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 16.71 | 2.3 | 0.14 |
| groupby_scan | 134.9 | 65.65 | 0.49 |
| index_join | 3.43 | 1.93 | 0.56 |
| index_join_scan | 4.25 | 1.32 | 0.31 |
| index_scan | 344.08 | 204.11 | 0.59 |
| oltp_point_select | 0.19 | 0.26 | 1.37 |
| oltp_read_only | 3.68 | 5.09 | 1.38 |
| select_random_points | 0.36 | 0.52 | 1.44 |
| select_random_ranges | 0.38 | 0.65 | 1.71 |
| table_scan | 344.08 | 204.11 | 0.59 |
| types_table_scan | 759.88 | 467.3 | 0.61 |
| reads_mean_multiplier | 0.84 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.84 | 6.21 | 0.79 |
| oltp_insert | 4.1 | 3.13 | 0.76 |
| oltp_read_write | 8.9 | 11.24 | 1.26 |
| oltp_update_index | 4.33 | 3.3 | 0.76 |
| oltp_update_non_index | 4.1 | 3.02 | 0.74 |
| oltp_write_only | 5.18 | 6.32 | 1.22 |
| types_delete_insert | 8.28 | 6.79 | 0.82 |
| writes_mean_multiplier | 0.91 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 96.87 | 52.38 | 1.85 |
| tpcc_tps_multiplier | 1.85 |
| Overall Mean Multiple | 1.20 |
|---|
v2.3.42.3.4
Merged PRs
dolt
- 11796: go/store/nbs: journal_writer.go: Fix a rare race where the journal_writer entered a weird state because its caller context Canceled as it was bootstraping.
- 11791: Warn about session-only checkout in noninteractive SQL
Warns when a lone
dolt_checkout()call in noninteractive SQL changes only the SQL session's branch, leaving the CLI branch unchanged. Fixes https://github.com/dolthub/dolt/issues/6876 - 11790: Add virtual name indexes for tags and branches Adds virtual name indexes with cached ref lookups for dolt_tags and dolt_branches. Fixes https://github.com/dolthub/dolt/issues/10365 Companion PR: https://github.com/dolthub/doltgresql/pull/3342
- 11788: Persist
sql_modeas string and reload on server startup Fix dolthub/dolt#11776 - 11785: Validate vector index creation without restricting schema loading Preserves existing vector index schemas while validating new index creation, with Dolt commit/reset regression tests and shared DDL coverage in https://github.com/dolthub/go-mysql-server/pull/3858. Fixes https://github.com/dolthub/dolt/issues/10448
- 11782: Omit generated columns from SQL diff assignments Omits generated columns from SQL diff assignments and suppresses updates with no assignable columns, carrying forward #11476 with Elian's review feedback addressed. Fixes https://github.com/dolthub/dolt/issues/11445
- 11780: Handle statement cancellation in the SQL shell
Supports
\ccancellation in the interactive SQL shell, carrying forward #11291 with regression coverage verifying canceled single-line and multiline inserts leave the table empty. Fixes https://github.com/dolthub/dolt/issues/10867 - 11772: Fix foreign keys with dropped columns
Changes are used by:
- https://github.com/dolthub/doltgresql/pull/3312 This also fixes a Dolt bug dealing with dropping a column used by a foreign key
- 11755: build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 in /integration-tests/go-sql-server-driver Bumps google.golang.org/grpc from 1.83.1 to 1.83.2.
- 11303: sql: fix empty/comment-only query handling in interactive shell
What
In the interactivedolt sqlshell, two related edge cases around empty/comment-only statements produced confusing output instead of clear, MySQL-consistent behavior:- A bare empty query (e.g. typing just
;) silently printedEmpty set, 1 warningwith a warning body ofquery was empty after trimming comments, instead of a clear client-side error. - A comment-only query (e.g.
-- foo ;) behaved the same way — a spurious "empty" warning — instead of being silently skipped the waydolt sql < file.sql(batch mode) already treats it. This PR makes the shell branch onsqlparser.ErrEmptyexplicitly inexecShell'sUninterpretedcallback (go/cmd/dolt/commands/sql.go):
- A truly empty statement (nothing left after
;is stripped) now prints a MySQL-styleNo query specifiederror, matching how the realmysqlCLI responds to a bare;. - A comment-only statement (non-empty input that parses to
ErrEmptybecause it's all comment) is now skipped silently — no output, no warning — which mirrors the existing behavior ofexecBatchMode, whereerr == sqlparser.ErrEmptyis already a silentcontinue.
Why
Batch mode (execBatchMode, sql.go) andprocessQuery(used by scripting/non-interactive paths) both already treatsqlparser.ErrEmptyas "silently skip." The interactive shell was the only place papering over this with a fakeEmpty set, 1 warningresult, which is misleading — there's no result set, and the "warning" concept here doesn't correspond to anything the query actually did. This change brings the shell in line with the rest of the codebase's handling of empty statements while adding a genuinely useful error for the truly-empty case (bare;), since that's a real MySQL client-side error dolt users would expect to see. Closes #10864 Closes #10863 Thanks to angelamayxie for the original reports.Test plan
-
go build ./cmd/dolt/...— passes -
go vet ./cmd/dolt/...— passes -
gofmt -l go/cmd/dolt/commands/sql.go— clean - New bats regression tests added in
integration-tests/bats/sql-shell.bats: sql-shell: bare empty query gives MySQL-style error, not a warning(uses newsql-shell-empty-query.expect)sql-shell: comment-only query is skipped silently, no warning(uses newsql-shell-comment-only-query.expect)- Both new bats tests run locally against a freshly built
doltbinary and pass:
ok 1 sql-shell: bare empty query gives MySQL-style error, not a warning ok 1 sql-shell: comment-only query is skipped silently, no warning- Full
sql-shell.batssuite regression run was kicked off locally to check for unrelated breakage; not gating this PR description on it since the two new/targeted cases already passed cleanly and no other test in the file touches this code path.
- A bare empty query (e.g. typing just
go-mysql-server
- 3858: Cover vector index nullability across DDL paths Extends vector-index nullability regression coverage to JSON columns and ALTER TABLE, complementing Dolt's engine coverage in https://github.com/dolthub/dolt/pull/11785. Fixes https://github.com/dolthub/dolt/issues/10448
- 3857: Set return type for population statistic aggregate functions Fixes dolthub/dolt#11391
- 3855: Implement Numeric to Date conversions
Implements conversions from numeric types (int, float, decimal) to
DATETIMEtypes. Partially addresses: https://github.com/dolthub/dolt/issues/10278 Fixes: https://github.com/dolthub/dolt/issues/10088 - 3852: Reject unsupported DISTINCT window aggregates
Rejects
DISTINCTwindow aggregates with MySQL 8.4-compatible error 1235 / SQLSTATE 42000 forCOUNT,SUM, andAVG, including multi-argumentCOUNT, while preserving acceptedMINandMAXbehavior. Adds engine coverage for the exact customer reproduction and adjacent aggregate behavior. Fixes dolthub/dolt#11392 - 3847: Remove schema length check when analyzing subquery aliases
Fixes dolthub/dolt#11501
When analyzing subquery aliases, checking if the child schema length matched the
ColumnNameslength was too strict. In nested subqueries, it's possible the child schema length was already reduced due to table pruning when the child subquery was analyzed. This check was removed altogether because we don't have any tests that actually rely on this check happening. - 3845: Fix
CHARvalues differing only in trailing space to be equal Fix dolthub/dolt#11464 - 3841: Delimit window partition and order expressions in PartitionId Fix dolthub/dolt#11461
- 3840: Support pluggable UPDATE assignment evaluation Adds an UpdateExpressionApplier engine override for PostgreSQL assignment semantics in https://github.com/dolthub/doltgresql/pull/3300 while preserving MySQL evaluation by default. Fixes https://github.com/dolthub/doltgresql/issues/3092
- 3836: [4/6] Test grouped windows and iterator cleanup Adds regression coverage for grouped windows, HAVING order, and iterator cleanup already fixed on main, stacked on #3835 with compatibility in https://github.com/dolthub/dolt/pull/11753 and https://github.com/dolthub/doltgresql/pull/3291.
- 3835: [3/6] Fix user-variable strings and prepared bindings Fixes UserVar SQL quoting and prepared lookup by variable name, stacked on #3834 with compatibility in https://github.com/dolthub/dolt/pull/11753 and https://github.com/dolthub/doltgresql/pull/3291.
- 3834: [2/6] Fix subquery strings and scalar alias resolution Fixes Subquery and InSubquery SQL strings while preserving scalar alias resolution, stacked on #3833 with compatibility in https://github.com/dolthub/dolt/pull/11753 and https://github.com/dolthub/doltgresql/pull/3291.
- 3833: [1/6] Fix independent expression strings and descriptions Fixes independent expression SQL strings and descriptions from #3803, with follow-ups starting at #3834 and compatibility in https://github.com/dolthub/dolt/pull/11753 and https://github.com/dolthub/doltgresql/pull/3291.
- 3832: Always return
transform.NewTreewhen replacingGetFieldwith aliased projection expression Fixes dolthub/dolt#11407 When pushing filters below a subquery alias, we were only returningtransform.NewTreewhen an aliased expression mapped to aGetFieldhas been recursively transformed. However theGetFieldgets replaced with the aliased expression regardless if it gets transformed recursively, this is incorrect, and we should always be returningtransform.NewTree. Not returningtransform.NewTreewas causing us to not be able to find the correct field index for certain expressions. - 3825: Support multi-byte strings and collation derivation in
LPADandRPAD- Derive output collation and coercibility from string operand.
- Replace byte-level padding with code-point counting.
- Add
CharSetHandlerfor multi-byte handling. - Fix invalid Go error formatting when during evaluation. Fix dolthub/dolt#11380 Blocked by dolthub/go-mysql-server#3824
- 3824: Fix collation coercibility resolution and binary collation detection
- Add
CollationID.IsBinary - Align coercibility resolution to MySQL precedence rules for explicit conflicts, binary precedence, and charset conversion.
- Add
ResolveCoercibilityExpressionsfor future correctness and reduce boilerplate. Block dolthub/go-mysql-server#3825
- Add
- 3823: Fix BIGINT arithmetic overflow handling Dolt currently allows BIGINT arithmetic to wrap at signed and unsigned boundaries. This applies MySQL integer result typing, performs checked native addition, subtraction, and multiplication, and honors NO_UNSIGNED_SUBTRACTION. MySQL-only engine scripts cover literal, stored-column, mixed-sign, SQL mode, and prepared execution paths, while protocol errors preserve MySQL error 1690 and SQLSTATE 22003. Fixes dolthub/dolt#11411
- 3822: Fix empty inserts with generated columns
Preserve implicit all-empty
VALUESrows as zero-width sources so insert analysis materializes defaults and generated expressions against the complete destination schema. Reject mixed empty and non-empty tuple widths to match MySQL, with coverage for generated, invisible, auto-increment, atomic, and prepared cases. Fixes dolthub/dolt#11388 - 3820: Added DESC indexes and NULL ordering This implements DESC indexes and NULL ordering (nulls can be set to be first or last). NULL ordering is primarily used by integrators. Related PRs:
- 3807: Fix
SELECTlist alias resolution in window clauses Fixes an issue where window function clauses could incorrectly resolve or shadow column references using SELECT list aliases.- Allow expressions in window clauses to reference
SELECTlist aliases while preserving resolution to underlying table columns. - Normalizes
SELECTlist alias lookup keys to lower case for consistent case-insensitive matching. Fix dolthub/dolt#11502
- Allow expressions in window clauses to reference
- 3780: Fix EXISTS over ungrouped aggregate subqueries Ungrouped aggregates produce one row even when their input is empty. Preserve that cardinality when simplifying EXISTS subqueries so correlated forms retain correct results without suppressing aggregate expression evaluation. Teach TableCopier to expose its independently analyzed create and source trees, accept integrator-owned create destinations through the standard sql.Nameable contract, and close the create iterator before copying rows. Adds coverage for SELECT and write statements, including CTAS, plus HAVING / LIMIT / OFFSET boundaries. Companion: https://github.com/dolthub/doltgresql/pull/3274 Fixes dolthub/dolt#11489 Fixes https://github.com/dolthub/dolt/issues/11477 Fixes https://github.com/dolthub/dolt/issues/11508
Closed Issues
- 11399: Dolt raises an internal field-index error for sibling
SUM/AVGwindows - 11396: Dolt
RANGE BETWEEN 1 PRECEDING AND CURRENT ROWoverBIGINT UNSIGNEDloses the current row at the lower boundary. - 11545: Dolt swallows a child-expression evaluation error in SUM
- 11460: Dolt forms incorrect
RANGEboundaries for a correlated computed order key - 11425: Dolt reports an internal row-index bug for invalid
NTILE(column). - 10365: dolt_tags system table missing index on tag_name - causes O(n) lookup
- 6876: Warn users about running
dolt sql -q "call dolt_checkout(...);" - 11391: Dolt computes population statistical aggregates incorrectly for
INTinput. - 11776: SET PERSIST sql_mode does not survive a sql-server restart ("value N was not found in the set")
- 10448: VECTOR INDEX: batch inserts fail with NULL embeddings after ~83 rows
- 10088: allow for times between
0000-00-00and0000-01-01 - 11445:
dolt diff -r sqlemits statements that assign generated columns - 10867: Dolt shell doesn't handle
\c - 10863: Do not emit warnings for empty query after trimming comments
- 10864: MySQL has error for empty delimited queries whereas Dolt has misleading warning
- 11411: Dolt arithmetic on
BIGINT UNSIGNEDvalues wraps into signed negative values. - 11388: Dolt raises an internal row-index error for empty
INSERT () - 11392: Dolt silently ignores
DISTINCTforCOUNTandSUMwindow aggregates. - 11747: sql-server auto-GC published a manifest whose root chunk was not preserved; only dolt_ignore'd (working-set-only) tables were lost
- 11501: Nested multi-column VIEW + self
EXISTS→ ERROR 1105 column-count mismatch - 11464:
CHARPAD SPACE values split a window partition - 11502: Dolt reaches an internal error on invalid window
ORDER BYalias. - 11407:
if(<cond>, <literal>, <column>)in a WHERE over a view raises internal error - 11741: git remotes: a cancelled push/fetch wedges sql-server indefinitely — CommandContext kills only the direct git child, and the orphaned transport holds the pipe Wait() reads
- 11508: Correlated
EXISTSloses an empty aggregate row - 11477: Wrong results: EXISTS/NOT EXISTS over an un-grouped aggregate subquery is mis-evaluated in a WHERE filter
- 11489: Silent data loss: EXISTS/NOT EXISTS over an un-grouped aggregate subquery corrupts DELETE/UPDATE/INSERT-SELECT/CREATE-TABLE-AS write paths (uncorrelated form deletes the whole table)
- 11380:
RPAD()/LPAD()has unexpected behvior - 11461: Distinct window partition/order shapes collide in
PartitionId
v2.3.32.3.3
Merged PRs
dolt
- 11757: go/store/nbs: byte_sink.go: Fix an error in non-archive push and GC paths which could result in table files with missing indexes. Failure to properly handle a boundary condition in BufferedFileByteSink meant that a table file writer that was producing a large table file could end up writing it out with a broken index. All chunk data made it to the file, but the file itself was unusable without manual recovery because the index portion of the file was wrong.
- 11746: Added DESC indexes and NULL ordering This implements DESC indexes and NULL ordering (nulls can be set to be first or last). NULL ordering is primarily used by Doltgres. This is a feature version bump for Dolt because, now that we support DESC indexes, old databases trying to read a DESC index would read it incorrectly and return incorrect results. Related PRs:
- 11745: Coalesce git remote read fetches, answer absent keys from the cache.
A cache-missing Get or Exists ran its own
git fetchof the whole data ref, so a burst of concurrent readers opened a connection each and every probe for a key that does not exist fetched again. Concurrent read-path fetches now share one fetch, and a key missing from a cache already merged from a commit is reported absent without fetching. A fetch that finds the head unchanged now also refreshes the dedup window, which previously never renewed against a quiet remote. - 11744: go: git remotes: kill the process group on cancel, bound the wait on inherited pipes.
A cancelled DOLT_PUSH/DOLT_FETCH wedged sql-server indefinitely (#11741): exec.CommandContext's default Cancel kills only the direct git child, so the transport it spawned survives holding the write end of the pipe Run reads from, and cmd.Wait() waits on an EOF nobody will send. Set cmd.Cancel to kill the whole group -- CmdSetsid already makes git the group leader, and Windows shells out to
taskkill /T-- and set cmd.WaitDelay as a backstop for a holder that left the group, such as an ssh ControlMaster. Cancellation and expired-wait errors now report ctx.Err() rather than a bare kill signal, and skip the credential hints NormalizeError appends. - 11743: integration-tests/mysql-client-tests/Dockerfile: Bump java_clients_build off EOL Debian bullseye to maven:3.9-eclipse-temurin-17-noble.
- 11742: go/store/nbs: Clone table file sources which are already open on Conjoin, instead of always opening them anew.
- 11710: Fix misleading paths in multiple .doltcfg error message Fix dolthub/dolt#10688
- 11697: Report branch update, force push, and tag status on
dolt pushDolt now prints standard status messages when pushing branches and tags to a remote database. Update display the commit transition rangeold...new, and when forced are explicitly marked(forced update).- Inspects the remote reference state before transferring chunks in
actions.Push. to captureOldHash,NewHash, and existence. - Add
PushRefResultto distinguish new branches, fast-forward, updates, forced updates, deletions, and tags. - Add
formatPushSuccessto format push success messages. Fix dolthub/dolt#11352 Close dolthub/dolt#11590
- Inspects the remote reference state before transferring chunks in
- 11693: Name the conflicting ref in ExistingRefError Include the full conflicting ref in ExistingRefError messages, and give tag and workspace creation their own already-exists errors. Fixes #11434 Close #11708
- 11692: build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 in /go Bumps google.golang.org/grpc from 1.82.1 to 1.83.1.
- 11687: Fix keyless COUNT column projection
Keyless value tuples store row cardinality before user columns. Advance non-primary-key
COUNTfield ordinals past that hidden value soCOUNT(column)examines the requested column. Fixes #11521 Depends on: go-mysql-server #3779 - 11669: build(deps): bump mysql2 from 3.22.0 to 3.23.1 in /integration-tests/mysql-client-tests/node Bumps mysql2 from 3.22.0 to 3.23.1.
- 11668: Probe pending unique key conflicts Add writer support for checking pending unique-key conflicts before inserting a row. This gives the query engine the storage-layer information needed to implement PostgreSQL conflict handling without suppressing unrelated errors. Part of dolthub/doltgresql#3091 Depends on: https://github.com/dolthub/go-mysql-server/pull/3758
- 11664: build(deps): bump github.com/apache/thrift from 0.23.0 to 0.24.0 in /go Bumps github.com/apache/thrift from 0.23.0 to 0.24.0.
- 11663: Add Doltgres transaction lifecycle callback Adds Doltgres transaction lifecycle notifications required by https://github.com/dolthub/doltgresql/pull/3256.
- 11482: SECURITY.md: Update documentation to reflect this project's stance on panics as security issues.
- 11359: Enable replication tests on MacOS
DNS lookups on GitHub MacOS runners are very slow, which makes some of these test expectations fail.
localhostresolves through DNS on MacOS but not on Ubuntu, which doesn't have this problem. This PR changes alllocalhostdefinitions in the test to the loopback address instead. - 11193: -C flag Implements -C with behavior matching git. Fixes https://github.com/dolthub/dolt/issues/11720
go-mysql-server
-
3821: Fix correlated subqueries in window sorting Window execution appended each row's original position directly to the SQL row before evaluating partition and ordering expressions. Correlated scalar subqueries could observe that synthetic field and produce incorrect window sort keys. Track original positions in a parallel slice that is swapped alongside rows and cached sort keys, keeping bookkeeping outside the SQL-visible row. Add the reported regression and exact row-to-position invariants for reordered partitions, NULL keys, and stable duplicate keys. Fixes dolthub/dolt#11419 Fixes dolthub/dolt#11460
-
3816: Make sure window framer end is never after the partition start fixes dolthub/dolt#11465
-
3813: Fix merging nondeterministic window expressions The window planner currently deduplicates identical expressions by their rendered SQL. Preserve that optimization for deterministic expressions, but emit separate window outputs when an expression tree contains a nondeterministic function. Evaluate each source-row value once per partition for
FIRST_VALUEandLAST_VALUE, including NULL values and changing frame boundaries. Adds engine and focused unit regressions for both planner and executor behavior. Fixes dolthub/dolt#11499 -
3811: Return error for standalone interval expressions Standalone
INTERVALexpressions can reachInterval.Eval, whose placeholder implementation panics. Return the shared invalid-use error instead, centralize that error in thesqlpackage, and cover the public query behavior with an engine regression. Fixes dolthub/dolt#11452 -
3810: Fix windows over grouped inputs Build grouped window evaluation after aggregation and HAVING, preserving the grouped fields and aggregate results needed by window definitions and derived aliases. Allow aggregate and window expressions to coexist regardless of projection order while continuing to reject windows nested inside aggregate arguments. Also close the wrapped child iterator when a window iterator closes. Adds coverage for grouping, filtering, ordering, NULL groups, mixed aggregate/window aliases, invalid nesting, and iterator cleanup. Fixes dolthub/dolt#11500
-
3809: Count nonnumeric strings as non-null in window AVG and SUM Fix dolthub/dolt#11470
-
3804: Omit
INVISIBLEcolumns projections from wildcard projections and default inserts Fix dolthub/dolt#11551 Blocked by dolthub/vitess#487 -
3802: Add non-window CURRENT_TIME precision regression test Adds non-window engine coverage for CURRENT_TIME precision. Fixes https://github.com/dolthub/dolt/issues/11543
-
3800: Validate set ops for aggregations in
ORDER BYclause fixes dolthub/dolt#11462 -
3798: Fix count distinct tuple hashing Fix dolthub/dolt#11562
-
3796: Fix constant window expression partitions Constant-only window expressions can leave zero-width projected rows. Partition and peer-group detection treated those rows as uninitialized, splitting every input row into its own partition or peer group. Use nil as the uninitialized-row sentinel and treat an absent
ORDER BYas one peer group. Add current script-suite coverage for constant aggregate, partition, and ordering expressions, validated against MySQL 8.0.45 and PostgreSQL 15.17. This adapts and supersedes the core fix contributed by @vishnujayvel in #3684. Credit also goes to @wanteatfruit for the report. Fixes dolthub/dolt#11409 -
3795: Fix correlated subqueries alongside window functions Window planning preserves ordinary projection dependencies, but did not preserve outer columns referenced only through a correlated scalar subquery. This left the subquery reading a stale post-window ordinal and silently producing empty-match results. Carry correlated outer columns through the window node using the same column-ID dependency handling already used by aggregation planning. Add engine regressions for correlated
COUNTandSUMalongside two different window functions. Fixes dolthub/dolt#11478 -
3794: Return ROW_NUMBER values as INT64 Aligns ROW_NUMBER runtime values with its declared INT64 type. Fixes https://github.com/dolthub/dolt/issues/11420
-
3793: Support TIME values in HOUR Supports valid time-only values in the HOUR function. Fixes https://github.com/dolthub/dolt/issues/11512
-
3792: Mark FIRST_VALUE results nullable Marks FIRST_VALUE nullable because legal window frames may be empty. Fixes https://github.com/dolthub/dolt/issues/11471
-
3791: Distinguish window frame ending bounds Preserves distinct ending bounds when identifying sibling window frames. Fixes https://github.com/dolthub/dolt/issues/11395
-
3790: Enable bitwise window aggregates Enables BIT_AND, BIT_OR, and BIT_XOR as window aggregates. Fixes https://github.com/dolthub/dolt/issues/11390
-
3789: Fix tuple IN comparisons containing NULL Track scalar NULL values separately from tuples that contain NULL when building hash-optimized IN expressions. Definite non-NULL matches continue to use constant-time hash lookup, while ambiguous tuple-NULL misses fall back to componentwise three-valued comparison. Add unit and engine coverage that distinguishes an UNKNOWN partial tuple match from a definite FALSE mismatch and verifies nullable tuple metadata. Fixes dolthub/dolt#11480
-
3788: Return NULL for all-NULL window sums Returns NULL when a window SUM frame contains no non-NULL values. Fixes https://github.com/dolthub/dolt/issues/11410
-
3786: Include bucket count in NTILE identity Keeps sibling NTILE expressions with different bucket counts distinct. Fixes https://github.com/dolthub/dolt/issues/11466
-
3785: Preserve literal case in window expression identity Preserves case-sensitive literals when deduplicating window expressions. Fixes https://github.com/dolthub/dolt/issues/11497
-
3784: Preserve LIKE escape clauses in window expressions Preserves distinct LIKE escape clauses when identifying window expressions. Fixes https://github.com/dolthub/dolt/issues/11498
-
3783: Fix CURRENT_TIME precision in window expressions Fixes CURRENT_TIME precision handling in cloned window expressions. Fixes https://github.com/dolthub/dolt/issues/11543
-
3779: enginetest: cover keyless count column projection Adds shared engine coverage for
COUNT(column)on nullable keyless columns, including duplicate rows. Part of dolthub/dolt#11521 -
3778: Add
MAKEDATEfunction Fix dolthub/dolt#11595 -
3777: String inputs to integer division should be treated as decimals to match MySQL This is necessary to return the correct results. Because integer division takes the floor of the result, floating point error on a div operation that appears to divide evenly might even up returning a value one lower than expected. This PR also fixes a related issue, where a division operation that converts its input to a decimal will silently convert the input to 0 when the input must be truncated, without emitting a warning. This changes the behavior to match MySQL, producing a result from the truncated input and emitting a warning.
-
3776: Warn when removing
NO_ZERO_IN_DATEfrom@@SQL_MODEBecause we don't properly support 0 Month and 0 Day for DATE/DATETIME types, we throw a warning when removing theNO_ZERO_IN_DATEsql_mode and behave as if it were enabled. -
3775: fix: change INFORMATION_SCHEMA default collation from utf8mb3 to utf8mb4 Changes INFORMATION_SCHEMA's default collation from utf8mb3 to utf8mb4; companion Dolt PR: https://github.com/dolthub/dolt/pull/11680.
-
3774: Preserve empty strings in GROUP_CONCAT Fixes GROUP_CONCAT to preserve empty non-NULL strings while continuing to skip NULL values. Fixes https://github.com/dolthub/dolt/issues/11561 Fixes https://github.com/dolthub/dolt/issues/11427
-
3773: Fix TIME_FORMAT hour specifiers Fixes TIME_FORMAT to preserve extended hours and support the non-padded hour specifier. Fixes https://github.com/dolthub/dolt/issues/11413
-
3772: Support extended hours in TIME_TO_SEC Fixes TIME_TO_SEC to preserve valid TIME values with more than 24 hours. Fixes https://github.com/dolthub/dolt/issues/11560
-
3771: Apply AM and PM in STR_TO_DATE Fixes STR_TO_DATE to apply AM and PM markers to 12-hour times. Fixes https://github.com/dolthub/dolt/issues/11544
-
3770: Fix INET_NTOA for unsigned IPv4 values Fixes INET_NTOA conversion for IPv4 values above the signed 32-bit range. Fixes https://github.com/dolthub/dolt/issues/11510
-
3769: Fix decimal CEIL and FLOOR input mutation Decimal
CEILandFLOORnow write their results to fresh values instead of mutating their inputs. This prevents shared decimal results, including window aggregate outputs, from being corrupted during projection. Adds direct input-immutability coverage and an engine regression for positive and negative decimal window peers. Fixes dolthub/dolt#11542 -
3768: Match MySQL default
SQL_MODEThis PR changes the defaultSQL_MODEmatch MySQL's default, but does not change any query behavior associated with the new default modes. Additionally, throws warnings for invalid combinations of "strict" modes. -
3766: Fix recursive CTE result type coercion Recursive CTEs establish their output schema from the non-recursive term, but the executor previously hashed, buffered, and returned raw child values. This allowed a recursive boolean true to remain distinct from an existing integer 1 under UNION DISTINCT. Coerce the CTE-result suffix to the established schema before deduplication and buffering while preserving any correlated outer-row prefix. Add the reported windowed recursive UNION regression. Full GMS sql and enginetest suites, focused Dolt normal and prepared engine tests, MySQL 8.0.45 differential validation, and diff checks pass. Fixes dolthub/dolt#11563
-
3765: Reject ABS of minimum BIGINT Returns an out-of-range error for ABS of the minimum signed BIGINT. Fixes https://github.com/dolthub/dolt/issues/11412
-
3764: Preserve non-ASCII Soundex initial case Preserves the case of non-ASCII initial characters in SOUNDEX results. Fixes https://github.com/dolthub/dolt/issues/11546
-
3763: Support binary values in CRC32 Adds CRC32 support for binary string values. Fixes https://github.com/dolthub/dolt/issues/11507
-
3762: Allow REGEXP_REPLACE position after source Allows REGEXP_REPLACE to start immediately after the source string. Fixes https://github.com/dolthub/dolt/issues/11547
-
3761: Fix STR_TO_DATE NULL propagation Propagates NULL arguments through STR_TO_DATE. Fixes https://github.com/dolthub/dolt/issues/11509
-
3760: Fix aggregate reuse across scalar subquery scopes Prevents aggregate functions in scalar subqueries from reusing matching aggregate references from an outer query scope. Aggregate deduplication now considers only the current grouping scope, preserving same-query-block reuse while keeping subqueries independent. Adds regression coverage for MAX, MIN, SUM, COUNT, and AVG across numeric and datetime values. Fixes dolthub/dolt#11638
-
3758: Limit PostgreSQL conflict ignores to duplicate keys Add a row-inserter contract for probing unique-key conflicts and use it to implement targetless ON CONFLICT DO NOTHING semantics. Duplicate-key conflicts are skipped while foreign-key, check, and NOT NULL errors remain errors, preserving the existing MySQL INSERT IGNORE path. Part of dolthub/doltgresql#3091 Depends on: https://github.com/dolthub/vitess/pull/485
-
3753: Prevent insert expression slice aliasing Allocate an independent result slice in
InsertInto.Expressions()instead of appending checks into backing storage owned byOnDupExprs. Analyzer index assignment can store duplicate-update, predicate, andRETURNINGexpressions in slices backed by the same array. Reusing that capacity while enumerating expressions can overwrite the predicate orRETURNINGexpressions before execution. The regression test verifies both the complete expression order and that enumeration leaves the insert plan unchanged. -
3748: sql.ValueRows: Correctly handle NULLs in comparisons.
This fixes a correctness issue running a query against a Dolt MySQL server: The test currently passes prior to this PR. This is because the test harness needs to be updated to more accurately reflect running against a Dolt MySQL server, but this currently causes other tests to fail. Instead, this change was tested locally to with the new test harness, and I confirmed that this PR fixes some of the failing tests and does not introduce any new failures.
-
3723: Refactor and improve
DATEparsing andSQL_MODEhandling This PR improves support for parsing various strings into DATETIME. There are a few improvements to converting DATETIME types to other types, but just enough to get exist tests to pass. Improvements to that area will come in future PRs. Warnings have also been improved to match MySQL, but we are currently ignoring the delimiter ones. Dolt bump: https://github.com/dolthub/dolt/pull/11584 Changes:- Default
SQL_MODEmatches MySQL. - The
time.Timepackage does not fully supportZERO_IN_DATE, so that SQL_MODE isn't supported for now. - Refactor
datetimeType.Convert() - Tests Fixes:
- https://github.com/dolthub/dolt/issues/11414 Possibly a breaking change, because of SQL_MODE changes.
- Default
-
3675: sql/types: trim whitespace before parsing date/datetime strings MySQL trims leading and trailing whitespace before parsing a string literal into a
DATE/DATETIME/TIMESTAMPvalue.datetimeType.ConvertWithoutRangeCheck(sql/types/datetime.go) did not, so passing a whitespace-padded string throughCAST(... AS DATE)orDATE(...)caused every layout inparseDatetime'stime.Parseattempts to fail, and the caller silently converted that parse failure intoNULL(with a1292warning from theDATE()path). Fixes dolthub/dolt#11414, reported by @Yibo-Dong.SELECT CAST('2024-01-01' AS DATE) AS plain_date, CAST(' 2024-01-01 ' AS DATE) AS spaced_date, CAST(CONCAT(' ', '2024-01-01') AS DATE) AS leading_date, DATE(' 2024-01-01 ') AS date_func;Before this change,
spaced_date,leading_date, anddate_funcwere allNULL; MySQL returns2024-01-01for all four columns.Root cause
ConvertWithoutRangeCheck'scase string:branch (sql/types/datetime.go) passed the raw string straight intoIsZeroTimestampStrandparseDatetime. None of the fixed layouts inTimestampDatetimeLayoutsthatparseDatetimetries viatime.Parsetolerate leading/trailing whitespace, so parsing failed andConvertWithoutRangeCheckreturnedErrConvertingToTime. BothCAST(... AS DATE/DATETIME/TIMESTAMP)(viadatetimeType.Convert->ConvertToTime->ConvertWithoutRangeCheck) and theDATE()function (via itsgetDatehelper, which calls the sameConvertWithoutRangeCheck) go through this one function, so a single fix covers both.Fix
Trim the string at the top of the
case string:branch, before the zero-timestamp check and beforeparseDatetime, so downstream parsing behaves the same as MySQL. Usesstrings.Trim(value, " \t\n\r\v\f")rather thanstrings.TrimSpacedeliberately: MySQL'smy_isspaceonly treats ASCII whitespace as significant for this purpose, while Go'sunicode.IsSpace(whatTrimSpaceuses) also strips Unicode whitespace (e.g. U+00A0 NO-BREAK SPACE) that MySQL does not trim and would reject.Test plan
- Added padded-string cases to the existing
TestDatetimeConverttable insql/types/datetime_test.go, matching the repo's own test-table style for this function:Datewith leading (" 2010-06-03"), trailing ("2010-06-03 "), and surrounding (" 2010-06-03 ","\t2010-06-03\n") whitespace; aDatetimeMaxPrecisioncase with a fractional-second value padded on both sides; and a padded zero-date case (" 0000-00-00 ") to pin the trim-before-IsZeroTimestampStrordering. - Added an end-to-end
enginetestquery case (enginetest/queries/queries.go) reproducing the exact issue repro:CAST(' 2024-01-01 ' AS DATE),CAST(CONCAT(' ', '2024-01-01') AS DATE), andDATE(' 2024-01-01 '), all asserting the correct (non-NULL) date. - Verified all 6 new
TestDatetimeConvertcases and the newTestQueriescase fail without the fix, then pass with it (reverted the fix, confirmed 6--- FAIL:lines plus the query-test failure, restored the fix, confirmed all pass). Note on the trailing-only case ("2010-06-03 "): the value MySQL expects is recoverable even pre-fix, becauseparseDatetime'sfindDatetimeEndloop shrinks the parse window and finds a match on"2010-06-03". But that path also returns a non-nilErrTruncatedIncorrectalongside the (correct) value, and the test harness'srequire.NoError(t, err)treats that as a failure — so this case is genuinely red pre-fix under the existing assertion style, not just wrong-by-value. Confirmed by isolating this single case against the pre-fix code with the real test harness (not a value-only probe). Commands run (from a go-mysql-server worktree,CGO_ENABLED=0,-tags gms_pure_goto avoid the icu4c/cgo regex dependency, matching how this package already gates cgo-free builds):
go test -tags gms_pure_go ./sql/types/... -run TestDatetimeConvert -v go test -tags gms_pure_go ./sql/types/... -count=1 -timeout 10m go test -tags gms_pure_go ./enginetest/... -run "TestQueries$" -timeout 20m gofmt -l sql/types/datetime.go sql/types/datetime_test.go enginetest/queries/queries.go go vet -tags gms_pure_go ./sql/types/...All green:
ok github.com/dolthub/go-mysql-server/sql/types 0.649s ok github.com/dolthub/go-mysql-server/sql/types/jsontests 1.196s ok github.com/dolthub/go-mysql-server/enginetest 12.393sgofmtandgo vetreport no issues on the changed files. - Added padded-string cases to the existing
-
3630: server/listener.go: Fix a race on listener shutdown where an Accept goroutine could try to send on a closed conns channel.
-
3625: Advertise binary charset for
BITresult columns MySQL marksBITresult columns with the binary charset (63) in the wire protocol. We were sendingutf8mb4(255), so clients like themysqlCLI printedBITvalues as raw bytes instead of hex.schemaToFieldsnow sets the binary charset forBITcolumns Block dolthub/dolt#11306
vitess
- 491: Added NULLs ordering This implements NULL ordering (nulls can be set to be first or last) Related PRs:
- 489: Support nested parentheses around subqueries, CTEs, and derived tables
- Add
paren_query_expressionfor CTEs and derived tables - Add
paren_subqueryforEXISTS - Add
PREFER_PARENTHESESprecedence token to disambiguate lookahead on shift/reduce conflicts. Fix dolthub/dolt#8058 Fix dolthub/dolt#11722 Block dolthub/go-mysql-server#3806
- Add
- 488: Support directed TRIM without removal string pattern Fix dolthub/dolt#11511 Block dolthub/go-mysql-server#3805
- 486: Suppress idle connection timeout errors
Suppress expected error logging when
sql-serverreaps idle connections after their read deadline. Timeout identity remains available to shared packet-reader callers; only the server command-loop error log is suppressed. Fixes dolthub/dolt#11658 - 485: Add insert conflict target to AST Expose the parsed INSERT conflict target so downstream query engines can distinguish targetless ON CONFLICT DO NOTHING from targeted conflict handling. Part of dolthub/doltgresql#3091
- 484: Disallow star expressions in
FIRST_VALUEandLAST_VALUEwindow functions Fix queries containingFIRST_VALUE(*)orLAST_VALUE(*)to not be accepted by the MySQL parser.sql.y: UpdateFIRST_VALUEandLAST_VALUErules to requireexpression. Fix dolthub/dolt#11468 Block dolthub/go-mysql-server#3756
- 483: Add conditional duplicate update metadata
Add insert AST metadata for a duplicate-update predicate and single-row affected-count semantics. This lets PostgreSQL dialect translation carry
ON CONFLICT DO UPDATE ... WHEREbehavior through the shared parser boundary. Adds formatting and AST-walk coverage for the predicate. Supports dolthub/doltgresql#3235.
Closed Issues
- 11434:
ExistingRefError.Error()omits the ref name and type - 11500: Dolt reaches an internal error on grouped one-column input.
- 11470: Window
AVGdrops a non-NULL nonnumericVARCHAR - 11720: Global-args gate rejects -C on the nine unmigrated commands, which is the case -C exists for
- 11460: Dolt forms incorrect
RANGEboundaries for a correlated computed order key - 11419: Dolt misorders a window when
ORDER BYcontains a correlated scalar subquery. - 11465:
MINpanics on a legal empty leadingROWSframe - 11425: Dolt reports an internal row-index bug for invalid
NTILE(column). - 8580: Error importing mysqldump with incorrect string value
- 9534: Panic or no results for information_schema query
- 11722:
EXISTS ((subquery))fails to parse, whileIN ((subquery))and scalar((subquery))succeed - 11452: Dolt panics with
Interval.Evalwithin standaloneINTERVALexpression - 8058: Double parentheses ie.
((...))do not parse in Dolt - 11721: Nine commands reject --data-dir, so they cannot be run against a database from outside its directory
- 11545: Dolt swallows a child-expression evaluation error in SUM
- 11499: Identical nondeterministic window expressions are incorrectly merged
- 11559: Dolt loses expression-index metadata in a windowed information_schema projection
- 11551: Dolt exposes a user INVISIBLE column through SELECT *
- 11511: Windowed
TRIM(LEADING FROM str)is rejected by the parser - 11562: Dolt collides distinct text tuples in COUNT(DISTINCT ...) before a window wrapper
- 10688: dolt sql auto-creates .doltcfg/privileges.db in CWD, causing multiple .doltcfg errors
- 11512: Windowed
HOUR()returnsNULLfor a valid time-only value - 11420: Dolt rejects unary negation of a
ROW_NUMBER()window result. - 11497: Window expression de-duplication folds case-sensitive literals
- 11352: dolt push prints '[new branch]' for every successful push of an existing branch
- 11395: Dolt sibling window aggregates with different explicit frames reuse the wrong frame.
- 11410: Dolt window
SUMreturns0for an all-NULL frame. - 11471: Empty value-window frame is incorrectly non-nullable in CTAS
- 11390: Dolt supports
BIT_AND,BIT_OR, andBIT_XORas ordinary aggregates, but the same functions fail when used as window aggregates. - 11462: Final window
ORDER BYon a set operation panics - 11466: Dolt sibling NTILE expressions reuse the first bucket count
- 11498: Dolt window expression omits
LIKE ESCAPE - 11543: Dolt raises an internal child-count error for CURRENT_TIME(precision)
- 11409:
COUNT(*) OVER ()returns 1 instead of the partition size - 11478: Wrong results: a window function makes a correlated scalar subquery in the same SELECT collapse to its empty-match value (0/NULL)
- 11521:
COUNT(<column>)counts the wrong column ondolt sql-server - 11480: Wrong results: row-value (tuple) IN treats NULL = NULL as TRUE (three-valued-logic violation)
- 11473:
WHERE <col> <= <expr>and>=return rows where IS NULL ondolt sql-server - 11581: DOLT_RESET('--hard') permanently returns "context canceled" on a fraction of freshly created databases (regression in 2.3.0)
- 11510:
INET_NTOAcorrupts valid IPv4 values above signed 32-bit - 11413: Dolt
TIME_FORMATmishandles hour format specifiers forTIMEvalues. - 11595: Feature Request:
MAKEDATEfunction - 11427: Dolt
GROUP_CONCAT(expr1, expr2, ...)ignores later expressions. - 11561: Dolt skips empty strings in GROUP_CONCAT before a window wrapper
- 11560: Dolt returns NULL for a 25-hour TIME in a windowed TIME_TO_SEC call
- 11563: Dolt keeps boolean true separate from integer 1 in recursive UNION DISTINCT
- 11542:
CEIL/FLOORof a windowedDECIMALreturns unexpected results - 11544: Dolt ignores the PM marker in STR_TO_DATE
- 11414: Dolt converts valid date strings with leading or trailing whitespace to
NULL - 11546: Dolt uppercases a lowercase non-ASCII initial in SOUNDEX
- 11638: Wrong results: a scalar subquery's aggregate returns the OUTER query's aggregate when both use the same aggregate expression on the same table
- 11412: Dolt returns a negative value for
ABS(-9223372036854775808). - 11547: Dolt rejects a legal REGEXP_REPLACE position after the source
- 11507: CRC32 rejects a legal binary value produced by a window
- 11648: git-remote: dolt_remote_info under refs/heads/ makes concurrent
git fetchfail with "incorrect old value provided" - 11509:
STR_TO_DATE()errors instead of propagatingNULL - 11589: Incorrect NULL filtering with nullable projection and ORDER BY
- 11658: sql-server logs expected idle-connection reaps at ERROR (6565 lines/day on a healthy server)
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 17.63 | 2.3 | 0.13 |
| groupby_scan | 134.9 | 63.32 | 0.47 |
| index_join | 3.43 | 1.93 | 0.56 |
| index_join_scan | 4.25 | 1.34 | 0.32 |
| index_scan | 344.08 | 204.11 | 0.59 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 5.0 | 1.38 |
| select_random_points | 0.36 | 0.52 | 1.44 |
| select_random_ranges | 0.38 | 0.65 | 1.71 |
| table_scan | 344.08 | 204.11 | 0.59 |
| types_table_scan | 773.68 | 467.3 | 0.6 |
| reads_mean_multiplier | 0.83 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 6.21 | 0.81 |
| oltp_insert | 4.1 | 3.13 | 0.76 |
| oltp_read_write | 8.9 | 11.24 | 1.26 |
| oltp_update_index | 4.33 | 3.36 | 0.78 |
| oltp_update_non_index | 4.1 | 3.02 | 0.74 |
| oltp_write_only | 5.18 | 6.32 | 1.22 |
| types_delete_insert | 8.43 | 6.79 | 0.81 |
| writes_mean_multiplier | 0.91 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 96.91 | 52.67 | 1.84 |
| tpcc_tps_multiplier | 1.84 |
| Overall Mean Multiple | 1.19 |
|---|
v2.3.22.3.2
Merged PRs
dolt
- 11665: go: sqle/resolve: Have SearchPath() parse the search path in a way which is more compliant with postgres. Correctly handle quoted identifiers and ToLower any unquoted ones.
- 11659: build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 in /integration-tests/go-sql-server-driver Bumps google.golang.org/grpc from 1.82.1 to 1.83.1.
- 11654: build(deps): bump mysql2 from 3.9.8 to 3.22.0 in /integration-tests/mysql-client-tests/node Bumps mysql2 from 3.9.8 to 3.22.0.
- 11652: go: sqle: Improve autotracker update robustness during dolt_reset --hard. Get rid of the unnecessary background work, and update the tracker state synchronously as part of the reset itself.
- 11651: store/val: return error on malformed adaptive value
Fix panic when reading corrupted or truncated off-page storage chunks to return a SQL error.
- Malformed addresses that aren't exactly 20 bytes now return
ErrInvalidAddressLen. - Add
varintPrefixLento assert buffer length before reading varints, preventing out-of-bounds slice panics on truncated multi-byte headers. - Add
ErrNullAdaptiveValue,ErrInlineAdaptiveValue,ErrTruncatedVarint, andErrInvalidAddressLenfor callers and tests. Fix #11641
- Malformed addresses that aren't exactly 20 bytes now return
- 11646: cmd/dolt: improve connection error reporting and stale server info cleanup
CLI commands cleanup stale
.dolt/sql-server.infofiles left by crashed servers and recover locally, while connection failures provide troubleshooting steps.creds.go: AddProcessExists.server.go: Writing.dolt/sql-server.infois deferred until afterInitSQLServerbinds the listener.queryist_utils.go:PingContextchecks connectivity early and closesconnon dial failure. Fix dolthub/dolt#10856 Close dolthub/dolt#11474
- 11634: build(deps): bump org.mariadb:r2dbc-mariadb from 1.2.2 to 1.4.1 in /integration-tests/mysql-client-tests/java Bumps org.mariadb:r2dbc-mariadb from 1.2.2 to 1.4.1.
- 11633: build(deps): bump org.mariadb.jdbc:mariadb-java-client from 3.5.3 to 3.5.9 in /integration-tests/mysql-client-tests/java Bumps org.mariadb.jdbc:mariadb-java-client from 3.5.3 to 3.5.9.
- 11630: argparser: fix panic on empty-string value for list options
Passing an empty string as the value of a list-valued option (e.g.
dolt log --not "",dolt diff --include-cols "") no longer panics. Close dolthub/dolt#11347 - 11623: build(deps): bump mariadb from 3.4.5 to 3.5.3 in /integration-tests/mysql-client-tests/node Bumps mariadb from 3.4.5 to 3.5.3.
- 11614: go: sqle/dtablefunctions: defer dolt_query_diff execution to
RowIterand enforce subquery auth Fix permission checking and planning fordolt_query_diff. With this change, permissions on tables, views, and databases referenced are verified during planning. Table rows are only fetched when the query is executed, fixing edge cases withEXPLAIN.WithCatalognow callsengine.AnalyzeQueryto parse and validate permissions without instantiating rows.- Iterators are created only when results are requested.
- Authorization is delegated to
WithCatalog. Fix dolthub/dolt#10701 Close dolthub/dolt#10822
- 11611: Resolve predicates before partial index backfill Resolve partial-index predicates against the actual table schema before evaluating them while backfilling an index over existing rows. This prevents planner-relative field ordinals from being evaluated against stored table rows. Part of dolthub/doltgresql#3100
- 11610: go/libraries/doltcore/env, sqle: handle duplicate database directories
Log warning to skip duplicate database folders when scanning for databases to prevent overwriting an existing database.
- Add shared warning helper that logs duplicate database.
- Check active databases before clone or create operations. Fix dolthub/dolt#10143 Close dolthub/dolt#10678
- 11607: dbfactory: git remotes with more flexible cache dir name
Enable DumboDB to use git* remotes, but under a different cache directory, that doesn't include
.dolt - 11606: tracking field so that adaptive encoded keys work with garbage collection, push, etc New field in prolly.fbs to account for address values in keys. Doltgres permits this; Dolt does not (always requires prefixes for long keys). This gap would cause any key values stored out of band in Doltgres to be garbage collected inappropriately, as well as fail to be pushed.
- 11604: go: sqle/expranalysis: Have ResolveExpression take a schema-qualified TableName. Allows for fixing some partial-index creation failures in doltgres.
- 11598: feat: add orcarouter provider to dolt assist
The
dolt assistcommand is Dolt's chat assistant for running dolt commands and queries in plain language. This PR adds a named OrcaRouter provider via--provider orcarouter, mirroring the existing OpenAI wiring: it readsORCAROUTER_API_KEY, targetshttps://api.orcarouter.ai/v1/chat/completions, and defaults to theorcarouter/automodel. OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents — like OpenRouter it exposes a provider/model namespace across many models, but also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint, so Dolt users can use that stack without treating it as an anonymous base URL. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes. OpenAI stays the default; no behavior change. I also fixed a pre-existing bug ingetJsonPromptthat emitted a leading comma (invalid JSON) on the first request. Verification:go build+go vetpass,gofmtclean, live-tested--provider orcarouteragainst OrcaRouter (200).go test ./cmd/dolt/commands/passes; the only failure is pre-existingTestSignAndVerifyCommit(needsgpg, not installed here). Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter I'm an engineer on the OrcaRouter team. - 11597: Fix duplicate key errors with expression indexes Sizes reconstructed rows from mapped SQL ordinals so system-hidden expression-index columns cannot leave out-of-range gaps after schema changes. Covers keyed and keyless tables across duplicate errors, ignored inserts, and duplicate-key updates. Supports doltgresql #3082.
- 11596: Fix macOS-only bats CI failures
Fixes the long-standing macOS-only bats CI failures (verified: 38 → 0 failures across two full nightly-workflow runs).
- Skip docker-entrypoint.bats/tzdata.bats for MacOS (no docker available on PATH in MacOS runners)
- Fix BSD awk/grep incompatibilities in sql-diff.bash and GNU-only
sed -iin sql-pull.bats - Disable the detached
dolt send-metricsprocess during bats runs (raced with test teardown cleanup) - Default
DOLT_PAGER=cat(less races with expect scripts typing ahead, dropping keystrokes)
- 11594: Added extended vector index support This adds support for extended vector index support for Doltgres. Builds on top of:
- 11593: go: clone: Make clone use the same semantics on srcDB as fetch. Open without caching and close when finished with it.
- 11592: Say that a failed conjoin was deferred, not that something went fatal
Reword the conjoin failure log line to say that compaction was deferred and will be retried, and add a
deferredfield so log consumers can classify it without parsing prose. Fixes #11591 Close #11624 Blocked by #11624 - 11585: Fix auto-increment tracker init race
NewSequenceTrackerFromRootsinitializes sequence state in a background goroutine but ran it on the caller's request-scoped context, so it could be canceled as soon as the triggering query (e.g.CREATE DATABASE) returned, poisoning the tracker for later callers. Detach that goroutine's context from the caller's cancellation, and add a deterministic regression test. - 11582: go: Add cleanup of the created directory on some database creation failure paths.
- 11580: Fix FK lookup during table rename UpdateForeignKey was looking up the existing foreign key using the new table name passed in the constraint, but go-mysql-server calls it during a rename before the table has actually been renamed. This lookup only matters (and only broke) for schema-qualified engines like Doltgres, since plain Dolt's foreign key lookups ignore table name when schema is empty. Fixed by looking up using the table's current name, and added a regression test that reproduces the mid-rename state directly against WritableDoltTable.UpdateForeignKey. Related to: https://github.com/dolthub/doltgresql/issues/3114
- 11577: Fix a race in SequenceTracker.InitWithRoots
Concurrent
dolt_resetordolt_checkoutcalls from different sessions against the same database could race insideSequenceTracker.InitWithRoots, with two overlapping calls both ending up closing the same completion channel and crashing the whole server process. This PR serializesInitWithRootswith a mutex and has each asyncinitclose a captured channel reference instead of the mutable field. Also adds a unit test that reproduces the panic against the old code and passes clean under -race against the fix. - 11576: dumbo: expose session operations
- 11571: user contribution: s3 remote support Original PR: https://github.com/dolthub/dolt/pull/11433 Fixes: https://github.com/dolthub/dolt/issues/509 Documentation Change: https://github.com/dolthub/docs-2/pull/174
- 11569: build(deps): upgrade Hibernate to 6.6.55
Summary
- replace the vulnerable Hibernate 5.6 dependency with Hibernate ORM 6.6.55.Final
- migrate the smoke-test entity annotations from
javax.persistencetojakarta.persistence - remove the obsolete
hibernate-entitymanagerdependency and target Java 11, as required by Hibernate 6 - resolve Dependabot alert #122 / CVE-2026-0603
Validation
mvn -B -ntp clean compilemvn -B -ntp dependency:tree -Dincludes=org.hibernate:hibernate-core,org.hibernate.orm:hibernate-core[no-release-notes]
- 11449: pin the aborted-rebase state behind ErrRebaseDataConflictsCantBeResolved
Related to #10951 — extends the existing
dolt_rebasedata-conflict enginetest to assert the abort that the error message promises actually happened: original branch restored, thedolt_rebase_<branch>working branch and thedolt_rebaseplan table both gone, anddolt_conflictsempty. - 11438: fix: populate dolt_statistics created_at
Sets
Statistic.Createdon newly generated table-scan and index statistics sodolt_statistics.created_atreports the collection time instead of Go’s zero value, while cached statistics keep their existing timestamps. Fix #10168 Close #11647 - 11433: Add s3:// remote scheme for generic S3-compatible object stores (#509)
Motivation
#509 asks for S3-compatible storage support. The historical blocker was the manifest:aws://pairs S3 with a DynamoDB table for the atomic check-and-set, which generic S3-compatible stores cannot provide. That blocker is gone: AWS S3 supports conditional writes (If-None-Match: *for create since Aug 2024,If-Match: <ETag>CAS since Nov 2024), and Cloudflare R2 and current MinIO AIStor document both headers onPutObject.Design
A news3://bucket/pathscheme backed by an endpoint-configurableS3Blobstore:- The manifest ETag is an opaque version token.
CheckAndPutissues a direct single-part conditionalPutObject(If-None-Match: *on create,If-Matchon replace). HTTP 412, AWS's conditional409 ConditionalRequestConflict, andIf-Matchagainst a missing key all map to the unwrappedblobstore.CheckAndPutError, so the existing NBS manifest reread/retry path handles races unchanged. 429/5xx are left to the caller's retry with the original condition preserved. CheckAndPutnever uses multipart (multipart ETags are not content-stable across providers, and conditional headers onCompleteMultipartUploadare not universally supported). OrdinaryPutuses the SDK upload manager, which switches to multipart automatically for large table files.- The factory wires
nbs.NewNoConjoinBSStore, soConcatenateis never invoked — no server-side compose operation is required, following the Git-remote backend precedent. - Credentials come from the standard AWS SDK chain. New optional remote params:
s3-endpoint,s3-region,s3-path-style(theAWS_ENDPOINT_URL_S3env var is honored when params are omitted). The first commit fixes a pre-existing gap this work surfaced:noConjoinBlobstorePersister.Openlacked the archive-format (.darc) fallback thatblobstorePersister.Openhas, so pushing archive table files into a no-conjoin blobstore store failed atopenChunkSources.
Verification
- Integration tests (env-gated on
TEST_S3_BUCKET/TEST_S3_ENDPOINT/TEST_S3_PATH_STYLE, following the GCS/OCI convention) cover put/get/exists/ranged reads, conditional create/update/stale-version/missing-key semantics, an 8-writer concurrentCheckAndPutrace asserting exactly one winner, multipartPut, and unsupportedConcatenate. All pass against live Cloudflare R2. - End-to-end against R2:
remote add→push→clone→ data verified → secondpush→pullround-trip verified. - Caveat stated plainly: the concurrent-race test is a smoke test, not a proof of provider-side CAS linearization. R2 documents the conditional headers but not an explicit exactly-one-winner guarantee, and R2 rate-limits ~1 write/sec per key (relevant to the hot manifest). A more rigorous conformance harness (synchronized independent clients, disabled SDK retries, raw timing/status capture, repetition) is planned; providers lacking conditional writes should eventually get a fast capability-probe error.
Open questions
- Is this design shape acceptable, and is the work planned under the current #509 assignment far enough along that this PR conflicts? Happy to adapt or hand off.
- Naming/config bikeshed:
s3://scheme ands3-endpoint/s3-region/s3-path-styleparam names. - Whether a startup capability probe (fail-fast on providers without conditional-write support) should land in this PR or a follow-up.
Known cosmetic issue: a second push to an existing branch prints
[new branch]instead of a fast-forward line; investigating.
- The manifest ETag is an opaque version token.
- 11022: build(deps): bump fast-xml-builder from 1.1.5 to 1.2.0 in /.github/actions/ses-email-action Bumps fast-xml-builder from 1.1.5 to 1.2.0.
- 11018: build(deps): bump github.com/apache/thrift from 0.13.1-0.20201008052519-daf620915714 to 0.23.0 in /go Bumps github.com/apache/thrift from 0.13.1-0.20201008052519-daf620915714 to 0.23.0.
go-mysql-server
-
3748: sql.ValueRows: Correctly handle NULLs in comparisons.
This fixes a correctness issue running a query against a Dolt MySQL server: The test currently passes prior to this PR. This is because the test harness needs to be updated to more accurately reflect running against a Dolt MySQL server, but this currently causes other tests to fail. Instead, this change was tested locally to with the new test harness, and I confirmed that this PR fixes some of the failing tests and does not introduce any new failures.
-
3747: sql.ValueRows: Correctly handle filter expressions that aren't bools
This fixes a correctness issue running the following queries from
TestQueriesagainst a Dolt MySQL server:SELECT i,v from stringandtable WHERE i SELECT i,v from stringandtable WHERE v SELECT i FROM mytable WHERE NULL > 10; SELECT i FROM mytable WHERE NULL IN (10); SELECT i FROM mytable WHERE NULL IN (NULL, NULL); SELECT i FROM mytable WHERE NOT NULL NOT IN (NULL); SELECT i FROM mytable WHERE NOT (NULL) <> 10; SELECT i FROM mytable WHERE NOT NULL <> NULL;There are no test changes because the test harness needs to be updated for every query test at once, once every test passes. I ran the new test harness locally and confirmed that this PR fixes some of the failing tests and does not introduce any new failures.
-
3746: Support conditional duplicate updates Adds support for conditionally applying duplicate-key updates, as required by PostgreSQL’s
ON CONFLICT DO UPDATE ... WHERE. When an insert conflicts with an existing row, the optional condition is evaluated against the existing and proposed rows. A false condition skips that row; a true condition applies the update. The change also supports returning the updated row and lets PostgreSQL count a duplicate update as one affected row without changing MySQL’s default behavior. Tests cover conditional updates,RETURNING, affected-row counts, and a batch of 100,000 filtered conflicts. Supports dolthub/doltgresql#3235. Depends on: dolthub/vitess#483 -
3745: Plumb DROP TABLE ... CASCADE through to plan.DropTable Adds a Cascade flag to plan.DropTable (populated from the vitess AST) so that integrator pre-execution hooks can implement dialect-specific cascade semantics; the engine itself does not act on it. Companion PRs:
- dolthub/vitess: https://github.com/dolthub/vitess/pull/482
- dolthub/doltgresql: https://github.com/dolthub/doltgresql/pull/3155
-
3744: sql/mysql_db: Make OverwriteUsersAndGrantsData leave ephemeral users in place. Ephemeral users are part of in-memory process-local state, and any functionally equivalent users are not included in the persisted payload coming in for OverwriteUsersAndGrantsData. This allows Dolt CLI access to retain access through dolt_local_user even when cluster replication replicates users and grants to a replica.
-
3742: Avoid redundant window output sort Window execution currently performs a second stable sort after evaluating results solely to restore input order, even though each result already carries its original row ordinal. Place results directly at their original ordinals and compact empty positions for grouped windows. This changes output restoration from O(n log n) to O(n) while preserving row order and grouped output cardinality. A temporary 1,000-row ROW_NUMBER benchmark matching the reported query shape improved from approximately 1.03 ms/op to 0.76 ms/op on an Apple M1 Max, about 25%. Allocations changed from 10,041 to 10,038 per operation. Fixes dolthub/dolt#11626
-
3741: Don't re-evaluate set-returning expressions in the final projection When a select alias is materialized in an inner projection (e.g. so an ORDER BY can reference it), the final projection re-evaluated the alias expression. For expressions that return a RowIter (set-returning functions), the inner projection has already expanded the rows, so re-evaluation multiplied them again and clobbered the sort order. The final projection now references the expanded column instead. There's an engine test with a synthetic function, but most testing lives in Doltgres. Companion PR: https://github.com/dolthub/doltgresql/pull/3151/
-
3740: Convert
LOAD_FILEfilename to text type Fixes dolthub/dolt#11564 Casting filename to string was causing a panic when it was not a string type. UsingTypeAwareConversionfirst is much safer and prevents the panic. -
3739: Fix HAVING aggregate alias resolution Resolve HAVING aggregate inputs using their full table qualifiers so joins with duplicate column names do not bind the wrong source. Fixes dolthub/dolt#11627
-
3738: Don't set the max1Row query flag for plans containing RowIter exprs Set-returning functions multiply output rows, so a strict index lookup no longer guarantees at most one result row when the plan contains one. See https://github.com/dolthub/doltgresql/pull/3151
-
3737: Preserve LEFT JOIN semantics for lateral joins with no join filters A LEFT JOIN LATERAL with a trivially true condition (e.g. ON true) had its filter simplified away, and the memo exec builder then rebuilt every filterless lateral join as a lateral cross join incorrectly.
-
3735: handle parenthesized select with trailing order by and limit Enable planning engine to evaluate parenthesized query expressions in
CREATE TABLE ... AS (SELECT ....)with optional modifiers.- Apply trailing
ORDER BYandLIMITclauses inbuildSelectStmt. - Add shared
buildLimitAndOffsethelper. Fix dolthub/dolt#11620 Blocked by dolthub/vitess#481
- Apply trailing
-
3733: Evaluate sort key expressions once per row instead of once per comparison Sort comparators previously re-evaluated ORDER BY expressions on every comparison. For non-deterministic expressions (e.g. ORDER BY RAND()), this biased the result heavily toward rows late in the scan: with ORDER BY RAND() LIMIT 1 each comparison was a fresh coin flip, so the last row won ~50% of the time instead of 1/N. It was also wasteful for expensive sort keys, evaluating them O(n log n) times instead of O(n). Sort keys are now evaluated at most once per row and cached, in the full sort, Top-N heap, and top-1 paths. The top-1 path also now surfaces sort expression evaluation errors instead of swallowing them.
-
3732: Validate DISTINCT windows after function resolution
…
v2.3.12.3.1
Merged PRs
dolt
- 11568: build(deps): bump undici to 6.28.0
Summary
- bump the transitive
undicidependency from 6.24.0 to 6.28.0 in the SES email action lockfile - resolve Dependabot alerts #137, #138, #139, #140, #171, #172, and #173
Validation
npm ci --ignore-scriptsnpm run buildnpm audit --omit=dev(the undici advisories are resolved; the remaining fast-xml-builder finding is covered by #11022) [no-release-notes]
- bump the transitive
- 11567: /.github/workflows: pin add-and-commit
- 11556: archives: parallelize/coalesce chunk fetches There are a fair number of unit tests are added, but I've also had this verified by the user that raised the issue initially. Local testing with some added trace further convinced me this works as expected.
- 11537:
backup: stop writing the working set on syncdolt_backupno longer commits the calling session's open transaction before it copies.- Syncing an idle database leaves the backup unchanged.
ROLLBACKafter sync now works correctly. Fix dolthub/dolt#11488
- 11335: Bump google.golang.org/grpc from 1.79.3 to 1.82.1 in /go Bumps google.golang.org/grpc from 1.79.3 to 1.82.1.
- 11271: Bump golang.org/x/image from 0.38.0 to 0.41.0 in /go Bumps golang.org/x/image from 0.38.0 to 0.41.0.
go-mysql-server
-
3710: fix panic in TRIM functions Added a conversion for
TimeSpantype toLongTextand updated errors to not panic. fixes: https://github.com/dolthub/dolt/issues/11455 -
3703: Fix panic for
LIKEexpression with emptyESCAPEcharacter Despite what MySQL documentation says, emptyESCAPEcharacter actually escapes theNULcharacter (\0). fixes: https://github.com/dolthub/dolt/issues/11518 -
3702: fix panic in
format()fixes: https://github.com/dolthub/dolt/issues/11517 -
3700: fix panic on
rand(null)fixes: https://github.com/dolthub/dolt/issues/11494 -
3697: fix inet6 type assertions fixes: https://github.com/dolthub/dolt/issues/11493
-
3696: cap initial heapsize This PR adds a cap to the initial heap size of the
maxRowHeapwithinTopNRowsIter, to prevent overflows. Additionally, unnecessarily largeorder by ... limit xclauses would result wasted time allocating space.heap.Pushappends to the internal slice, so we'll rely on golang to manage the memory. fixes: https://github.com/dolthub/dolt/issues/11503 -
3695: Allow
NULLand other numerical swap flags forBIN_TO_UUIDFixes dolthub/dolt#11457 -
3693: fix panic for
GeometryFromWKTand various GeoSpatial bugs We added support for "pure empty geometry forms", which MySQL doesn't support, except for "GEOMETRYCOLLECTION EMPTY". Changes:- fix panics for pure empty geometry forms
- fix panics for invalid axis-order options
- fix ordering for axis-order options
- expose st_latitude function
- fix geospatial srid for
st_x()andst_y()functions Fixes: https://github.com/dolthub/dolt/issues/11492
-
3692: When serializing bytes for a MySQL client, correctly handle wrapped values, such as adaptive encoded columns Currently, when a
sql.Valuecontains a wrapped value, but the value's type doesn't implementsql.ValueType, we fail to properly serialize it when sending the bytes to the MySQL client. -
3691: block certain statements from
PREPAREThis PR blocksCREATE EVENTandCREATE PROCEDUREfrom getting created. Additionally, adds tests for a variety of DDL statements likeDELETE,CREATE, andALTER. Fixes: https://github.com/dolthub/dolt/issues/11417 https://github.com/dolthub/dolt/issues/11451 -
3690: Check for null before casting
LAST_INSERT_IDinput fixes dolthub/dolt#11454 -
3689: Refactor window function tests into
ScriptTestsConverts existing window function tests to useScriptTestand moves those ScriptTests into a newwindow_function_queries.gofile. -
3687: SECURITY: Document security stance on panics generated by GMS. Add some defensive recover() calls at places where GMS itself spawns goroutines.
-
3677: Bump jsonpath and add new test for parsing JSON null. Fixes https://github.com/dolthub/dolt/issues/11394 Our jsonpath dependency wasn't properly parsing paths when the input object was a JSON null value.
-
3676: Update various window aggregation functions to expect the correct number of children Fixes dolthub/dolt#11428 Some window functions were expecting the wrong number of child expressions, thus incorrectly throwing an error. However, this error was getting swallowed and going unnoticed during
fixExprToScope, which is intentional due to errors being falsely triggered for dual tables or subqueries but does lead to unintentional consequences. As a result, child expressions were not getting properly updated duringfixExprToScope, leading to a panic. This PR updatesWithChildrenfor those window functions to expect the correct number of children. -
3674: Error out for undefined window names fixes dolthub/dolt#11426
ErrUnknownWindowNamewas defined but never actually used anywhere. This PR updates the error message to better match MySQL and throws the error when a referenced window name has not actually be defined. -
3672: Pass context through aggregate/window check funcs
-
3671: Handle negative start positions in
LOCATEfunction fixes dolthub/dolt#11393 -
3670: Fix panic when a RANGE window frame offset pushes a SET/ENUM order-by value outside its valid domain Also stops swallowing non-EOF framer errors that let it turn into an out-of-bounds index. Fixes: https://github.com/dolthub/dolt/issues/11397
-
3669: Combine
assignmentExprsToUpdateExprsandbuildOnDupUpdateExprsFixes dolthub/dolt#11389 This PR addresses a TODO that I had added to combineassignExprsToUpdateExprsandbuildOnDupUpdateExprs, since these two functions did pretty much the same thing with a lot of repeated code.buildOnDupUpdateExprswas missing the step to resolveDEFAULTso it made more sense to combine the two functions that it did to rewrite that step. This PR also replaces the panic inDefaultColumn.Evalwith an error in an effort to reduce the number of panics in GMS and Dolt (dolthub/dolt#11299). -
3667: Clear autocommit transactions on err on all paths
-
3666: Include
orderByin various window functions to return correct default framer fixes dolthub/dolt#11381baseWindowFunctionwas created to avoid duplicating shared code and is intended to be extended to fully eliminate duplicated code for window functions. Also updates tests that were asserting incorrect behavior (verified to match MySQL) Some new test cases are skipped for Doltgres (see dolthub/doltgresql#3036 and dolthub/doltgresql#3038) -
3665: Adding a new
TimeDeltaExpressioninterface Allows window interval arithmetic to work properly with Doltgres' implementation. -
3664: Check if SubqueryAlias itself is lateral when prepending rows Fixes dolthub/dolt#11378
-
3663: bug fix: infer a bindvar's column type Fix untyped bind-var type inference to use the comparison expression's own declared type instead of digging into its children. This means operators like
#>> (jsonb→text)(from Doltgres) don't leak their operand's type onto the parameter. Related to: https://github.com/dolthub/doltgresql/issues/3012 -
3662: add case for injected exprs in node batch
-
3661: create schema from inscope columns of the table being parsed as column
-
3660: bug fixes for schema in table statistics As well as other bugs that were preventing table statistics from being used in doltgres
-
3659: fallback to gms types for extended type histograms benchmarks: https://github.com/dolthub/doltgresql/pull/3001#issuecomment-5135634713
-
3658: When comparing tuples for equality, widen each pair of input values. Previously, when comparing tuples, we would cast the right tuple to the type of the left tuple. This is inconsistent with MySQL, which considers each pair of values and converts them both to a widened type. This resulted in us returning the incorrect result for the simple query:
SELECT (1, 1) = (1.1, 1.1);Dolt would round both of the values on the right to integers prior to comparing them, evaluating to true. The correct behavior is to apply MySQL's type conversion rules to each pair, which in this case would result in both integers being converted to decimals, and the tuples comparing unequal.
-
3657: check stats prov for empty stat Instead of creating the (potentially same) empty stat every time, we should check if it has already been made in the StatsProvider.
-
3656: Bug fix for
CASEexpressions withExtendedTypeinstances Related to: https://github.com/dolthub/doltgresql/issues/2980 Doltgres fix: https://github.com/dolthub/doltgresql/pull/2987 -
3653: adding prepare tests for insert and update
-
3652: Allow aliasing column names in a table function
Depends on: https://github.com/dolthub/vitess/pull/477
-
3651: Correctly do NullUnsafe comparisons with tuples. Previously, all comparisons with tuples acted as though the comparison was null-safe. But the correct behavior is more subtle. Essentially, any comparison operation involving NULL should return NULL if substituting different values for the NULL could result in different outputs. This PR fixes most of the incorrect comparisons. Some stragglers remain involving
WHERE x IN (SELECT ...)subqueries. This PR is inspired by https://github.com/dolthub/go-mysql-server/pull/3640 but doesn't use any of the code from that PR. -
3644: add ExtendedTableFunction interface to support table function schema … …on OUT parameters
-
3643: Use
buildScalarto getGetFieldexpression forON UPDATEcolumns fixes dolthub/dolt#11346 Building theGetFieldexpression for a column using its index in a table was causing indexing issues when there was also a CTE. Instead, we need to build the theGetFieldusingbuildScalarto properly resolve the column within the scope. -
3641: Bug fix for a panic when calling a stored procedure without a database selected
-
3639: have coster consider not picking secondary indexes This PR adds a "no index" option to the coster and some additional heuristics for index costing. Before, we would always pick any available index, which would sometimes be sub-optimal, especially if the index is a non-covering secondary index. Additionally, the
normal_distandexp_disttables are now seeded to reduce random variability between test runs. Benchmarks: https://github.com/dolthub/dolt/pull/11336#issuecomment-5040609790 -
3638: Bug fixes for secondary indexes using virtual columns When updating a row in a secondary index, any virtual generated columns need their generation expression evaluated to get the correct data stored in the secondary index. There were a few edge case with virtual columns and secondary indexes where this evaluation wasn't happening. This PR closes those gaps. The first case is when a table rewrite is performed and secondary indexes are rebuilt (e.g. when dropping a column on a table). Not properly evaluating a virtual column's expression caused incorrect data to be stored in the index when it was rebuilt. A second case is for referential actions on a foreign key that update a table and its secondary index. Not properly evaluating a virtual column's expression here can also cause incorrect data to be written to the secondary index. Fix for failing Dolt CI integration test in: https://github.com/dolthub/dolt/pull/11333
-
3634: Add support for multiple expressions in functional indexes
-
3627: fix stats functions to include schema We include the schema in the stats key, but only sometimes fill in the field.
-
3626: Prevent index offset when comparing rows in
topRowsIterFixes dolthub/dolt#11300 Appending the row order number to the end of asql.Rowduring a Top-N Heap Sort intopRowsIterwas causing an index offset when evaluating SortFields that were subqueries, thus resulting in incorrect result. This PR- modifies
topRowsHeapto instead take arowWithOrderstruct that separates out thesql.Rowfrom the order number while still taking the order number into account when sorting the heap. - refactoring
Sorter.LesserRowlogic into a newCompareRowsfunction to allow checking for row equality - moves top row(s) iterators to its own file as part of an effort to make our iterators more organized (#3620). This file also includes
topRowsHeapsince it is only ever used bytopRowIter(see https://github.com/dolthub/go-mysql-server/issues/3622#issuecomment-4984884473 for next steps) - removes
ValueRowSortersince it's actually never used anywhere and doesn't even fully implementsort.Interface
- modifies
-
3623: memory: use stable sort for secondary index ordering
memory.TableData.sortSecondaryIndexessorted secondary index storage withsort.Slice, which uses Go's unstable pdqsort algorithm. Rows that tie on the indexed columns (same key, different primary key) could be reordered relative to each other on every sort, so repeated index rebuilds of the same data could produce different physical row orders. This PR switches tosort.SliceStable, which preserves the relative (insertion) order of tied rows, making secondary index storage ordering deterministic across rebuilds. Fixes #2877 -
3621: bug fix: honor named window reference An existing bug in GMS was not properly applying a named window reference. We had enginetests for named window references, but they weren't sufficient to catch this because the aggregate function they used produced identical values in both cases. New enginetest cases are added to prevent a regression. These two issues were identified by Ito automated review, in https://github.com/dolthub/doltgresql/pull/2913
-
3619: sql: Fix ALTER USER to allow the Identity field of the User record to be updated.
CREATE USER ... IDENTITY WITH <plugin> AS '<identity>'correctly parsed and persisted the Identity field.ALTER USERcorrectly parsed the Identity field but failed to persist the changes. The end result is that GMS had a bug where attempt to alter the identity field on an existing user seemed to succeed but was not reflected in the data going forward. Fix the bug so that updates to Identity are reflected and persisted going forward. -
3618: Error on SELECT @@SESSION., matching MySQL GMS silently returned the global value when a GLOBAL-only system variable was read with an explicitly-qualified SESSION/LOCAL scope (e.g.
SELECT @@SESSION.innodb_autoinc_lock_mode), instead of raising MySQL's ERROR 1238 (ErrSystemVariableGlobalOnly).buildSysVar's case forSetScope_None/SetScope_Sessionalready carriesspecifiedScope, which is empty for a bare@@fooreference and non-empty ("session"/"local") only when the scope was explicitly written in the query. This change uses that existing signal to raiseErrSystemVariableGlobalOnlywhen a global-only variable's scope is explicitly specified as session/local, while leaving the bare@@foofallback-to-global behavior untouched (MySQL allows that case). Also un-skips a pre-existing enginetest case invariable_queries.gothat already asserted this exact error — the test was written in anticipation of this fix (Skip: true) and now passes. Fixes dolthub/dolt#6722 -
3617: special case on extended type for getting compare type
-
3615: Bump golang.org/x/crypto from 0.46.0 to 0.52.0 Bumps golang.org/x/crypto from 0.46.0 to 0.52.0.
-
3614: Report Sum/Avg's true float64 type; add window-func override hook Various tweaks to go-mysql-server's unary aggregate function support to enable Doltgres window function support:
- fixed agg_gen template to be in-sync with generated code after manual changes were applied recently.
- changed Avg() and Sum()'s definition to always return float64 and removed analyzer code in aggregates.go that override return types for Avg() and Sum() to float64.
- added a window function override hook (
IsWindowFunc).
-
3613: Apply
IndexSearchableoptimization tosql.Equalityexpressions -
3612: Bug fix: allow running analysis on indexed join queries with bindvars To support Doltgres, the analyzer in GMS needs to support running on queries that contain bindvars. An assumption in indexed join costing was causing a panic for Doltgres when a bindvar appeared in the join condition on an indexed column. Doltgres needs to run the analyzer when preparing a statement because of the Postgres wire protocol, which requires more detailed schema information to be returned before the prepared statement is executed.
-
3611: avoid
fmt.Sprintfin groupby hash -
3610: pushdown inequalities to merge joins Before, only equality filters would be pushed down into the IndexedTableAccess for MergeJoins. This PR makes it so all static comparisons are pushed down. TODO:
- The Filter over these IndexedTableAccess nodes are useless and we should drop them
- The coster needs to properly account for the pushed down filters.
- We should be able to push down more than just one expression over a column
- We should be able to push more than just the prefix into the index
-
3609: server: Add client-disconnect watching to more platforms and more query types. Previously GMS had rudimentary logic on Linux to scan the socket state list and watch for a TCP connection associated with a running query to transition to a non-connected state. If that happened, GMS would cancel a Context associated with the query so that it could terminate in a timely manner --- the client was no longer waiting for the response. The old implementation had a few downsides:
- The scan itself periodically scanned a large table in /proc for every in-flight query. This was relatively expensive and somewhat wasteful.
- It only worked on Linux and only for TCP listeners.
- It only worked for some queries. In particular, it was never enabled for OkResult queries, or queries that were knowingly going to return only one result. This was an optimization because even setting up the connection logic scanning was somewhat expensive.
This PR changes GMS to take a different approach. We added
(*mysql.Conn).WaitForClientActivity(context.Context)to the vitess layer, and now the server handler uses that to get a quick notification the the client connection received readable activity (probably an EOF) when it was not expecting. We still have to be careful to not needless add overhead to very fast-running queries. The approach we take is to have a single goroutine periodically scanning the connection state. Connections themselves register when they start a query and when they end it. The scanning goroutine will start the disconnect watcher on the connection only after its query has been running for a bit of time.
-
3608: Rewrite
pushFiltersto use single top-down node traversal Split off from #3591pushFilterswas also previously written with two nested transform.NodeWithCtx (a bottom-up traversal). The outer traversal was done to identify filter nodes. The inner traversal "pushed down" filter expressions to the table level - this was not a true "pushdown" because it was a bottom-up traversal. An additionalInspectUptraversal was done for each filter node to collect all the filter expressions in the node tree -- this was unnecessary since any child filter nodes would've already had their filter expressions handled and this resulted in chains of identical filter nodes that later needed to be condensed. An additionalInspecttraversal was done per filter node to find projection expressions -- this only needed to be done once with the root node instead of per filter node.pushFiltersalso checks if the node tree is unresolved at the beginning, adding another traversal. This meant a node tree withnfilters would be traversed2+3ntimes. #3603 reduced the number of traversals done to find projection expressions to 1, instead of once per filter node. This PR rewrites thepushFiltersrule to only use a single node traversal that collects filters as the traversal moves down the node tree. It also removes the check for unresolved nodes. These changes reduce the number of node tree traversals to a constant 2. This also makes it easier to later combine thepushFiltersandmoveJoinConditionsToFilterrule (which is done in #3591). Query plans have changed because repeated filter expressions (previously from traversing the entire child tree to find all filters) have been de-duped and filter expressions areANDed slightly differently. -
3605: Use
TableIds instead of names when mapping filters to tables Split off from #3591 Using table names prevented us from being able to distinguish between tables from different databases with the same unqualified name. This PR also updates places where we were not using the correctTableId- when condensing a
SubqueryAliasinto aTableAlias, the newTableAliasshould have the sameTableIdas theSubqueryAlias - A view should be getting its
TableIdfrom the scope via its name, not the name of its first column
- when condensing a
-
3603: Only get projection expressions once when creating filterSet during filter pushdown Split off from #3591
getProjectionExpressionsis only called once, instead of for eachFilternode.tableAliasesis also removed because it's never actually used anywhere. -
3602: Create single override point for
SplitConjunctionSplitConjunctionworks differently for Doltgres expressions. The integration with Doltgres relied onanalyzer.SplitConjunctionandmemo.SplitConjunctionbeing replaced and called instead ofexpression.SplitConjunction; however,expression.SplitConjunctionwas still being called in many places in the analyzer. Not calling the correct version ofSplitConjunctionwas preventing filter expressions from being properly pushed down in Doltgres. Furthermore,expression.SplitConjunctionwas still being called inrowexecand callinganalyzer.SplitConjunctionfrom therowexecpackage causes a cyclical import. To avoid confusion between the variousSplitConjunctioninstances, this PR replaces the various override variables with a single one in theexpressionpackage. This allowsSplitConjunctionto be consistently replaced throughout GMS without requiring GMS developers to have knowledge ofSplitConjunctionworking differently in Doltgres. This change is integrated into Dolgres in dolthub/doltgresql#2865. This issue was originally encountered while working on #3591. -
3601: cache
GeneralizeTypesoutput and avoidfmt.SprintfinHashOfSimpleThis PR adds some optimizations to CASE statements and HashLookups -
3600: Allow filter pushdown in subqueries when analyzing insert sources fixes dolthub/dolt#11232
-
3598: Fix
JSON_LENGTHand member-access lookups to match MySQLJSON_LENGTHreturnedNULLfor empty arrays and the JSON null literal, and member-access paths (.key/.*) on an array returned[]instead ofNULL.- Empty array now has length 0, JSON null has length 1
- Member access on a non object yields
SQL NULL, at any depth - New allocation free path scanner for the pre check Fix dolthub/dolt#11224 Close dolthub/dolt#11235
-
3597: Revert "Merge pull request #3590 from dolthub/aaron/poll-for-closed-connection-more-cases" This reverts commit fd2dd1dc271b33b78dab499bea47a321da117f1d, reversing changes made to a5d92faf1ed8ae517399aabbf5d71d9de208d373. This may have been a performance regression. Reverting while investigating.
-
3595: Rollback event-driven stale-client detection.
-
3594: allow using star expr after sql value for Doltgres
-
3593: server/handler.go: Use event-driven notification to quickly cancel a running query after a client-disconnect, instead of polling socket state in a platform-dependent way.
-
3591: Combine
pushFiltersrule withmoveJoinConditionsToFilterFixes dolthub/dolt#10899 This PR rewrites thepushFiltersrule by combining it with themoveJoinConditionsToFilter. Background Previously, if a join condition only referenced one side of a join,moveJoinConditionsToFilterwould wrap that side with a filter. The idea was that the filter would later get pushed down to the table duringpushFilters, but this caused an issue with nested joins where join/filter conditions that referred to multiple tables that were all part of the same child join would get orphaned in the middle of the join tree and then dropped duringreorderJoin(dolthub/dolt#9868). This was partially fixed with #3231, where filters could get pushed into the join condition. However, this didn't work for all join types and also introduced the problem in dolthub/dolt#10899, where the filter expression pushed down into the join condition was being treated as an edge duringreorderJoin, leading to incorrect join plans. Why query plan tests changed- Filters are no longer automatically getting pushed into join conditions, which affects the join type and join reordering. There are cases where this could still be allowed, but for now, it's safer to not since doing so was causing incorrect join reorders.
- More CrossJoins. Previously, joins that had all their join conditions pushed down into a filter were getting
TRUEassigned as their join condition. This was preventing InnerJoins from being turned into CrossJoins because they had a non-nil join condition, even though nil join conditions are treated asTRUE. Additional Work - There are cases where parent filter expressions or join conditions can be pushed down into a join condition. This could be achieved by extending
filtersByTableto use aFastIntSetto store expressions that reference more than oneTableIdand forpushdownFiltersAboveTablesto propagate up aFastIntSetof childTableIds. - There are also join types, such as Left Outer and Anti joins, where a parent filter expression should not be evaluated as a join condition; however, it may be performant to evaluate the filter expression as part of the join iterator to reduce the need for an additional loop through a filter iterator.
- The
replaceCrossJoinsmay not be necessary and could probably combined intopushFiltersas well
-
3590: server: Use pollForClosedConnection on all query paths, including DML, DDL, OkResults, empty result schemas, etc.
-
3589: fix JSON control-character escaping and out-of-band text reads Escape every control character in JSON output and unwrap lazily loaded text so JSON functions read it correctly.
- escape
U+0000toU+001Fas\uXXXX, keeping the short forms for backspace, tab, newline, form feed, and carriage return. - unwrap StringWrapper before evaluating
JSONfunctions, fixingJSON_VALIDand friends on large keylessTEXT - add serializer, JSON_QUOTE, and function tests Block dolthub/dolt#11215
- escape
-
3587: go.mod: Bump github.com/lestrrat-go/strftime to v1.2.0. Fixes a lock leak which can deadlock queries in Dolt.
-
3585: Add right side lookup overhead for LookupJoins LookupJoins were getting costed lower than they should be, resulting in bad join strategies in some cases. This PR adjusts the coster and includes an overhead for the right side of a lookup join. An example of the bad join is:
explain SELECT SUM(CASE WHEN s_quantity = 0 THEN 1 ELSE 0 END) AS stockouts, SUM(ol.ol_amount) AS total_cost FROM stock s JOIN order_line ol ON s.s_i_id = ol.ol_i_id WHERE s.s_i_id <= 7500; plan --------------------------------------------------------------------------------------------------------------------------------------------------------------- Project ├─ columns: [sum(case when s.s_quantity = 0 then 1 else 0 end as case when s_quantity = 0 then 1 else 0 end) as stockouts, sum(ol.ol_amount) as total_cost] └─ GroupBy ├─ select: SUM(CASE WHEN s.s_quantity = 0 THEN 1 ELSE 0 END as CASE WHEN s_quantity = 0 THEN 1 ELSE 0 END), SUM(ol.ol_amount) ├─ group: └─ LookupJoin ├─ TableAlias(ol) │ └─ Table │ ├─ name: order_line │ └─ columns: [ol_i_id ol_amount] └─ Filter ├─ s.s_i_id <= 7500 └─ TableAlias(s) └─ IndexedTableAccess(stock) ├─ index: [stock.s_i_id] ├─ columns: [s_i_id s_quantity] └─ keys: ol.ol_i_id (17 rows)The more optimal plan uses a HashJoin
explain SELECT /*+ HASH_JOIN(ol, s) */ HINT SUM(CASE WHEN s_quantity = 0 THEN 1 ELSE 0 END) AS stockouts, SUM(ol.ol_amount) AS total_cost FROM stock s JOIN order_line ol ON s.s_i_id = ol.ol_i_id WHERE s.s_i_id <= 7500; plan --------------------------------------------------------------------------------------------------------------------------------------------------------------- Project ├─ columns: [sum(case when s.s_quantity = 0 then 1 else 0 end as case when s_quantity = 0 then 1 else 0 end) as stockouts, sum(ol.ol_amount) as total_cost] └─ GroupBy ├─ select: SUM(CASE WHEN s.s_quantity = 0 THEN 1 ELSE 0 END as CASE WHEN s_quantity = 0 THEN 1 ELSE 0 END), SUM(ol.ol_amount) ├─ group: └─ HashJoin ├─ s.s_i_id = ol.ol_i_id ├─ TableAlias(ol) │ └─ Table │ ├─ name: order_line │ └─ columns: [ol_i_id ol_amount] └─ HashLookup ├─ left-key: (ol.ol_i_id) ├─ right-key: (s.s_i_id) └─ Filter ├─ s.s_i_id <= 7500 └─ TableAlias(s) └─ Table ├─ name: stock └─ columns: [s_i_id s_quantity]Source: I made it up.
-
3584: Add LockSubsystem.TryLock for non-blocking lock acquisition Extract the single CAS attempt from Lock into a private tryLock helper and expose it as a public TryLock method that returns immediately if the lock is held by another session. Callers no longer need to pass a short timeout to Lock and treat ErrLockTimeout as a false return. Referenced by a TODO in dolthub/doltgresql.
-
3582: fix: panic in regexp functions over large text in group by
REGEXP_REPLACEon a largeTEXTcolumn inside aGROUP BYpanic withSIGSEGV.- Add a
ScriptTestandRegexScriptTestsfor similar regressions onREGEXP_REPLACE,REGEXP_SUBSTR,REGEXP_LIKE, andREGEXP_INSTR. Depends on dolthub/go-icu-regex#13
- Add a
-
3581: Fix
LIKE 'prefix%'dropping rows with multibyte textLIKE 'prefix%'is rewritten into an index range for speed, but the upper bound used byte255 (U+00FF), which is not the largest character. Any value after prefix aboveU+00FFfalls outside the range and was silently dropped as aWHERE/JOINfilter. Instead, we build the bound per collation:utf8mb4_0900_binmatches are an exact code-point range, so emitGTE prefix AND LT next(prefix and last character incremented by one skipping the surrogate code points).- Any other collation
GTE prefix AND <LIKE>so the index still narrows the scan while the retainedLIKEkeeps results correct. These collations may not sort by raw character numbers, or have unique rules (i.e., treating trailing spaces as nothing, so "ab" and "ab " count as equal). - Fix TPCH and IMDB plan expectations with old baked-in bound. Fix dolthub/dolt#11182 Close dolthub/dolt#11188
-
3579: make hashjoin compatible with doltgres doltgres has different equality expressions, which prevented hashjoins from getting considered during join planning.
-
3578: fix: retain table comment when primary key is a separate clause
CREATE TABLE ... COMMENT='c'dropped the comment whenPRIMARY KEYwas given as a separate clause.- Add a
commentparameter toIndexedTableCreator.CreateIndexedTableand thread it through the executor. Block dolthub/dolt#11170
- Add a
-
3577: fix: return ok result schema for
ALTER TABLEcommentAlterTableCommentyields anOkResultrow but reported the table schema, so schema-driven renderers (i.e. Dolt) formatted theOkResultagainst the first column and failed. Block dolthub/dolt#11168 Fix dolthub/dolt#11164 -
3575: decompose tuple inequalities This PR extends the tuple in filter decomposition logic to cover tuples in equallities and inequalities.
-
3574: Ensure SchemaObjectNameValidator is used when a table is renamed
-
3573: support NOT VALID on foreign key and check constraints Depends on https://github.com/dolthub/vitess/pull/471
-
3572: Rewrite
CachedResultsnode andcachedResultsIterto not useMemoryManagerThis PR is a follow-up to #3561 and further addresses the memory leak mentioned in #3560. While the initial fix in #3561 made it seem like the issue was that we were not properly disposing of theCachedResultsnode, the real issue was that acachedResultsIterthat never wrote to theCachedResultsnode was never disposed of in theMemoryManagerif it was never closed. This PR rewrites theCachedResultsnode andcachedResultsIterto never actually make use of theMemoryManager. Since we do not make use of parallel partitions, there's no need to have a locking cache. Instead, the results of thecachedResultsIterare stored directly in theCachedResultsnode. This greatly simplifies both theCachedResultsnode and thecachedResultsIter. This PR also moves theemptyCacheIterandEmptyIterout of theplanpackage and de-dupes any code related to empty iters. -
3571: Add
IndexNameGeneratorinterface NewIndexNameGeneratorinterface allows databases to customize the logic that generates index names when they aren't explicitly specified. -
3570: improvements to time to wire format Should use
apd.Decimal.Append()and faster way to append time strings. Benchmarks: https://github.com/dolthub/dolt/pull/11130#issuecomment-4580541049 -
3568: bug fix for non-found search paths
-
3567: fix for division on decimals BenchmarkPlusHighScaleDecimals:
before (decimal.Decimal) 2505679 460.8 ns/op after (apd.Decimal) 3746318 304.5 ns/opBenchmarkMinusHighScaleDecimals:
before (decimal.Decimal) 2619691 449.0 ns/op after (apd.Decimal) 3723363 312.1 ns/opBenchmarkMultHighScaleDecimals:
before (decimal.Decimal) 2537882 454.6 ns/op after (apd.Decimal) 3608662 321.3 ns/opBenchmarkDivHighScaleDecimals:
before (decimal.Decimal) 793515 1414 ns/op before fix (apd.Decimal) 367 3112350 ns/op after fix (apd.Decimal) 946606 1246 ns/opBenchmarkDivManyDecimals:
before (decimal.Decimal) 130582 7691 ns/op before fix (apd.Decimal) 54 21534736 ns/op after fix (apd.Decimal) 110416 9347 ns/op -
3566: analyzer: export BuildForeignKeyEditor for callers outside DML analysis Refactors the internal FK-editor builder chain (getForeignKeyEditor, getForeignKeyReferences, getForeignKeyRefActions, cache.GetUpdater, getForeignKeyHandlerFromUpdateTarget) to take *Catalog instead of *Analyzer since only a.Catalog was ever used. Adds an exported BuildForeignKeyEditor entry point so integrators can wrap a writer in a ForeignKeyEditor when their write path doesn't go through the analyzer (e.g. dolt's workspace tables).
-
3565: Allow unparenthesized function expressions in column defaults. MariaDB allows the use of a function expression as a column default expressions without requiring it to be wrapped in parentheses. MySQL does not allow this. In order to parse scripts created for MariaDB, we should also accept unwrapped function expressions as column defaults. However, in order to ensure that dumps created by Dolt are compatible with MySQL, we normalize these expressions by wrapping them in parentheses internally.
-
3563: Introduce
SchemaObjectNameValidatorinterface To support custom Postgresql logic for Doltgres, a new interface calledRelationNameValidatoris added. -
3562: pass schema name when retreiving function
-
3561: fix(rowexec): dispose CachedResults child when closing hashLookupGeneratingIter (#3560)
Summary
hashLookupGeneratingIter.Closereturnednilwithout closing the child iter chain or disposing the wrapped*plan.CachedResultsnode. Every executed hash join over aCachedResultssubtree could therefore leak one entry intoAnalyzer.CachedResultsManager.cachedResultsCaches, freed only by process restart. This PR makesClose:- Dispose the
CachedResultschild if present (releases the global Manager entry). - Propagate
Closedown the rest of the child iter chain.
Fix
func (h *hashLookupGeneratingIter) Close(c *sql.Context) error { - return nil + if cr, ok := h.n.Child.(*plan.CachedResults); ok { + cr.Dispose(c) + } + return h.childIter.Close(c) }Why
Full RCA, reproducer, and pprof evidence are in #3560. Headline numbers from the 3-minute, ~30 req/sec workload reported there (Dolt 2.0.6 sql-server vendoring this commit):
Metric Vanilla Δ Patched Δ Improvement RSS +5069 MB +44 MB ~115× HeapAlloc (live) +4.3 GB +82 MB ~52× HeapObjects (live) +90 million +1.5 million ~60× Mallocs - Frees(net live)+204 million +4 million ~50× Allocation rate is unchanged (~1.1B mallocs in 3 min both runs); the patched build services the same workload but Freeskeeps up withMallocs.Tests
go test ./sql/rowexec/...passes locally with the patch applied. I did not include a unit-level regression test in this PR. In a minimalengine.Query→RowIterToRowstest,TrackedRowIter.Close → done → disposeNodealready walks the plan tree and disposes theCachedResultsviasql.Dispose(ctx, node), so the leak doesn't reproduce that way; faithfully exercising the production path (Dolt sql-server, prepared statements via the MySQL wire protocol) needs significantly more harness scaffolding. Happy to add a test if maintainers can point me at the right entry point. Closes #3560 - Dispose the
-
3558: Unwrap wrapped strings before casting to string during
RegexpReplace.EvalFixes dolthub/dolt#11095REGEXP_REPLACEqueries onLONGTEXTtype columns were panicking because we were casting values to strings without unwrapping them. Note that this doesn't happen with tables created in Dolt 2.0 due to the recent changes to adaptive encoding, but we still need to support tables before then. Also movedmockStringWrapperto a sharedtestutil package so it can be used in various tests. -
3557: Include
CHARandVARCHARinINexpression optimization A few months ago, I added an optimization to avoid building expensive RangeTrees. https://github.com/dolthub/go-mysql-server/pull/3330 This expands that optimization to includeCHARandVARCHARcolumn types.BINARY,VARBINARY,JSON,GEOMETRY, etc. could be included as well with some more effort. Internally, these types are represented as[]byte, whileCHARandVARCHARarestring, so they are not of typecmp.Orderedand need a different sorting/comparison function (binary.Compare). Locally, this seems to give 8-10% improvement onselect ... from ... in (<str1>, <str2>, ...)queries -
3556: Fix
CHAR_LENGTHandLIKEfailing on the replacement character The replacement character (UnicodeU+FFFD, shown when text gets garbled during encoding conversion) is a normal, valid character. ButCHAR_LENGTHwould error on it instead of counting it. The fix adds that size check, so the valid character (3 bytes) is accepted while genuinely broken input (1 byte) is still rejected. Fix dolthub/dolt#11088 -
3555: Lookup table when not specified in
DROP INDEXstatements MySQL requires the owning table for an index be explicitly mentioned when dropping an index, but Postgres does not. This change looks up the owning table for an index when it is not specified. Because MySQL requires the table name to be specified, tests for this functionality are in the Doltgres package (PR https://github.com/dolthub/doltgresql/pull/2747). -
3553: add partial index on WHERE predicate
-
3552: Do not allow
CASCADEandSET NULLforeign keys on columns that are referenced bySTOREDgenerated column expressions fixes dolthub/dolt#11065 According to the MySQL docs:A foreign key constraint on the base column of a stored generated column cannot use
CASCADE,SET NULL, orSET DEFAULTasON UPDATEorON DELETEreferential actions. (This is actually not totally true because I was able to create a such foreign key constraint with aSET DEFAULTreferential action in MySQL) This PR prevents adding such foreign key constraints (with the exception ofSET DEFAULT) duringCREATE TABLEandALTER TABLE. Note that in MySQL, the error messages for creating a new table with an invalid foreign key and adding an invalid foreign key to an existing table are different (Cannot add foreign key constraintvsCannot add foreign key on the base column of stored column.), but I've decided to use the same error message for both cases (Cannot add foreign key on the base column of a stored generated column.).CreateTable.CreateForeignKeyswas removed and replaced withBaseBuilder.buildCreateTableForeignKeysto avoid a cyclical import. -
3551: star expression used in function
-
3550: modify CompareJSON to use sorted object keys
-
3546: Cache context to use for
String()methods This is a replacement for:- https://github.com/dolthub/go-mysql-server/pull/3525
This accomplishes the same effective goal of passing context in the areas that we previously were not (primarily the
String()function, which is load-bearing). The above PR changed the interfaces such that nodes and expressions no longer respected thefmt.Stringerinterface. This PR instead caches the context inside of all nodes that need a context in theirString()function by providing that context at node creation time. This was a tactic that we were already using before my original context threading PR: - https://github.com/dolthub/go-mysql-server/pull/3513
...and should therefore be no worse than we were before I embarked on this journey.
It's worth noting that the
information_schematables do not have a proper context inside of theirString()function, as those tables are created when the engine is created, and SQL contexts only exist inside of connections/sessions. For now this doesn't impact anything as theSchema(ctx)methods (which use the context fromString()) return a precomputed schema, however there are comments in place that warn about thenilcontext if those methods are ever modified.
- https://github.com/dolthub/go-mysql-server/pull/3525
This accomplishes the same effective goal of passing context in the areas that we previously were not (primarily the
-
3543: Improve costed index scans for tuples by destructuring tuple operations when possible. This is an alternative to https://github.com/dolthub/go-mysql-server/pull/3541/. It's a simpler and more targeted change. In theory, https://github.com/dolthub/go-mysql-server/pull/3541/ lays the groundwork for more general-purpose analysis, since it could be used when tuples are used in additional operators (like inequalities), but it also adds additional complexity. I'm not sure which approach is better.
-
3539: Bug fix for dropping sort nodes Also fixed a couple under-specified goup concat tests. The latter were relying on a particular row storage order which is not guaranteed and broke when Dolt changed some encoding parameters.
-
3537: sql: opt-in SQL trace redaction
Summary
Adds an opt-in redaction layer for the SQL text and identifiers that get attached to OpenTelemetry span attributes — the planbuilder parse-span
queryattribute and the rowexectable/left/right/indexattributes. When enabled via a newsql.Contextoption, identifiers and literal values are rewritten into stable, low-entropy tokens (n1,n2, ...,v1,v2, ...) that repeat across queries of the same shape so trace storage compresses well. Use case: multi-tenant SQL servers (Dolt is one, our own dsabstraction layer is another) where tracing data flows to shared long-term storage. Operators want privacy regulation compliance and tenant isolation without giving up trace visibility entirely. Default off to preserve backward compatibility — existing trace consumers readingquery,table,left,right, etc. verbatim see no change. Callers opt in withsql.WithTraceRedaction(true).How it works
Two passes over the same SQL, deliberately combined:
- Parse to AST, walk it to collect every
TableIdentandColIdentstring. The grammar is the authority on which lexemes are identifiers — necessary because vitess treats hundreds of words (NAME,USER,DATA,STATUS, ...) as non-reserved keywords: the lexer emits a keyword token type for them, but real queries use them as bare column / table names. - Lex the SQL and emit token-by-token. Literal token types (
STRING,INTEGRAL,FLOAT,HEX,HEXNUM,BIT_LITERAL) redact as values.IDtokens redact as identifiers.COMMENTtokens drop.VALUE_ARG/LIST_ARGpass through. Any other token (keyword, punctuation, multi-char operator) emits structurally — unless itsvalis in the identifier set from step 1, in which case it redacts as an identifier (this catches the non-reserved-keyword-as-column-name case). Coverage is bounded by the grammar's notion of identifier (TableIdent+ColIdent) and the lexer's fixed set of literal token types — not by an evolving list of AST node fields. Future grammar / AST shape changes are covered automatically as long as they go throughWalkand produce the same lexer token classes. This is deliberately distinct fromsqlparser.Normalize/RedactSQLQuery, which is a plan-cache primitive that parameterizes literals only, dedupes only inside SELECT, and skips long values for CPU. The redactor here treats traces as a privacy boundary: every high-cardinality token is rewritten, always dedupes, drops comments, and falls back to<unparseable>on parse failure rather than risk a partial redaction.
Examples
Before: SELECT * FROM t WHERE c1 = 'could_be_sensitive' After: SELECT * FROM `n1` WHERE `n2` = 'v1'Before: SELECT u.name, u.email FROM users AS u After: SELECT `n1` . `n2` , `n1` . `n3` FROM `n4` AS `n1`nameis a non-reserved keyword in the vitess grammar — lexed with a keyword token type, notID. A pure lexer-driven redactor would leak it. The hybrid grammar+lex approach catches it.Before: WITH x (renamed_col) AS (SELECT a FROM t) SELECT * FROM x JOIN y USING (sensitive_join_col) After: WITH `n1` ( `n2` ) AS ( SELECT `n3` FROM `n4` ) SELECT * FROM `n1` JOIN `n5` USING ( `n6` )CTE column-rename list, USING column list — both are
[]ColIdentslices on pointer parents. Picked up via the AST walk's identifier collection, redacted at lex time.Before: /* PII: alice@example.com */ SELECT 1 FROM t /* inline */ After: SELECT :v1 FROM `n1`Both margin and inline comments are dropped (the lexer emits
COMMENTfor both — drop happens at the lex pass).Concurrency
The
Mappingis eagerly allocated byNewContextwhen redaction is enabled (never lazy after construction), so concurrent rowexec spans firing while the parser populates the mapping never race on lazy initialization. The Mapping itself uses an internalsync.RWMutex— the fast path for already-minted tokens takesRLock, mints takeLockwith a re-check after upgrade. A newTestMapping_ConcurrentRedactIsRaceFreeexercises the production usage pattern (parent populates during parse, many goroutines read with occasional mint-on-miss) under-racefor 500 iterations × 32 goroutines.Public API
// sql.Context option (default off) sql.WithTraceRedaction(enabled bool) ContextOption // Methods on *Context (*Context).TraceRedactionEnabled() bool (*Context).RedactionMapping() *sqlredact.Mapping (*Context).RedactQueryForTrace(query string) string (*Context).RedactNameForTrace(name string) string (*Context).RedactStringerForTrace(v interface{ String() string }) string // New subpackage sqlredact.RedactSQLForTrace(sql string) (redacted string, m *Mapping, err error) sqlredact.RedactSQLForTraceInto(sql string, m *Mapping) (string, error) sqlredact.NewMapping() *MappingCommits
sqlredact: SQL trace redaction for span attributes (opt-in)— newsql/sqlredactpackage (parse + lex hybrid, theMappingwithsync.RWMutex), newsql.Contextoption and helpers, tests including the concurrency stress.trace: redact SQL identifiers in span attributes— wiresplanbuilder/parse.go,rowexec/rel.go,rowexec/join_iters.go,rowexec/range_heap_iter.go, androwexec/ddl_iters.gothrough the new helpers.
Test plan
-
go build ./...for./sqland./sql/sqlredactclean -
go test ./sql ./sql/sqlredactall pass (incl. testify assertions and the concurrency test under-race) -
gofmt -lclean on touched files -
enginetestend-to-end coverage — not yet added; perCONTRIBUTING.mdthis is expected. Happy to add a query+expected-redacted-trace fixture if there's an existing pattern for span-attribute assertions, or open to guidance on the right scaffolding.
Open questions for review
- Token format
n1/v1/:v1/X'v1'— chosen to be short and repeating for compression density. Happy to adopt a different convention (e.g._redacted_n1) if the project prefers more obviously synthetic markers. - The
<redacted>placeholder forLIMIT/OFFSETStringer attrs drops the value entirely under redaction (see commit message rationale). Open to alternative: re-tokenize the fragment text against the mapping, accepting that pushdown-generated synthetic identifiers won't have entries. - Any existing convention for end-to-end tests of span attributes that I should hook into? 🤖 Generated with Claude Code
- Parse to AST, walk it to collect every
-
3532: replace all
decimal.Decimalwith*apd.Decimal
vitess
- 477: Adding
Columnsfield toTableFuncExprAllows aliasing columns from a table function. Needed primarily for Doltgres, which supports more expressive table functions than MySQL. - 476: Small fixes for functional indexes
- adds test coverage for multi column function indexes
- fixes Walk() to walk index fields
- 474: go/mysql: add Conn.WaitForClientActivity to detect a departed client
On context cancelation, the function returns with a
nilerror. If the client unexpectedly writes to the connection or closes it, then this method will return a non-nilerror. Unlike the first attempt at this method, this new implementation accounts for LoadDataInFile. It uses a preempt-able read lease to let the handler read from the client socket even while WaitForClientActivity is outstanding. The Peek becomes active once again after the reads are issued and completed. - 473: Revert "Merge pull request #472 from dolthub/aaron/vitess-async-read-eof" This reverts commit 02705d5447c2e7062c3ae31f6909d4e5e1c97812, reversing changes made to 0893abc805429d8a31ea9fa395ff118fa95474da.
- 472: go/mysql: Conn: Add WaitForClientActivity, which has semantics that allow a server to quickly cancel inflight work if a client goes away.
- 471: add not valid on fkey and check constraints
- 470: Expand the set of function call expressions that can be used as a column default value without requiring parentheses. These forms are not valid MySQL but are accepted by MariaDB. We should also accept them in order to have better compatibility with schemas created for MariaDB.
- 469: add predicate to indexspec
- 467: Add ERWarnDeprecatedSyntax 1287 Blocks dolthub/dolt#10983
Closed Issues
- 11467: Dolt panics on a non-numeric NTILE bucket expression
- 11540: prolly/tree: DiffOp stringer is stale — entry 12 unlabelled, one label transposed, one -linecomment wrong
- 11455:
TRIMpanics on a nativeTIMEvalue - 11488: Make CALL DOLT_BACKUP('sync', ...) a no-op when nothing has changed
- 11517: Dolt panics on a numeric
FORMATlocale from a window expression - 11518: Dolt panics on empty
LIKE ... ESCAPE ''within window expressions - 3707: SHOW INDEX FROM table WHERE key_name = ? ignores the WHERE filter
- 3706: Constraint-violation errors return SQLSTATE HY000 instead of 23000 (MySQL parity gap)
- 3708: Unmodified Drupal core install fails with "already an active transaction" against Dolt (works against MySQL)
- 2877: MemoryDB: Building non-unique indexes is nondeterministic
- 3622: Clean up: move sorters in
sql/expression/sort.goout ofexpressionpackage - 3560: CachedResults / HashLookup chain leaks rows-cache for every hash join until process restart
v2.3.02.3.0
Merged PRs
dolt
- 11534: go: remotesrv: http: Authenticate incoming requests against the correct remote peer address.
For authentication, this previously defaulted to
localhost, while still applying authorization on the true remote peer address. - 11481: go: store/nbs,dprocedures_backup: Add dolt backup sync{,-url} --prune-with-grace-period.
Backups into a destination store land new table files there before they update the manifest of the destination store to refer to the files. If the backup fails partially through, it can leave behind temporary files and unreferenced table files.
--prune-with-grace-period is a new flag which can be used when calling
backup syncandbackup sync-url. It will cause all unreferenced table files in the destination store to be removed, before the sync starts, if no files in the destination store have an mtime more recent than the provided grace period. In general, --prune-with-grace-period should be larger than the amount of time it takes to land the backup, but smaller than the period of time between backup attempts. Fixes #11361
Closed Issues
- 11361:
dolt backup sync: an interrupted sync leaves a complete, unreferenced archive in the destination forever — the archive is published before the manifest and there is no prune
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 17.01 | 2.39 | 0.14 |
| groupby_scan | 134.9 | 61.08 | 0.45 |
| index_join | 3.43 | 1.93 | 0.56 |
| index_join_scan | 4.25 | 1.32 | 0.31 |
| index_scan | 344.08 | 196.89 | 0.57 |
| oltp_point_select | 0.19 | 0.25 | 1.32 |
| oltp_read_only | 3.62 | 5.0 | 1.38 |
| select_random_points | 0.36 | 0.51 | 1.42 |
| select_random_ranges | 0.38 | 0.64 | 1.68 |
| table_scan | 344.08 | 200.47 | 0.58 |
| types_table_scan | 746.32 | 458.96 | 0.61 |
| reads_mean_multiplier | 0.82 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 7.7 | 6.21 | 0.81 |
| oltp_insert | 4.1 | 3.13 | 0.76 |
| oltp_read_write | 8.74 | 11.24 | 1.29 |
| oltp_update_index | 4.33 | 3.3 | 0.76 |
| oltp_update_non_index | 4.1 | 3.02 | 0.74 |
| oltp_write_only | 5.18 | 6.21 | 1.2 |
| types_delete_insert | 8.28 | 6.67 | 0.81 |
| writes_mean_multiplier | 0.91 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 95.46 | 52.64 | 1.81 |
| tpcc_tps_multiplier | 1.81 |
| Overall Mean Multiple | 1.18 |
|---|