Bug #81010 [Opn->Dup]: PDO boolean casting not working
| From: | cmb@php.net | Date: | Tue, 04 May 2021 10:18:04 +0000 |
| Subject: | Bug #81010 [Opn->Dup]: PDO boolean casting not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233672@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81010&edit=1
ID: 81010
Updated by: cmb@php.net
Reported by: sebastian dot woellmann at th-deg dot de
Summary: PDO boolean casting not working
-Status: Open
+Status: Duplicate
Type: Bug
Package: PDO PgSQL
Operating System: Macos 11.3.1
PHP Version: 7.4.18
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is a duplicate of bug #81002, which will be fixed in
PHP 7.4.19 and 8.0.6.
Previous Comments:
------------------------------------------------------------------------
[2021-05-04 08:11:14] sebastian dot woellmann at th-deg dot de
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 this bug report at https://bugs.php.net/bug.php?id=81010&edit=1