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

[PHP]Connect will success when passing a error passwd to cubrid_pconnect() method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: PHP-8.4.1
    • Fix Version/s: PHP-8.4.1, PHP-Apricot
    • Component/s: PHP Driver
    • Labels:
      None

      Description

      Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
      OS: Linux 64
      Description:
      First:
      Connection succeeds using cubrid_pconnect method and passing five correct value to this method.
      Second:
      Passing a error passwd to cubrid_pconnect method, connection will success too.

      Repro steps:
      1. execute: php pconnectest1.phpt
      statements in pconnectest1.phpt

      $host = "localhost";
      $port = 33113;
      $db = "demodb";
      $user = "dba";
      $passwd = "";
      if (!($pconn1 = cubrid_pconnect($host, $port, $db, $user, $passwd))) {
          printf("[001] Can not connect to the server using host=%s, port=%s, user=%s, passwd=***\n", $host, $port, $user);
      }else{
          printf("[001]pconn values: %s \n",$pconn1);
      }
      
      $pconn4 = cubrid_pconnect($host, $port, $db,"dba","dioado");
      if (FALSE == $pconn4) {
          printf("[004]Expect: return value false, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
      }elseif(TRUE == $pconn4){
          printf("[004]No Expect: return value true, [%d] [%s]\n", cubrid_error_code(), cubrid_error_msg());
          printf("[004]pconn: %s\n",$pconn4);
      }else{
          printf("[004]no true and no fal
      

      Actual result:

      [001]pconn values: Resource id #4 
      [004]No Expect: return value true, [0] []
      [004]pconn: Resource id #5
      

      Expect result:
      Maybe connection will fail when passing a error passwd to cubrid_pconnect() method.

        Activity

        Hide
        hellohuizhang 张慧 added a comment -

        Commit rev: 491

        Show
        hellohuizhang 张慧 added a comment - Commit rev: 491
        Hide
        zoujing ZouJing added a comment -

        Test build : CUBRID 2008 R4.1 (8.4.1.1018)
        OS: Linux 64bit
        Test Result: PASS
        so i close it

        Show
        zoujing ZouJing added a comment - Test build : CUBRID 2008 R4.1 (8.4.1.1018) OS: Linux 64bit Test Result: PASS so i close it

          People

          • Assignee:
            zoujing ZouJing
            Reporter:
            zoujing ZouJing
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: