Download src/php/php-src/ext/pdo_sqlite/tests/bug78192.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_sqlite/tests/bug78192.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_sqlite/tests/bug78192.phpt
-
curl -L -o bug78192.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_sqlite/tests/bug78192.phpt
1.01 kB
| --TEST-- | |
| PDO SQLite Bug #78192 SegFault when reuse statement after schema change | |
| --EXTENSIONS-- | |
| pdo_sqlite | |
| --FILE-- | |
| $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]); | |
| var_dump($stmt->fetchAll(\PDO::FETCH_ASSOC)); | |
| $connection->query('ALTER TABLE user ADD new_col VARCHAR(255)'); | |
| $stmt->execute(['id' => 10]); | |
| var_dump($stmt->fetchAll(\PDO::FETCH_ASSOC)); | |
| --EXPECT-- | |
| array(1) { | |
| [0]=> | |
| array(2) { | |
| ["id"]=> | |
| int(10) | |
| ["name"]=> | |
| string(4) "test" | |
| } | |
| } | |
| array(1) { | |
| [0]=> | |
| array(3) { | |
| ["id"]=> | |
| int(10) | |
| ["name"]=> | |
| string(4) "test" | |
| ["new_col"]=> | |
| NULL | |
| } | |
| } | |