Moodle
  1. Moodle
  2. MDL-26844

Overflow problems on pgsql driver with tests using PHP_INT_MAX

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical 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
    • Rank:
      16815

      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.

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

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

          Show
          Petr Škoda added a comment - While diagnosing this I have discovered a problem in pg driver, the "from + limit" < "max int".
          Hide
          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
          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
          Helen Foster added a comment -

          Thanks Petr

          Show
          Helen Foster added a comment - Thanks Petr

            People

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

              Dates

              • Created:
                Updated:
                Resolved: