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

detect invalid values when converting signed integers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.3.2
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Testing Instructions:
      Hide

      1/ install 22 on mysql
      2/ inject some oversized unsigned value to some table
      3/ upgrade to 23
      4/ expected error complaining about invalid ranges
      5/ fix the value manually
      6/ finish upgrade without problems

      Show
      1/ install 22 on mysql 2/ inject some oversized unsigned value to some table 3/ upgrade to 23 4/ expected error complaining about invalid ranges 5/ fix the value manually 6/ finish upgrade without problems
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w33_MDL-34782_m24_mysqlunsigned

      Description

      the problem is that moodle XMLDB editor specifies integer sizes in digits - that is size 3 means max 999. Unfortunately some developers ignore the allowed ranges completely which results in data loss during upgrade code in MDL-27982

      Solution is to detect the invalid values over the unsigned max and stop immediately during upgrade.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Ankit Agarwal
              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:
                Resolved:
                Fix Release Date:
                10/Sep/12