1--TEST--
2MySQL PDOStatement->rowCount() @ SELECT
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12    require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
13    $db = MySQLPDOTest::factory();
14    MySQLPDOTest::createTestTable($db);
15
16    try {
17
18        if (0 !== ($tmp = $db->query('SELECT id FROM test WHERE 1 = 0')->rowCount()))
19            printf("[002] Expecting 0 got %s", var_export($tmp, true));
20
21        if (1 !== ($tmp = $db->query('SELECT id FROM test WHERE id = 1')->rowCount()))
22            printf("[003] Expecting 1 got %s", var_export($tmp, true));
23
24    } catch (PDOException $e) {
25        printf("[001] %s [%s] %s\n",
26            $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
27    }
28
29    print "done!";
30?>
31--CLEAN--
32<?php
33require __DIR__ . '/mysql_pdo_test.inc';
34MySQLPDOTest::dropTestTable();
35?>
36--EXPECT--
37done!
38