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

[PHP] Create table failed when using default timestamp '2038-01-19 12:14:07'

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: PHP-Apricot
    • Fix Version/s: PHP 9.1.0 0004
    • Component/s: PHP Driver
    • Labels:

      Description

      [PHP] Create table failed when using default timestamp '2038-01-19 12:14:07'

      Case Path: php/_04_field_flags/flags_01.phpt

      Test verion:

      Cubrid: CUBRID 9.0 (9.0.0.0478)
      PHP Driver: 
      http://svn.cubrid.org/cubridapis/php/branches/RB-9.0.0 Revision: 917
      

      codes:

       cubrid_execute($conn,"CREATE TABLE flag1_tb(c1 string primary key , c2 char(20) not null , c3 int unique key auto_increment, c4 double default 22.22, c5 time default TIME '
          23:59:59', c6 date, c7 TIMESTAMP default TIMESTAMP  '2038-01-19 12:14:07',c8 bit, c9 numeric(13,4));");
      

      result:

      Warning: Error: DBMS, -494, Semantic: before ' ,c8 bit, c9 numeric(13,4));'
      Invalid utime: '2038-01-19 12:14:07'.  in /home/php/phptestcases/php/php/_04_field_flags/flags_01.php on line 6
      
      1. flags_01.php
        2 kB
        欧明宝[Bom Owen]

        Activity

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

        This is not a bug of Php dirver. The cci function cci_prepare_and_execute returns -20001 for the sql statement

        "CREATE TABLE flag1_tb(c1 string primary key , c2 char(20) not null , c3 int unique key auto_increment, c4 double default 22.22, c5 time default TIME '
            23:59:59', c6 date, c7 TIMESTAMP default TIMESTAMP  '2038-01-19 12:14:07',c8 bit, c9 numeric(13,4));"
        

        If we change default timestamp to a smaller value, for example to '2018-01-19 12:14:07', everythins work fine. So please make a test of CCI functions.

        Show
        cn15163 杨伟为[Astro] added a comment - This is not a bug of Php dirver. The cci function cci_prepare_and_execute returns -20001 for the sql statement "CREATE TABLE flag1_tb(c1 string primary key , c2 char(20) not null , c3 int unique key auto_increment, c4 double default 22.22, c5 time default TIME ' 23:59:59', c6 date, c7 TIMESTAMP default TIMESTAMP '2038-01-19 12:14:07',c8 bit, c9 numeric(13,4));" If we change default timestamp to a smaller value, for example to '2018-01-19 12:14:07', everythins work fine. So please make a test of CCI functions.
        Hide
        kadishmal Esen Sagynov added a comment -

        Remember not to close this issue even if it's CCI's issue. When CCI issue is resolved, only then close this issue.

        Show
        kadishmal Esen Sagynov added a comment - Remember not to close this issue even if it's CCI's issue. When CCI issue is resolved, only then close this issue.
        Hide
        kadishmal Esen Sagynov added a comment -

        According to http://www.cubrid.org/wiki_tutorials/entry/cubrid-rdbms-size-limits, the maximum allowed value of TIMESTAMP column is 2038-01-19 03:14:07 (GMT). The value you're trying to set is bigger 2038-01-19 12:14:07: 03 hours vs. 12 hours. So, I suppose this is not a bug but a spec.

        If this is a spec, the question is what kind of error message is displayed when bigger value is inserted? If there is no message, we need to report to CCI team to fix and return correct message. Let me know what message is given for error code 20001.

        Show
        kadishmal Esen Sagynov added a comment - According to http://www.cubrid.org/wiki_tutorials/entry/cubrid-rdbms-size-limits , the maximum allowed value of TIMESTAMP column is 2038-01-19 03:14:07 (GMT) . The value you're trying to set is bigger 2038-01-19 12:14:07 : 03 hours vs. 12 hours. So, I suppose this is not a bug but a spec. If this is a spec, the question is what kind of error message is displayed when bigger value is inserted? If there is no message, we need to report to CCI team to fix and return correct message. Let me know what message is given for error code 20001.
        Hide
        cn15163 杨伟为[Astro] added a comment -

        The error message is :

        Warning: Error: DBMS, -494, Semantic: before ' ,c8 bit, c9 numeric(13,4));' Invalid utime: '2038-01-19 12:14:07'.
        
        Show
        cn15163 杨伟为[Astro] added a comment - The error message is : Warning: Error: DBMS, -494, Semantic: before ' ,c8 bit, c9 numeric(13,4));' Invalid utime: '2038-01-19 12:14:07'.
        Hide
        kadishmal Esen Sagynov added a comment -

        The error message is correct. I think this issue can be closed.

        Show
        kadishmal Esen Sagynov added a comment - The error message is correct. I think this issue can be closed.
        Hide
        ryin005 Ray Yin added a comment - - edited

        The max/min value of TIMESTAMP allowed is depended on the "World Time Standard" (i.e. GMT or KST) of your running server, based on the introduction on http://www.cubrid.org/manual/91/en/sql/datatype.html#date-time-types, the min TIMESTAMP is: GMT 1970-01-01 00:00:01 or KST 1970-01-01 09:00:01 ; the max TIMESTAMP is : GMT 2038-01-19 03:14:07 or KST 2038-01-19 12:14:07

        Show
        ryin005 Ray Yin added a comment - - edited The max/min value of TIMESTAMP allowed is depended on the "World Time Standard" (i.e. GMT or KST) of your running server, based on the introduction on http://www.cubrid.org/manual/91/en/sql/datatype.html#date-time-types , the min TIMESTAMP is: GMT 1970-01-01 00:00:01 or KST 1970-01-01 09:00:01 ; the max TIMESTAMP is : GMT 2038-01-19 03:14:07 or KST 2038-01-19 12:14:07
        Hide
        ryin005 Ray Yin added a comment - - edited

        Added a case to test valid default timestamp, overbound default timestamp and error messages based on the issue

        [php@NC-PL-QA011 _14_issues]$ svn ci --username ray -m "[APIS-358] Added a case to test the valid, overbound default timestamp value"
        Adding         _14_issues/bug_apis_358
        Adding         _14_issues/bug_apis_358/cases
        Adding         _14_issues/bug_apis_358/cases/bug_apis_358.phpt
        Adding         _14_issues/bug_apis_358/cases/bug_apis_358.sh
        Adding         _14_issues/bug_apis_358/cases/connect.inc
        Transmitting file data ...
        Committed revision 1979.
        

        URL: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests2/php/_14_issues/bug_apis_358/

        Show
        ryin005 Ray Yin added a comment - - edited Added a case to test valid default timestamp, overbound default timestamp and error messages based on the issue [php@NC-PL-QA011 _14_issues]$ svn ci --username ray -m "[APIS-358] Added a case to test the valid, overbound default timestamp value" Adding _14_issues/bug_apis_358 Adding _14_issues/bug_apis_358/cases Adding _14_issues/bug_apis_358/cases/bug_apis_358.phpt Adding _14_issues/bug_apis_358/cases/bug_apis_358.sh Adding _14_issues/bug_apis_358/cases/connect.inc Transmitting file data ... Committed revision 1979. URL: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests2/php/_14_issues/bug_apis_358/
        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 Result: Pass

        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 Result: Pass
        Hide
        ryin005 Ray Yin added a comment - - edited

        Notes: we should add KST max/min TIMESTAMP info to the document http://www.cubrid.org/wiki_tutorials/entry/cubrid-rdbms-size-limits, currently the info only avaliable on the 9.1.0 document http://www.cubrid.org/manual/91/en/sql/datatype.html#date-time-types

        Show
        ryin005 Ray Yin added a comment - - edited Notes: we should add KST max/min TIMESTAMP info to the document http://www.cubrid.org/wiki_tutorials/entry/cubrid-rdbms-size-limits , currently the info only avaliable on the 9.1.0 document http://www.cubrid.org/manual/91/en/sql/datatype.html#date-time-types

          People

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

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2 days
              2d
              Remaining:
              Remaining Estimate - 2 days
              2d
              Logged:
              Time Spent - Not Specified
              Not Specified