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

SQL Server doesn't escape all LIKE wildcard characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.9.7, 3.10.4
    • 3.9.6, 3.10.3, 3.11, 4.0
    • Database SQL/XMLDB
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • Hide

      Confirm the following test passes on all 4 supported DBs (Postgres, MySQL, SQL Server, Oracle):

      $ vendor/bin/phpunit --filter test_sql_like_escape
      

      Show
      Confirm the following test passes on all 4 supported DBs (Postgres, MySQL, SQL Server, Oracle): $ vendor/bin/phpunit --filter test_sql_like_escape

      In my case, it was square brackets [ ] - there may be others we want to escape too

      https://www.w3schools.com/sql/sql_wildcards.asp

      Worth checking other DML drivers to make sure they are all correct

            pholden Paul Holden
            pholden Paul Holden
            David Carrillo David Carrillo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 41 minutes
                1h 41m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.