Skip to content

"Data truncated for column '%s' at row %d" #52672

@aytrack

Description

@aytrack

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists PK_PRECISION10063;
CREATE TABLE `PK_PRECISION10063` (
  `COL1` decimal(55,0) NOT NULL,
  `COL2` varchar(20) DEFAULT NULL,
  `COL4` datetime DEFAULT NULL,
  `COL3` bigint(20) DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  PRIMARY KEY (`COL1`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
insert into `PK_PRECISION10063` (`COL1`) values (8320145330174776428);

select col1, tan(col1) from PK_PRECISION10063 where tan(col1) < tan(9021874879467600608071521900001091070693729763119983979);

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

[16:55:05]MySQL root:test> select col1, tan(col1) from PK_PRECISION10063 where tan(col1) < tan(9021874879467600608071521900001091070693729763119983979);
+---------------------+---------------------+
| col1                | tan(col1)           |
+---------------------+---------------------+
| 8320145330174776428 | 0.06084016242886609 |
+---------------------+---------------------+

3. What did you see instead (Required)

[16:54:19]TiDB root:test> select col1, tan(col1) from PK_PRECISION10063 where tan(col1) < tan(9021874879467600608071521900001091070693729763119983979);
(1265, "Data truncated for column '%s' at row %d")

4. What is your TiDB version? (Required)

v8.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.3This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.fuzz/compIssues found by comp fuzz test.severity/majorsig/executionSIG executiontype/bugThe issue is confirmed as a bug.type/regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions