dolthub / dolthub/dolt

truncate strings when casting to `time`

Open
#10,000 4 comments 0 reactions 0 assignees View on GitHub
bug correctness sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

mysql
```
mysql> select cast('12:23 a' as time);
+-------------------------+
| cast('12:23 a' as time) |
+-------------------------+
| 12:23:00 |
+-------------------------+
1 row in set, 2 warnings (0.00 sec)

mysql> select cast('12:23:18 a' as time);
+----------------------------+
| cast('12:23:18 a' as time) |
+----------------------------+
| 12:23:18 |
+----------------------------+
1 row in set, 2 warnings (0.00 sec)

mysql> select cast('12:34:12abc' as time);
+-----------------------------+
| cast('12:34:12abc' as time) |
+-----------------------------+
| 12:34:12 |
+-----------------------------+
1 row in set, 1 warning (0.00 sec)
```

dolt
```
tmp/main*> select cast('12:23 a' as time);
+-------------------------+
| cast('12:23 a' as time) |
+-------------------------+
| NULL |
+-------------------------+
1 row in set (0.00 sec)

tmp/main*> select cast('12:23:18 a' as time);
+----------------------------+
| cast('12:23:18 a' as time) |
+----------------------------+
| NULL |
+----------------------------+
1 row in set (0.00 sec)

tmp/main*> select cast('12:34:12abc' as time);
+-----------------------------+
| cast('12:34:12abc' as time) |
+-----------------------------+
| NULL |
+-----------------------------+
1 row in set (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.