Minor Version Bump
This release of dolt changes the behavior of dolt_merge() when the --squash parameter is present. Previously, --squash committed immediately, whereas git merge --squash leaves the changes staged for a later git commit. This release aligns Dolt with Git. It merits a minor version bump because applications that expect the old behavior will break and need to call dolt_commit() explicitly after dolt_merge('--squash').
Merged PRs
dolt
- 12788: Restrict the global config to its owner on Windows
dolt profileadd and remove chmod the global config to 0600 because profiles can store passwords. On Windows chmod only toggles the read-only flag, so the file kept its inherited ACL and stayed readable by anyone who could read the directory. It now gets an ACL that grants read and write to the current user only. - 12787: Make merge --squash never create a commit, matching git
Fixes dolthub/doltgresql#3751.dolt_merge('--squash')anddolt_pull('--squash')committed whenever the merge was not a fast-forward, creating a single-parent commit with a "Merge branch" message. The new behavior matches git. - 12782: sql-server: configurable TLS minimum version and cipher suites
Closes #12764. Supersedes #12779, keeping its original commit.
Addstls_min_version(1.2or1.3) andtls_cipher_suites(Go crypto/tls TLS 1.2 suite names) to thelistener,metricsandcluster.remotesapiconfig sections. The plain remotesapi server shares thelistenerTLS config, so it picks up thelistenersettings.Unknown, insecure or TLS 1.3 suite names are rejected at startup, and so are these settings on a listener with nolistener: tls_key: key.pem tls_cert: cert.pem tls_min_version: "1.2" tls_cipher_suites: - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
tls_key/tls_cert. Setting cipher suites together withtls_min_version: 1.3logs a warning, because they have no effect on TLS 1.3. - 12766: sql: allow LOAD DATA LOCAL from dolt sql with --local-infile
Fixes #10636.dolt sqlrejected everyLOAD DATA LOCAL INFILE, even when connected to a server. It now sends the named file to the server when run with the new--local-infileflag, which is off by default like themysqlclient's. Takes over #12287, keeping its commits. - 12761: Flush temporary table to write session after DROP/RENAME INDEX and ADD/DROP CHECK
Takes over #12394. FixesALTER TABLE ... DROP INDEX,RENAME INDEX,ADD CHECKandDROP CHECKon a temporary table being undone by the next write, because the write session's editor kept the stale schema. Each of these now flushes the updated table to the write session, asCreateIndexalready does. - 12759: cli: fix help and error text that names unsupported flags
Takes over #12726 from @andretorresdg, adding bats tests on top of their commit.
Thedolt schema importsynopsis listed--force,--lowerand--upper, which the command doesn't accept, and left out--update; the missing-operation error also left out--update.dolt sql-serverreported a bad--max-connections-timeoutvalue under the nonexistent name--max-wait-connections-timeout. - 12758: go/store/nbs: Write incremental GC table files on SaveHashes's context, not the read callback's, which is canceled when the read returns.
go/store/nbs: Write incremental GC table files on SaveHashes's context, not the read callback's, which is canceled when the read returns. - 12757: dump: wrap triggers in a custom delimiter that does not occur in the statement
dolt dumpwrote each trigger with the default;delimiter, so a trigger whose body is aBEGIN ... ENDblock with several statements could not be loaded back withdolt sql < doltdump.sql. #12671 wraps triggers indelimiter END_TRIGGER, the same way procedures were already wrapped inEND_PROCEDURE.
On top of that, this PR:- Picks the delimiter so it never occurs in the statement. The scanner splits on any unquoted occurrence of the delimiter, so a body that mentions e.g. a column named
END_TRIGGERbroke the load.writeWithDelimiterstarts fromEND_TRIGGER/END_PROCEDUREand appends_1,_2, ... until the delimiter does not appear anywhere in the statement (case-insensitively). Dump output stays deterministic, and is unchanged for every statement that does not contain the base delimiter. This also fixes the same latent issue for procedures. - Moves the test from a new
dump_test.gointodump.bats, alongside the existing dump round-trip tests. The new test dumps a compound trigger and a compound procedure whose bodies referenceEND_TRIGGER,END_TRIGGER_1andEND_PROCEDUREcolumns, checks the chosen delimiters, reloads the dump into a fresh repo and checks that the trigger and procedure behave.
Testing:dump.batspasses (39 tests, 2 skipped as before). As a control, the new test run against #12671's head fails atdolt sql < doltdump.sql.
- Picks the delimiter so it never occurs in the statement. The scanner splits on any unquoted occurrence of the delimiter, so a body that mentions e.g. a column named
- 12752: Make a branch creator's admin entry in dolt_branch_control match only that branch
The entry used the raw database, branch and user names, whose '_' and '%' are wildcards, so creating feat_1 also granted admin over feat-1. Access checks now match names literally, so escaped entries apply.
Edits to dolt_branch_control and dolt_branch_namespace_control also match the user name literally when checking who may make them, so a creator can still manage the entries of their branches. - 12750: Add range iteration to prolly.AddressMap and use it in fbTableMap.Iter
Adds range iteration to prolly.AddressMap and uses it in fbTableMap.Iter to avoid full-map scans and fix schema prefix matching.
Companion PR: dolthub/doltgresql#4026
Related to dolthub/doltgresql#3519 - 12739: Fail with the appropriate error when
dolt admin set-refis missing input parameters
Previously, we would accidentally ignore an error and proceed with the operation even when the input was incorrect. - 12733: Fix Windows bats failures: file path handling and Unix-only assertions
- filesys: on Windows a path like \tmp\x was joined onto the working directory, so a file:///tmp/x remote or backup resolved differently depending on where dolt ran. It now resolves on the working directory's drive, as Windows does.
- bats: tests embedded Git Bash paths in file:// URLs and SQL strings, which dolt.exe cannot resolve; a fileurl helper converts them on Windows (sql-backup, replication-multidb), and sql-export uses pwd -W.
- bats: remotesrv's port check used nc, which Windows lacks; use bash /dev/tcp as other helpers do.
- status.bats: accept the file://D:/... form dolt writes for Windows remotes.
- ssh-transfer.bats: run the mock ssh scripts through bash on Windows.
- log.bats: the --parents regex ended in \n, which Windows rejects; match the commit and parent hashes.
- sql-load-data.bats: accept Windows' missing-file message and stop skipping the unknown-file test on Windows.
- 12731: admin: stop set-ref and show-root after reporting an error
dolt admin set-refanddolt admin show-rootnow stop with a non-zero exit code after reporting an error. Before, invalid arguments could still write a ref, exit 0, or panic. - 12728: Parse merged CHECK expressions with the engine's parser
Fixes dolthub/doltgresql#3979: merging a schema change into a table whose CHECK uses a Postgres-only operator (->>,->,?) failed withsyntax error at position 18 near 'body'.ColumnsFromCheckDefinitionparsed the expression with the MySQL parser; it now uses the parser from the engine overrides.
Companion PR: dolthub/doltgresql#4019 - 12687: Remove a branch's admin entries in dolt_branch_control when it is deleted and before its name is reused
Otherwise the creator of a deleted branch kept admin over any later branch with the same name.
Branches are now created, copied, renamed and deleted throughdsess.BranchOps, which the provider owns. Before a branch is created under a name that no branch has, it removes the admin entries scoped to exactly that database and name, and it removes them again after the last branch with the name is deleted. Operations on the same database and branch name (ignoring case) are serialized, so one operation cannot remove the entries of another's new branch.branch_controlitself only gainsAddBranchAdminandRemoveBranchAdmins, andenv/actionsno longer touches branch control.
Read replicas create and delete pulled branches throughBranchOpstoo, so a replicated branch also clears leftover entries for its name.
Entries for other databases or branch patterns, and non-admin entries, are kept, since they may be granted before a branch exists. An exact admin entry granted before its branch is created is now removed on creation, sobranch-control.batsgrants admin after creating the branch.
Since #12752 escapes the names in admin entries, both the escaped entries and the unescaped ones from before are removed. - 12672: filesys: make InMemFS.OpenForWriteAppend append to an existing file
InMemFS.OpenForWriteAppendnow appends to an existing file, as the local filesystem does. Tests that randolt dumpagainst an in-memory environment only kept the last write. - 11152: Preserve table metadata and foreign keys when updating column tags
dolt schema update-tag,dolt schema copy-tags, andCALL dolt_update_column_tag()now preserve secondary indexes,CHECKconstraints, table comments, primary key ordinals, collations, and target row size when updating a column tag.Foreign keys that reference a retagged column on the child table, on the parent table, or in a self-reference now update their stored column tags alongside the table schema.CREATE TABLE accounts ( id INT NOT NULL, region VARCHAR(8) NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY (region, id), UNIQUE KEY email_unique (email), CONSTRAINT email_format CHECK (email LIKE '%@%') ) COMMENT='application accounts'; CALL dolt_update_column_tag('accounts', 'id', 999); INSERT INTO accounts VALUES (1, 'us', 'invalid'); -- Check constraint "email_format" violated
Fixes #10003CREATE TABLE regions (code VARCHAR(8) PRIMARY KEY); CREATE TABLE accounts ( id INT PRIMARY KEY, region VARCHAR(8) NOT NULL, CONSTRAINT fk_accounts_region FOREIGN KEY (region) REFERENCES regions(code) ); CALL dolt_update_column_tag('regions', 'code', 777); CALL dolt_update_column_tag('accounts', 'region', 888); INSERT INTO accounts VALUES (1, 'ap'); -- Foreign key violation on fk: `fk_accounts_region`
Refs: #11007
go-mysql-server
- 4282: Enforce display width and max_allowed_packet limits for CHAR and BINARY CAST/CONVERT
Enforces display width and max_allowed_packet limits for CHAR and BINARY CAST/CONVERT operations.
Fixes #12676 - 4281: plan: compute SetOp schema without recursion
SetOp.Schemanow walks a UNION chain in a loop instead of recursing, which cuts allocations and memory-profile growth in long-running servers that plan many long UNION queries. Query results do not change. - 4280: Identify when a JSON path lookup uses an array index on a non-array, and avoid using the jsonpath library for these cases.
Fixes #12649.
The jsonpath library has different behavior for key lookups on arrays and array indexes on non-arrays. jsonpath allows paths that MySQL doesn't.
Ultimately, jsonpath is not the correct implementation to use here and should be replaced. But this change makes us strictly more correct. - 4279: Compare signed and unsigned integers by converting them to decimals.
Fixes #12621
Previously, signed and unsigned integers were compared by converting them to float64. But not every int64 and uint64 can be represented as a float64. For large values, this could result in different values being incorrectly compared as equal.
But every int64 and uint64 can be represented as decimal value, so we can convert both values to decimals and compare those. - 4278: Escape backslashes and control characters in ENUM and SET member strings
ENUMandSETcolumn definitions now escape backslashes, single quotes, NUL bytes, newlines, and carriage returns when formatted as SQL strings, preserving member values inSHOW CREATE TABLE,information_schema.COLUMNS, and re-parsed DDL.
Closes dolthub/go-mysql-server#4095 bypcbeingused33
Fixes #12256 - 4277: Return error 1064 (42000) without parser dumps for syntax errors and disallowed '*' function arguments
Syntax errors and disallowed*arguments in scalar, aggregate, and window functions now return error code1064(SQLSTATE42000) with plain error text instead of internal parser dumps, so clients can classify them as syntax errors.
Closes dolthub/go-mysql-server#4246 byaloneangel45
Closes dolthub/go-mysql-server#4291
Fixes #12684 - 4274: Warn and return
NULLfor invalidTIMESTAMPDIFFarguments
Fixes #12679
Includes contributions from dolthub/go-mysql-server#4253 - 4273: Return
NULLwhenDATE_FORMATinput is zero date
Fixes #12683
Includes contributions from dolthub/go-mysql-server#4254 - 4271: Return ER_DATA_TOO_LONG (1406 / 22001) for string length overflow
String length overflow now returns error1406(ER_DATA_TOO_LONG) with SQLSTATE22001and messageData too long for column '<col>' at row <N>instead of1105/HY000.
Closes dolthub/go-mysql-server#4114 bysciyoshi
Fixes #2173
Blocks #12768
Blocks dolthub/doltgresql#4036 - 4270: Return string types from REVERSE and SUBSTRING to prevent numeric coercion
REVERSE,SUBSTRING,MID, andSUBSTRnow returnLONGTEXT(orLONGBLOBfor binary inputs) while preserving text collations instead of inheriting numeric input types.
Closes dolthub/go-mysql-server#4264 bysanketpatel32
Fixes #12612 - 4268: Fix panic when setting GLOBAL-only System Variable to
DEFAULT
Based off: dolthub/go-mysql-server#4235
Fixes: #12667 - 4265: Fix panic in UNIX_TIMESTAMP with a binary string argument
Takes over dolthub/go-mysql-server#4262 from @amalsaidov.UNIX_TIMESTAMPpanicked when given a constant binary string, such as a hex literal (SELECT UNIX_TIMESTAMP(x'32303030')). Binary values are now read as their string contents, matching MySQL. Adds an engine test for hex literals and checks the warning on a binary value that isn't a date.
- 4260: Treat an array index other than 0 on JSON null as no match
- 4255: Return MySQL error 1411 for out of range ST_AsGeoJSON and ST_GeomFromGeoJSON options
Fixes #12681 - 4254: Return NULL from DATE_FORMAT for a zero date instead of panicking
- 4253: Return NULL from TIMESTAMPDIFF when an argument is not a datetime
- 4252: Return an error instead of panicking for CONVERT and CHAR with unimplemented character sets
Fixes #12680.
Fixes #12677. - 4238: Return NULL from INET_ATON for a binary argument that is not an address
Fixes #12605 - 4229: Prevent
EVENTSwith overflowingEVERYclauses from gettingENABLED
Events with largeON SCHEDULE EVERYclauses would silently overflowtime.Duration(auint64) and wrap around to a relatively small Duration. As a result, the invalid events would repeat frequently.
This PR has event behavior more closely match MySQL. Events with largeEVERYclauses can be created, but are silently DISABLED and throw a warning when attempting to be ENABLED.
Fixes: #12582 - 4224: Plan scalar subquery filters as lookup joins on tables that require an index
Scalar subqueries compared to columns of tables that require an index lookup, such as Dolt's dolt_commit_diff tables, are now planned as lookup joins, and scalar subqueries that return more than one row now return an error.
Companion PRs: - 4183: Propagate comparison errors when joining histograms
stats.Joinnow returns comparison errors when joining histogram buckets, instead of building an empty statistic.
Fixes dolthub/go-mysql-server#4171 - 4119: sql/expression/function: round DOUBLE and FLOAT half to even in ROUND
ROUNDnow roundsDOUBLEandFLOATvalues half to even, matching MySQL (ROUND(2.5e0)is 2).
Fixes #12310
vitess
- 516: Reject '' function arguments outside COUNT() during parsing to fail invalid wildcards as syntax errors
Passing*or qualifiedtable.*as a function argument outside unqualifiedCOUNT(*)andCOUNT(*) OVER (...)now fails at parse time as a syntax error so invalid wildcard arguments are rejected consistently before query planning.
Blocks dolthub/go-mysql-server#4277 - 509: Return SQL errors and keep sessions open when streamed queries fail
Streamed queries, prepared statements, and server cursors that fail after sending initial rows now end the partial result set with a MySQLERR_Packetand keep the session open instead of dropping the connection withERROR 2013.In multi-statement requests, an error packet also stops any remaining statements from running, whether the failure occurs before column headers or mid-stream.WITH RECURSIVE cte(n) AS (SELECT 1 UNION ALL SELECT n + 1 FROM cte) SELECT * FROM cte; -- ERROR 3636 (HY000): Recursive query aborted after 10002 iterations SELECT 42; -- 42
Connections still close when a socket write fails mid-packet or when an error arrives after a rowless command such asSELECT 1; <failing query>; SELECT 3; -- returns 1, then the error; SELECT 3 is not executed
INSERThas already sent its completion response. In Vitess's streaming client (Conn.ExecuteStreamFetchandConn.FetchNext), receiving an error packet now clears stored column metadata so subsequent queries do not block.
Blocks dolthub/go-mysql-server#4182
Fixes #12504
Closed Issues
- 10636: Unable to
LOAD DATA LOCAL INFILEin DoltSQL shell - 2173: Better error message for type violation errors
- 12684: A '*' argument in a function call fails with ERROR 1105 and a leaked Go "%!(EXTRA ...)" struct dump (MySQL: syntax error 1064)
- 12679: TIMESTAMPDIFF() with a numeric datetime argument panics with "interface conversion: interface {} is nil, not time.Time"
- 12764: sql-server: allow configuring TLS minimum version and cipher suites for the MySQL listener
- 12681: ST_AsGeoJSON() with an invalid options argument fails with ERROR 1105 and a leaked Go format verb "%!s(int=-1)"
- 12605: INET_ATON() with a binary argument that is not valid UTF-8 fails with ERROR 1105 "invalid type: []uint8" (MySQL returns NULL)
- 12591: Unary minus on date/time functions fails with
invalid type: int - 12676: CAST(x AS BINARY(n)) with a huge n panics with "growslice: len out of range" (MySQL: ERROR 1439)
- 12256: Backslash escapes in ENUM and SET members are processed twice
- 12649: An array index other than 0 on a JSON null value is treated as a match
- 12621: A BIGINT compared with the literal 9223372036854775808 is treated as equal to 9223372036854775807 (9223372036854775807 = 9223372036854775808 returns 1; a table scan and an index lookup disagree)
- 12612: REVERSE() and SUBSTRING() of an integer argument return the result converted back to the argument's integer type (REVERSE(127) on a TINYINT is 127, MySQL returns '721'; SUBSTRING(105, 2) is 5, MySQL returns '05')
- 12683: DATE_FORMAT() of a zero date with %x, %X, %v or %V panics with "interface conversion: interface {} is nil, not int32"
- 12266: A merge reports a unique violation when a value moves to another row
- 12269: COMMIT succeeds but drops rows written to a branch renamed mid-transaction
- 12251: dolt_preview_merge_conflicts returns wrong values when a branch drops a column
- 10003: Updating a column's tag should update indexes and foreign key references
- 12667: SET SESSION / SET GLOBAL of some system variables to DEFAULT panics and closes the client connection
- 12677: INET6_ATON() of a ucs2 string panics with a nil pointer dereference (#11493 only fixed the integer case)
- 12680: CONVERT(... USING ujis) (and sjis) panics in the result-set handler and drops the connection
- 4171:
stats.Joinreturns a zero-row statistic instead of an error when MCV or cross-type key comparison fails