Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38462

SAKAI_CONFIG_ITEM hibernate creation fails with utf8mb4 db

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.1
    • Fix Version/s: 12.0
    • Component/s: Kernel
    • Labels:
    • Previous Issue Keys:
      KNL-1484

      Description

      SAKAI_CONFIG_ITEM added in KNL-1063 is confusingly created twice, once by Hibernate:

      kernel/api/src/main/java/org/sakaiproject/config/api/HibernateConfigItem.hbm.xml

      and once with SQL ddl:

      kernel/kernel-impl/src/main/sql/mysql/sakai_config_item.sql

      On mysql databases with default character set utf8mb4, the Hibernate creations (which seems to run first) fails:

      java.sql.SQLSyntaxErrorException: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

      The SQL attempted is:

      create table SAKAI_CONFIG_ITEM
      (ID bigint not null auto_increment,
      NODE varchar(255),
      NAME varchar(255) not null,
      VALUE varchar(4000),
      RAW_VALUE varchar(4000),
      TYPE varchar(255) not null,
      DEFAULT_VALUE varchar(4000),
      DESCRIPTION varchar(4000),
      SOURCE varchar(255),
      DEFAULTED bit not null,
      REGISTERED bit not null,
      SECURED bit not null,
      DYNAMIC bit not null,
      CREATED datetime not null,
      MODIFIED datetime not null,
      POLL_ON datetime,
      primary key (ID)) ENGINE=InnoDB;

      To fix this, it looks like the hbm.xml should be adjusted, although it seems there are some complications around this which the DDL SQL was presumably intended to avoid. It's sufficient to reduce the length of 4000 for these 4 fields to something a little smaller, e.g. 3500.

      Although in the Sakai 11 conversion script, these are defined as LONGTEXT.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  k1team KERNEL TEAM (Inactive)
                  Reporter:
                  smarquard Stephen Marquard
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration