pingcap / pingcap/tidb

Unexpected Error for Function INET_ATON

Open
#35,677 2 comments 0 reactions 1 assignee Claimed by @likzn View on GitHub
fuzz/sqlancer severity/moderate sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)

```sql
CREATE TABLE t1(c0 DOUBLE);
CREATE INDEX i0 ON t1(c0);
INSERT INTO t1(c0) VALUES (0);

SELECT (CASE t1.c0 WHEN NULL THEN LOG10(-1) ELSE INET_ATON(0.1111111) END ) FROM t1; -- Incorrect string value: '0.1111111' for function inet_aton
```

### 2. What did you expect to see? (Required)
No error.
The integer is valid as shown in this SQL query:
```sql
SELECT INET_ATON(0.1111111); -- NULL
```
https://www.db-fiddle.com/f/xscGwcubPEEFqW5Rna6qQ5/1 There is also no error for MySQL.
### 3. What did you see instead (Required)
Incorrect string value: '0.1111111' for function inet_aton
### 4. What is your TiDB version? (Required)

| Release Version: v6.2.0-alpha-159-ge0527ba27
Edition: Community
Git Commit Hash: e0527ba27c72b0a533b126fedfa025d47a209ca9
Git Branch: master
UTC Build Time: 2022-06-21 11:55:54
GoVersion: go1.18.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |

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.