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

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Database SQL/XMLDB
    • None
    • MOODLE_20_STABLE
    • 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

            skodak Petr Skoda
            stronk7 Eloy Lafuente (stronk7)
            Petr Skoda Petr Skoda
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10