pingcap / pingcap/tidb

different warning sequence when `tidb_enable_vectorized_expression` is on/off

Open
#50,197 0 comments 0 reactions 0 assignees View on GitHub
severity/minor sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

```
> create table tt(a varchar(32));
> insert into tt values("0001-00-01");
> insert into tt values("0001-01-01");
> insert into tt values("0001-00-01");
> set @@tidb_enable_vectorized_expression=1;
> select subdate(a, 999999999999999) from tt;
> show warnings;
> set @@tidb_enable_vectorized_expression=0;
> select subdate(a, 999999999999999) from tt;
> show warnings;
```

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

The two `show warnings` should be the all same including sequence.

### 3. What did you see instead (Required)

Two `show warnings` output warnings with different sequences.

```
TiDB root@127.0.0.1:test> set @@tidb_enable_vectorized_expression=1;
Query OK, 0 rows affected
Time: 0.002s
TiDB root@127.0.0.1:test> select subdate(a, 999999999999999) from tt;
+-----------------------------+
| subdate(a, 999999999999999) |
+-----------------------------+
| |
| |
| |
+-----------------------------+
3 rows in set
Time: 0.010s
TiDB root@127.0.0.1:test> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0001-00-01' |
| Warning | 1292 | Incorrect datetime value: '0001-00-01' |
| Warning | 1441 | Datetime function: datetime field overflow |
+---------+------+--------------------------------------------+
3 rows in set
Time: 0.010s
```

```
TiDB root@127.0.0.1:test> set @@tidb_enable_vectorized_expression=0;
Query OK, 0 rows affected
Time: 0.001s
TiDB root@127.0.0.1:test> select subdate(a, 999999999999999) from tt;
+-----------------------------+
| subdate(a, 999999999999999) |
+-----------------------------+
| |
| |
| |
+-----------------------------+
3 rows in set
Time: 0.012s
TiDB root@127.0.0.1:test> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0001-00-01' |
| Warning | 1441 | Datetime function: datetime field overflow |
| Warning | 1292 | Incorrect datetime value: '0001-00-01' |
+---------+------+--------------------------------------------+
3 rows in set
Time: 0.010s
TiDB root@127.0.0.1:test>
```

### 4. What is your TiDB version? (Required)

master

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.