Bug #81010 [NEW]: PDO boolean casting not working
| From: | sebastian dot woellmann at th-deg dot de | Date: | Tue, 04 May 2021 08:11:14 +0000 |
| Subject: | Bug #81010 [NEW]: PDO boolean casting not working | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233671@lists.php.net to get a copy of this message | ||
From: sebastian dot woellmann at th-deg dot de
Operating system: Macos 11.3.1
PHP version: 7.4.18
Package: PDO PgSQL
Bug Type: Bug
Bug description:PDO boolean casting not working
Description:
------------
After upgrading from 7.4.16 to 7.4.18 boolean casting in sql statements
doesn' work any more. The error appears when using laravel/passport, but
i can replicate it with own code.
I tried running it with version 8.0.5, doesn't work either.
With version 7.3.28 it works as intended.
The problem appeared this morning after updating MacOS to version 11.3.1
and then updating php via homebrew to version 7.4.18.
Error:
SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column
"personal_access_client" is of type boolean but expression is of type
integer
LINE 1: ...pdated_at", "created_at") values ($1, $2, $3, $4, $5, $6,
$7...
^
HINT: You will need to rewrite or cast the expression. (SQL: insert
into "oauth_clients" ("user_id", "name", "secret",
"redirect",
"personal_access_client", "password_client", "revoked",
"updated_at",
"created_at") values (?, EnerPlanET Personal Access Client,
MAq9IgpCf4c2X7kLIj9GuhOLg191fnsXtXitL7VO, http://localhost, 1, 0, 0,
2021-05-04 06:56:49, 2021-05-04 06:56:49) returning "id")
For anyone running into a similar problem: the only way i was able to
fix the issue was downgrading to php 7.3.28. I guess downgrading to
7.4.16 would also work, but homebrew doesn't support that
Test script:
---------------
The error occurs when executing "php artisan passport:install"
--
Edit bug report at https://bugs.php.net/bug.php?id=81010&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81010&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81010&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81010&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81010&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81010&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81010&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81010&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81010&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81010&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81010&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81010&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81010&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81010&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81010&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81010&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81010&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81010&r=mysqlcfg