You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Shtykh (JIRA)" <ji...@apache.org> on 2018/11/15 04:39:00 UTC
[jira] [Commented] (IGNITE-10265) PDOStatement::rowCount returns 0
[ https://issues.apache.org/jira/browse/IGNITE-10265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16687467#comment-16687467 ]
Roman Shtykh commented on IGNITE-10265:
---------------------------------------
[~isapego] Another PDO issue ;)
> PDOStatement::rowCount returns 0
> --------------------------------
>
> Key: IGNITE-10265
> URL: https://issues.apache.org/jira/browse/IGNITE-10265
> Project: Ignite
> Issue Type: Bug
> Components: odbc
> Affects Versions: 2.6
> Environment: CentOS, unixODBC
> Reporter: Roman Shtykh
> Priority: Major
>
> How to reproduce:
> {noformat}
> $ cat ~/odbc.php
> <?php
>
> try {
> echo PHP_EOL,PHP_EOL,"# Using PDO",PHP_EOL;
> $dbh = new PDO('odbc:DRIVER={ApacheIgnite};Server=127.0.0.1;PORT=10800');
> $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
>
> $sql = 'SELECT * FROM "Person".Person';
> $statement = $dbh->prepare($sql);
> $statement->execute();
>
> $data = $statement->fetchAll();
>
> foreach($data as $row) {
> var_dump($row);
> }
>
> echo "array Count : " . count($data) . "\n";
> echo "rowCount : " . $statement->rowCount() . "\n";
>
> } catch (PDOException $e) {
> print "Error!: " . $e->getMessage() . "\n";
> die();
> }
>
> $ php ~/odbc.php
>
> # Using PDO
> array(10) {
> ["ORGID"]=>
> string(1) "1"
> [0]=>
> string(1) "1"
> ["FIRSTNAME"]=>
> string(4) "John"
> [1]=>
> string(4) "John"
> ["LASTNAME"]=>
> string(3) "Doe"
> [2]=>
> string(3) "Doe"
> ["RESUME"]=>
> string(14) "Master Degree."
> [3]=>
> string(14) "Master Degree."
> ["SALARY"]=>
> string(4) "2200"
> [4]=>
> string(4) "2200"
> }
> ・
> ・
> ・
> array(10) {
> ["ORGID"]=>
> string(1) "2"
> [0]=>
> string(1) "2"
> ["FIRSTNAME"]=>
> string(4) "Mary"
> [1]=>
> string(4) "Mary"
> ["LASTNAME"]=>
> string(5) "Major"
> [2]=>
> string(5) "Major"
> ["RESUME"]=>
> string(16) "Bachelor Degree."
> [3]=>
> string(16) "Bachelor Degree."
> ["SALARY"]=>
> string(4) "1200"
> [4]=>
> string(4) "1200"
> }
> array Count : 6
> rowCount : 0
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)