Professional Web Applications Themes

#45652 [NEW]: Empty string replaced with blank character - PHP Bugs

From: dsauneuf at guillemot dot fr Operating system: Windows PHP version: 5.2.6 PHP Bug Type: MSSQL related Bug description: Empty string replaced with blank character Description: ------------ Empty string turned into a blank character. ----------- Running a php site under windows 2003 / IIS / ntwdblib.dll (2000.80.2039.0) to access an SQL server 2000 database. Same thing under Windows XP / IIS / ntwdblib.dll. Works fine under fedora / apache / freetds. Denis Reproduce code: --------------- $sql=" select '' "; $res_id=mssql_query($sql)or die ("Database Error"); $row=mssql_fetch_row($res_id); echo strlen($row[0]); Expected result: ---------------- Should return 0. Actual result: -------------- Returns 1. -- Edit bug ...

  1. #1

    Default #45652 [NEW]: Empty string replaced with blank character

    From: dsauneuf at guillemot dot fr
    Operating system: Windows
    PHP version: 5.2.6
    PHP Bug Type: MSSQL related
    Bug description: Empty string replaced with blank character

    Description:
    ------------
    Empty string turned into a blank character.

    -----------
    Running a php site under windows 2003 / IIS / ntwdblib.dll
    (2000.80.2039.0) to access an SQL server 2000 database.
    Same thing under Windows XP / IIS / ntwdblib.dll.
    Works fine under fedora / apache / freetds.

    Denis



    Reproduce code:
    ---------------
    $sql=" select '' ";
    $res_id=mssql_query($sql)or die ("Database Error");
    $row=mssql_fetch_row($res_id);
    echo strlen($row[0]);


    Expected result:
    ----------------
    Should return 0.

    Actual result:
    --------------
    Returns 1.

    --
    Edit bug report at http://bugs.php.net/?id=45652&edit=1
    --
    Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45652&r=trysnapshot52
    Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45652&r=trysnapshot53
    Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45652&r=trysnapshot60
    Fixed in CVS: http://bugs.php.net/fix.php?id=45652&r=fixedcvs
    Fixed in release: http://bugs.php.net/fix.php?id=45652&r=alreadyfixed
    Need backtrace: http://bugs.php.net/fix.php?id=45652&r=needtrace
    Need Reproduce Script: http://bugs.php.net/fix.php?id=45652&r=needscript
    Try newer version: http://bugs.php.net/fix.php?id=45652&r=oldversion
    Not developer issue: http://bugs.php.net/fix.php?id=45652&r=support
    Expected behavior: http://bugs.php.net/fix.php?id=45652&r=notwrong
    Not enough info: http://bugs.php.net/fix.php?id=45652&r=notenoughinfo
    Submitted twice: http://bugs.php.net/fix.php?id=45652&r=submittedtwice
    register_globals: http://bugs.php.net/fix.php?id=45652&r=globals
    PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45652&r=php4
    Daylight Savings: http://bugs.php.net/fix.php?id=45652&r=dst
    IIS Stability: http://bugs.php.net/fix.php?id=45652&r=isapi
    Install GNU Sed: http://bugs.php.net/fix.php?id=45652&r=gnused
    Floating point limitations: http://bugs.php.net/fix.php?id=45652&r=float
    No Zend Extensions: http://bugs.php.net/fix.php?id=45652&r=nozend
    MySQL Configuration Error: http://bugs.php.net/fix.php?id=45652&r=mysqlcfg

    dsauneuf Guest

  2. #2

    Default #45652 [Opn->Bgs]: Empty string replaced with blank character

    ID: 45652
    Updated by: net
    Reported By: dsauneuf at guillemot dot fr
    -Status: Open
    +Status: Bogus
    Bug Type: MSSQL related
    Operating System: Windows
    PHP Version: 5.2.6
    New Comment:

    Please do not submit the same bug more than once. An existing
    bug report already describes this very problem. Even if you feel
    that your issue is somewhat different, the resolution is likely
    to be the same.

    Thank you for your interest in PHP.

    This has been submitted *many* times already, and it is also expected
    behavior. It's simply how MSSQL works.


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-07-29 10:43:39] dsauneuf at guillemot dot fr

    Description:
    ------------
    Empty string turned into a blank character.

    -----------
    Running a php site under windows 2003 / IIS / ntwdblib.dll
    (2000.80.2039.0) to access an SQL server 2000 database.
    Same thing under Windows XP / IIS / ntwdblib.dll.
    Works fine under fedora / apache / freetds.

    Denis



    Reproduce code:
    ---------------
    $sql=" select '' ";
    $res_id=mssql_query($sql)or die ("Database Error");
    $row=mssql_fetch_row($res_id);
    echo strlen($row[0]);


    Expected result:
    ----------------
    Should return 0.

    Actual result:
    --------------
    Returns 1.


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=45652&edit=1

    derick@php.net Guest

  3. #3

    Default #45652 [Bgs]: Empty string replaced with blank character

    ID: 45652
    User updated by: dsauneuf at guillemot dot fr
    Reported By: dsauneuf at guillemot dot fr
    Status: Bogus
    Bug Type: MSSQL related
    Operating System: Windows
    PHP Version: 5.2.6
    New Comment:

    As I told you it is working fine under fedora / apache / freetds, and
    this is running with the SAME mssql database.
    If you are compting the number of character in an empty string, the
    result cannot be something different than 0, as it is the definition of
    the empty string ! So the result is wrong. Now, it can have something to
    see with either php.ini or the api ntwdblib.dll, or even the way the API
    is used by PHP, but it cannot be the expected behavior. It is not how
    MSSQL works either.

    If this has been submitted *many* times already, can you please provide
    me with the resolution brought to those case ?


    Previous Comments:
    ------------------------------------------------------------------------

    [2008-07-29 10:50:10] net

    Please do not submit the same bug more than once. An existing
    bug report already describes this very problem. Even if you feel
    that your issue is somewhat different, the resolution is likely
    to be the same.

    Thank you for your interest in PHP.

    This has been submitted *many* times already, and it is also expected
    behavior. It\'s simply how MSSQL works.

    ------------------------------------------------------------------------

    [2008-07-29 10:43:39] dsauneuf at guillemot dot fr

    Description:
    ------------
    Empty string turned into a blank character.

    -----------
    Running a php site under windows 2003 / IIS / ntwdblib.dll
    (2000.80.2039.0) to access an SQL server 2000 database.
    Same thing under Windows XP / IIS / ntwdblib.dll.
    Works fine under fedora / apache / freetds.

    Denis



    Reproduce code:
    ---------------
    $sql=" select '' ";
    $res_id=mssql_query($sql)or die ("Database Error");
    $row=mssql_fetch_row($res_id);
    echo strlen($row[0]);


    Expected result:
    ----------------
    Should return 0.

    Actual result:
    --------------
    Returns 1.


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=45652&edit=1

    dsauneuf Guest

Similar Threads

  1. RegExp that looks for a string and only replaced part of it...
    By Mark Hanford in forum PHP Development
    Replies: 1
    Last Post: July 29th, 04:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139