Download src/php/php-src/ext/pdo_firebird/tests/bug_53280.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_firebird/tests/bug_53280.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_firebird/tests/bug_53280.phpt
-
curl -L -o bug_53280.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_firebird/tests/bug_53280.phpt
1.2 kB
| --TEST-- | |
| PDO_Firebird: bug 53280 segfaults if query column count is less than param count | |
| --EXTENSIONS-- | |
| pdo_firebird | |
| --SKIPIF-- | |
| require('skipif.inc'); | |
| --FILE-- | |
| require("testdb.inc"); | |
| $dbh = getDbConnection(); | |
| $dbh->exec('CREATE TABLE test53280(A VARCHAR(30), B VARCHAR(30), C VARCHAR(30))'); | |
| $dbh->exec("INSERT INTO test53280 VALUES ('A', 'B', 'C')"); | |
| $stmt1 = "SELECT B FROM test53280 WHERE A = ? AND B = ?"; | |
| $stmt2 = "SELECT B, C FROM test53280 WHERE A = ? AND B = ?"; | |
| $stmth2 = $dbh->prepare($stmt2); | |
| $stmth2->execute(array('A', 'B')); | |
| $rows = $stmth2->fetchAll(); // <------ OK | |
| var_dump($rows); | |
| $stmth1 = $dbh->prepare($stmt1); | |
| $stmth1->execute(array('A', 'B')); | |
| $rows = $stmth1->fetchAll(); // <------- segfault | |
| var_dump($rows); | |
| unset($stmth1); | |
| unset($stmth2); | |
| unset($stmt); | |
| unset($dbh); | |
| --CLEAN-- | |
| require 'testdb.inc'; | |
| $dbh = getDbConnection(); | |
| @$dbh->exec("DROP TABLE test53280"); | |
| unset($dbh); | |
| --EXPECT-- | |
| array(1) { | |
| [0]=> | |
| array(4) { | |
| ["B"]=> | |
| string(1) "B" | |
| [0]=> | |
| string(1) "B" | |
| ["C"]=> | |
| string(1) "C" | |
| [1]=> | |
| string(1) "C" | |
| } | |
| } | |
| array(1) { | |
| [0]=> | |
| array(2) { | |
| ["B"]=> | |
| string(1) "B" | |
| [0]=> | |
| string(1) "B" | |
| } | |
| } | |