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

Error in mssql_n adodb driver when the string to insert begins with single quotes...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8, 1.9
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Database:
      Microsoft SQL
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      The parser built into the mssql_n driver has one bug, causing the "N" char not being positioned at the beginning of the resulting string, so, for example, the string:

      '''hello' (3 single quotes + hello + 1 single quote)

      is being converted to:

      ''N'hello' (2 single quotes + N + 1 single quote + hello + 1 single quote)

      that breaks the SQL execution: it should be:

      N'''hello' (N + 3 single quotes + hello + 1 single quote)

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody
            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:
              11/Oct/07