# Vitess v22.0.2

2025-11-05 · [Original release notes](https://github.com/vitessio/vitess/releases/tag/v22.0.2) · [Full summary](https://ratatosk.io/en/releases/vitess/v22.0.2)

Security 4 · Breaking changes 5 · Important fixes 17 · Enhancements 3 · Dependency updates 6 · Other changes 26

## Security (4)

### `GetPermissions` now zeroes password checksums

- Affects: setups using `vtctldclient GetPermissions` (Inferred)

Previously, `GetPermissions` did not zero `PasswordChecksum` before marshaling the permissions response.

>  * [release-22.0] Potential fix for code scanning alert no. 2992: Clear-text logging of sensitive information (#18754) [#18759](https://github.com/vitessio/vitess/pull/18759)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### `vtctldclient GetPermissions` redacts `authentication_string`

- Affects: setups using `vtctldclient GetPermissions`

>  * [release-22.0] `vtctldclient GetPermissions`: hide `authentication_string` from response (#18771) [#18798](https://github.com/vitessio/vitess/pull/18798)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### File backup path traversal blocked

- Affects: file backup storage

Previously, `ListBackups()` used the supplied `dir` without preventing traversal outside the storage root, including through the `GetBackups` RPC on the vtctld server. Paths that resolve outside the root now return an error when listing, reading, starting, or removing backups.

> ### Security 
> #### Backup and Restore
>  * [release-22.0] Address dir traversal in file backup storage `GetBackups` RPC (#18814) [#18817](https://github.com/vitessio/vitess/pull/18817) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Vitess Java driver dependency vulnerability fixed

- Affects: installations using the Vitess Java driver (Inferred)

The driver previously used vulnerable `commons-lang` 2.6; it now uses `org.apache.commons:commons-lang3` 3.19.0.

> #### Java
>  * [release-22.0] Resolve `commons-lang` vulnerability in Java driver (#18768) [#18796](https://github.com/vitessio/vitess/pull/18796) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

## Breaking changes (5)

### Heartbeat reader reports stale heartbeats as errors

- Affects: VTTablet instances using the heartbeat reader for replication tracking (Inferred)

When MySQL stalled and heartbeat updates stopped, vttablet was not marked as not serving. Now, `Status` returns an error if no heartbeat arrives for more than twice the heartbeat interval.

>  * [release-22.0] Fix `vttablet` not being marked as not serving when MySQL stalls (#17883) [#18454](https://github.com/vitessio/vitess/pull/18454)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### `GetSchema` omits view definitions when `EnableViews` is disabled

- Affects: VTTablet/Schema Tracker configurations with `EnableViews` disabled (Inferred)

Previously, `GetSchema` could still return view definitions when `EnableViews` was disabled. Now, requests for views return no definitions, while requests for all schema definitions return table definitions only.

>  * [release-22.0] Fix GetSchema RPC to prevent returning view definitions when EnableViews is disabled (#18513) [#18517](https://github.com/vitessio/vitess/pull/18517)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### BuiltinBackupEngine file-close retries with a failure limit

- Affects: setups using the BuiltinBackupEngine for backup or restore (Inferred)

Previously, backup and restore code called `Close` directly, and a failed backup-file operation could be retried by existing per-file handling. Now close failures are retried with backoff up to 20 times; if they persist, the operation returns `FAILED_PRECONDITION` and the caller does not retry that file operation.

>  * [release-22.0] BuiltinBackupEngine: Retry file close and fail backup when we cannot (#18848) [#18861](https://github.com/vitessio/vitess/pull/18861) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### VReplication marks `ER_BINLOG_CREATE_ROUTINE_NEED_SUPER` unrecoverable

- Affects: VReplication workflows with binary logging enabled

This includes `CREATE TRIGGER` operations that fail because `SUPER` privilege is missing while binary logging is enabled.

Evidence: “err: sqlerror.NewSQLError(sqlerror.ERBinlogCreateRoutineNeedSuper, "unknown", "error applying event: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) (errno 1419) (sqlstate HY000) during query: CREATE DEFINER=`root`@`localhost` TRIGGER upd_customer BEFORE UPDATE ON customer FOR EACH ROW SET @email = NEW.email + \" (updated)\""),” https://github.com/vitessio/vitess/pull/18819

>  * [release-22.0] VReplication: Treat ER_BINLOG_CREATE_ROUTINE_NEED_SUPER as unrecoverable (#18784) [#18819](https://github.com/vitessio/vitess/pull/18819) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### VDiff sidecar schema updated for faster queries

- Affects: VDiff using the internal sidecar database

Some VDiff queries against the internal sidecar database performed poorly, and running VDiff could lead to primary VTTablet crashes.

Evidence: “This pull request intends to improve the performance of some of the queries executed by VDiff against the internal sidecar database.” https://github.com/vitessio/vitess/pull/18579

>  * [release-22.0] Fix: Improve VDiff internal query performance (#18579) [#18632](https://github.com/vitessio/vitess/pull/18632)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

## Important fixes (17)

### Scalar aggregation fixed for empty results

- Affects: VTGate scalar aggregations with literal or parameter expressions (Inferred)

When the input result set is empty, literal and parameter expressions are now evaluated through evalengine as part of the aggregation.

>  * [release-22.0] Fix scalar aggregation with literals in empty result sets (#18477) [#18491](https://github.com/vitessio/vitess/pull/18491)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### `SimpleProjection` names-only fields restored

- Affects: VTGate queries using `SimpleProjection` in names-only mode, including prepared-query field retrieval (Inferred)

In names-only mode, a simple projection could show no fields; it now returns the input fields and applies non-empty projected column names. Prepared-query field retrieval returns the expected field names and types.

>  * [release-22.0] Fix for simple projection showing no fields (#18489) [#18493](https://github.com/vitessio/vitess/pull/18493)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### VSchema foreign-key metadata follows table routing

- Affects: foreign-key-bearing tables routed to another keyspace or table

When table routing sends a table elsewhere, VSchema construction skips adding foreign-key relationships to its source-keyspace table. The destination keyspace retains its schema-defined relationships.

>  * [release-22.0]  Fix foreign key relation with routed tables (#18537) [#18541](https://github.com/vitessio/vitess/pull/18541)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Replication tracker resets `replicationLagSeconds`

- Affects: VTTablet replication trackers on primary tablets or with replication tracking disabled

The metric is reset to zero when a tablet becomes primary and when `Status` runs in primary or disabled mode.

>  * [release-22.0] repltracker: reset replica lag when we are primary (#18800) [#18806](https://github.com/vitessio/vitess/pull/18806)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### [Silent failure] VTTablet runs queries independently after waiter-cap overflow

- Affects: VTTablet query consolidation (Inferred)

Before this fix, affected queries could return an empty result without an error.

>  * [release-22.0] Fix bug where query consolidator returns empty result without error when the waiter cap exceeded (#18782) [#18832](https://github.com/vitessio/vitess/pull/18832) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Full key-range coverage fixed in `GenerateShardRanges`

- Affects: setups using `GenerateShardRanges` (Inferred)

Before this fix, it could return shard names that did not cover the full range.

> #### vtctl
>  * [release-22.0] fix: Fix `GenerateShardRanges` returning shard names that don't cover the full range (#18641) [#18654](https://github.com/vitessio/vitess/pull/18654)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### [Silent failure] VTGate subquery limit handling fixed

- Affects: VTGate queries with a positive `sqlSelectLimit` (Inferred)

When SQL SELECT LIMIT is set through a session variable or JDBC's `.setMaxRows`, it was also applied to subqueries, producing incorrect results: with `sql_select_limit = 1`, a count over a three-row subquery returned 1 instead of 3.

>  * [release-22.0] fix sqlSelectLimit propagating to subqueries (#18716) [#18872](https://github.com/vitessio/vitess/pull/18872)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Impossible-query formatting fixed for `UNION` statements

- Affects: impossible queries containing `UNION`, including queries with a CTE (Inferred)

Their generated SQL now adds `where 1 != 1` to every `SELECT` branch, including in CTE-containing queries.

>  * [release-22.0] bugfix: Fix impossible query for UNION (#18463) [#18465](https://github.com/vitessio/vitess/pull/18465)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Online DDL VReplication restart after failed cut-over

- Affects: Online DDL migrations using VReplication

When the cut-over rename fails, the executor attempts to restart the migration’s VReplication workflow; a failed restart is logged.

>  * [release-22.0] Online DDL: resume vreplication after cut-over/RENAME failure (#18428) [#18437](https://github.com/vitessio/vitess/pull/18437)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Unnecessary `srvtopo` watcher notifications fixed

- Affects: setups using `srvtopo` watchers (Inferred)

During topology outages, updates could repeatedly notify listeners even when cached data was available. Now, errors with cached data leave listeners silent; successful updates and errors without cached data still notify them.

>  * [release-22.0] Fix watcher storm during topo outages (#18434) [#18440](https://github.com/vitessio/vitess/pull/18440)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Correct column counts in VTGate plans for group-only aggregation over derived tables

- Affects: VTGate queries with group-only aggregation over a derived table

Before this release, these queries could produce an incorrect number of columns.

>  * [release-22.0] bugfix: Plan group by only on top of derived tables correctly (#18505) [#18511](https://github.com/vitessio/vitess/pull/18511)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Connection-pool waits unblock on closure

- Affects: setups using the smart connection pool (Inferred)

Previously, a goroutine waiting for a connection could hang if the pool closed while it waited. Now the wait returns `ErrConnPoolClosed`.

>  * [release-22.0] CONNPOOL: Fix race condition when waiting for connection (#18713) [#18721](https://github.com/vitessio/vitess/pull/18721)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### VDiff extra-row reconciliation panic fixed

- Affects: VDiff extra-row reconciliation (Inferred)

VDiff could panic when `ExtraRowsSource` or `ExtraRowsTarget` exceeded its corresponding extra-diff slice. Reconciliation now sizes its matching work from the available row-diff slices.

>  * [release-22.0] Fix a panic in VDiff when reconciling extra rows. (#18585) [#18596](https://github.com/vitessio/vitess/pull/18596) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### `AtomicCopy` workflows use normal retry handling after copying

- Affects: VReplication workflows with subtype `AtomicCopy`

Previously, any error on a workflow started with `AtomicCopy` could trigger termination, even after it had left the `Copying` phase.

>  * [release-22.0] Avoid terminating atomic copy workflows on error if they are out of copy phase (#18475) [#18487](https://github.com/vitessio/vitess/pull/18487)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### MoveTables sequence initialization now escapes names

- Affects: `MoveTables --initialize-target-sequences` runs with names that require escaping

During a traffic switch, sequence initialization could fail with a SQL syntax error when the generated query used names containing dashes. The generated query now escapes database and sequence names in this path.

>  * [release-22.0] VReplication: Ensure proper handling of keyspace/database names with dashes (#18762) [#18772](https://github.com/vitessio/vitess/pull/18772)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### Repeated Row Streamer heartbeats fixed

- Affects: VTTablet Row Streamer streams that send `VStreamRowsResponse` heartbeats. (Inferred)

After sending the first heartbeat, the sender stopped responding to later heartbeat-ticker events. It now continues sending heartbeat responses on each ticker event until the stream context is canceled.

>  * [release-22.0] [Bugfix] Broken Heartbeat system in Row Streamer (#18390) [#18398](https://github.com/vitessio/vitess/pull/18398)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

### VTTablet sequence counters reset after successful updates

- Affects: VTTablet sequence backing tables (Inferred)

After a traffic switch, cached sequence values could persist, producing duplicate values and duplicate-key errors. After a successful sequence-value update, the next insert ID is fetched from the sequence table instead of using stale in-memory counters.

>  * [release-22.0] Reset in-memory sequence info on vttablet on UpdateSequenceTables request (#18415) [#18445](https://github.com/vitessio/vitess/pull/18445)

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

## Enhancements (3)

- Tuple bind variables supported on the right-hand side of VTGate `IN` filters
- Recursive lock-path creation enables `zk2` named locks
- `LookupVindex create` escapes keyspace and table names

## Dependency updates (6)

### VTAdmin upgrades Vite and related frontend tooling

- [CVE-2024-52011](https://www.cve.org/CVERecord?id=CVE-2024-52011), [CVE-2025-58751](https://www.cve.org/CVERecord?id=CVE-2025-58751), [CVE-2025-58752](https://www.cve.org/CVERecord?id=CVE-2025-58752), [CVE-2025-62522](https://www.cve.org/CVERecord?id=CVE-2025-62522), [GHSA-93m4-6634-74q7](https://github.com/advisories/GHSA-93m4-6634-74q7), [GHSA-c27g-q93r-2cwf](https://github.com/advisories/GHSA-c27g-q93r-2cwf), [GHSA-g4jq-h2w9-997c](https://github.com/advisories/GHSA-g4jq-h2w9-997c), [GHSA-jqfw-vq24-v9c3](https://github.com/advisories/GHSA-jqfw-vq24-v9c3)

VTAdmin moves `vite` from `^4.5.14` to `^7.1.12`, `@vitejs/plugin-react` from `^3.1.0` to `^5.1.0`, `vite-plugin-svgr` from `^2.4.0` to `^4.5.0`, and `vitest` from `^0.29.8` to `^4.0.3`.

>  * [release-22.0] vtadmin: upgrade vite to the latest (#18803) [#18811](https://github.com/vitessio/vitess/pull/18811) 

https://github.com/vitessio/vitess/blob/main/changelog/22.0/22.0.2/changelog.md

5 more, none mentioning security

- `` * [release-22.0] Upgrade the Golang version to `go1.24.7` [#18621](https://github.com/vitessio/vitess/pull/18621) ``
- `` * [release-22.0] Upgrade the Golang version to `go1.24.9` [#18737](https://github.com/vitessio/vitess/pull/18737) ``
- `* [release-22.0] Bump vite from 4.5.9 to 4.5.14 in /web/vtadmin (#18485) [#18500](https://github.com/vitessio/vitess/pull/18500)`
- `* [release-22.0] Bump @babel/runtime from 7.26.0 to 7.27.6 in /web/vtadmin (#18467) [#18502](https://github.com/vitessio/vitess/pull/18502)`
- `* [release-22.0] Bump form-data from 4.0.1 to 4.0.4 in /web/vtadmin (#18473) [#18504](https://github.com/vitessio/vitess/pull/18504)`

## Other changes (26)

- CI workflows use event payload for draft state
- VReplication `copy_state` changes `lastpk` to `mediumblob`
- VTGate removes ordinary database qualifiers from pushed-down SQL
- Foreign-key verification SQL aliases parent and child tables
- Named-lock test coverage added for `consul` and `zk2`
- Unnecessary `GROUP BY` removed from VReplication workflow query
- VTGate `VStream` callbacks no longer run after return
- Go update workflows now use `peter-evans/create-pull-request@v7`
- CI workflows update the MySQL APT config package
- CI OS tuning extracted into a reusable action
- Reusable MySQL setup action for GitHub Actions
- Java Maven publishing moved to Sonatype Central
- Updated code owners and maintainers on `release-22.0`
- Code-owner assignments updated in `.github/CODEOWNERS`
- Simplified repository CI workflow files
- CI workflow conditions use `!cancelled()` instead of `always()`
- Automatic `man-db` updates disabled in CI workflows
- CI workflows updated to `actions/setup-go` v5.5.0
- Code Coverage CI workflow trigger changes
- VTGate multi-query protocol flag setup regression fixed
- Release 22.0 branch returned to development mode
- `release-22.0` branch frozen for v22.0.2
- Flaky Consul topology tests fixed
- Atomic heartbeat counting in `TestStreamRowsHeartbeat`
- VDiff2 end-to-end test waits for VDiff to start or complete
- Smart connection pool test timeout increased

---

Summaries are produced by AI, so they can be wrong, and they are provided without warranty.
