Vectors with infinities can be created
- 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)
```sql
select vec_from_text('[1e39, -1e39]') _;
```
### 2. What did you expect to see? (Required)
```
ERROR 1105 (HY000): Invalid vector text: [1e39, -1e39]
```
(it should actually mention "infinite value not allowed in vector" as well but that's another matter)
### 3. What did you see instead (Required)
```
+-------------+
| _ |
+-------------+
| [+Inf,-Inf] |
+-------------+
1 row in set (0.00 sec)
```
Such vector can produce a scalar Infinity or NaN as well
```sql
mysql> select VEC_L2_NORM('[1e39]') + 1;
ERROR 1690 (22003): DOUBLE value is out of range in '(+Inf + 1)'
mysql> select VEC_L2_NORM('[1e39]')*0 + 1;
ERROR 1690 (22003): DOUBLE value is out of range in '(NaN + 1)'
```
### 4. What is your TiDB version? (Required)
Today's nightly.
```
Release Version: v8.5.0-alpha-373-g177a03c8e5
Edition: Community
Git Commit Hash: 177a03c8e51caf844491d8a93edda29295510e8d
Git Branch: HEAD
UTC Build Time: 2024-12-18 05:08:16
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```
Contributor guide
Assessment
This issue has not been assessed yet.