Merged PRs
dolt
- 11176: go/store/{val,prolly/tree}: Implement ValueContext for the places where we need a Context.
dolthub/driver directly consumes these values and has the abilityt to pass the correct Context instance. - 11172: bug fix for race condition in acquiring auto increment locks
The global auto increment tracker had a race condition in Next(). In interleaved mode (the default), a necessary table-level lock was not being taken, leading to a non-atomic get-increment-set race between two concurrent sessions. This was due to the lock mode being stored in the struct itself and only set during some code paths. The fix sets the lock mode value at startup.
The new test reliably reproduced the race condition before this patch. - 11170: fix: persist table comment on indexed table creation
SeparatePRIMARY KEYclause routes creation throughCreateIndexedTablewhich never sets schema comment. - 11168: add test for
ALTER TABLEcomment on primary key table
Fix #11164 - 11155: support NOT VALID for foreign key and check constraints
Depends on dolthub/vitess#471 and dolthub/go-mysql-server#3573 - 11149: Implement
IndexNameGeneratorinterface
Depends on: dolthub/go-mysql-server#3571 - 11110: go/go.mod: Bump fslock, adopt fallible fslock.New() and the requirement to Close() the *Lock instance.
- 11001: Store adaptive-encoded values in lexical order
In Dolt, all adaptive-encoded values are stored in an arbitrary order according to their raw bytes.This isn't a problem for Dolt, because keys on columns that will be adaptively encoded post 2.0 (TEXT, BLOB) all require a key prefix length, which is used by the secondary index to order the keys correctly.func compareAdaptiveValue(l, r AdaptiveValue) int { return bytes.Compare(l, r) }
But for Doltgres, it's possible to create indexes on TEXT and VARCHAR (no length) columns without a key prefix length. This means that adaptive-encoded values must be stored in a canonical order independent of whether the value is stored inline or out-of-band. Otherwise, various SQL engine optimizations, like removing the Sort operation on an index range scan, would not yield correct results in Doltgres. There are also many other known and unknown assumptions in Dolt and go-mysql-server that break if values in indexed columns are not stored in a consistent order. Additionally, enforcing a canonical order for such columns makes it possible to bring these enhancements to Dolt in the future (by relaxing MySQL's constraints on key lengths), or in new products we might build.
This PR sorts adaptive encoded values by adding a ValueStore param to theCompare()interface. It is unused except when comparing adaptive values.
The downside to this change is that we must perform 1 or 2 additional disk reads for each comparison of out-of-band values. This is a large performance penalty but is unavoidable, and should (we think) happen in a small minority of cases.
go-mysql-server
- 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 #11170
- Add a
- 3577: fix: return ok result schema for
ALTER TABLEcomment
AlterTableCommentyields anOkResultrow but reported the table schema, so schema-driven renderers (i.e. Dolt) formatted theOkResultagainst the first column and failed.
Block #11168
Fix #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 dolthub/vitess#471 - 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 useapd.Decimal.Append()and faster way to append time strings.
Benchmarks: #11130 (comment) - 3568: bug fix for non-found search paths
- 3563: Introduce
SchemaObjectNameValidatorinterface
To support custom Postgresql logic for Doltgres, a new interface calledRelationNameValidatoris added.
vitess
- 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.