1--TEST--
2PDO MySQL PECL Bug #5780 (Failure to produce an error when one is expected)
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once __DIR__ . '/inc/mysql_pdo_test.inc';
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/inc/mysql_pdo_test.inc';
13$db = MySQLPDOTest::factory();
14
15$db->exec("CREATE TABLE test_pecl_bug_5780 (login varchar(32) NOT NULL, data varchar(64) NOT NULL)");
16$db->exec("CREATE TABLE test_pecl_bug_5780_2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)");
17$db->exec("INSERT INTO test_pecl_bug_5780_2 (login, password) VALUES ('testing', 'testing')");
18$db->exec("INSERT INTO test_pecl_bug_5780_2 (login, password) VALUES ('test2', 'testpw2')");
19
20$logstmt = $db->prepare('INSERT INTO test_pecl_bug_5780 (login, data) VALUES (:var1, :var2)');
21$authstmt = $db->prepare('SELECT * FROM test_pecl_bug_5780_2 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_once __DIR__ . '/inc/mysql_pdo_test.inc';
32$db = MySQLPDOTest::factory();
33$db->exec('DROP TABLE IF EXISTS test_pecl_bug_5780');
34$db->exec('DROP TABLE IF EXISTS test_pecl_bug_5780_2');
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