Skip to content

Retrying transaction with a double type auto-increment column leads to data error #29892

Closed
@djshow832

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Prepare:

tidb> set global tidb_txn_mode='optimistic';
Query OK, 0 rows affected (0.01 sec)

tidb> set global tidb_disable_txn_auto_retry=false;
Query OK, 0 rows affected (0.01 sec)

In session1:

session1> create table t(a double key auto_increment, b int);
Query OK, 0 rows affected (0.03 sec)
session1> insert into t values (146576794, 1);
Query OK, 1 row affected (0.01 sec)
session1> begin;
session1> insert into t(b) select 1;

In session2:

session2> begin;
Query OK, 0 rows affected (0.00 sec)
session2> insert into t values (146576795, 1);
Query OK, 1 row affected (0.00 sec)
session2> insert into t values (146576796, 1);                             
Query OK, 1 row affected (0.00 sec)
session2> commit;
Query OK, 0 rows affected (0.01 sec)

In session1:

session1> commit;
Query OK, 0 rows affected (2.63 sec)
session1> select * from t;
ERROR 1105 (HY000): Failed to decode datum payload as f64

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

Query without an error.

3. What did you see instead (Required)

ERROR 1105 (HY000): Failed to decode datum payload as f64

4. What is your TiDB version? (Required)

master

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

affects-4.0This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.severity/criticalsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions