mysql ddl contains:

      VERSION varchar(56) NOT NULL,

      However, per definition, Maven versions can be up to 100 characters long (in hsql, ist VARCHAR(256) btw).

      Since we encode branch names in our version, we break that 56 character boundry.

      This column should conform to Maven rules for versions.

          [JENKINS-56246] VERSION Column on Mysql is too small

          I initially tried 256 chars and faced a limitation with MySQL indexes. I forgot it this limitation was specific to a version of flavor of MySQL.
          Which flavor and version of MySQL do you use?

          Cyrille Le Clerc added a comment - I initially tried 256 chars and faced a limitation with MySQL indexes. I forgot it this limitation was specific to a version of flavor of MySQL. Which flavor and version of MySQL do you use?

          I am using a MariaDB 10.1.29. However, this should be quite independent of the version. Even with 4 byte UTF characters, a column size of 100 is well within the limit (767 bytes) and would still allow all valid Maven versions.

          Also, we could even allow bigger versions (afaik the 100 chars is not in the specification, but only a de facto limit) by limiting the index to the first 100 characters (https://dev.mysql.com/doc/refman/8.0/en/create-index.html#create-index-column-prefixes)

           

          Stephan Pauxberger added a comment - I am using a MariaDB 10.1.29. However, this should be quite independent of the version. Even with 4 byte UTF characters, a column size of 100 is well within the limit (767 bytes) and would still allow all valid Maven versions. Also, we could even allow bigger versions (afaik the 100 chars is not in the specification, but only a de facto limit) by limiting the index to the first 100 characters ( https://dev.mysql.com/doc/refman/8.0/en/create-index.html#create-index-column-prefixes)  

          Thanks pauxus

           

          From what I remember, the problem is the index "IDX_MAVEN_ARTIFACT". The solution is probably to remove the "TYPE" column from the index to get more chars for the VERSION column

           

          CREATE TABLE MAVEN_ARTIFACT
          (
            GROUP_ID varchar(256) NOT NULL,
            ARTIFACT_ID varchar(256) NOT NULL,
            VERSION varchar(56) NOT NULL,
            TYPE varchar(64) NOT NULL,
            ID integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
            CLASSIFIER varchar(256) DEFAULT NULL
          );
          CREATE INDEX IDX_MAVEN_ARTIFACT on MAVEN_ARTIFACT (GROUP_ID, ARTIFACT_ID, VERSION, TYPE); 

          Cyrille Le Clerc added a comment - Thanks pauxus   From what I remember, the problem is the index "IDX_MAVEN_ARTIFACT". The solution is probably to remove the "TYPE" column from the index to get more chars for the VERSION column   CREATE TABLE MAVEN_ARTIFACT ( GROUP_ID varchar (256) NOT NULL , ARTIFACT_ID varchar (256) NOT NULL , VERSION varchar (56) NOT NULL , TYPE varchar (64) NOT NULL , ID integer AUTO_INCREMENT PRIMARY KEY NOT NULL , CLASSIFIER varchar (256) DEFAULT NULL ); CREATE INDEX IDX_MAVEN_ARTIFACT on MAVEN_ARTIFACT (GROUP_ID, ARTIFACT_ID, VERSION, TYPE );

          > However, per definition, Maven versions can be up to 100 characters long (in hsql, ist VARCHAR(256) btw).

          pauxus can you please educate me on where you found this "definition"? I was not aware that such specification was existing. It would help me to verify the assumptions I made on the DB model.

          Cyrille Le Clerc added a comment - > However, per definition, Maven versions can be up to 100 characters long (in hsql, ist VARCHAR(256) btw). pauxus  can you please educate me on where you found this "definition"? I was not aware that such specification was existing. It would help me to verify the assumptions I made on the DB model.

          Neither was I, but I got an Exception citing exactly this limit. Therefore a clipped my branch names - with a quick check, however, I was not able to reproduce the issue nor to find the source of the exception. Unfortunately, I did not copy the stacktrace, so it might also have been a plugin, but the message clearly stated that Maven versions must not be longer than 100 characters. I will keep looking.

          Stephan Pauxberger added a comment - Neither was I, but I got an Exception citing exactly this limit. Therefore a clipped my branch names - with a quick check, however, I was not able to reproduce the issue nor to find the source of the exception. Unfortunately, I did not copy the stacktrace, so it might also have been a plugin, but the message clearly stated that Maven versions must not be longer than 100 characters. I will keep looking.

          I have successfully tested the following fix on "MySQL 8.0.13" and on "MySQL 5.6.10 / Amazon Aurora 1.17.7"

          ALTER TABLE MAVEN_ARTIFACT MODIFY COLUMN VERSION varchar(100);
          UPDATE VERSION SET VERSION = 12;
          

          I am investigating, I think that I tried a while ago on a version of MySQL that didn't support such a long index IDX_MAVEN_ARTIFACT based on (GROUP_ID, ARTIFACT_ID, VERSION, TYPE)

          Cyrille Le Clerc added a comment - I have successfully tested the following fix on "MySQL 8.0.13" and on "MySQL 5.6.10 / Amazon Aurora 1.17.7" ALTER TABLE MAVEN_ARTIFACT MODIFY COLUMN VERSION varchar (100); UPDATE VERSION SET VERSION = 12; I am investigating, I think that I tried a while ago on a version of MySQL that didn't support such a long index IDX_MAVEN_ARTIFACT based on (GROUP_ID, ARTIFACT_ID, VERSION, TYPE)

          Fixed in pipeline-maven-3.6.8-beta-1 , pauxus can you please test?

          Release and release notes:
          https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.6.8-beta-1

          Cyrille Le Clerc added a comment - Fixed in pipeline-maven-3.6.8-beta-1 , pauxus can you please test? Release and release notes: https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.6.8-beta-1

          fixed in 3.6.8

          Cyrille Le Clerc added a comment - fixed in 3.6.8

          Thanks and sorry for not answering, last weeks were pretty full...

          Stephan Pauxberger added a comment - Thanks and sorry for not answering, last weeks were pretty full...

            cleclerc Cyrille Le Clerc
            pauxus Stephan Pauxberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: