bad conversion between string and decimal types with trailing 0s
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 121
Description
When converting between strings and decimals for `HASH IN ` expressions, trailing 0s cause a problems.
There's a skipped test added in this PR:
https://github.com/dolthub/go-mysql-server/pull/2267
Setup:
```sql
create table t (v varchar(100));
insert into t values ('0'), ('0.0'), ('123'), ('123.0');
create table t_idx (v varchar(100));
create index idx on t_idx(v);
insert into t_idx values ('0'), ('0.0'), ('123'), ('123.0');
```
MySQL:
```sql
mysql> select * from t where (v in (0.0, 123));
+-------+
| v |
+-------+
| 0 |
| 0.0 |
| 123 |
| 123.0 |
+-------+
4 rows in set (0.0343 sec)
mysql> select * from t_idx where (v in (0.0, 123));
+-------+
| v |
+-------+
| 0 |
| 0.0 |
| 123 |
| 123.0 |
+-------+
4 rows in set (0.0069 sec)
```
Dolt:
```sql
tmp> select * from t where (v in (0.0, 123));
+-----+
| v |
+-----+
| 123 |
+-----+
1 row in set (0.00 sec)
tmp> select * from t_idx where (v in (0.0, 123));
+-----+
| v |
+-----+
| 123 |
+-----+
1 row in set (0.01 sec)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.