Merged PRs
dolt
- 10357: Prevent temporary table name collisions
fixes #10353
MySQL allows creating temporary tables with the same names as existing non-temporary tables and creating non-temporary tables with the same names as existing temporary tables. However, temporary tables cannot have the same name as other temporary tables.
Our previous implementation seemed to have assumed temporary tables with the same names were allowed. Each session had a map of db names to an array of tables, and new temporary tables were added to the end of the array, without checking if there was a table with an existing name. When fetching or dropping a temporary table, we iterated through the array and returned/dropped the first table with a matching name; this meant even though we allowed temporary tables with the same name, we only ever operated on whichever one was created first.
Since temporary tables with the same names are actually not allowed, the array of temporary tables was replaced with a name-to-table map to make fetching a temporary table withGetTemporaryTablefaster. This also makesDropTemporaryTablefaster. This does makeGetAllTemporaryTablesslower since we now have to iterate over the mappings to create an array for temporary tables, butGetAllTemporaryTablesdoesn't seem to be called as frequently asGetTemporaryTable. - 10349: Remove requirement for -i in dolt_rebase
Hold over from the original impl of rebase now addressed! - 10274:
dolt stash apply
Adds #10131
Addsdolt stash apply. Functions similar todropandpopin usage: accepts no argument for most recent stash, orintorstash@{int}for non-top stashes. i.e.dolt stash apply 2ordolt stash apply stash@{2}. - 10227: #5862: Add ignore system table
Summary
Adds a newdolt_status_ignoredsystem table that extendsdolt_statusfunctionality by including anignoredcolumn to identify which unstaged tables match patterns defined indolt_ignore. This provides a SQL interface equivalent todolt status --ignored.Changes
New System Table
dolt_status_ignored- Same schema asdolt_statusplus anignoredcolumn:table_name(text): Name of the tablestaged(boolean): Whether the table is stagedstatus(text): Status of the table (e.g., "new table", "modified", "conflict")ignored(boolean): Whether the table matches adolt_ignorepattern
Implementation Details
The implementation started with logic similar tostatus_table.goand was then refactored to share common code between both tables while adding the ignore-checking functionality.
go/libraries/doltcore/doltdb/system_table.go- Added
StatusIgnoredTableNameconstant - Registered table in
GeneratedSystemTableNames()andDoltGeneratedTableNames
go/libraries/doltcore/sqle/database.go - Added switch case for
StatusIgnoredTableNameingetTableInsensitiveWithRoot() - Extracted
getStatusTableRootsProvider()helper to eliminate duplicate logic betweendolt_statusanddolt_status_ignoredswitch cases
go/libraries/doltcore/sqle/dtables/status_table.go - Added
getStatusRowsData()function using existingstatusTableRowstruct to share status collection logic between both tables - Refactored
newStatusItr()to use shared function
go/libraries/doltcore/sqle/dtables/status_ignored_table.go (new file) - Implements
StatusIgnoredTableandStatusIgnoredItr - Uses shared
getStatusRowsData()fromstatus_table.go - Uses adapter pattern via
DoltTableAdapterRegistrysimilar toStatusTable - Adds ignore-checking logic via helper functions:
getIgnorePatterns(): Fetches patterns fromdolt_ignorebuildUnstagedTableNameSet(): Creates set for quick lookupcheckIfIgnored(): Checks if table matches ignore pattern (returns error on failure)
Behavior
- Unstaged tables:
ignored=1if table name matches a pattern indolt_ignore,ignored=0otherwise - Staged tables: Always
ignored=0(staging overrides ignore patterns, matching git behavior) - Constraint violations, merge conflicts, schema conflicts: Always
ignored=0
Tests
BATS integration tests
integration-tests/bats/system-tables.bats:- Basic functionality: Verifies
ignoredcolumn correctly identifies ignored tables while non-ignored tables haveignored=0 - Staged tables: Confirms staged tables always have
ignored=0regardless of ignore patterns - System table visibility: Ensures table appears in
dolt ls --system
integration-tests/bats/ls.bats: - Updated "ls: --system shows system tables" to include
dolt_status_ignored(27 tables instead of 26)
Go enginetests
go/libraries/doltcore/sqle/enginetest/dolt_queries.go:
Closes #5862
go-mysql-server
- 3395: fewer
strings.ToLowercalls ingatherTableAlias
benchmarks: #10355 (comment) - 3393: add
transform.InspectWithOpaquefunction
This changestransform.Inspectto not apply the helper function on children ofsql.OpaqueNodes.
Additionally, it adds atransform.InspectWithOpaquethat does.
This is to matchtransform.Nodeandtransform.NodeWithOpaque.
There are still some inconsistencies between the different transform helper functions:- transform.Node:
- post order (applies to node.Children then node)
- no way to break out early
- transform.Inspect:
- pre order (applies to node then node.Children)
- can break out early (only on all or none of children)
- return true to continue
- transform.InspectExpr:
- post order (applies to expr.Children then expr)
- can break out early, including stopping during children
- return false to continue
- 3389: remove
convertLeftAndRight
This PR removesc.convertLeftAndRight, which avoids calls toc.Left().Type()andc.Right().Type().
Not entirely sure why receiver methods would impact performance this much, but benchmarks say so.
Benchmarks: #10342 (comment)