Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-8180

Error when creating Cache_RA_HTTPServer table with MySQL

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.0RC5, 4.0.8, 4.1.0
    • 4.0RC3
    • None
    • None
    • 4.1 RC2

      Unable to execute SQL: 'CREATE TABLE Cache_RA_HTTPServer ( Unique_Id VARCHAR(255) NOT NULL, Site VARCHAR(255) NOT NULL, Request_Date TIMESTAMP NOT NULL, Method VARCHAR(255) NOT NULL, Path_Hash VARCHAR(255) NOT NULL, Path TEXT NOT NULL, Query_String TEXT NOT NULL, Ori_Status_Code CHAR(3) NOT NULL, Ret_Status_Code CHAR(3) NOT NULL, Cache_Hit TINYINT(1) NOT NULL, Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, Processed TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (Unique_Id) ) ENGINE=InnoDB' at line 33
      Location:	org.ametys.core.script.SQLScriptHelper._execute(SQLScriptHelper.java:403)
      Thrown:
      java.sql.SQLException: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
      

      problem in jdbc_cache_mon.sql

      version of MySQL : mysql Ver 14.14 Distrib 5.5.19, for Win64 (x86)

          [CMS-8180] Error when creating Cache_RA_HTTPServer table with MySQL

          We should use DateTime since it is exactly the same for our use
          https://www.codeproject.com/Tips/1215635/MySQL-DATETIME-vs-TIMESTAMP

          In my memories, the choice of Timestamp was made to save storage

          Raphaël Franchet added a comment - We should use DateTime since it is exactly the same for our use https://www.codeproject.com/Tips/1215635/MySQL-DATETIME-vs-TIMESTAMP In my memories, the choice of Timestamp was made to save storage

          Created_At TIMESTAMP NOT NULL DEFAULT 0,

          -> (modification by CMS-7715)

          Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

          -> (modification by first try of CMS-8180)

          Created_At TIMESTAMP NOT NULL,

          Apparently, there is still something wrong

          Simon Prieul (Inactive) added a comment - Created_At TIMESTAMP NOT NULL DEFAULT 0, -> (modification by CMS-7715 ) Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -> (modification by first try of CMS-8180 ) Created_At TIMESTAMP NOT NULL, Apparently, there is still something wrong

          The code you removed is required for mysql 5.5+

          Raphaël Franchet added a comment - The code you removed is required for mysql 5.5+

          see also CMS-7715

          Simon Prieul (Inactive) added a comment - see also CMS-7715

            sprieul Simon Prieul (Inactive)
            sprieul Simon Prieul (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: