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

[PHP][8.4.4]There is no error_code and error_msg when the cubrid_connect() failed

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: PHP 8.4.4
    • Fix Version/s: PHP 8.4.4.0001
    • Component/s: PHP Driver
    • Labels:
      None
    • Environment:
      • OS: Linux 64bit
      • CUBRID: 8.4.4.0227
      • PHP: 5.5.0
      • Driver: cubrid-php 8.4.4.0001 (20130821)

      Description

      • Brief: the error_code always be 0 and error_msg always be
      • Test Code {code}
        // invalid user
        $conn1 = cubrid_connect('localhost', '33367', 'demodb', 'invalid_user', '');
        if($conn1 == false){
        print cubrid_error_code()." ".cubrid_error_msg();
        }

        // invalid db
        $conn2 = cubrid_connect('localhost', '33367', 'invalid_db', 'dba', '');
        if($conn2 == false){
        print cubrid_error_code()." ".cubrid_error_msg();
        }

        // invalid password
        $conn2 = cubrid_connect('localhost', '33367', 'demodb', 'dba', '222');
        if($conn2 == false){
        print cubrid_error_code()." ".cubrid_error_msg();
        }
        {code}

      Expected Result:

      -165 User "invalid_user" is invalid.
      -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost]
      -171 Incorrect or missing password.
      

      Actual Result:

      0 Unknown DBMS error
      0 Unknown DBMS error
      0 Unknown DBMS error
      

        Activity

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

        after modify:

        -165 User "invalid_user" is invalid.[CAS INFO - 127.0.0.1:33000, 0, 0].
        -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost[CAS INFO - 127.0.0.1:33000, 0, 0].
        -171 Incorrect or missing password.[CAS INFO - 127.0.0.1:33000, 0, 0].

        Show
        cn15800 谢韦华[Bert] added a comment - after modify: -165 User "invalid_user" is invalid. [CAS INFO - 127.0.0.1:33000, 0, 0] . -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost [CAS INFO - 127.0.0.1:33000, 0, 0] . -171 Incorrect or missing password. [CAS INFO - 127.0.0.1:33000, 0, 0] .
        Hide
        ryin005 Ray Yin added a comment - - edited

        The error message is not accurate (host value) for error code 677

        $conn1 = cubrid_connect('localhost', '33000', 'invalid_db', 'dba', '');
        if($conn1 == false){
        	 print cubrid_error_code()." ".cubrid_error_msg();
        }
        
        $conn2 = cubrid_connect('xx.xx.xx.xx', '33000', 'invalid_db', 'dba', '');
        if($conn2 == false){
        	 print cubrid_error_code()." ".cubrid_error_msg();
        }
        

        Expected Result:
        -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost[CAS INFO - 127.0.0.1:33000, 0, 0].
        -677 Failed to connect to database server, 'invalid_db', on the following host(s): xx.xx.xx.xx:xx.xx.xx.xx[CAS INFO - xx.xx.xx.xx:33000, 0, 0].

        Actual Result:
        -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost[CAS INFO - 127.0.0.1:33000, 0, 0].
        -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost[CAS INFO - 127.0.0.1:33000, 0, 0].

        Reopen the issue

        Show
        ryin005 Ray Yin added a comment - - edited The error message is not accurate (host value) for error code 677 $conn1 = cubrid_connect('localhost', '33000', 'invalid_db', 'dba', ''); if($conn1 == false){ print cubrid_error_code()." ".cubrid_error_msg(); } $conn2 = cubrid_connect('xx.xx.xx.xx', '33000', 'invalid_db', 'dba', ''); if($conn2 == false){ print cubrid_error_code()." ".cubrid_error_msg(); } Expected Result: -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost [CAS INFO - 127.0.0.1:33000, 0, 0] . -677 Failed to connect to database server, 'invalid_db', on the following host(s): xx.xx.xx.xx:xx.xx.xx.xx [CAS INFO - xx.xx.xx.xx:33000, 0, 0] . Actual Result: -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost [CAS INFO - 127.0.0.1:33000, 0, 0] . -677 Failed to connect to database server, 'invalid_db', on the following host(s): localhost:localhost [CAS INFO - 127.0.0.1:33000, 0, 0] . Reopen the issue
        Hide
        cn15800 谢韦华[Bert] added a comment -

        All error messages are return by cci.

        and i test the issue in test enviroment: -16 Cannot connect to CUBRID CAS

        Show
        cn15800 谢韦华[Bert] added a comment - All error messages are return by cci. and i test the issue in test enviroment: -16 Cannot connect to CUBRID CAS

          People

          • Assignee:
            cn15800 谢韦华[Bert]
            Reporter:
            ryin005 Ray Yin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: