Grokbase Groups PHP php-cvs May 2009
FAQ
mbeccati Thu May 7 23:29:55 2009 UTC

Modified files: (Branch: PHP_5_3)
/php-src/ext/pdo_sqlite sqlite_statement.c
/php-src NEWS
Log:
MFH
- Fixed bug #48185 removing no-op code


http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite_statement.c?r1=1.18.2.4.2.3.2.6&r2=1.18.2.4.2.3.2.7&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite_statement.c
diff -u php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.3.2.6 php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.3.2.7
--- php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.3.2.6 Wed Apr 1 14:35:24 2009
+++ php-src/ext/pdo_sqlite/sqlite_statement.c Thu May 7 23:29:54 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: sqlite_statement.c,v 1.18.2.4.2.3.2.6 2009/04/01 14:35:24 indeyets Exp $ */
+/* $Id: sqlite_statement.c,v 1.18.2.4.2.3.2.7 2009/05/07 23:29:54 mbeccati Exp $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -265,11 +265,6 @@
case SQLITE3_TEXT:
*ptr = (char*)sqlite3_column_text(S->stmt, colno);
*len = sqlite3_column_bytes(S->stmt, colno);
- if (*len) {
- /* sqlite3.h says "the NUL terminator is included in the byte count
- * for TEXT values" */
- *len--;
- }
return 1;

default:
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.590&r2=1.2027.2.547.2.965.2.591&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.590 php-src/NEWS:1.2027.2.547.2.965.2.591
--- php-src/NEWS:1.2027.2.547.2.965.2.590 Thu May 7 16:56:18 2009
+++ php-src/NEWS Thu May 7 23:29:54 2009
@@ -33,6 +33,8 @@
- Added ability to throw exceptions from SQLite3 instead of warnings. (Scott)
- Added startup notices for deprecated ini settings. (Kalle)

+- Fixed bug #48185 (warning: value computed is not used in
+ pdo_sqlite_stmt_get_col line 271). (Matteo)
- Fixed bug #48087 (call_user_method() invalid free of arguments). (Felipe)
- Fixed bug #48060 (pdo_pgsql - large objects are returned as empty). (Matteo)
- Fixed bug #48034 (PHP crashes when script is 8192 (8KB) bytes long). (Dmitry)

Search Discussions

  • Antony Dovgal at May 8, 2009 at 8:17 am

    On 08.05.2009 03:29, Matteo Beccati wrote:
    #ifdef HAVE_CONFIG_H
    #include "config.h"
    @@ -265,11 +265,6 @@
    case SQLITE3_TEXT:
    *ptr = (char*)sqlite3_column_text(S->stmt, colno);
    *len = sqlite3_column_bytes(S->stmt, colno);
    - if (*len) {
    - /* sqlite3.h says "the NUL terminator is included in the byte count
    - * for TEXT values" */
    - *len--;
    - }
    return 1;
    It doesn't look like no-op to me, but it's not clear what's being decremented.
    I'd say it should do (*len)-- if the comment in sqlite3.h is correct.

    --
    Wbr,
    Antony Dovgal
  • Matteo Beccati at May 8, 2009 at 8:35 am

    Antony Dovgal ha scritto:
    On 08.05.2009 03:29, Matteo Beccati wrote:
    #ifdef HAVE_CONFIG_H
    #include "config.h"
    @@ -265,11 +265,6 @@
    case SQLITE3_TEXT:
    *ptr = (char*)sqlite3_column_text(S->stmt, colno);
    *len = sqlite3_column_bytes(S->stmt, colno);
    - if (*len) {
    - /* sqlite3.h says "the NUL terminator is included in the byte count
    - * for TEXT values" */
    - *len--;
    - }
    return 1;
    It doesn't look like no-op to me, but it's not clear what's being decremented.
    I'd say it should do (*len)-- if the comment in sqlite3.h is correct.
    By "no-op" I meant that it's not doing anything in a broader context,
    i.e. it's not decreasing the length integer used by the caller function.

    I've been pointed to the compiler warning (see bug topic of
    http://bugs.php.net/bug.php?id=48185) and propery fixed it. When I ran
    the test suite lots of test cases were failing because the output was
    truncated.

    I think that this by itself is the proof that sqlite3_column_bytes() is
    not including the NULL terminator. To be sure I've also checked
    sqlite3.h and couldn't find any reference to that behaviour.

    The comment is wrong and the code is not doing what the comment tells,
    so I thought that a clean up was required, both for consistency and to
    fix the compiler warning.


    Cheers
    --
    M.
  • Antony Dovgal at May 8, 2009 at 8:52 am
    Ok, so it's not a no-op, but a wrong fix for a non-existing problem.
    On 08.05.2009 12:35, Matteo Beccati wrote:
    By "no-op" I meant that it's not doing anything in a broader context,
    i.e. it's not decreasing the length integer used by the caller function.

    I've been pointed to the compiler warning (see bug topic of
    http://bugs.php.net/bug.php?id=48185) and propery fixed it. When I ran
    the test suite lots of test cases were failing because the output was
    truncated.

    I think that this by itself is the proof that sqlite3_column_bytes() is
    not including the NULL terminator. To be sure I've also checked
    sqlite3.h and couldn't find any reference to that behaviour.

    The comment is wrong and the code is not doing what the comment tells,
    so I thought that a clean up was required, both for consistency and to
    fix the compiler warning.


    Cheers
    --
    M.

    --
    Wbr,
    Antony Dovgal

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedMay 7, '09 at 11:30p
activeMay 8, '09 at 8:52a
posts4
users3
websitephp.net

People

Translate

site design / logo © 2019 Grokbase