Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b938a81ced
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 41 lines (32 sloc) 0.771 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
--TEST--
PostgreSQL: do not save errorous prepared statements

--FILE--
<?php
require_once dirname(__FILE__) . '/../init.php';

$LAST_ERROR = null;
function errorSaver($msg, $error)
{
global $LAST_ERROR;
$LAST_ERROR = $error;
}

function main(&$DB)
{
global $LAST_ERROR;
$query = "oshibka";
$DB->setErrorHandler("errorSaver");
$DB->query($query);
$msg1 = $LAST_ERROR["message"];
$DB->query($query);
$msg2 = $LAST_ERROR["message"];
if (false !== strpos($msg1, $query) && false !== strpos($msg2, $query)) echo "OK\n";
else echo "Different errors are responded from the same errorous queries:\n$msg1\n$msg2\n";
}
?>


--SKIPIF--
<?php
if (!is_callable('pg_connect')) print('skip pgsql extension not loaded');
?>


--EXPECT--
Query: 'oshibka'
Query: 'oshibka'
OK

Something went wrong with that request. Please try again.