Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bumpCreated with
brew bump-formula-pr.release notes
This events source is too detailed and emits too many events to be appropriate for our usage metrics. It is useful in an operational context for DoltHub and Hosted, but it should be used by default in Dolt itself. We will revisit this events source if we need it for internal infrastructure, but for now we should disable it.
User Contributed PR: #5861 refactor: make dolt_diff_summary respect dolt_ignore patterns dolthub/dolt#9946
Closes:
dolt_diff_summarysystem table should hide tables ignored bydolt_ignoredolthub/dolt#5861A user reported that their
dolt_branch_controltable was in a corrupted state, as they could not delete a row even though running the appropriateDELETE FROM dolt_branch_controlwould report that 1 row was affected. RunningSELECTshowed that it was still there.I was able to replicate a way of getting the table into that state, which is to insert the exact same row as an existing row but with a larger permission set.
dolt_branch_controlhandles primary key conflicts differently than other tables, as we throw a conflict when a subset is inserted. For example,'%'will match all entries that's%'can match, so's%'is a subset of'%'. Of course, when taking permissions into account,'s%'may not be a subset if it has a broader permission set than'%', in which case we want to allow the insertion of's%'.The failure case was with exact matches. An exact match is still a subset when the permissions are as restrictive or more restrictive than the original, however it's not a subset when the permissions are broader, and this would result in allowing the insertion of the exact match. We convert all expressions into a specialized integer format, and store those integers in a prefix tree. Since the format will be the exact same, we end up overwriting the old entry, which is an implicit deletion without the accompanying bookkeeping in the rest of the data structure. This is what causes the mismatch, and creates the failure state.
To prevent this, we never allow insertion when there's an exact match, so you must use an
UPDATEin such cases. This will prevent that failure mode from occurring.unsafe.Pointergets strings from []byte without allocating memory.This is especially beneficial for operations that pass around strings.
Dolt already uses
unsafe.Pointers in other places and this is within an immutable context.This change allows users to add foreign key relations on nonlocal tables (table names that match entries in
dolt_nonlocal_tablesand resolve to tables on other branches).The biggest obstacle was that the foreign key verification logic operates on the DB directly, but resolving the references in the
dolt_nonlocal_tablestable requires a Dolt SQL engine. Because we now use the engine for most operations, the engine is guaranteed to exist, but it wasn't obvious how to allow the storage code to access the engine in a way that didn't break encapsulation or create dependency cycles.The way this PR accomplishes this is by creating a new interface called
doltdb.TableResolver, which has the methodGetDoltTableInsensitiveWithRoot, which can resolve table names at a supplied root value. This object can be instantiated by the Dolt Session and passed into the DB layer.I'm not thrilled about adding the extra confusingly similar methods to
doltdb.Database, but hopefully the differences between them are clear.Instead of requiring column tags to be unique across all tables in a branch, this change only requires column tags to be unique within each table.
Column tags are intended to be an internal only, implementation detail of Dolt, but if a conflict occurred (two columns in the same branch having the same column tag), then it blocked customers and often required expert help to resolve. This change greatly reduces the chance of hitting a column tag conflict, since it reduces the scope across which a column tag must be unique.
Summary
Makesdolt_diff_summarytable function respectdolt_ignorepatterns to matchdolt diffcommand behavior.Changes
dolt_diff_summarydolt_ignorepatterns are now filtered outdolt_*prefixed tablesTesting
Questions/Misc
@macneale4 I think I got this change good for #5861, finally (sorry took me awhile, went out of country and was busy with work to jump back on it immediately). two things to call out for clarity:Closes:
dolt_diff_summarysystem table should hide tables ignored bydolt_ignoredolthub/dolt#5861sql.ValueRowThis PR implements
sql.ValueRow, which is a server output friendly version ofsql.Row.Currently we have two access patterns where we need to iterate over all chunks in a storage file: Archive/Unarchive and FSCK. In both cases, we are loading one chunk at a time and disk IO becomes a bottleneck. This change updates the iteration methods to iterate over the data blocks of table files and archive files such that we can load data in larger batches.
There are not new tests for this. archive and fsck tests should cover this.
Testing on a 500Mb database: 8.7s to fsck before change, 5.0s after change.
go-mysql-server
CREATE TABLE ... SELECTFixes dolthub/dolt#9316
dateAlso explicitly cast datetime to max precision during comparisons
sql.ValueRowsql.ValueRowis the reincarnation ofsql.Row2.This is an optimization to the sqlengine that eliminates interface boxing by never placing variables into a
[]interface.sql.ValueRowIteris implemented by:Comparison should only use CompareValue when left and right are both NumericType, so Integers, Floats, Decimal, Bit64, and Year types.
vitess
CREATE TABLE ... AS SELECTsupportFixes dolthub/dolt#9316
Companion dolthub/go-mysql-server#3283
Closed Issues
dolt_diff_summarysystem table should hide tables ignored bydolt_ignoreCREATE TABLE (...) AS SELECTView the full release notes at https://github.com/dolthub/dolt/releases/tag/v1.76.4.