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

Upgrade to 1.9.7+ fails on MS SQL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Database SQL/XMLDB, MNet
    • Labels:
      None
    • Database:
      Microsoft SQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      See http://moodle.org/mod/forum/discuss.php?d=146195 for full details.

      The recent MNet changes fail with an error like "Alter column ... failed because one or more objects references this column."

      I guess that is what happens when you try to alter a column used by an index.

      That could either be a bug in XMLDB, or someone writing upgrade code by hand that does something unsupported.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Crap,

            the field is original "smallint" in DB and we are trying to change it to "integer" (5).

            Problem is that Adodb's metadata returns exactly 5 as length for smallints, hence it coincides with the new lenght (5 too), so no change in length is detected. And that causes the underlying default constraint not being dropped (the reported dependency).

            Adding some more rules to detect length changes right now... stay tuned. Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Crap, the field is original "smallint" in DB and we are trying to change it to "integer" (5). Problem is that Adodb's metadata returns exactly 5 as length for smallints, hence it coincides with the new lenght (5 too), so no change in length is detected. And that causes the underlying default constraint not being dropped (the reported dependency). Adding some more rules to detect length changes right now... stay tuned. Ciao
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            This is fixed now, both in 19_STABLE and HEAD. Now some extra checks are performed under mssql to be able to detect changes in type better.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - This is fixed now, both in 19_STABLE and HEAD. Now some extra checks are performed under mssql to be able to detect changes in type better. Ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Mar/10