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

[PHP Static] Cas error code is not expected in Windows

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: PHP-Aprium
    • Fix Version/s: PHP 9.1.0 0004
    • Component/s: PHP Driver
    • Environment:

      Windows 32 bit

      Description

      [PHP Static] Cas error code is not expected in Windows
      Test case: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests2/php/_03_close/pconnect_01.phpt

      Test Envrionment:

      PHP Driver:  http://10.34.64.219/2013-03-20/9.1.0/CUBRID-PHP5-5.3-WIN32-VC9-NTS-9.1.0.0001.bin.zip
      
      PHP Version: 5.3.13
      

      Test code:

      {code}
      $pconn8 = cubrid_pconnect($host, $port,$phpdb);
      if (FALSE == $pconn8) {
      printf("[008]Expect: return value false, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
      }elseif(TRUE == $pconn8){
      printf("[008]No Expect: return value true, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
      }else{
      printf("[008]no true and no false\n");
      }{code}

      Expected result:

      Warning: Error: CAS, -9001, Unknown error message in %s on line %d
      [008]Expect: return value false, [-9001] [Unknown error message]
      

      Acutal result:

      Warning: Error: CAS, -1, Unknown error message in D:\php_drivers\php\branches\RB-9.1.0_static_cci\tests2\php\_03_close\pconnect_01.php on line 63
      [008]Expect: return value false, [-1] [Unknown error message]
      

        Activity

        Hide
        cn15163 杨伟为[Astro] added a comment -

        Fixed.
        The error code now is -9001 instead of -1.

        Show
        cn15163 杨伟为[Astro] added a comment - Fixed. The error code now is -9001 instead of -1.
        Hide
        ryin005 Ray Yin added a comment - - edited

        Test OS: Linux 64, Win 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 Case: (the existing case) http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests2/php/_03_close/pconnect_01.phpt

        Test Code:

        {code}
        $pconn8 = cubrid_pconnect($host, $port,$phpdb);
        if (FALSE == $pconn8) {
        printf("[008]Expect: return value false, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
        }elseif(TRUE == $pconn8){
        printf("[008]No Expect: return value true, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
        }else{
        printf("[008]no true and no false\n");
        }{code}

        Expected Result

        Warning: Error: CAS, -9001, Unknown error message in %s on line %d
        [008]Expect: return value false, [-9001] [Unknown error message]
        

        Actual Result

        Warning: Error: CCI, -20030, Invalid url string in /home/php/cubrid_php/RB-9.1.0_static_cci/tests2/php/_03_close/pconnect_01.php on line 63
        [008]Expect: return value false, [-20030] [Invalid url string]
        Finished!
        

        Test Result: Failed

        Summary: it returns a CCI invalid url error but not a CAS error (ps: driver 9.1.0.0001 returns a CAS error properly)

        Reopen the issue

        Show
        ryin005 Ray Yin added a comment - - edited Test OS: Linux 64, Win 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 Case: (the existing case) http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests2/php/_03_close/pconnect_01.phpt Test Code: {code} $pconn8 = cubrid_pconnect($host, $port,$phpdb); if (FALSE == $pconn8) { printf(" [008] Expect: return value false, [%d] [%s] \n", cubrid_error_code(), cubrid_error_msg()); }elseif(TRUE == $pconn8){ printf(" [008] No Expect: return value true, [%d] [%s] \n", cubrid_error_code(), cubrid_error_msg()); }else{ printf(" [008] no true and no false\n"); }{code} Expected Result Warning: Error: CAS, -9001, Unknown error message in %s on line %d [008]Expect: return value false, [-9001] [Unknown error message] Actual Result Warning: Error: CCI, -20030, Invalid url string in /home/php/cubrid_php/RB-9.1.0_static_cci/tests2/php/_03_close/pconnect_01.php on line 63 [008]Expect: return value false, [-20030] [Invalid url string] Finished! Test Result: Failed Summary: it returns a CCI invalid url error but not a CAS error (ps: driver 9.1.0.0001 returns a CAS error properly) Reopen the issue
        Hide
        cn15163 杨伟为[Astro] added a comment -

        All the error codes are retured by cci. In version 9.1.0.0001 the cci connect to CAS and return the CAS error, in version 9.1.0.0004 the cci directly return the "Invalid url string" itself. so the cci may have changed it's logic. And i think the error message " CCI, -20030, Invalid url string" is better than "CAS, -9001, Unknown error message", we should keep it instead of change it.

        Show
        cn15163 杨伟为[Astro] added a comment - All the error codes are retured by cci. In version 9.1.0.0001 the cci connect to CAS and return the CAS error, in version 9.1.0.0004 the cci directly return the "Invalid url string" itself. so the cci may have changed it's logic. And i think the error message " CCI, -20030, Invalid url string" is better than "CAS, -9001, Unknown error message", we should keep it instead of change it.
        Hide
        ryin005 Ray Yin added a comment -

        Since all the error codes from 9.1.0.0004 are now returned by CCI, we should update the relevant documents such as http://www.cubrid.org/wiki_apis/entry/custom-error-codes-for-php-driver and http://www.cubrid.org/manual/91/en/api/php.html to let user know those updates.

        PS: There is a description in mysqli document http://www.php.net/manual/zh/mysqli-stmt.errno.php, which tells user where the mysqli error code and messages are stored
        Client error message numbers are listed in the MySQL errmsg.h header file, server error message numbers are listed in mysqld_error.h. In the MySQL source distribution you can find a complete list of error messages and error numbers in the file Docs/mysqld_error.txt

        We may need to add a similar desription to cubrid php documents in php.net to let user know where the cubrid-php drivers error code and messages could be found

        Show
        ryin005 Ray Yin added a comment - Since all the error codes from 9.1.0.0004 are now returned by CCI, we should update the relevant documents such as http://www.cubrid.org/wiki_apis/entry/custom-error-codes-for-php-driver and http://www.cubrid.org/manual/91/en/api/php.html to let user know those updates. PS: There is a description in mysqli document http://www.php.net/manual/zh/mysqli-stmt.errno.php , which tells user where the mysqli error code and messages are stored Client error message numbers are listed in the MySQL errmsg.h header file, server error message numbers are listed in mysqld_error.h. In the MySQL source distribution you can find a complete list of error messages and error numbers in the file Docs/mysqld_error.txt We may need to add a similar desription to cubrid php documents in php.net to let user know where the cubrid-php drivers error code and messages could be found
        Hide
        kadishmal Esen Sagynov added a comment -

        Another place to search for CAS errors is at http://www.cubrid.org/wiki_tutorials/entry/cubrid-error-codes. However, this page is not always up to date. So, the CCI source code is of course the best place for a complete list of errors.

        Show
        kadishmal Esen Sagynov added a comment - Another place to search for CAS errors is at http://www.cubrid.org/wiki_tutorials/entry/cubrid-error-codes . However, this page is not always up to date. So, the CCI source code is of course the best place for a complete list of errors.

          People

          • Assignee:
            cn15163 杨伟为[Astro]
            Reporter:
            cn14130 欧明宝[Bom Owen]
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: