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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8, 1.9
    • 1.8.3, 1.9
    • Database SQL/XMLDB
    • None
    • Microsoft SQL
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • 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

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Nobody Nobody
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Oct/07