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

Incorrect data type for grade_high column

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
      None
    • Environment:
      Linux

      Description

      Postgres 7.3.4

      ERROR: overflow on numeric ABS(value) >= 10^2 for field with precision 4 scale 2

      UPDATE mdl_grade_letter SET letter = 'CHD', grade_high = '100', grade_low = '85.00' WHERE id = '9'

      Unable to set grade_high to 100

        Gliffy Diagrams

          Activity

          Hide
          dougiamas Martin Dougiamas added a comment -

          From (penny at catalyst.net.nz) Monday, 12 December 2005, 10:59 AM:

          weird, this works fine for me and I can clearly see that grade_high is

          numeric(6,2)

          Can you please paste the output of \d mdl_grade_letter here?

          From Michael Deane (mdeane at hightoncomputersolutions.com) Monday, 12 December 2005, 04:49 PM:

          id int4 No No

          courseid int4 No No

          letter varchar(8) No No

          grade_high numeric(4,2) No No

          grade_low numeric(4,2) No No

          From Yu Zhang (yu at moodle.com) Friday, 28 April 2006, 02:00 PM:

          Giving this back to Penny..

          Show
          dougiamas Martin Dougiamas added a comment - From (penny at catalyst.net.nz) Monday, 12 December 2005, 10:59 AM: weird, this works fine for me and I can clearly see that grade_high is numeric(6,2) Can you please paste the output of \d mdl_grade_letter here? From Michael Deane (mdeane at hightoncomputersolutions.com) Monday, 12 December 2005, 04:49 PM: id int4 No No courseid int4 No No letter varchar(8) No No grade_high numeric(4,2) No No grade_low numeric(4,2) No No From Yu Zhang (yu at moodle.com) Friday, 28 April 2006, 02:00 PM: Giving this back to Penny..
          Hide
          jgraham Jeff Graham added a comment -

          Incorrect datatype caused some problems with specific versions of MySQL as well. Used to be decimal(4,2) but is incorrect SQL specification. Old versions of MySQL were not strict on this SQL requirement.

          This is reported for postgres, but as Penny mentions the datatype is extended to decimal(6,2) see lib/db/postgres7.sql, and decimal(5,2) for mysql.

          This was fixed a while ago, but not sure which version. The initial bug report might be from an early adopter while this version of gradebook was still in contrib. (gradebook_cdc)

          Show
          jgraham Jeff Graham added a comment - Incorrect datatype caused some problems with specific versions of MySQL as well. Used to be decimal(4,2) but is incorrect SQL specification. Old versions of MySQL were not strict on this SQL requirement. This is reported for postgres, but as Penny mentions the datatype is extended to decimal(6,2) see lib/db/postgres7.sql, and decimal(5,2) for mysql. This was fixed a while ago, but not sure which version. The initial bug report might be from an early adopter while this version of gradebook was still in contrib. (gradebook_cdc)
          Hide
          mblake Michael Blake added a comment -

          Assigning to JG as he resolved this bug.

          Show
          mblake Michael Blake added a comment - Assigning to JG as he resolved this bug.
          Hide
          mblake Michael Blake added a comment -

          Jeff, Use the resolution code "fixed" only when code is changed. In this instance I'd have used "not a bug" (although I realise it's not totally appropriate here).

          If no futher testing is required on this bug, please change status to "closed".

          Show
          mblake Michael Blake added a comment - Jeff, Use the resolution code "fixed" only when code is changed. In this instance I'd have used "not a bug" (although I realise it's not totally appropriate here). If no futher testing is required on this bug, please change status to "closed".

            People

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

              Dates

              • Created:
                Updated:
                Resolved: