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

detect invalid values when converting signed integers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.2
    • 2.3, 2.4
    • Database SQL/XMLDB
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE
    • w33_MDL-34782_m24_mysqlunsigned
    • 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

      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.

            skodak Petr Skoda
            skodak Petr Skoda
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.