Merged PRs
dolt
- 7884: [tree] return blob builders to pool after use
I added a builder pool and never returned the objects, this adds the Put(). - 7882: Bug fix: no-op
dolt_pull()
was leaving working set dirty
Customer-reported bug. Twodolt_pull()
operations on two branches in the same session when local branches are already up to date, with@@autocommit
off, leave the session unable to commit because two branch heads are considered dirty. See new bats test for details on reproducing.
The issue is thatDoltSession.SetWorkingSet()
marks that branch head dirty until the transaction is committed. Most merge code paths used by pull involve performing adolt_commit
(), which has the side effect of zeroing out the current transaction, meaning the next statement would get a new transaction and fresh working sets loaded from disk, avoiding the dirty state problem. Only the code path where the branch head is already up to date is affected by this bug. All the merge library code that actually needs to callDoltSession.SetWorkingSet()
(only necessary before adolt_commit
happens, or in the case of a squash where changes should remain in the working set) already does so, making the additional call indolt_pull.go
redundant and leading to this buggy behavior in the no-change case.
There are probably still related bugs for session state management during pull and merge operations, but I want to keep this fix narrow to address the customer issue while I build up more robust (non-bats) tests for pull. - 7878: Move sql patch statement generation APIs to the
sqlfmt
package
We have a few different APIs scattered around for generating SQL patch statements. I needed to make some functions fromdolt_patch_table_function.go
public to generate DDL statements for binlog support, so I moved them into thesqlfmt
package and cleaned up some package import cycles along the way. - 7872: Various test utils and small fixes
As part of the work for binlog source support (on fulghum/binlog_prototype branch), these are various smaller changes to tidy up docs, packaging, small bug fixes, and add new test utils that I've pulled out into this PR to review separately.
Notable changes:- Adds the third version component to the go version in our
go.mod
. Two component versions indicate a development version, not a release version and cause an error about not being able to download a toolchain. - Allows Dolt binlog replicas to accept the
SOURCE_AUTO_POSITION
config parameter, and errors if a user attempts to disable GTID auto positioning. - Adds several new test util functions specific to binlog testing.
- Adds the third version component to the go version in our
- 7870: go/utils/publishrelease: Bump MUSL toolchains used for cutting releases.
The new toolchain uses MUSL + mimalloc.
Include the mimalloc license in our released LICENSES notice. - 7859: Cache table and schema indexes on schema address
The bulk of ~1ms read and write TPC-C queries benefit from caching table and index schemas, which have a lifecycle between schema migrations/alter statements/new table additions. This is in contrast to how we've typically cached objects using the root value hash, which is great for read-only workflows, but has a much shorter half-life.
go-mysql-server
- 2511: Adding mapping to error code 1049 for
ErrDatabaseNotFound
errors
When a database doesn't exist, MySQL returns error code 1049. This change adds a mapping to error code 1049 forErrDatabaseNotFound
errors, and updates our handler so thatComInitDB
messages will map errors to MySQL error codes.
This is needed because tooling (e.g. Pomelo EntityFramework MySQL library) can rely on this error code in application logic.
Related to #7890 - 2510: Fix race errors with memory tables
We use this library for running our tests. These are run with the-race
flag - and we are seeing some errors related to concurrency and updating of the tables map.
I've added async.Mutex
to all the places where this map is updated - our tests are now passing :) - 2504: Added InjectedStatement as an AST node
This is the same asInjectedExpr
, except for statements instead of expressions. - 2502: Use Uint32 for SEQ_IN_INDEX in 'SHOW INDEXES' queries.
This is seemingly the correct type for this field.
MySQL Connector/NET expects this for servers >8.0.1: https://github.com/mysql/mysql-connector-net/blob/8.4.0/MySQL.Data/src/SchemaProvider.cs#L298-L300
Fixes dolthub/go-mysql-server#2501
vitess
- 347: Added InjectedStatement
This is the same asInjectedExpr
, except for statements instead of expressions. - 346: support
DATE
,TIME
, andTIMESTAMP
literal parsing
The SQL standard has special syntax for parsing date, time, and timestring literals.
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html
This PR adds support for that.
Code was mostly taken from vitessio.
The types are still left as string types, as type conversion later on handles it just fine. - 345: parse type aliases in cast
add support for statements like:select cast(<str> as character)
select cast(<str> as double precision)
select cast(<str> as read)