summaryrefslogtreecommitdiff
path: root/ext/pdo/tests/bug_34687.phpt
blob: 312272dbb68587649f30707fab7ed5eea8849b4f (plain)
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
--TEST--
PDO Common: Bug #34687 (query doesn't return error information)
--SKIPIF--
<?php
if (!extension_loaded('pdo')) die('skip');
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();

$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
$x = $db->query("UPDATE non_existent_pdo_test_table set foo = 'bar'");

var_dump($x);
$code = $db->errorCode();
if ($code !== '00000' && strlen($code)) {
	echo "OK: $code\n";
} else {
	echo "ERR: $code\n";
	print_r($db->errorInfo());
}

?>
--EXPECTF--
bool(false)
OK: %s