-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: partial index corruption #74385
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.C-technical-advisoryCaused a technical advisoryCaused a technical advisoryO-communityOriginated from the communityOriginated from the communityS-0-visible-logical-errorDatabase stores inconsistent data in some cases, or queries return invalid results silently.Database stores inconsistent data in some cases, or queries return invalid results silently.T-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-21.1Used to mark GA and release blockers, technical advisories, and bugs for 21.1Used to mark GA and release blockers, technical advisories, and bugs for 21.1branch-release-21.2Used to mark GA and release blockers, technical advisories, and bugs for 21.2Used to mark GA and release blockers, technical advisories, and bugs for 21.2
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.C-technical-advisoryCaused a technical advisoryCaused a technical advisoryO-communityOriginated from the communityOriginated from the communityS-0-visible-logical-errorDatabase stores inconsistent data in some cases, or queries return invalid results silently.Database stores inconsistent data in some cases, or queries return invalid results silently.T-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-21.1Used to mark GA and release blockers, technical advisories, and bugs for 21.1Used to mark GA and release blockers, technical advisories, and bugs for 21.1branch-release-21.2Used to mark GA and release blockers, technical advisories, and bugs for 21.2Used to mark GA and release blockers, technical advisories, and bugs for 21.2
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Done
Describe the problem
We have observed in our database, that after updating a row, queries leveraging a partial, unique index work as if row wasn't updated. This leads to wrong query results when the index is used. The problem seems to occur only if more than one index is defined on the table.
To reproduce
The problem is easily reproducible.
First we will start a CockroachDB node (single-node, but the behavior was originally observed in Cockroach Cloud cluster) and connect SQL client to it:
Then run the following SQL:
Expected behavior
Query should return correct results, regardless which index is used.
Environment:
cockroach sqland JDBCgz#10904