Bug #78192 [NEW]: SegFault when reuse statement after schema has changed
From: stanneux at b2pweb dot com
Operating system: linux Fedora
PHP version: 7.2.19
Package: PDO SQLite
Bug Type: Bug
Bug description:SegFault when reuse statement after schema has changed
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 bug report at https://bugs.php.net/bug.php?id=78192&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78192&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78192&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78192&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78192&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78192&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78192&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78192&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78192&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78192&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78192&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78192&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78192&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78192&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78192&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78192&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78192&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78192&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78192&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78192&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78192&r=mysqlcfg
Thread (5 messages)
- stanneux at b2pweb dot com