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

Overflow problems on pgsql driver with tests using PHP_INT_MAX

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Unit tests
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      // test 2 tables with aliases and limits with order bys (limit which is out of range)
      $records = $DB->get_records_sql($sql, null, 21098765432109876543210, 2); // Skip all courses
      $this->assertEqual(0, count($records));

      // test 2 tables with aliases and limits with order bys (limit which is out of range)
      $records = $DB->get_records_sql($sql, null, 21098765432109876543210, 21098765432109876543210); // Skip all courses
      $this->assertEqual(0, count($records));

      these tests are wrong, you can not type large numbers like this in PHP.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            skodak Petr Skoda added a comment -

            While diagnosing this I have discovered a problem in pg driver, the "from + limit" < "max int".

            Show
            skodak Petr Skoda added a comment - While diagnosing this I have discovered a problem in pg driver, the "from + limit" < "max int".
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            I've created MDL-26922 about the same (overflow) problem happening under mssql and sqlsrv drivers. Working / testing it tomorrow.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - I've created MDL-26922 about the same (overflow) problem happening under mssql and sqlsrv drivers. Working / testing it tomorrow. Ciao
            Hide
            tsala Helen Foster added a comment -

            Thanks Petr

            Show
            tsala Helen Foster added a comment - Thanks Petr

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/May/11