Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14679 META: DB layer 2.0
  3. MDL-16669

Make sql_substr() to accept parameters instead of simply returning function name

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Until Moodle 2.0, the sql_substr() helper function (dmllib), is used without parameters at simply returns the "substring" function used for each DB.

      Change this behaviour so it will look like:

      $DB->sql_substr(string, from, len)

      with len being optional.

      • Implement it in new moodle_databases.
      • Document it.
      • Look for wrong usages in core.
      • Add some tests, with and without len.

      Ciao

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Petr Skoda
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

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