> ## Documentation Index
> Fetch the complete documentation index at: https://www.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Technical Advisory 50587

Publication date: July 6, 2020

## Description

When executing a [`TRUNCATE`](https://www.cockroachlabs.com/docs/v19.2/truncate) statement on a table, CockroachDB creates a new table with a new descriptor ID, copies the contents from the old table to the new table, and then [drops](https://www.cockroachlabs.com/docs/v19.2/drop-table) the old table. When the old table is dropped, a [drop job](https://www.cockroachlabs.com/docs/v19.2/online-schema-changes) is created to asynchronously clean up the table's data. In v19.2, v19.1, and prior versions, a job ID is assigned to the old table prior to copying its contents to the new table. This means that the new table descriptor will have a populated drop job ID. This drop job ID prevents the table from being [renamed](https://www.cockroachlabs.com/docs/v19.2/alter-table#rename-to).

## Statement

This bug has been fixed in versions v19.1.11 and v19.2.9. All users are encouraged to upgrade to the latest maintenance release (see [Mitigation](#mitigation) below).

## Mitigation

Customers on [v19.1.0 - v19.1.10](https://www.cockroachlabs.com/docs/v19.1/upgrade-cockroach-version) and [v19.2.0 - v19.2.8](https://www.cockroachlabs.com/docs/v19.2/upgrade-cockroach-version) are strongly encouraged to upgrade to the next maintenance release containing the fix. The scenario can be avoided on clusters still running v19.1.10 and earlier, or v19.2.8 and earlier, by delaying [`ALTER TABLE RENAME`](https://www.cockroachlabs.com/docs/v20.1/rename-table) statements for any table that was previously truncated, until the upgrade is completed.

## Impact

All CockroachDB v19.x releases up to and including v19.1.10 and v19.2.8 are affected.

Questions about any technical alert can be directed to our [support team](https://support.cockroachlabs.com/).
