Skip to content

Escape single quote and backslash when writing GUIDs as byte arrays.#265

Merged
bgrainger merged 1 commit intomysql-net:masterfrom
adampoit:fix-old-guids
May 26, 2017
Merged

Escape single quote and backslash when writing GUIDs as byte arrays.#265
bgrainger merged 1 commit intomysql-net:masterfrom
adampoit:fix-old-guids

Conversation

@adampoit
Copy link
Copy Markdown
Contributor

This code is copied from writing a byte array.

These byte values were not escaped when writing a GUID as a byte array, causing syntax errors when doing something like

var query = @"insert into table(value) select @value from dual";
database.Connection.Execute(query, new { value = Guid.NewGuid() });

when OldGuids=true.

Since the code is duplicated, I can refactor it into a method if we feel that's appropriate.

@bgrainger bgrainger merged commit affbb9c into mysql-net:master May 26, 2017
bgrainger added a commit that referenced this pull request May 26, 2017
Escape single quote and backslash when writing GUIDs as byte arrays.
@bgrainger
Copy link
Copy Markdown
Member

Fixed in 0.19.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants