Bug #78192 [Opn->Ver]: SegFault when reuse statement after schema has changed
Edit report at https://bugs.php.net/bug.php?id=78192&edit=1
ID: 78192
Updated by: sjon@php.net
Reported by: stanneux at b2pweb dot com
Summary: SegFault when reuse statement after schema has
changed
-Status: Open
+Status: Verified
Type: Bug
Package: PDO SQLite
Operating System: linux Fedora
PHP Version: 7.2.19
Block user comment: N
Private report: N
New Comment:
this has some interesting behaviour - 7.1 (still) throws a correct exception, 7.2 fails silently and
7.3 / 7.4 segfault
Previous Comments:
------------------------------------------------------------------------
[2019-06-21 09:23:27] stanneux at b2pweb dot com
Description:
------------
This bug occurs on php 7.2.0 and it is not fixed in v7.3.6. The test script has been launched on
docker image php:7.2-cli and php:7.3-cli
The test case fail with pdo_sqlite but works fine with SQLite3
No changes set on docker images. The php.ini file is the same.
Test script:
---------------
<?php
$connection = new \PDO('sqlite::memory:');
$connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$connection->query('CREATE TABLE user (id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(255)
NOT NULL)');
$stmt = $connection->prepare('INSERT INTO user (id, name) VALUES(:id, :name)');
$stmt->execute([
'id' => 10,
'name' => 'test',
]);
$stmt = $connection->prepare('SELECT * FROM user WHERE id = :id');
$stmt->execute(['id' => 10]);
$stmt->fetchAll(\PDO::FETCH_ASSOC);
$connection->query('ALTER TABLE user ADD new_col VARCHAR(255)');
$stmt->execute(['id' => 10]); // SegFault here
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78192&edit=1
Thread (5 messages)