Bug #112792 | Documentation bug: CURDATE - return type | ||
---|---|---|---|
Submitted: | 21 Oct 2023 11:28 | Modified: | 3 Nov 2023 22:38 |
Reporter: | Thorsten Kettner | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | curdate |
[21 Oct 2023 11:28]
Thorsten Kettner
[21 Oct 2023 11:54]
Luuk V
The same problem applies to CURTIME.
[23 Oct 2023 11:41]
MySQL Verification Team
Hi Mr. Kettner, Thank you for your bug report. However , this is not a bug. Yes, that function returns a date, but not in the DATE domain, but in two different formats. String and numeric. You can try comparing the string format and DATE column values and you will see that everything is documented properly. Not a bug.
[28 Oct 2023 7:36]
Luuk V
Can you explain, or give at least 1 example, when `curdate()` does NOT give a value to make this "not in the date domain" ?
[30 Oct 2023 11:54]
MySQL Verification Team
Hi, This is indeed a documentation-only bug. t is correct that it can be used as a string or a numeric value, but this depends on the context it is used in, like any other temporal expression. Verifed as a documentation bug.
[3 Nov 2023 22:38]
Jon Stephens
This is all explained at https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-syntax.html Not a bug.
[3 Nov 2023 23:30]
Jon Stephens
Also, an example: mysql> SELECT CURDATE() INTO @x; Query OK, 1 row affected (0.00 sec) mysql> SELECT @x, DATE_ADD(@x, INTERVAL 12 WEEK), REVERSE(@x); +------------+--------------------------------+-------------+ | @x | DATE_ADD(@x, INTERVAL 12 WEEK) | REVERSE(@x) | +------------+--------------------------------+-------------+ | 2023-11-03 | 2024-01-26 | 30-11-3202 | +------------+--------------------------------+-------------+ 1 row in set (0.00 sec) This demonstrates that the description in the Manual is correct: DATE_ADD() treats its (unquoted) first argument as a DATE, but REVERSE() treats the exact same value as a string. cheers jon.
[6 Nov 2023 11:11]
MySQL Verification Team
Thank you, Jon.