Skip to content

should report error when divide 0 occurs when adding a generated index with default sql mode #50053

@lcwangchao

Description

@lcwangchao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

> create table t1(a int);
> insert into t1 values(0);
> alter table t1 add index i((100/a));

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

In mysql8.0

mysql> alter table t1 add index i((100/a));
ERROR 1365 (22012): Division by 0

3. What did you see instead (Required)

mysql> alter table t1 add index i((100/a));
Query OK, 0 rows affected (0.76 sec)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

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.component/ddlThis issue is related to DDL of TiDB.severity/majortype/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