Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67216

core\dml\table suffix can cause field aliases to be too long for some DBs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 3.7.3, 3.8.1
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Labels:
      None

      Description

      We have a class, core\dml\table which is heavily used in Forum and which we should look to use elsewhere too.

      However there is a case, particularly on Oracle, where the maximum length of a field name or alias is 31 characters.

      The class combines a provided prefix with the field name, which can lead to field names which are too long. For example a prefix of example combined with a value of thisisareallylongfieldname will lead to examplethisisareallylongfieldname which is 34 characters long and will cause a fail in Oracle.

      We therefore need to detect this case and shorten the name accordingly. This will also require a uniqueness check.

      See MDL-66360 as an example.

        Attachments

          Activity

            People

            Assignee:
            dobedobedoh Andrew Nicols
            Reporter:
            dobedobedoh Andrew Nicols
            Peer reviewer:
            Jun Pataleta
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 20 minutes
                2h 20m