1--TEST-- 2Bug #73959 (lastInsertId fails to throw an exception) 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); 6require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; 7require __DIR__ . '/config.inc'; 8PDOTest::skip(); 9?> 10--FILE-- 11<?php 12require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; 13require __DIR__ . '/config.inc'; 14$db = PDOTest::test_factory(__DIR__ . '/common.phpt'); 15$db->setAttribute(PDO::ATTR_PERSISTENT, false); 16$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 17$db->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES, true); 18 19try { 20 $db->lastInsertId('nonexistent_seq'); 21 echo "Error: No exception thrown"; 22} catch (PDOException $e) { 23 echo "Success: Exception thrown"; 24} 25?> 26--EXPECT-- 27Success: Exception thrown 28