Roman Shtykh created IGNITE-10265:
-------------------------------------

             Summary: 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


How to reproduce:
{quote}{{$ 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}}{quote}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to