Last modified: 2014-09-24 11:03:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 71207 - MS SQL Driver doesn't handle escaping for LIKE patterns correctly
MS SQL Driver doesn't handle escaping for LIKE patterns correctly
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: mssql
  Show dependency treegraph
Reported: 2014-09-23 23:10 UTC by Emad Elwany
Modified: 2014-09-24 11:03 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Emad Elwany 2014-09-23 23:10:49 UTC
MS SQL requires specifying the escape character in the query using the ESCAPE directive. The way it is currently handled leads to incorrect escaping, for example, simpleSearch doesn't work since the backend query contains something like:

"...page_title LIKE '%foo\_bar'%..." which works for most DB's, but MS SQL requires:
"...page_title LIKE '%foo\_bar'% ESCAPE '\'..."

This is breaking various functions around the code base that expect LIKE queries to work correctly.
Comment 1 Gerrit Notification Bot 2014-09-23 23:34:29 UTC
Change 162508 had a related patch set uploaded by Emadelwany:
Add ESCAPE identifier to MS SQL LIKE queries so that the escaping would work as expected.

Note You need to log in before you can comment on or make changes to this bug.