From issues-return-82003-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Thu Nov 15 05:37:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4DAFD18066B for ; Thu, 15 Nov 2018 05:37:05 +0100 (CET) Received: (qmail 3936 invoked by uid 500); 15 Nov 2018 04:37:04 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 3927 invoked by uid 99); 15 Nov 2018 04:37:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2018 04:37:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CAF06180D08 for ; Thu, 15 Nov 2018 04:37:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.801 X-Spam-Level: X-Spam-Status: No, score=-109.801 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xcM87jYWEysI for ; Thu, 15 Nov 2018 04:37:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1FBCF61AF6 for ; Thu, 15 Nov 2018 04:37:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A5F22E0F4C for ; Thu, 15 Nov 2018 04:37:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3668026733 for ; Thu, 15 Nov 2018 04:37:00 +0000 (UTC) Date: Thu, 15 Nov 2018 04:37:00 +0000 (UTC) From: "Roman Shtykh (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IGNITE-10265) PDOStatement::rowCount returns 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-10265?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Roman Shtykh updated IGNITE-10265: ---------------------------------- Description:=20 How to reproduce: {{ $ cat ~/odbc.php setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); =20 $sql =3D 'SELECT * FROM "Person".Person'; $statement =3D $dbh->prepare($sql); $statement->execute(); =20 $data =3D $statement->fetchAll(); =20 foreach($data as $row) { var_dump($row); } =20 echo "array Count : " . count($data) . "\n"; echo "rowCount : " . $statement->rowCount() . "\n"; =20 } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "\n"; die(); } =20 $ php ~/odbc.php =20 # Using PDO array(10) { ["ORGID"]=3D> string(1) "1" [0]=3D> string(1) "1" ["FIRSTNAME"]=3D> string(4) "John" [1]=3D> string(4) "John" ["LASTNAME"]=3D> string(3) "Doe" [2]=3D> string(3) "Doe" ["RESUME"]=3D> string(14) "Master Degree." [3]=3D> string(14) "Master Degree." ["SALARY"]=3D> string(4) "2200" [4]=3D> string(4) "2200" } =E3=83=BB =E3=83=BB =E3=83=BB array(10) { ["ORGID"]=3D> string(1) "2" [0]=3D> string(1) "2" ["FIRSTNAME"]=3D> string(4) "Mary" [1]=3D> string(4) "Mary" ["LASTNAME"]=3D> string(5) "Major" [2]=3D> string(5) "Major" ["RESUME"]=3D> string(16) "Bachelor Degree." [3]=3D> string(16) "Bachelor Degree." ["SALARY"]=3D> string(4) "1200" [4]=3D> string(4) "1200" } array Count : 6 rowCount : 0 }} was: How to reproduce: {{$ cat ~/odbc.php}} {{setAttribute(PDO::ATTR_ERRMODE, PDO= ::ERRMODE_EXCEPTION);}} =C2=A0 {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{$sql}} {{=3D }}{{'SELECT * FROM "Person".Pers= on'}}{{;}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{$statement}} {{=3D }}{{$dbh}}{{->prepare(}}{{= $sql}}{{);}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{$statement}}{{->execute();}} =C2=A0 {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{$data}} {{=3D }}{{$statement}}{{->fetchAll();= }} =C2=A0 {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{foreach}}{{(}}{{$data}} {{as}} {{$row}}{{) {}= } {{=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}}{{var_dump(}}{{$row}}{{= );}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{}}} =C2=A0 {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{echo}} {{"array Count : "}} {{. }}{{count}}{{= (}}{{$data}}{{) . }}{{"\n"}}{{;}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{echo}} {{"rowCount : "}} {{. }}{{$statement}}= {{->rowCount() . }}{{"\n"}}{{;}} =C2=A0 {{} }}{{catch}} {{(PDOException }}{{$e}}{{) {}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{print}} {{"Error!: "}} {{. }}{{$e}}{{->getMes= sage() . }}{{"\n"}}{{;}} {{=C2=A0=C2=A0=C2=A0=C2=A0}}{{die}}{{();}} {{}}} =C2=A0 {{$ php ~/odbc.php}} =C2=A0 {{# Using PDO}} {{array}}{{(10) {}} {{=C2=A0=C2=A0}}{{[}}{{"ORGID"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(1) }}{{"1"}} {{=C2=A0=C2=A0}}{{[0]=3D>}} {{=C2=A0=C2=A0}}{{string(1) }}{{"1"}} {{=C2=A0=C2=A0}}{{[}}{{"FIRSTNAME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"John"}} {{=C2=A0=C2=A0}}{{[1]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"John"}} {{=C2=A0=C2=A0}}{{[}}{{"LASTNAME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(3) }}{{"Doe"}} {{=C2=A0=C2=A0}}{{[2]=3D>}} {{=C2=A0=C2=A0}}{{string(3) }}{{"Doe"}} {{=C2=A0=C2=A0}}{{[}}{{"RESUME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(14) }}{{"Master Degree."}} {{=C2=A0=C2=A0}}{{[3]=3D>}} {{=C2=A0=C2=A0}}{{string(14) }}{{"Master Degree."}} {{=C2=A0=C2=A0}}{{[}}{{"SALARY"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"2200"}} {{=C2=A0=C2=A0}}{{[4]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"2200"}} {{}}} {{=E3=83=BB}} {{=E3=83=BB}} {{=E3=83=BB}} {{array}}{{(10) {}} {{=C2=A0=C2=A0}}{{[}}{{"ORGID"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(1) }}{{"2"}} {{=C2=A0=C2=A0}}{{[0]=3D>}} {{=C2=A0=C2=A0}}{{string(1) }}{{"2"}} {{=C2=A0=C2=A0}}{{[}}{{"FIRSTNAME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"Mary"}} {{=C2=A0=C2=A0}}{{[1]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"Mary"}} {{=C2=A0=C2=A0}}{{[}}{{"LASTNAME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(5) }}{{"Major"}} {{=C2=A0=C2=A0}}{{[2]=3D>}} {{=C2=A0=C2=A0}}{{string(5) }}{{"Major"}} {{=C2=A0=C2=A0}}{{[}}{{"RESUME"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(16) }}{{"Bachelor Degree."}} {{=C2=A0=C2=A0}}{{[3]=3D>}} {{=C2=A0=C2=A0}}{{string(16) }}{{"Bachelor Degree."}} {{=C2=A0=C2=A0}}{{[}}{{"SALARY"}}{{]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"1200"}} {{=C2=A0=C2=A0}}{{[4]=3D>}} {{=C2=A0=C2=A0}}{{string(4) }}{{"1200"}} {{}}} {{array}} {{Count}} {{: 6}} {{rowCount : 0}} =C2=A0 > 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: > {{ > $ cat ~/odbc.php > =20 > try { > echo PHP_EOL,PHP_EOL,"# Using PDO",PHP_EOL; > $dbh =3D new PDO('odbc:DRIVER=3D{ApacheIgnite};Server=3D127.0.0.1;POR= T=3D10800'); > $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); > =20 > $sql =3D 'SELECT * FROM "Person".Person'; > $statement =3D $dbh->prepare($sql); > $statement->execute(); > =20 > $data =3D $statement->fetchAll(); > =20 > foreach($data as $row) { > var_dump($row); > } > =20 > echo "array Count : " . count($data) . "\n"; > echo "rowCount : " . $statement->rowCount() . "\n"; > =20 > } catch (PDOException $e) { > print "Error!: " . $e->getMessage() . "\n"; > die(); > } > =20 > $ php ~/odbc.php > =20 > # Using PDO > array(10) { > ["ORGID"]=3D> > string(1) "1" > [0]=3D> > string(1) "1" > ["FIRSTNAME"]=3D> > string(4) "John" > [1]=3D> > string(4) "John" > ["LASTNAME"]=3D> > string(3) "Doe" > [2]=3D> > string(3) "Doe" > ["RESUME"]=3D> > string(14) "Master Degree." > [3]=3D> > string(14) "Master Degree." > ["SALARY"]=3D> > string(4) "2200" > [4]=3D> > string(4) "2200" > } > =E3=83=BB > =E3=83=BB > =E3=83=BB > array(10) { > ["ORGID"]=3D> > string(1) "2" > [0]=3D> > string(1) "2" > ["FIRSTNAME"]=3D> > string(4) "Mary" > [1]=3D> > string(4) "Mary" > ["LASTNAME"]=3D> > string(5) "Major" > [2]=3D> > string(5) "Major" > ["RESUME"]=3D> > string(16) "Bachelor Degree." > [3]=3D> > string(16) "Bachelor Degree." > ["SALARY"]=3D> > string(4) "1200" > [4]=3D> > string(4) "1200" > } > array Count : 6 > rowCount : 0 > }} -- This message was sent by Atlassian JIRA (v7.6.3#76005)