Download src/php/php-src/ext/pdo_pgsql/tests/bug71885_2.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug71885_2.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_pgsql/tests/bug71885_2.phpt
-
curl -L -o bug71885_2.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug71885_2.phpt
1.27 kB
| --TEST-- | |
| Request #71855 (PDO placeholder escaping, part 2) | |
| --EXTENSIONS-- | |
| pdo_pgsql | |
| --SKIPIF-- | |
| require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| require_once dirname(__FILE__) . '/config.inc'; | |
| PDOTest::skip(); | |
| $db = PDOTest::factory(); | |
| if (version_compare($db->getAttribute(PDO::ATTR_SERVER_VERSION), '9.4.0') < 0) { | |
| die("skip Requires 9.4+"); | |
| } | |
| --FILE-- | |
| require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| require_once dirname(__FILE__) . '/config.inc'; | |
| $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); | |
| $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM); | |
| $jsonb = $db->quote(json_encode(['a' => 1])); | |
| foreach ([false, true] as $emulate) { | |
| $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, $emulate); | |
| $stmt = $db->prepare("SELECT {$jsonb}::jsonb ?? ?"); | |
| $stmt->execute(['b']); | |
| var_dump($stmt->fetch()); | |
| $stmt = $db->prepare("SELECT {$jsonb}::jsonb ???"); | |
| $stmt->execute(['a']); | |
| var_dump($stmt->fetch()); | |
| } | |
| ==OK== | |
| --EXPECT-- | |
| array(1) { | |
| [0]=> | |
| string(1) "0" | |
| } | |
| array(1) { | |
| [0]=> | |
| string(1) "1" | |
| } | |
| array(1) { | |
| [0]=> | |
| string(1) "0" | |
| } | |
| array(1) { | |
| [0]=> | |
| string(1) "1" | |
| } | |
| ==OK== | |