1--TEST-- 2PDO MySQL PECL Bug #5780 (Failure to produce an error when one is expected) 3--EXTENSIONS-- 4pdo 5pdo_mysql 6--SKIPIF-- 7<?php 8require __DIR__ . '/config.inc'; 9require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; 10PDOTest::skip(); 11?> 12--FILE-- 13<?php 14require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; 15$db = PDOTest::test_factory(__DIR__. '/common.phpt'); 16 17$db->exec("CREATE TABLE test (login varchar(32) NOT NULL, data varchar(64) NOT NULL)"); 18$db->exec("CREATE TABLE test2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)"); 19$db->exec("INSERT INTO test2 (login, password) VALUES ('testing', 'testing')"); 20$db->exec("INSERT INTO test2 (login, password) VALUES ('test2', 'testpw2')"); 21 22$logstmt = $db->prepare('INSERT INTO test (login, data) VALUES (:var1, :var2)'); 23$authstmt = $db->prepare('SELECT * FROM test2 WHERE login = :varlog AND password = :varpass'); 24$authstmt->execute(array(':varlog' => 'testing', ':varpass' => 'testing')); 25var_dump($authstmt->fetch(PDO::FETCH_NUM)); 26@var_dump($logstmt->execute(array(':var1' => 'test1', ':var2' => 'test2'))); 27$info = $logstmt->errorInfo(); 28unset($info[2]); 29var_dump($info); 30?> 31--CLEAN-- 32<?php 33require __DIR__ . '/mysql_pdo_test.inc'; 34$db = MySQLPDOTest::factory(); 35$db->exec('DROP TABLE IF EXISTS test'); 36$db->exec('DROP TABLE IF EXISTS test2'); 37?> 38--EXPECT-- 39array(2) { 40 [0]=> 41 string(7) "testing" 42 [1]=> 43 string(7) "testing" 44} 45bool(true) 46array(2) { 47 [0]=> 48 string(5) "00000" 49 [1]=> 50 NULL 51} 52