Merged PRs
dolt
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 #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 |
|---|