Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-557

cubrid_lob2_seek64 example does not work properly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PHP 9.1.0 0004
    • Component/s: PHP Driver
    • Labels:
      None
    • Environment:

      CUBRID 9.1

      Description

      http://www.php.net/manual/en/function.cubrid-lob2-seek64.php

      In the above page, the example has one error:
      "$data = $cubrid_lob2_read($lob, 20);"
      should be
      "$data = cubrid_lob2_read($lob, 20);"

      and it uses cubrid_lob2_seek even though the page mentions cubrid_lob2_seek64.

      If I put cubrid_lob2_seek then no error occurs, but if I use cubrid_lob2_seek64, then the error:

      {code}
      Warning: cubrid_lob2_seek64(): offset(20101029056306120215) may be a negative number or out of range, please check the offset you give. in C:\Users\user\Desktop\PHP Driver Tests\cubrid_lob2_
      n line 10

      Call Stack:
      0.0005 331856 1. {main}() C:\Users\user\Desktop\PHP Driver Tests\cubrid_lob2_seek.php:0
      0.0512 334104 2. cubrid_lob2_seek64() C:\Users\user\Desktop\PHP Driver Tests\cubrid_lob2_seek.php:10{code}

      is obtained.

        Activity

        Hide
        cn15800 谢韦华[Bert] added a comment -

        It's mean the offset is invalid, Did the length of data lager than 20101029056306120215? If not, the except will be throw.

        Show
        cn15800 谢韦华[Bert] added a comment - It's mean the offset is invalid, Did the length of data lager than 20101029056306120215? If not, the except will be throw.
        Hide
        cn15800 谢韦华[Bert] added a comment -

        1 "$data = $cubrid_lob2_read($lob, 20);" ----〉 this is bug,we will fixed it

        2 it uses cubrid_lob2_seek even though the page mentions cubrid_lob2_seek64. --------> this is bug,we will fixed it

        Show
        cn15800 谢韦华[Bert] added a comment - 1 "$data = $cubrid_lob2_read($lob, 20);" ----〉 this is bug,we will fixed it 2 it uses cubrid_lob2_seek even though the page mentions cubrid_lob2_seek64. --------> this is bug,we will fixed it
        Hide
        ovidiu.veliscu Veliscu Ovidiu added a comment - - edited

        The lob entry I entered was very small (about 15 characters). The warning itself is confusing. It does say that is out of range, but because it says first that it could be a negative number and the user knows it is not, it will be difficult to understand to out of range error.

        Warning: cubrid_lob2_seek64(): offset(20101029056306120215) may be a negative number or out of range, please check the offset you give. in

        should be split in 2: If offset is negative, then display:
        Warning: cubrid_lob2_seek64(): offset(-1) must not be a negative number, so please check the offset you give.

        If offset is out of range:
        Warning: cubrid_lob2_seek64(): offset(20101029056306120215) is out of range for the lob field you have chosen, so please check the offset you give and the lob length. in C:\Users\user\Desktop\PHP Driver Tests\cubrid_lob2_
        n line 10

        Show
        ovidiu.veliscu Veliscu Ovidiu added a comment - - edited The lob entry I entered was very small (about 15 characters). The warning itself is confusing. It does say that is out of range, but because it says first that it could be a negative number and the user knows it is not, it will be difficult to understand to out of range error. Warning: cubrid_lob2_seek64(): offset(20101029056306120215) may be a negative number or out of range, please check the offset you give. in should be split in 2: If offset is negative, then display: Warning: cubrid_lob2_seek64(): offset(-1) must not be a negative number, so please check the offset you give. If offset is out of range: Warning: cubrid_lob2_seek64(): offset(20101029056306120215) is out of range for the lob field you have chosen, so please check the offset you give and the lob length. in C:\Users\user\Desktop\PHP Driver Tests\cubrid_lob2_ n line 10
        Hide
        cn15800 谢韦华[Bert] added a comment -

        Ok, we will modify the warning message.

        Show
        cn15800 谢韦华[Bert] added a comment - Ok, we will modify the warning message.
        Hide
        cn15800 谢韦华[Bert] added a comment -

        negative number:

        Warning: cubrid_lob2_seek64(): offset(-10) must not be a negative number, so please check the offset you give. in /mnt/hgfs/share/nginx_clent/script/apis557.php on line 10

        overbound:
        Warning: cubrid_lob2_seek64(): offset(10) is out of range for the lob field you have chosen, so please check the offset you give and the lob length. in /mnt/hgfs/share/nginx_clent/script/apis557.php on line 10

        Show
        cn15800 谢韦华[Bert] added a comment - negative number: Warning: cubrid_lob2_seek64(): offset(-10) must not be a negative number, so please check the offset you give. in /mnt/hgfs/share/nginx_clent/script/apis557.php on line 10 overbound: Warning: cubrid_lob2_seek64(): offset(10) is out of range for the lob field you have chosen, so please check the offset you give and the lob length. in /mnt/hgfs/share/nginx_clent/script/apis557.php on line 10
        Hide
        ryin005 Ray Yin added a comment -

        Added a unit test case for cubrid_lob2_seek64

        [php@NC-PL-QA011 tests]$ svn ci --username ray -m "[APIS-557] Added a unit test case for cubrid_lob2_seek64"
        Adding         tests/cubrid_lob2_seek64.phpt
        Transmitting file data ..........
        Committed revision 1981.
        

        Case Url: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests/cubrid_lob2_seek64.phpt

        Show
        ryin005 Ray Yin added a comment - Added a unit test case for cubrid_lob2_seek64 [php@NC-PL-QA011 tests]$ svn ci --username ray -m "[APIS-557] Added a unit test case for cubrid_lob2_seek64" Adding tests/cubrid_lob2_seek64.phpt Transmitting file data .......... Committed revision 1981. Case Url: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests/cubrid_lob2_seek64.phpt
        Hide
        ryin005 Ray Yin added a comment -

        Test OS: Linux 64, Windows 32
        CUBRID Server: CUBRID 9.1 (9.1.0.0212)
        PHP Version: PHP 5.4.15
        CUBRID-PHP: 9.1.0.0004 svn: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/
        Test Tool: PHP Tester (PHPT)

        Test Result: Pass

        Show
        ryin005 Ray Yin added a comment - Test OS: Linux 64, Windows 32 CUBRID Server: CUBRID 9.1 (9.1.0.0212) PHP Version: PHP 5.4.15 CUBRID-PHP: 9.1.0.0004 svn: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/ Test Tool: PHP Tester (PHPT) Test Result: Pass

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ovidiu.veliscu Veliscu Ovidiu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: