Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61410 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12918 invoked from network); 18 Jul 2012 15:48:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 15:48:15 -0000 Authentication-Results: pb1.pair.com header.from=jorton@redhat.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jorton@redhat.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain redhat.com designates 209.132.183.28 as permitted sender) X-PHP-List-Original-Sender: jorton@redhat.com X-Host-Fingerprint: 209.132.183.28 mx1.redhat.com Received: from [209.132.183.28] ([209.132.183.28:54117] helo=mx1.redhat.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/BF-39169-CBAD6005 for ; Wed, 18 Jul 2012 11:48:14 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IFm9Mk016662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Jul 2012 11:48:10 -0400 Received: from iberis.manyfish.co.uk (vpn-8-156.rdu.redhat.com [10.11.8.156]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6IFm8h0030554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Jul 2012 11:48:09 -0400 Received: from jorton by iberis.manyfish.co.uk with local (Exim 4.76) (envelope-from ) id 1SrWTv-0003d0-LQ; Wed, 18 Jul 2012 16:48:07 +0100 Date: Wed, 18 Jul 2012 16:48:07 +0100 To: internals@lists.php.net Cc: mosvald@redhat.com Message-ID: <20120718154807.GA13890@redhat.com> Mail-Followup-To: internals@lists.php.net, mosvald@redhat.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Organization: Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson (USA), Charlie Peters (USA) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Subject: [PATCH] pdo_odbc: fix pdo_odbc_error's use of SQLGetDiagRec() From: jorton@redhat.com (Joe Orton) --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline The "state" parameter passed to SQLGetDiagRec() needs to be six bytes not 5; the attached patch fixes this, from Martin Osvald. --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=diff diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 84a147b..ca2808c 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -114,7 +114,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, * diagnostic records (which can be generated by PRINT statements * in the query, for instance). */ while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - char discard_state[5]; + char discard_state[6]; char discard_buf[1024]; SQLINTEGER code; rc = SQLGetDiagRec(htype, eh, recno++, discard_state, &code, --yrj/dFKFPuw6o+aM--