Releases: dolthub/dolt
Releases · dolthub/dolt
1.79.1
Merged PRs
dolt
- 10140: Full passthrough of Doltgres overrides
Related PRs:
go-mysql-server
- 3342: Set
SubqueryAlias.OuterScopeVisibilityto true if inside trigger scope
Fixes #10175
Trigger scopes were being included when determining exec indexes forSubqueryAliaschild nodes but were not actually passed down to child iterators during rowexec (code). As a result, we were getting index out of bounds errors since the trigger scopes were not included in the parent row.
Since there's no easy way to separate the trigger scope columns out from the rest of the parent row during rowexec, it was easier to just markSubqueryAlias.OuterScopeVisibilityinside triggers to true. I think it technically does make sense here because the trigger scope is an outer scope that theSubqueryAliasdoes have visibility of, but I added a TODO comment in case this is incorrect. - 3340: enable native indexes on all in-memory tables by default
Also simplifies the test harness setup by removing the non-native-index cases.
Fixes dolthub/go-mysql-server#3338 - 3339: Do not erase projections for insert sources inside triggers
part of #10175 (see example 2)
Erasing projections for insert sources inside triggers was causing the wrong columns to be selected when the trigger is executed. This is because the exec indexes in Project nodes inside the trigger logic account for the prepended trigger row and is needed to "trim" away the prepended row to get the right columns. The Project node that ultimately wraps the insert source, which re-projects it to match the insert destination, assumes the correct columns have already been fetched by its child node so does not account for the prepended trigger row. - 3335: For large joins, prefer sticking to the user-supplied join order over full enumeration.
This effectively reverts a change that was introduced in dolthub/go-mysql-server#3289 (potentially by accident). For a large join (16+ tables), full enumeration of every possible join plan is too slow. In the event that we can't find a good join plan heuristically, we should stick to the original join order, and not attempt to enumerate all the possible joins.
This results in worse joins in the IMDB query tests... but those tests were previously skipped because they were too slow, and we can now unskip them.
Ideally we would do a better job of finding the best join without needing to fall back on an exhaustive search, but in the meantime, this serves as a workaround. - 3334: Index lookup type conversion issues
This PR addresses type conversion semantics during key lookups. Some type conversions were insufficient for Doltgres, and some were simply incorrect, notably the behavior when a value being converted was out of range, which could produce incorrect results.
Other fixes addressed:- New
ExecBuilderNodeinterface to allow Doltgres to correctly use the custom builder overrides when building row iters - Corrected behavior for
INandNOT INused in index lookups for doltgres
Tests for some of these changes only exist in Doltgres, will address before merging.
See: dolthub/doltgresql#2093
- New
- 3330: Add fast path for simple
INfilters
If we are filtering an indexed column with a simpleINquery, we can avoid building a range tree.
This currently only applies to integer columns, but it's possible to expand it to floats and decimals.
Also, simplifies rounding checks for float/decimal keys on integer indexes.
Benchmarks:
#10133 (comment) - 3303: Explicit Analyzer/Builder Overrides
Related PRs:
Closed Issues
- 10175: Unable to find field with index ... in row of ... columns
- 7128: Truncate strings when converting to
double - 10156: syntax error in CREATE TEMPORARY TABLE statement used by Gnucash
- 3338: Foreign key behavior doesn't match modern MySQL
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 1.89 | 0.55 | 0.29 |
| groupby_scan | 13.7 | 11.65 | 0.85 |
| index_join | 1.52 | 1.96 | 1.29 |
| index_join_scan | 1.47 | 1.34 | 0.91 |
| index_scan | 34.33 | 22.28 | 0.65 |
| oltp_point_select | 0.2 | 0.28 | 1.4 |
| oltp_read_only | 3.82 | 5.28 | 1.38 |
| select_random_points | 0.35 | 0.56 | 1.6 |
| select_random_ranges | 0.39 | 0.58 | 1.49 |
| table_scan | 34.95 | 27.66 | 0.79 |
| types_table_scan | 75.82 | 65.65 | 0.87 |
| reads_mean_multiplier | 1.05 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.43 | 6.55 | 0.78 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.22 | 11.65 | 1.26 |
| oltp_update_index | 4.25 | 3.3 | 0.78 |
| oltp_update_non_index | 4.25 | 3.19 | 0.75 |
| oltp_write_only | 5.28 | 6.32 | 1.2 |
| types_delete_insert | 8.58 | 6.91 | 0.81 |
| writes_mean_multiplier | 0.91 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 93.54 | 36.85 | 2.54 |
| tpcc_tps_multiplier | 2.54 |
| Overall Mean Multiple | 1.50 |
|---|
1.79.0
Dolt 1.79.0 has support for new sql-server config parameters. Due to the strict yaml parser used for server configuration, a 1.79.0 config will not work with older versions of Dolt.
Merged PRs
dolt
- 10188: Added JWT support for metrics endpoint authorization.
- 10184: removed doltgres index implementation
This change removes doltgres-specific index logic from Dolt and fixes various bugs in index lookup and type conversion logic that were preventing doltgres from using the unified index logic in the first place.
See: dolthub/doltgresql#2093 - 10159: Add
adapters.TableAdapterto handledolt_statusand other table conversions for integrators (a.k.a. Doltgres)
A recent change to cherry-pick tests requireddolt_statusto display its staged column as abytetype to overcome MySQL's wire protocol being unable to distinguish Boolean types. This had the side affect of breaking Doltgres. This fix adds Dolt system table adapters for integrators (i.e. Doltgres).adapters.TableAdapterallows for tables in general to be wrapped or overwritten with different implementations.- Add
adapters.TableAdapterto allow integrator's to overwrite or wrap existing table implementations. - Add
adapters.DoltTableAdapterRegistryto automatically integrate said table adapters for Dolt system table through an interface available to integrators. - Remove explicit
SUPERUSERprivilege check indolt_purge_dropped_databasesas this should be handled by integrators. - Remove authentication handling in
dolt_backupfor Doltgres; now handled by dolthub/doltgresql#2068.
- Add
- 10097: #10030:
--filtercontribution fordolt diff
Author @codeaucafe
Add--filteroption todolt diff, enabling filtering by specific change types and fixing issues from the earlier stalled PR (#3499).Users reviewing large diffs often need to focus on specific change types - deletes may need extra scrutiny while inserts are routine. With diffs spanning thousands of rows across multiple tables, grep isn't enough since updates show
both additions and deletions.Close #10030dolt diff --filter=added # new tables/rows dolt diff --filter=modified # schema changes, row updates dolt diff --filter=renamed # renamed tables dolt diff --filter=dropped # dropped tables, deleted rows dolt diff --filter=removed # alias for dropped dolt diff HEAD~1 --filter=dropped -r sql
Fix #1430 - 10030: dolt/dolthub#1430: Add
--filteroption for dolt diff
There was no action on the original #3499 for issue #1430; the PR was closed ~3 years ago. This PR fixes the open PR comments and updates the implementation details a bit for the RowWriting of filtered rows
go-mysql-server
- 3336: Return a helpful error message when attempting to use a table function where a non-table function is expected.
Previously, we would return a "function not found" error, which was confusing and misleading.
Fixes #10187 - 3334: Index lookup type conversion issues
This PR addresses type conversion semantics during key lookups. Some type conversions were insufficient for Doltgres, and some were simply incorrect, notably the behavior when a value being converted was out of range, which could produce incorrect results.
Other fixes addressed:- New
ExecBuilderNodeinterface to allow Doltgres to correctly use the custom builder overrides when building row iters - Corrected behavior for
INandNOT INused in index lookups for doltgres
Tests for some of these changes only exist in Doltgres, will address before merging.
See: dolthub/doltgresql#2093
- New
- 3333: fix overflow indexed table access
There's a bug where filtering by a key that overflows the index column type results in incorrect lookups.
When converting the key type to the column type, we ignore in OutOfRange results, and use the max/min of the corresponding type. As a result, we perform lookups using the wrong key.
Changes:sql.Convert()returns if the conversion result isInRange,Overflows, orUnderflows.- Reduce number of potential ranges by ignoring impossible ones.
- Fixes
HashInto handle overflowing keys. - Added tests for out of range key conversions.
- 3332: Fix create view error message
This fixes: #10177 - 3331: Introduce notion of conditional equivalence sets in FDS for optimizing outer joins.
Fixes #9520
In Functional Dependency Analysis, equivalence sets are sets of columns which have been determined to always be equal to each other. During join planning, we walk the join tree, read the join filters, and use these filters to compute equivalence sets which can inform the analysis.
However, we currently only look at filters on inner joins, because filters on outer joins do not unconditionally imply equivalence.
For example, in the following join query:It cannot be said thatSELECT * FROM table_one LEFT JOIN table_two ON table_one.one = table_two.two
table_one.oneandtable_two.twohave equal values in the output. Any of the following are valid rows in the final output:table_one.one table_two.two 1 1 1 NULL NULL NULL In order to record this filter and include it in FDS, we need to tweak the definition of equivalence sets slightly. This PR adds conditional equivalence sets, which consist of two column sets: conditional columns and equivalent columns. A conditional equivalence set should be interpreted as: "IF at least one of the columns in conditional is not null, THEN all of the columns in equivalent are equal." This matches the behavior of left joins. We could implement regular equivalence sets as conditional equivalence sets with an empty conditional, but this PR keeps them separate to avoid complicating existing logic. It's worth noting that we deliberately don't check if the columns are non-null at the time that the equivalence set is created. This is deliberate, because when equivalence sets are inherited by parent nodes, this can change for outer joins, and when evaluating whether a join can be implemented as a lookup, we analyze the child node using filters and equivalence sets from the parent, but with the child's nullness information. Thanks to Angela, who worked on the investigation with me, wrote the original version of this feature (dolthub/go-mysql-server#3288), and wrote the plan test for this PR.
vitess
- 445: /go/vt/sqlparser: support float8
- 444: go/mysql: server.go: Add a callback on Handler, ConnectionAuthenticated, which is called immediately after the connection is authenticated.
This allows a server implementation to know the authenticated user without waiting for the first command interactions, such as ComQuery or ComInitDB.
Closed Issues
- 10174: Does Dolt Support Minio Storage for Remotes and Backups?
- 10059: Incorrect collation returned by case expression
- 10187: Using a table function where a non-table function is expected results in confusing "function not found" error
- 10157: Unexpected ANTI JOIN Result
- 1430:
dolt diffshould support--filteroption - 10136: DOLT_BACKUP Restore Requires Existing Database Context and Service Restart to Recognize New Database
1.78.8
Merged PRs
dolt
- 10183: go: store/datas/pull: pull_chunk_tracker.go: Optimize memory use when backing up to an AWS remote.
PullChunkTracker is responsible for making the HasMany calls against the destination and batching up absent hashes into HashSets which will be delivered to GetManyCompressed and eventually written into table files which are uploaded. This code is used for both pull and push, when the destination is the "local" database or when destination is the remote database respectively. It is used when the remote is both doltremoteapi, thus every HasMany call is an RPC, and when the remote is something like file:// or aws://, thus the table file indexes for the remote are in memory and HasMany calls are very quick.
Different operational characteristics of the various dependencies mean that sometimes a Pull is prone to build up large sets of hashes waiting for HasMany calls, whereas other times it is prone to build up large sets of absent hashes which are waiting for the fetcher thread(s) to take them.
Previously, PullChunkTracker was structured to accumulate HasMany responses and wait to batch them into appropriately-sized batches for GetManyCompressed until the fetcher threads asked for them. This meant that if HasMany batches were very small, because HasMany was very fast, we would accumulate a large number of very small HashSets. These HashSets would take up large amounts of memory. Accumulating the batches as the HasMany responses come in is more memory efficient and should be no slower - we will always accumulate the full batches, and in basically the same order.
Tested by pushing a large database to an AWS remote and memory profiling the result. - 10164: #10136: Fix
dolt_backupto work in non-Dolt directories
Fixes #10136- Fix
dolt_backupto work in non-Dolt directories; this amends thedolt.goboolean expression for commands that accept non-Dolt directories into a searchable map. - Remote
sql-backup.batsfromlocal-remote.bashso it also gets run against server.
- Fix
go-mysql-server
- 3332: Fix create view error message
This fixes: #10177 - 3328: Avoid underestimating rows in outer joins.
When computing row estimates for joins, if the join can't be optimized into a lookup join or a merge join, we use stats to predict the fraction of pairwise combinations of left and right rows that will match and estimate the number of result rows asleftRows * rightRows * selectivity.
This is correct for inner joins, but not correct for outer joins, because left joins guarantee at least one result per left row, and full outer joins guarentee at least one result per left or right row.
Consider a left join whereleft.RowCount()is much greater thanright.RowCount(), and every row of the relevant column is distinct (soleft.RowCount() == left.DistinctCount(). In that case,selectivity == 1.0 / left.RowCount(), and the estimated cardinality is equal to:
left.RowCount() * right.RowCount() * selectivity==left.RowCount() * right.RowCount() * (1.0 / left.RowCount())==right.RowCount().
If the selectivity of the join is very small, this could result in a row estimate that is lower than the guaranteed minimum, which can cause the join planner to pick bad plans. In the worst case it could cause us to favor an unoptimizable join order over an optimizable one.
A common impact of this change is to now favor hash joins for left joins when the right is much smaller than the left. This makes sense: iterating over the smaller right table once and building a hash table in memory is going to be much faster than doing a table lookup for each left row.
Closed Issues
- 9520: PRIMARY KEY isn't always used in left joins
- 10177: need better error message when creating view with conflicting name
- 10176: panic during dolt_rebase:
panic: expected false - 10136: DOLT_BACKUP Restore Requires Existing Database Context and Service Restart to Recognize New Database
- 10157: Unexpected ANTI JOIN Result
- 10086: Dolt Unable to Resolve Default Branch Head Error
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 1.86 | 0.55 | 0.3 |
| groupby_scan | 13.7 | 12.08 | 0.88 |
| index_join | 1.52 | 1.96 | 1.29 |
| index_join_scan | 1.47 | 1.34 | 0.91 |
| index_scan | 35.59 | 22.28 | 0.63 |
| oltp_point_select | 0.2 | 0.28 | 1.4 |
| oltp_read_only | 3.82 | 5.28 | 1.38 |
| select_random_points | 0.35 | 0.58 | 1.66 |
| select_random_ranges | 0.39 | 0.57 | 1.46 |
| table_scan | 35.59 | 27.66 | 0.78 |
| types_table_scan | 80.03 | 65.65 | 0.82 |
| reads_mean_multiplier | 1.05 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.43 | 6.55 | 0.78 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.22 | 11.65 | 1.26 |
| oltp_update_index | 4.18 | 3.25 | 0.78 |
| oltp_update_non_index | 4.25 | 3.19 | 0.75 |
| oltp_write_only | 5.28 | 6.32 | 1.2 |
| types_delete_insert | 8.58 | 6.91 | 0.81 |
| writes_mean_multiplier | 0.91 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 93.62 | 36.19 | 2.59 |
| tpcc_tps_multiplier | 2.59 |
| Overall Mean Multiple | 1.52 |
|---|
1.78.7
Merged PRs
dolt
- 10178: Report merge conflict when merging a JSON document that is NULL in the common ancestor.
When attempting to merge concurrent changes to a JSON document, Dolt should check whether the document is NULL in either branch or the common ancestor, and correctly report when this results in a merge conflict. - 10155: Update
datetimetypes to correct precision for dolt system tables
fixes #10128
depends on dolthub/go-mysql-server#3323 - 10120: Allow dolt_commit_diff_ to diff against HEAD
Previously it was not possible to use 'HEAD' as a filter value on dolt_commit_diff_ system tables. This PR adds support and additional tests.
go-mysql-server
- 3328: Avoid underestimating rows in outer joins.
When computing row estimates for joins, if the join can't be optimized into a lookup join or a merge join, we use stats to predict the fraction of pairwise combinations of left and right rows that will match and estimate the number of result rows asleftRows * rightRows * selectivity.
This is correct for inner joins, but not correct for outer joins, because left joins guarantee at least one result per left row, and full outer joins guarentee at least one result per left or right row.
Consider a left join whereleft.RowCount()is much greater thanright.RowCount(), and every row of the relevant column is distinct (soleft.RowCount() == left.DistinctCount(). In that case,selectivity == 1.0 / left.RowCount(), and the estimated cardinality is equal to:
left.RowCount() * right.RowCount() * selectivity==left.RowCount() * right.RowCount() * (1.0 / left.RowCount())==right.RowCount().
If the selectivity of the join is very small, this could result in a row estimate that is lower than the guaranteed minimum, which can cause the join planner to pick bad plans. In the worst case it could cause us to favor an unoptimizable join order over an optimizable one.
A common impact of this change is to now favor hash joins for left joins when the right is much smaller than the left. This makes sense: iterating over the smaller right table once and building a hash table in memory is going to be much faster than doing a table lookup for each left row. - 3326: Skip expected estimates and analysis for keyless table plan tests
This is because of #10160
These tests were supposed to be disabled in a previous PR, but plangen regenerated them.
Thus, this PR provides a way explicitly tell plangen not to generated expected estimates, while still generating missing estimates as the default behavior.
The difference between setting an expected value to "skip" vs omitting is how plangen treats it: plangen will generate omitted estimates (since we typically want them) but will avoid generating estimates that are explicitly skipped. - 3325: Make
IsNullablereturntruefor log and math functions where applicable
fixes #10102
fixes #10157
Like mentioned in #3308, we should do an audit of all our functions to make sureIsNullablecorrectly returnstrueifEvalcan return nil for a non-nil child value. I've filed #10161 to ensure that it's on our to-do list. - 3322: custom
AppendDateFormat
The time package's implementation of AppendDate contains additional checks and formatting options that are not necessary. Implementing a cheaper version gives us better performance.
Benchmarks: #10150 (comment) - 3320: Mark
innodb_lock_wait_timeoutas being in both global and session scopes
We had theinnodb_lock_wait_timeoutsystem variable marked only as being in global scope, but in MySQL, it is in global and session scope.
Closed Issues
1.78.6
Merged PRs
dolt
- 10163: Bug fix: correctly copy check constraints
A customer reported a strange behavior where check constraints were getting corrupted/duplicated. The root cause was a bug in the CheckConstraint.Copy() implementation that wasn't returning a copy of the underlying checks, and allowed another part of engine to modify the check constraints accidentally. - 10149: Change
nodeCachefrom array to slice
Arrays in golang are pass by value, whereas slices are pass by reference, so thenodeCachewas getting copied everywhere. - 10147: #10138: Fix
dolt_backupsync and sync-url not taking working set changes in transaction
Fixes #10138 - 10146: #7628: Amend
dolt_backupDoltgresSQL privilege check for server only
Fixes #7628- Fix
dolt_backupsupport indolthub/doltdriver. - Fix Erlang MySQL integrations test to use locked version of Elixir 1.18.3 base docker image.
- Fix
- 10126: .github,go/utils/{publishrelease,rpmbuild}: Add a basic RPM build to the published release artifacts for Dolt.
These RPMs include the statically linked Dolt binary, installed at /usr/local/bin/dolt. They work on x86_64 and aarch64 RPM-based Linux distributions. To install them, download the appropriatedolt-...-1.{x86_64,aarch64}.rpmfile from the GitHub release artifacts and runsudo rpm -i downloaded_file.rpmon it. - 10078: journal errors, recovery, and testing
Variety of changes to provide assist in healthy journals.- Detect journal data loss by looking for parsable objects after unparsable blocks. (root hash followed by another root or chunk). Data loss detection prevents loading of DB, and produced error message in logs.
- Removed null padding during journal file creation.
- Automatically truncate journal files when they do not contain any dataloss after parsable portions of the file.
- Refactor FSCK to enable running when database is not loadable.
- Provide FSCK flag
--revive-journal-with-data-lossto backup and repair journal file
go-mysql-server
- 3322: custom
AppendDateFormat
The time package's implementation of AppendDate contains additional checks and formatting options that are not necessary. Implementing a cheaper version gives us better performance.
Benchmarks: #10150 (comment) - 3321: rewrite last query info
ReimplementLastQueryInfoto not use a map of*atomic.Valuewith constant keys
benchmarks: #10148 (comment) - 3319: Fix
TimestampFuncExprandSetOpin stored procedures
Changes: - 3318: #10113: Fix DELETE queries with NOT EXISTS uninitialized subqueries
Fixes #10113
DELETEqueries withNOT EXISTSsubqueries failed becauseEXISTSexpressions did not set therefsSubqueryflag. This causedDELETEqueries to use a simplified analyzer batch that skipped subquery initialization, leaving subqueries without execution builders.- Refactor
EXISTSexpression building to reusebuildScalar()for*ast.Subquery, ensuring refsSubquery is set. - Capture the table node for simple
DELETEqueries beforebuildWhere()wraps it. - Separate concerns between explicit targets and implicit targets in a bool, but keep all targets in the same list to handle wrapped targets.
- Add
WithTargets()method to update targets without changing the explicit/implicit flag. - Fix
offsetAssignIndexes()fast path to skip when virtual columns are present, using the full indexing path instead.
- Refactor
Closed Issues
- 10134: Dolt and Debezium - GTID error in debezium-connector-mysql
- 10138: Is dolt_add("-A") Required Before Calling the Stored Procedure dolt_backup("sync", "name")?
- 10141: Adding a procedure around a CTE query causes panic
- 10142: Referencing a procedure variable inside a non-trivial query fails
- 10137: Data returned from dolt sql-server is different from dolt sql -q
- 10113: Dolt attempted to evaluate uninitialized subquery , SQL compatibility adjustment
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 1.82 | 0.55 | 0.3 |
| groupby_scan | 13.95 | 11.65 | 0.84 |
| index_join | 1.5 | 1.96 | 1.31 |
| index_join_scan | 1.47 | 1.34 | 0.91 |
| index_scan | 34.33 | 22.69 | 0.66 |
| oltp_point_select | 0.2 | 0.28 | 1.4 |
| oltp_read_only | 3.82 | 5.28 | 1.38 |
| select_random_points | 0.35 | 0.58 | 1.66 |
| select_random_ranges | 0.39 | 0.57 | 1.46 |
| table_scan | 34.33 | 28.16 | 0.82 |
| types_table_scan | 74.46 | 65.65 | 0.88 |
| reads_mean_multiplier | 1.06 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.43 | 6.55 | 0.78 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.22 | 11.65 | 1.26 |
| oltp_update_index | 4.25 | 3.25 | 0.76 |
| oltp_update_non_index | 4.25 | 3.19 | 0.75 |
| oltp_write_only | 5.28 | 6.32 | 1.2 |
| types_delete_insert | 8.43 | 6.91 | 0.82 |
| writes_mean_multiplier | 0.9 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 93.72 | 36.25 | 2.59 |
| tpcc_tps_multiplier | 2.59 |
| Overall Mean Multiple | 1.52 |
|---|
1.78.5
Merged PRs
dolt
- 10110: #7628: Refactor
dolt backupto use SQL interface
Fixes #7628
Thedolt backupcommand now interfaces through SQL to execute stored proceduredolt_backup. Thedolt_backupprocedure now supports HTTP and HTTPS URLs foradd,restore, andsync-urlparameters as a result. AWS flags are also supported for the above too, but only outside of the sql-server (this goes for both CLI and SQL interfaces).- Removed
DoltEnv-based subcommand implementations and replaced them with calls to stored proceduredolt_backup. - Updated schema for
dolt_backupsto includeparamscolumn. - Added support for HTTP and HTTPS in
dolt_backupprocedure'sadd,restore, andsync-urlparameters. We implicitly use the dialer provided bySession.Provider()to get remote databases. - Added
helper/remotesrv-common.bashwithremotesrv_start,remotesrv_stop, andwait_for_portfunctions to testdolt backupagainst HTTP remote server. - Removed
backup.batsfromlocal-remote.bashlist so tests run on remote server. - Add AWS flags
--aws-region,--aws-creds-type,--aws-creds-fileand--aws-creds-profiletodolt backup restore.' - Switch
TestDoltStoredProceduresto use local file system due to limitation onInMem.TmpDir()incompatibility.
- Removed
go-mysql-server
- 3318: #10113: Fix DELETE queries with NOT EXISTS uninitialized subqueries
Fixes #10113
DELETEqueries withNOT EXISTSsubqueries failed becauseEXISTSexpressions did not set therefsSubqueryflag. This causedDELETEqueries to use a simplified analyzer batch that skipped subquery initialization, leaving subqueries without execution builders.- Refactor
EXISTSexpression building to reusebuildScalar()for*ast.Subquery, ensuring refsSubquery is set. - Capture the table node for simple
DELETEqueries beforebuildWhere()wraps it. - Separate concerns between explicit targets and implicit targets in a bool, but keep all targets in the same list to handle wrapped targets.
- Add
WithTargets()method to update targets without changing the explicit/implicit flag. - Fix
offsetAssignIndexes()fast path to skip when virtual columns are present, using the full indexing path instead.
- Refactor
Closed Issues
- 10113: Dolt attempted to evaluate uninitialized subquery , SQL compatibility adjustment
- 7628: Migrate
dolt backupto SQL - 10008: Implement client certificate authentication
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 1.86 | 0.55 | 0.3 |
| groupby_scan | 13.95 | 12.98 | 0.93 |
| index_join | 1.5 | 2.07 | 1.38 |
| index_join_scan | 1.5 | 1.37 | 0.91 |
| index_scan | 34.33 | 24.38 | 0.71 |
| oltp_point_select | 0.2 | 0.28 | 1.4 |
| oltp_read_only | 3.82 | 5.28 | 1.38 |
| select_random_points | 0.35 | 0.58 | 1.66 |
| select_random_ranges | 0.39 | 0.57 | 1.46 |
| table_scan | 34.33 | 28.16 | 0.82 |
| types_table_scan | 75.82 | 81.48 | 1.07 |
| reads_mean_multiplier | 1.09 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.43 | 6.43 | 0.76 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.22 | 11.65 | 1.26 |
| oltp_update_index | 4.18 | 3.25 | 0.78 |
| oltp_update_non_index | 4.25 | 3.19 | 0.75 |
| oltp_write_only | 5.28 | 6.32 | 1.2 |
| types_delete_insert | 8.58 | 6.91 | 0.81 |
| writes_mean_multiplier | 0.9 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 93.95 | 36.61 | 2.57 |
| tpcc_tps_multiplier | 2.57 |
| Overall Mean Multiple | 1.52 |
|---|
1.78.4
Merged PRs
dolt
- 10124: go/cmd/dolt: Allow the Dolt CLI to connect to a running dolt sql-server which is configured with require_secure_transport: true.
When Dolt CLI is running in a directory with a corresponding running sql-server process, it will connect to the server process and complete its work using SQL statements. Previously, the Dolt CLI was configured to always connect on a plaintext TCP connection for these connections. That meant it did not work for servers configured with require_secure_transport: true. One consequence was that the published Dolt dockerhub image did not work with require_secure_transport: true, since that image runsdolt sqlagainst the running server as part of its entrypoint.
This changesdoltCLI to connect over (non-verified) TLS if such as an option is presented by the server. The CLI still falls back to plaintext as well.
Dolt CLI still does not work when the server is configured with require_client_certificate, since Dolt CLI does not currently have a way to configure its presented client certificate and private key. As a consequence, at least for the time being, the published DockerHub images for Dolt do not work with require_client_certificate: true.
Closed Issues
1.78.3
Merged PRs
dolt
- 10111: Implement DOLT_JSON_DIFF table function
This defines a new system table functionDOLT_JSON_DIFF(arg1, arg2)
For each difference between the two provided JSON objects, this function produces a row describing the path to the changed value, and the before and after values. It can be used in a lateral join with other system tables to show changes in multiple rows or across multiple commits.
The tests in dolt_json_diff_test.go are go tests for the table function, confirming that it has the same behavior as the unit tests for the underlying differ.
The added engine tests are used to test more complicated behavior, such as using this table function in a lateral join. - 10096: Add
require_client_certto sql server configuration options
Adds a newrequire_client_certproperty to thelistenersection of a sql server configuration file. When enabled, clients must present a certificate and must connect over a secure connection. Ifca_certis also provided in the server's configuration, the provided client cert will also be verified against the server's CA cert.
Note that this mode preventsdolt sqlfrom being able to connect to a running Dolt SQL server, sincedolt sqlwill connect to the server but does not have a valid client cert and private key to use.
Related to #10008
Doc updates dolthub/docs#2718
go-mysql-server
- 3315: cache static groupby schema
The schema throughout a groupby query does not change, so we should not be recreating one for the grouping key each time.
Benchmarks: #10119 (comment) - 3314: server/handler: Add ConnectionAuthenticated callback which Vitess can call once the connection is authenticated.
Previously gms relied on the ComInitDB callback to update the processlist with the currently authenticated user. This resulted in the processlist showing "unauthenticated user" for connections which were already authenticated but which had not issued a ComInitDB. Those connections could issue queries which would also appear in the process list. Adding an explicit callback when the authentication is successful and allowing the processlist entry to be Command Sleep with an authenticated user even when no database is selected is more correct behavior here. - 3310: Split
Iter.Next(),RowToSQL, andcallbackinto separate threads
This PR expands on an optimization where we separateiter.Next()andRowToSQL+callback()into two separate threads. Now,iter.Next(),RowToSQL, andcallback()all run in their own goroutines with corresponding buffered channels communicating between them.
Additionally, this PR tidys up theresultForDefaultIterandresultForValueItercode.
Benchmarks: #10103 (comment)
vitess
- 444: go/mysql: server.go: Add a callback on Handler, ConnectionAuthenticated, which is called immediately after the connection is authenticated.
This allows a server implementation to know the authenticated user without waiting for the first command interactions, such as ComQuery or ComInitDB. - 443: Updating auth interfaces to pass connection
Enables implementations to have access to the connection. Needed as part of mutual TLS auth work so that implementations can validate connection properties. Also matches the interface definitions in the official vitess repo.
Closed Issues
1.78.2
Merged PRs
dolt
- 10095: support tls in the dolt metrics http endpoint
go-mysql-server
- 3310: Split
Iter.Next(),RowToSQL, andcallbackinto separate threads
This PR expands on an optimization where we separateiter.Next()andRowToSQL+callback()into two separate threads. Now,iter.Next(),RowToSQL, andcallback()all run in their own goroutines with corresponding buffered channels communicating between them.
Additionally, this PR tidys up theresultForDefaultIterandresultForValueItercode.
Benchmarks: #10103 (comment) - 3309: unsafe methods in
SQLandSQLValue
This PR adds unsafe string access toEnumType.SQLValue()andSetType.SQLValue().
Additionally, uses string concat overSPrintf().
Benchmarks: #10101 (comment) - 3308: make
IsNullablereturn true for nullable datetime functions
fixes #10092
I updated the datetime functions'IsNullablefunction based on whether they could return nil, usingfunction_queries.gofrom #3305 as a reference.
We should probably do an audit of all our functions to make sureIsNullableis correct.
Closed Issues
Performance
| Read Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| covering_index_scan | 1.86 | 0.55 | 0.3 |
| groupby_scan | 13.7 | 13.7 | 1.0 |
| index_join | 1.5 | 2.07 | 1.38 |
| index_join_scan | 1.5 | 1.34 | 0.89 |
| index_scan | 34.33 | 23.95 | 0.7 |
| oltp_point_select | 0.2 | 0.28 | 1.4 |
| oltp_read_only | 3.82 | 5.28 | 1.38 |
| select_random_points | 0.35 | 0.58 | 1.66 |
| select_random_ranges | 0.39 | 0.57 | 1.46 |
| table_scan | 34.95 | 28.16 | 0.81 |
| types_table_scan | 75.82 | 80.03 | 1.06 |
| reads_mean_multiplier | 1.09 |
| Write Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| oltp_delete_insert | 8.43 | 6.55 | 0.78 |
| oltp_insert | 4.18 | 3.19 | 0.76 |
| oltp_read_write | 9.22 | 11.65 | 1.26 |
| oltp_update_index | 4.25 | 3.25 | 0.76 |
| oltp_update_non_index | 4.25 | 3.19 | 0.75 |
| oltp_write_only | 5.28 | 6.32 | 1.2 |
| types_delete_insert | 8.58 | 6.91 | 0.81 |
| writes_mean_multiplier | 0.9 |
| TPC-C TPS Tests | MySQL | Dolt | Multiple |
|---|---|---|---|
| tpcc-scale-factor-1 | 93.7 | 36.51 | 2.57 |
| tpcc_tps_multiplier | 2.57 |
| Overall Mean Multiple | 1.52 |
|---|
1.78.1
Merged PRs
dolt
- 10094: go/store/nbs: Fix NomsBlockStore Conjoin against AWS S3 when the AWS S3 endpoint requires a Content-Length header.
AWS Go SDK needs an io.ReadSeeker in the UploadPartInput in order to supply a Content-Length header. Supplying an io.MultiReader was resulting in an error.
Fix this for now by making a temporary copy of the data and using a bytes.NewReader instead.
go-mysql-server
- 3308: make
IsNullablereturn true for nullable datetime functions
fixes #10092
I updated the datetime functions'IsNullablefunction based on whether they could return nil, usingfunction_queries.gofrom #3305 as a reference.
We should probably do an audit of all our functions to make sureIsNullableis correct. - 3306: #10083: Honor definer privileges when rebinding views
Fixes #10083
View rebinding no longer requires the invoker to have CREATE VIEW grant if the definer already did.- Introduce builder-level
mockDefinerto clone the cached privilege state with explicit global grants. - Update
resolveViewto mock definer for CREATE VIEW grant since it's implicitly required to exist.
- Introduce builder-level
- 3305: Fix datetime functions to return correct results for
0andfalse
Fixes #10075
Our datetime functions were not returning the correct results for0andfalse. This was because we were using0000-01-01aszeroTime(which evaluates to true using Go'stime.IsZero) and then extracting datetime information from that timestamp. Using0000-01-01aszeroTimewas also giving incorrect results for some functions when the input timestamp was actually0000-01-01, since it was being equated aszeroTime.
Also, depending on whetherfalsewas read asfalseor0, we were also not able to convert it tozeroTime.
This fix involves updatingzeroTimetotime.Date(0, 0, 0, 0, 0, 0, 0, time.UTC), which has the timestamp-0001-11-30. Since negative years are not valid in MySQL, this timestamp would not conflict with a non-zero timestamp. We also add in checks forzeroTimeto make sure functions return the correct value fromzeroTimeinstead of simply extracting datetime information from the timestamp.
Dolt bump PR: #10084