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

MSSQL/SQLSRV problems with TOP statements...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Current regexp present in mssql/sqlsrv drivers, used to apply for the TOP keyword when using limits in the query fails to match properly if there are multiple spaces (it matches only one space).

      Going to change it as fas as I got at least one case (in mod/data/view.php), leading to garbled SQL:

      SELECT TOP 10 DISTINCT ==> wrong

      and it should be:

      SELECT DISTINCT TOP 10 ==> correct

      Will add test for it too. Ciao

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stronk7 Eloy Lafuente (stronk7)
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Tester:
                Nobody
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10