? ? ? Pending

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
15 Feb 2017

Pull Request for Issue #13262 (comment)

Summary of Changes

MSSQL cut query string on NULL byte.
There not exists any escape sequence like \\\0 to escape NULL byte.

This PR use function CHAR(0) and concatenation to workaround it.

"... 'text\0suffix' ..." will be replace to
"... 'text' + CHAR(0) + 'suffix' ..."

Testing Instructions

Be sure that you have enabled plugin Smart Search - Categories.
Go to Smart Search component and click Index button:

before patch you should see error:
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Unclosed quotation mark after the character string 'O:19:"FinderIndexerResult":19:{s:11:"'.

after patch you should see:
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert the value NULL into column 'term_id', table 'joomla.dbo.#__finder_tokens_aggregate'; column does not allow nulls. INSERT fails.

Expected result

Query is valid but database table row has wrong value (unrelated issue).

Actual result

Query is corrupted.

Documentation Changes Required

None

avatar csthomas csthomas - open - 15 Feb 2017
avatar csthomas csthomas - change - 15 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
Category MS SQL Libraries
avatar csthomas csthomas - change - 15 Feb 2017
Labels Added: ?
avatar csthomas csthomas - edited - 15 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
Category MS SQL Libraries MS SQL Libraries Unit Tests
avatar waader waader - test_item - 19 Feb 2017 - Tested successfully
avatar waader
waader - comment - 19 Feb 2017

I have tested this item successfully on 853ee0b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14077.

avatar alikon alikon - test_item - 21 Feb 2017 - Tested successfully
avatar alikon
alikon - comment - 21 Feb 2017

I have tested this item successfully on 853ee0b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14077.

avatar zero-24 zero-24 - change - 21 Feb 2017
Title
Escape NULL byte in mssql driver
Escape NULL byte in quoted string on mssql driver
avatar zero-24 zero-24 - edited - 21 Feb 2017
avatar zero-24 zero-24 - change - 21 Feb 2017
Milestone Added:
Status Pending Ready to Commit
Labels Added: ?
avatar wilsonge wilsonge - change - 22 Feb 2017
Title
Escape NULL byte in quoted string on mssql driver
Escape NULL byte in mssql driver
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-02-22 10:41:19
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 22 Feb 2017
avatar wilsonge wilsonge - merge - 22 Feb 2017

Add a Comment

Login with GitHub to post a comment