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

Fix use of ORDER BY id in the messaging system

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.3, 2.7
    • Fix Version/s: 2.6.5, 2.7.2
    • Component/s: Messages
    • Labels:
    • Story Points:
      20
    • Sprint:
      BACKEND Sprint 14

      Description

      TO PEER REVIEWER

      There are two diffs to review here, please comment on which you think is the better solution; or if you think neither of them are.

      Mark's: https://github.com/markn86/moodle/compare/master...MDL-45594_master
      Tim's: https://github.com/markn86/moodle/compare/master...MDL-45594_master_alt


      See MDL-35453.

      Problem lines of code:

      message
        lib.php (3 matches)
          715: SELECT mr1.useridto AS userid, MAX(mr1.id) AS mid
          721: SELECT mr2.useridfrom AS userid, MAX(mr2.id) AS mid
          732:  ORDER BY mr.id DESC"; 
          741: SELECT m1.useridto AS userid, MAX(m1.id) AS mid
          747: SELECT m2.useridfrom AS userid, MAX(m2.id) AS mid
          758:  ORDER BY m.id DESC"; 
          799:  ORDER BY mr.id DESC";//ordering by id should give the same result as ordering by timecreated but will be faster 
      

        Attachments

        1. message_creation.php
          3 kB
          Mark Nelson
        2. recent_conversation_query.php
          1 kB
          Mark Nelson

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Dan Poltawski
              Integrator:
              Dan Poltawski
              Tester:
              Michael de Raadt
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Sep/14