mirror of
https://github.com/php/php-src.git
synced 2026-04-21 23:18:13 +02:00
737195c3ae
Of the important PDO drivers, this affects only PDO PgSQL, as both MySQL and SQLite do not return native boolean types.
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
--TEST--
|
|
Request #71855 (PDO placeholder escaping)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
|
require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
|
require_once dirname(__FILE__) . '/config.inc';
|
|
PDOTest::skip();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
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);
|
|
|
|
foreach ([false, true] as $emulate) {
|
|
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, $emulate);
|
|
|
|
try {
|
|
$stmt = $db->prepare('select ?- lseg \'((-1,0),(1,0))\'');
|
|
$stmt->execute();
|
|
} catch (PDOException $e) {
|
|
var_dump('ERR');
|
|
}
|
|
|
|
$stmt = $db->prepare('select ??- lseg \'((-1,0),(1,0))\'');
|
|
$stmt->execute();
|
|
|
|
var_dump($stmt->fetch());
|
|
}
|
|
|
|
?>
|
|
==OK==
|
|
--EXPECT--
|
|
string(3) "ERR"
|
|
array(1) {
|
|
[0]=>
|
|
string(1) "1"
|
|
}
|
|
array(1) {
|
|
[0]=>
|
|
string(1) "1"
|
|
}
|
|
==OK==
|