Merged PRs
dolt
- 11081: Update docs URLs from docs.dolthub.com to dolthub.com/docs
Update references fromdocs.dolthub.comtodolthub.com/docsacross READMEs and CLI help text. - 11060: more cleanup for
prollyWriteSession
This PR moves logic for updating the branch state fromprollyTableWritertoprollyWriteSession.
Additionally, it completely removes the mutex "protecting"prollyWriteSession.workingSetbecause it is unnecessary; there's no way the sameprollyWriteSessionis accessed by multiple threads.
go-mysql-server
- 3558: Unwrap wrapped strings before casting to string during
RegexpReplace.Eval
Fixes #11095
REGEXP_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.
dolthub/go-mysql-server#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 #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 dolthub/doltgresql#2747). - 3552: Do not allow
CASCADEandSET NULLforeign keys on columns that are referenced bySTOREDgenerated column expressions
fixes #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. - 3550: modify CompareJSON to use sorted object keys
- 3543: Improve costed index scans for tuples by destructuring tuple operations when possible.
This is an alternative to dolthub/go-mysql-server#3541. It's a simpler and more targeted change.
In theory, dolthub/go-mysql-server#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.
vitess
Closed Issues
- 11095: REGEXP_REPLACE panics on TextStorage values: 'interface conversion: interface {} is *val.TextStorage, not string'
- 11088: CHAR_LENGTH fails with malformed string on valid UTF-8 replacement character (0xEFBFBD)
- 11065: Stored generated column stays stale after ON UPDATE CASCADE updates its base column
- 11070: CALL dolt_gc() left manifest referencing a chunk address not present on disk, rendering DB unopenable (v2.0.3)
- 11068: conjoin ENOSPC: panic + leftover partial nbs_table_* files cause unrecoverable disk-fill loop under supervised dolt-server