Bug #79496 [NEW]: Query with period_diff works only if using LIMIT
| From: | shoresofnowhere at gmail dot com | Date: | Sun, 19 Apr 2020 21:52:26 +0000 |
| Subject: | Bug #79496 [NEW]: Query with period_diff works only if using LIMIT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-226672@lists.php.net to get a copy of this message | ||
From: shoresofnowhere at gmail dot com
Operating system: windows 10
PHP version: 7.4.5
Package: MySQLi related
Bug Type: Bug
Bug description:Query with period_diff works only if using LIMIT
Description:
------------
Connected to MySQL 8.0.19, having a utf8_general_ci encoded innodb table
named users with a field named birthdate of type date, this query
fails:
SELECT period_diff(DATE_FORMAT(CURDATE(), '%Y%m'),DATE_FORMAT(birthdate
, '%Y%m')) as result from users
with error:
(1210): Incorrect arguments to period_diff
but this identical query, except for the limit clause, works properly:
SELECT period_diff(DATE_FORMAT(CURDATE(), '%Y%m'),DATE_FORMAT(birthdate
, '%Y%m')) as result from users limit 0,10
Expected result:
----------------
Both queries are syntactically correct and should run (they DO work
properly if issued to the sql server with mysql workbench).
--
Edit bug report at https://bugs.php.net/bug.php?id=79496&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79496&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79496&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79496&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79496&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79496&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79496&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79496&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79496&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79496&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79496&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79496&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79496&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79496&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79496&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79496&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79496&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79496&r=mysqlcfg