Bug #80271 [NEW]: prepare json_set throw exception on mysql 8.0.22
| From: | cxlblm at gmail dot com | Date: | Thu, 22 Oct 2020 15:55:07 +0000 |
| Subject: | Bug #80271 [NEW]: prepare json_set throw exception on mysql 8.0.22 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229856@lists.php.net to get a copy of this message | ||
From: cxlblm at gmail dot com
Operating system: docker/ubuntu
PHP version: 7.4.11
Package: PDO MySQL
Bug Type: Bug
Bug description:prepare json_set throw exception on mysql 8.0.22
Description:
------------
$pdo = new
\PDO("mysql:host=host.docker.internal;dbname=laravel;charset=utf8mb4",
'root', 'root');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$stmt = $pdo->prepare('update test set setting = json_set(
setting,
"$.name", ?)');
$r = $stmt->execute(['fefwef']);
var_dump($r);
Expected result:
----------------
true
Actual result:
--------------
PHP Fatal error: Uncaught PDOException: SQLSTATE[22032]: <<Unknown
error>>: 3141 Invalid JSON text in argument 1 to function cast_as_json:
"Invalid value." at position 1. in /opt/project/local/PDO.php:10
Stack trace:
#0 /opt/project/local/PDO.php(10): PDOStatement->execute(Array)
#1 {main}
thrown in /opt/project/local/PDO.php on line 10
--
Edit bug report at https://bugs.php.net/bug.php?id=80271&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80271&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80271&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80271&r=mysqlcfg