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