Merged PRs
dolt
- 11796: go/store/nbs: journal_writer.go: Fix a rare race where the journal_writer entered a weird state because its caller context Canceled as it was bootstraping.
- 11791: Warn about session-only checkout in noninteractive SQL
Warns when a lonedolt_checkout()call in noninteractive SQL changes only the SQL session's branch, leaving the CLI branch unchanged.
Fixes #6876 - 11790: Add virtual name indexes for tags and branches
Adds virtual name indexes with cached ref lookups for dolt_tags and dolt_branches.
Fixes #10365
Companion PR: dolthub/doltgresql#3342 - 11788: Persist
sql_modeas string and reload on server startup
Fix #11776 - 11785: Validate vector index creation without restricting schema loading
Preserves existing vector index schemas while validating new index creation, with Dolt commit/reset regression tests and shared DDL coverage in dolthub/go-mysql-server#3858.
Fixes #10448 - 11782: Omit generated columns from SQL diff assignments
Omits generated columns from SQL diff assignments and suppresses updates with no assignable columns, carrying forward #11476 with Elian's review feedback addressed.
Fixes #11445 - 11780: Handle statement cancellation in the SQL shell
Supports\ccancellation in the interactive SQL shell, carrying forward #11291 with regression coverage verifying canceled single-line and multiline inserts leave the table empty.
Fixes #10867 - 11772: Fix foreign keys with dropped columns
Changes are used by:- dolthub/doltgresql#3312
This also fixes a Dolt bug dealing with dropping a column used by a foreign key
- dolthub/doltgresql#3312
- 11755: build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 in /integration-tests/go-sql-server-driver
Bumps google.golang.org/grpc from 1.83.1 to 1.83.2.Release notes
Sourced from google.golang.org/grpc's releases.
Release 1.83.2
Security
- server: Reject requests missing both
:authorityandHostheaders with HTTP 400 and statusInternal. (grpc/grpc-go#9365)- Special Thanks:
@winklemad
- Special Thanks:
Commits
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/dolthub/dolt/network/alerts). - server: Reject requests missing both
- 11303: sql: fix empty/comment-only query handling in interactive shell
What
In the interactivedolt sqlshell, two related edge cases around empty/comment-only statements produced confusing output instead of clear, MySQL-consistent behavior:- A bare empty query (e.g. typing just
;) silently printedEmpty set, 1 warningwith a warning body ofquery was empty after trimming comments, instead of a clear client-side error. - A comment-only query (e.g.
-- foo ;) behaved the same way — a spurious "empty" warning — instead of being silently skipped the waydolt sql < file.sql(batch mode) already treats it.
This PR makes the shell branch onsqlparser.ErrEmptyexplicitly inexecShell'sUninterpretedcallback (go/cmd/dolt/commands/sql.go):
- A truly empty statement (nothing left after
;is stripped) now prints a MySQL-styleNo query specifiederror, matching how the realmysqlCLI responds to a bare;. - A comment-only statement (non-empty input that parses to
ErrEmptybecause it's all comment) is now skipped silently — no output, no warning — which mirrors the existing behavior ofexecBatchMode, whereerr == sqlparser.ErrEmptyis already a silentcontinue.
Why
Batch mode (execBatchMode, sql.go) andprocessQuery(used by scripting/non-interactive paths) both already treatsqlparser.ErrEmptyas "silently skip." The interactive shell was the only place papering over this with a fakeEmpty set, 1 warningresult, which is misleading — there's no result set, and the "warning" concept here doesn't correspond to anything the query actually did. This change brings the shell in line with the rest of the codebase's handling of empty statements while adding a genuinely useful error for the truly-empty case (bare;), since that's a real MySQL client-side error dolt users would expect to see.
Closes #10864
Closes #10863
Thanks to angelamayxie for the original reports.Test plan
-
go build ./cmd/dolt/...— passes -
go vet ./cmd/dolt/...— passes -
gofmt -l go/cmd/dolt/commands/sql.go— clean - New bats regression tests added in
integration-tests/bats/sql-shell.bats: sql-shell: bare empty query gives MySQL-style error, not a warning(uses newsql-shell-empty-query.expect)sql-shell: comment-only query is skipped silently, no warning(uses newsql-shell-comment-only-query.expect)- Both new bats tests run locally against a freshly built
doltbinary and pass:
ok 1 sql-shell: bare empty query gives MySQL-style error, not a warning ok 1 sql-shell: comment-only query is skipped silently, no warning- Full
sql-shell.batssuite regression run was kicked off locally to check for unrelated breakage; not gating this PR description on it since the two new/targeted cases already passed cleanly and no other test in the file touches this code path.
- A bare empty query (e.g. typing just
go-mysql-server
- 3858: Cover vector index nullability across DDL paths
Extends vector-index nullability regression coverage to JSON columns and ALTER TABLE, complementing Dolt's engine coverage in #11785.
Fixes #10448 - 3857: Set return type for population statistic aggregate functions
Fixes #11391 - 3855: Implement Numeric to Date conversions
Implements conversions from numeric types (int, float, decimal) toDATETIMEtypes.
Partially addresses: #10278
Fixes: #10088 - 3852: Reject unsupported DISTINCT window aggregates
RejectsDISTINCTwindow aggregates with MySQL 8.4-compatible error 1235 / SQLSTATE 42000 forCOUNT,SUM, andAVG, including multi-argumentCOUNT, while preserving acceptedMINandMAXbehavior.
Adds engine coverage for the exact customer reproduction and adjacent aggregate behavior.
Fixes #11392 - 3847: Remove schema length check when analyzing subquery aliases
Fixes #11501
When analyzing subquery aliases, checking if the child schema length matched theColumnNameslength was too strict. In nested subqueries, it's possible the child schema length was already reduced due to table pruning when the child subquery was analyzed. This check was removed altogether because we don't have any tests that actually rely on this check happening. - 3845: Fix
CHARvalues differing only in trailing space to be equal
Fix #11464 - 3841: Delimit window partition and order expressions in PartitionId
Fix #11461 - 3840: Support pluggable UPDATE assignment evaluation
Adds an UpdateExpressionApplier engine override for PostgreSQL assignment semantics in dolthub/doltgresql#3300 while preserving MySQL evaluation by default.
Fixes dolthub/doltgresql#3092 - 3836: [4/6] Test grouped windows and iterator cleanup
Adds regression coverage for grouped windows, HAVING order, and iterator cleanup already fixed on main, stacked on #3835 with compatibility in #11753 and dolthub/doltgresql#3291. - 3835: [3/6] Fix user-variable strings and prepared bindings
Fixes UserVar SQL quoting and prepared lookup by variable name, stacked on #3834 with compatibility in #11753 and dolthub/doltgresql#3291. - 3834: [2/6] Fix subquery strings and scalar alias resolution
Fixes Subquery and InSubquery SQL strings while preserving scalar alias resolution, stacked on #3833 with compatibility in #11753 and dolthub/doltgresql#3291. - 3833: [1/6] Fix independent expression strings and descriptions
Fixes independent expression SQL strings and descriptions from #3803, with follow-ups starting at #3834 and compatibility in #11753 and dolthub/doltgresql#3291. - 3832: Always return
transform.NewTreewhen replacingGetFieldwith aliased projection expression
Fixes #11407
When pushing filters below a subquery alias, we were only returningtransform.NewTreewhen an aliased expression mapped to aGetFieldhas been recursively transformed. However theGetFieldgets replaced with the aliased expression regardless if it gets transformed recursively, this is incorrect, and we should always be returningtransform.NewTree. Not returningtransform.NewTreewas causing us to not be able to find the correct field index for certain expressions. - 3825: Support multi-byte strings and collation derivation in
LPADandRPAD- Derive output collation and coercibility from string operand.
- Replace byte-level padding with code-point counting.
- Add
CharSetHandlerfor multi-byte handling. - Fix invalid Go error formatting when during evaluation.
Fix #11380
Blocked by dolthub/go-mysql-server#3824
- 3824: Fix collation coercibility resolution and binary collation detection
- Add
CollationID.IsBinary - Align coercibility resolution to MySQL precedence rules for explicit conflicts, binary precedence, and charset conversion.
- Add
ResolveCoercibilityExpressionsfor future correctness and reduce boilerplate.
Block dolthub/go-mysql-server#3825
- Add
- 3823: Fix BIGINT arithmetic overflow handling
Dolt currently allows BIGINT arithmetic to wrap at signed and unsigned boundaries. This applies MySQL integer result typing, performs checked native addition, subtraction, and multiplication, and honors NO_UNSIGNED_SUBTRACTION. MySQL-only engine scripts cover literal, stored-column, mixed-sign, SQL mode, and prepared execution paths, while protocol errors preserve MySQL error 1690 and SQLSTATE 22003.
Fixes #11411 - 3822: Fix empty inserts with generated columns
Preserve implicit all-emptyVALUESrows as zero-width sources so insert analysis materializes defaults and generated expressions against the complete destination schema. Reject mixed empty and non-empty tuple widths to match MySQL, with coverage for generated, invisible, auto-increment, atomic, and prepared cases.
Fixes #11388 - 3820: Added DESC indexes and NULL ordering
This implements DESC indexes and NULL ordering (nulls can be set to be first or last). NULL ordering is primarily used by integrators.
Related PRs: - 3807: Fix
SELECTlist alias resolution in window clauses
Fixes an issue where window function clauses could incorrectly resolve or shadow column references using SELECT list aliases.- Allow expressions in window clauses to reference
SELECTlist aliases while preserving resolution to underlying table columns. - Normalizes
SELECTlist alias lookup keys to lower case for consistent case-insensitive matching.
Fix #11502
- Allow expressions in window clauses to reference
- 3780: Fix EXISTS over ungrouped aggregate subqueries
Ungrouped aggregates produce one row even when their input is empty. Preserve that cardinality when simplifying EXISTS subqueries so correlated forms retain correct results without suppressing aggregate expression evaluation.
Teach TableCopier to expose its independently analyzed create and source trees, accept integrator-owned create destinations through the standard sql.Nameable contract, and close the create iterator before copying rows. Adds coverage for SELECT and write statements, including CTAS, plus HAVING / LIMIT / OFFSET boundaries.
Companion: dolthub/doltgresql#3274
Fixes #11489
Fixes #11477
Fixes #11508
Closed Issues
- 11399: Dolt raises an internal field-index error for sibling
SUM/AVGwindows - 11396: Dolt
RANGE BETWEEN 1 PRECEDING AND CURRENT ROWoverBIGINT UNSIGNEDloses the current row at the lower boundary. - 11545: Dolt swallows a child-expression evaluation error in SUM
- 11460: Dolt forms incorrect
RANGEboundaries for a correlated computed order key - 11425: Dolt reports an internal row-index bug for invalid
NTILE(column). - 10365: dolt_tags system table missing index on tag_name - causes O(n) lookup
- 6876: Warn users about running
dolt sql -q "call dolt_checkout(...);" - 11391: Dolt computes population statistical aggregates incorrectly for
INTinput. - 11776: SET PERSIST sql_mode does not survive a sql-server restart ("value N was not found in the set")
- 10448: VECTOR INDEX: batch inserts fail with NULL embeddings after ~83 rows
- 10088: allow for times between
0000-00-00and0000-01-01 - 11445:
dolt diff -r sqlemits statements that assign generated columns - 10867: Dolt shell doesn't handle
\c - 10863: Do not emit warnings for empty query after trimming comments
- 10864: MySQL has error for empty delimited queries whereas Dolt has misleading warning
- 11411: Dolt arithmetic on
BIGINT UNSIGNEDvalues wraps into signed negative values. - 11388: Dolt raises an internal row-index error for empty
INSERT () - 11392: Dolt silently ignores
DISTINCTforCOUNTandSUMwindow aggregates. - 11747: sql-server auto-GC published a manifest whose root chunk was not preserved; only dolt_ignore'd (working-set-only) tables were lost
- 11501: Nested multi-column VIEW + self
EXISTS→ ERROR 1105 column-count mismatch - 11464:
CHARPAD SPACE values split a window partition - 11502: Dolt reaches an internal error on invalid window
ORDER BYalias. - 11407:
if(<cond>, <literal>, <column>)in a WHERE over a view raises internal error - 11741: git remotes: a cancelled push/fetch wedges sql-server indefinitely — CommandContext kills only the direct git child, and the orphaned transport holds the pipe Wait() reads
- 11508: Correlated
EXISTSloses an empty aggregate row - 11477: Wrong results: EXISTS/NOT EXISTS over an un-grouped aggregate subquery is mis-evaluated in a WHERE filter
- 11489: Silent data loss: EXISTS/NOT EXISTS over an un-grouped aggregate subquery corrupts DELETE/UPDATE/INSERT-SELECT/CREATE-TABLE-AS write paths (uncorrelated form deletes the whole table)
- 11380:
RPAD()/LPAD()has unexpected behvior - 11461: Distinct window partition/order shapes collide in
PartitionId