github dolthub/dolt v2.8.0
2.8.0

one hour ago

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 profile add 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') and dolt_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.
    Adds tls_min_version (1.2 or 1.3) and tls_cipher_suites (Go crypto/tls TLS 1.2 suite names) to the listener, metrics and cluster.remotesapi config sections. The plain remotesapi server shares the listener TLS config, so it picks up the listener settings.
    listener:
      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
    Unknown, insecure or TLS 1.3 suite names are rejected at startup, and so are these settings on a listener with no tls_key/tls_cert. Setting cipher suites together with tls_min_version: 1.3 logs 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 sql rejected every LOAD DATA LOCAL INFILE, even when connected to a server. It now sends the named file to the server when run with the new --local-infile flag, which is off by default like the mysql client'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. Fixes ALTER TABLE ... DROP INDEX, RENAME INDEX, ADD CHECK and DROP CHECK on 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, as CreateIndex already 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.
    The dolt schema import synopsis listed --force, --lower and --upper, which the command doesn't accept, and left out --update; the missing-operation error also left out --update. dolt sql-server reported a bad --max-connections-timeout value 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 dump wrote each trigger with the default ; delimiter, so a trigger whose body is a BEGIN ... END block with several statements could not be loaded back with dolt sql < doltdump.sql. #12671 wraps triggers in delimiter END_TRIGGER, the same way procedures were already wrapped in END_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_TRIGGER broke the load. writeWithDelimiter starts from END_TRIGGER / END_PROCEDURE and 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.go into dump.bats, alongside the existing dump round-trip tests. The new test dumps a compound trigger and a compound procedure whose bodies reference END_TRIGGER, END_TRIGGER_1 and END_PROCEDURE columns, checks the chosen delimiters, reloads the dump into a fresh repo and checks that the trigger and procedure behave.
      Testing: dump.bats passes (39 tests, 2 skipped as before). As a control, the new test run against #12671's head fails at dolt sql < doltdump.sql.
  • 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-ref is 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-ref and dolt admin show-root now 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 with syntax error at position 18 near 'body'. ColumnsFromCheckDefinition parsed 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 through dsess.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_control itself only gains AddBranchAdmin and RemoveBranchAdmins, and env/actions no longer touches branch control.
    Read replicas create and delete pulled branches through BranchOps too, 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, so branch-control.bats grants 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.OpenForWriteAppend now appends to an existing file, as the local filesystem does. Tests that ran dolt dump against 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, and CALL dolt_update_column_tag() now preserve secondary indexes, CHECK constraints, table comments, primary key ordinals, collations, and target row size when updating a column tag.
    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
    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 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`
    Fixes #10003
    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.Schema now 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
    ENUM and SET column definitions now escape backslashes, single quotes, NUL bytes, newlines, and carriage returns when formatted as SQL strings, preserving member values in SHOW CREATE TABLE, information_schema.COLUMNS, and re-parsed DDL.
    Closes dolthub/go-mysql-server#4095 by pcbeingused33
    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 code 1064 (SQLSTATE 42000) with plain error text instead of internal parser dumps, so clients can classify them as syntax errors.
    Closes dolthub/go-mysql-server#4246 by aloneangel45
    Closes dolthub/go-mysql-server#4291
    Fixes #12684
  • 4274: Warn and return NULL for invalid TIMESTAMPDIFF arguments
    Fixes #12679
    Includes contributions from dolthub/go-mysql-server#4253
  • 4273: Return NULL when DATE_FORMAT input 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 error 1406 (ER_DATA_TOO_LONG) with SQLSTATE 22001 and message Data too long for column '<col>' at row <N> instead of 1105 / HY000.
    Closes dolthub/go-mysql-server#4114 by sciyoshi
    Fixes #2173
    Blocks #12768
    Blocks dolthub/doltgresql#4036
  • 4270: Return string types from REVERSE and SUBSTRING to prevent numeric coercion
    REVERSE, SUBSTRING, MID, and SUBSTR now return LONGTEXT (or LONGBLOB for binary inputs) while preserving text collations instead of inheriting numeric input types.
    Closes dolthub/go-mysql-server#4264 by sanketpatel32
    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_TIMESTAMP panicked 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 EVENTS with overflowing EVERY clauses from getting ENABLED
    Events with large ON SCHEDULE EVERY clauses would silently overflow time.Duration (a uint64) 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 large EVERY clauses 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.Join now 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
    ROUND now rounds DOUBLE and FLOAT values 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 qualified table.* as a function argument outside unqualified COUNT(*) and COUNT(*) 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 MySQL ERR_Packet and keep the session open instead of dropping the connection with ERROR 2013.
    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
    In multi-statement requests, an error packet also stops any remaining statements from running, whether the failure occurs before column headers or mid-stream.
    SELECT 1; <failing query>; SELECT 3;
    -- returns 1, then the error; SELECT 3 is not executed
    Connections still close when a socket write fails mid-packet or when an error arrives after a rowless command such as INSERT has already sent its completion response. In Vitess's streaming client (Conn.ExecuteStreamFetch and Conn.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 INFILE in 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.Join returns a zero-row statistic instead of an error when MCV or cross-type key comparison fails

Don't miss a new dolt release

NewReleases is sending notifications on new releases.