pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.41k stars 5.85k forks source link

UPDATE caused an assertion failed #54830

Open chenglinLiang opened 4 months ago

chenglinLiang commented 4 months ago

Bug Report

This is the smallest reproducible example I could create. The issue might not be solely caused by the c0 column.

1. Minimal reproduce step (Required)

CREATE TABLE t0(c0 BOOL DEFAULT true , c1 BLOB(14) NOT NULL , c2 TEXT(98)  AS (CAST(false AS DATE)) VIRTUAL );
REPLACE INTO t0(c1) VALUES ('1980849292');
CREATE INDEX i0 ON t0(c0 ASC, c2(55) ASC, c1(200) DESC);
UPDATE t0 SET c0=0.14108447234433485;

2. What did you expect to see? (Required)

No error.

3. What did you see instead (Required)

error: mysql: 8141: assertion failed: key: 7480000000000001dd5f69800000000000000103800000000000000101303030302d30302dff3030000000000000f9013139383038343932ff3932000000000000f9038000000000000001, assertion: Exist, start_ts: 451338232889344001, existing start ts: 0, existing commit ts: 0

4. What is your TiDB version? (Required)

                      tidb_version()
-----------------------------------------------------------
 Release Version: v8.2.0                                  +
 Edition: Community                                       +
 Git Commit Hash: 821e491a20fbab36604b36b647b5bae26a2c1418+
 Git Branch: HEAD                                         +
 UTC Build Time: 2024-07-05 09:16:25                      +
 GoVersion: go1.21.10                                     +
 Race Enabled: false                                      +
 Check Table Before Drop: false                           +
 Store: tikv
chenglinLiang commented 4 months ago

I found additional assertion failed. To avoid duplicate reports, I tried to check the call stack of the assertion failed. I read https://pingcap.github.io/tidb-dev-guide/get-started/debug-and-profile.html#using-delve-to-debug-a-test-case but don't know where to put the breakpoints, any help will be appreciated!

cfzjywxk commented 4 days ago

Like https://github.com/pingcap/tidb/issues/55599, seems to be related to the virtual columns, /cc @wjhuang2016