Problem/Motivation

When we run the test with the field change to a BIG BLOB field the field get correctly changed to the right type. The problem is the existing field data get converted, only not completely in the right way. After each character SQL Server adds a NULL character. The string:

a:1:{s:6:"string";s:47:"This \n
 has \\ some backslash "*string action.\n";}

gets changed to:

a\x00:\x001\x00:\x00{\x00s\x00:\x006\x00:\x00"\x00s\x00t\x00r\x00i\x00n\x00g\x00"\x00;\x00s\x00:\x004\x007\x00:\x00"\x00T\x00h\x00i\x00s\x00 \x00\n
\x00 \x00h\x00a\x00s\x00 \x00\\x00\\x00 \x00s\x00o\x00m\x00e\x00 \x00b\x00a\x00c\x00k\x00s\x00l\x00a\x00s\x00h\x00 \x00"\x00*\x00s\x00t\x00r\x00i\x00n\x00g\x00 \x00a\x00c\x00t\x00i\x00o\x00n\x00.\x00\\x00n\x00"\x00;\x00}\x00

In the documentation for SQL Server, I found the following text:

Because Unicode data always uses an even number of bytes, use caution when you convert binary or varbinary to or from Unicode supported data types. For example, the following conversion does not return a hexadecimal value of 41. It returns a hexadecimal value of 4100: SELECT CAST(CAST(0x41 AS nvarchar) AS varbinary). For more information, see Collation and Unicode Support.

Proposed resolution

I do not know if this problem is solvable. Maybe we should add this problem to the list of known issues.

Remaining tasks

TBD

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

Comments

daffie created an issue. See original summary.

daffie’s picture

Issue summary: View changes
beakerboy’s picture

Is this an existing core test or something new? What is the default Collation of the database you are testing? If it’s an existing test, this test passes on the DrupalSqlsrvCI framework that I use on GitLab. So I assume it’s a problem with your configuration….in which case a note should be added to the README to prevent others from doing the same.

beakerboy’s picture

Status: Active » Postponed (maintainer needs more info)
beakerboy’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)