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

[PHP] timestamp tuple is not expected after insert into db

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: PHP-Aprium
    • Fix Version/s: None
    • Component/s: PHP Driver
    • Labels:
    • Environment:

      Linux 64

      Description

      [PHP] [PHP] timestamp tuple is not expected after insert into db

      Test case: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0/tests2/php/_13_cci_bugs/cubrid_bind_test2.phpt

      Test Build: 9.1.0.0206
      Test OS: linux 64
      php driver: 9.1.0.0001 Revision: 1617

      Test code

      {code}
      cubrid_execute($conn,"CREATE TABLE time2_tb(c1 int, c2 time, c3 date, c4 TIMESTAMP);");
      $req2 = cubrid_prepare($conn, "INSERT INTO time2_tb VALUES(1,?,?,?);");
      if(false == ($tmp=cubrid_bind($req2, 1, '25:22:60','time'))){
      printf("bind '25:22:60','time' failed \n");
      }else{
      printf("bind time success\n");
      }

      cubrid_bind($req2, 1, '02:22:59','time');
      cubrid_bind($req2, 2, '2012/03/02', 'date');
      cubrid_bind($req2, 3, '1977/08/14 1:36:10 pm', 'timestamp');
      cubrid_execute($req2);


      $req3= cubrid_execute($conn, "SELECT * FROM time2_tb");
      if($req3){
      $result = cubrid_fetch_assoc($req3);
      var_dump($result);
      cubrid_close_prepare($req3);
      }

      cubrid_disconnect($conn);
      print "Finished!\n";{code}

      Expected Result:

      bind time success
      array(4) {
        ["c1"]=>
        string(1) "1"
        ["c2"]=>
        string(8) "02:22:59"
        ["c3"]=>
        string(10) "2012-03-02"
        ["c4"]=>
        string(19) "1977-08-14 01:36:10 pm"
      }
      

      Acutal Result:

      bind time success
      array(4) {
        ["c1"]=>
        string(1) "1"
        ["c2"]=>
        string(8) "02:22:59"
        ["c3"]=>
        string(10) "2012-03-02"
        ["c4"]=>
        string(19) "1977-08-14 01:36:10"
      }
      Finished!
      

      According the document http://www.cubrid.org/manual/90/en/TIMESTAMP
      when inserting "1977-08-14 13:36:10", db should output as "1977-08-14 01:36:10 pm".
      I tried this case, actual ouput is "1977-08-14 13:36:10"

        Activity

        Hide
        jinhu 李金虎 added a comment -

        It's a CCI issue.
        After inserting "1977/08/14 1:36:10 PM" as timestamp, the query result is "1977-08-14 01:36:10".
        The test_bind_timestamp.c is the test case for CCI.

        To QA: Please register a issue for CCI. Thanks.

        Show
        jinhu 李金虎 added a comment - It's a CCI issue. After inserting "1977/08/14 1:36:10 PM" as timestamp, the query result is "1977-08-14 01:36:10". The test_bind_timestamp.c is the test case for CCI. To QA: Please register a issue for CCI. Thanks.
        Hide
        cn15800 谢韦华[Bert] added a comment -

        I have tested the issue with cci 8.4.4, it is not fixed.

        Show
        cn15800 谢韦华[Bert] added a comment - I have tested the issue with cci 8.4.4, it is not fixed.

          People

          • Assignee:
            jinhu 李金虎
            Reporter:
            cn14130 欧明宝[Bom Owen]
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: