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

prefix_user.{firstname,lastname} have incorrect size in Postgres

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.3, 1.6.4, 1.7
    • Fix Version/s: 1.8
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Environment:
      Any supported version of Postgres.
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      The Posrgres database schema for prefix_user.firstname and prefix_user.lastname specifies VARCHAR(20) for this two fields, whereas the MySQL schema specifies VARCHAR(100). Then, in fuction truncate_userinfo() in moodlelib.php the $limit array uses a max size of 100 for these two fields.

      When a user with a firstname or lastname longer than 20 chars (say 35) tries to log in for the first time, the user account is not created, as truncate_userinfo() says the lenght is ok, but postgres barfs saying the data is too long for the field.

      So we need to:

      a) increase the field size en lib/db/postgres.sql

      b) add code to lib/db/postgres.php and/or lib/db/upgrade.php to resize the field on upgrades.

      By the way, this is present in 1.6.x, 1.7.x and HEAD. I don't know fi MS-SQL and Oracle have this problem too, as I haven't looked at it.

      Saludos. Iñaki.

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            iarenaza Iñaki Arenaza
            Tester:
            Nobody
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              31/Mar/07