Moodle
  1. Moodle
  2. MDL-17863

mnet_host.portno field unable to hold port number higher than 255 in mysql (making https impossible)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3, 2.0
    • Fix Version/s: 1.9.8, 2.0
    • Component/s: MNet
    • Labels:
      None
    • Environment:
      Ubuntu 8.04.1
      mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486)
      PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:44:49)
    • Database:
      MySQL
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      31598

      Description

      Integration BTW Moodle 1.9.3+ (2007101533.01) and Mahara 1.0.8 works fine with https & postgresql, but https & mysql is broken. The reason appears to be that neither app is able to store port 443 in mysql.

      Database install.xml version 20081010 says:

      <FIELD NAME="portno" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="transport" NEXT="last_connect_time"/>

      I recommend LENGTH="10" instead.

      This is also affecting Mahara downstream; see Mahara bug #3097 ( http://eduforge.org/tracker/?func=detail&atid=739&aid=3097&group_id=176 ).

      ...I was testing this to be sure this was sufficient to fix the problem, but I ended up taking a guess and setting 443 manually after setting up the integration, and it still didn't work. I just gave up and will use postgresql instead.

      1. mnet-host-portno-column-size-increase-1.9.patch
        3 kB
        Nigel McNie
      2. mnet-host-portno-column-size-increase-2.0.patch
        3 kB
        Nigel McNie
      3. portno.patch
        3 kB
        Nigel McNie

        Issue Links

          Activity

          Hide
          Nigel McNie added a comment -

          I should be able to provide a patch for this, I've just fixed the Mahara side.

          Show
          Nigel McNie added a comment - I should be able to provide a patch for this, I've just fixed the Mahara side.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Assigning to Nigel and addressing to 1.9.4. I guess LENGTH=5 will be enough, isn't it?

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Assigning to Nigel and addressing to 1.9.4. I guess LENGTH=5 will be enough, isn't it? Ciao
          Hide
          Nigel McNie added a comment -

          Thanks Eloy. Assuming LENGTH=5 produces a column big enough to hold 64K on all databases, that should be ok.

          Show
          Nigel McNie added a comment - Thanks Eloy. Assuming LENGTH=5 produces a column big enough to hold 64K on all databases, that should be ok.
          Hide
          Martin Dougiamas added a comment -

          +1 for 1.9.4 (and HEAD of course)! I think it's no problem to alter that field to change the length ... it's not as dangerous as adding / removing fields.

          Show
          Martin Dougiamas added a comment - +1 for 1.9.4 (and HEAD of course)! I think it's no problem to alter that field to change the length ... it's not as dangerous as adding / removing fields.
          Hide
          Nigel McNie added a comment -

          Patch attached, hopefully I've done everything the Moodle Way(tm).

          Show
          Nigel McNie added a comment - Patch attached, hopefully I've done everything the Moodle Way(tm).
          Hide
          Eloy Lafuente (stronk7) added a comment -

          +1 too.

          just you'll have to use actual last digit increment instead of the one present in the patch. And don't forget HEAD, a good exercise to learn the the Moodle 2.0 Way (tm too, of course)

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - +1 too. just you'll have to use actual last digit increment instead of the one present in the patch. And don't forget HEAD, a good exercise to learn the the Moodle 2.0 Way (tm too, of course) TIA and ciao
          Hide
          Nigel McNie added a comment -

          Attached are two patches - one for 1.9_STABLE and one for cvshead. Version bumps should be correct as of today (though note I'm patching against the git mirror).

          I have tested them both on postgres (8.1 for 1.9_STABLE and 8.3 for head).

          Show
          Nigel McNie added a comment - Attached are two patches - one for 1.9_STABLE and one for cvshead. Version bumps should be correct as of today (though note I'm patching against the git mirror). I have tested them both on postgres (8.1 for 1.9_STABLE and 8.3 for head).
          Hide
          Penny Leach added a comment -

          everyone ok with me committing these? i'll rebase on top of the tips (changing version numbers)

          Show
          Penny Leach added a comment - everyone ok with me committing these? i'll rebase on top of the tips (changing version numbers)
          Hide
          Penny Leach added a comment -

          committed to head & stable. Thanks Nigel!

          Show
          Penny Leach added a comment - committed to head & stable. Thanks Nigel!
          Hide
          Andrew Davis added a comment -

          Fix looks good. Upgrade worked as expected using MySQL 5.1.37-1ubuntu5

          Show
          Andrew Davis added a comment - Fix looks good. Upgrade worked as expected using MySQL 5.1.37-1ubuntu5

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: