# Technical Advisory 71002

Publication date: October 7, 2021

## Description

A bug was introduced in CockroachDB v21.1.9 that causes the database to drop `WHERE` predicates from prepared statements in specific circumstances.

The bug can only be triggered when a prepared statement references a boolean column in top-level `AND` clauses in `WHERE` clauses or `JOIN … ON` clauses. In such statements, it is possible for the part of the filter referencing the boolean column, or any other child of an adjacent `AND` expression to be omitted during execution.

Only CockroachDB version 21.1.9 is affected by this bug.

## Statement

This bug was resolved in CockroachDB by PR 71035. The fix has been applied to CockroachDB 21.1.10. This public issue is tracked by 71002.

## Mitigation

Users of CockroachDB 21.1.9 are encouraged to upgrade to 21.1.10 or a later version.

## Impact

Users who ran prepared statements with `WHERE` clauses and `JOIN .. ON` clauses that contained references to a boolean column in top-level `AND` expressions could have gotten incorrect query results, caused by incorrect omission of parts of the filter.

Please reach out to the support team if you need more information or assistance.