Skip to content

Normalised queries with quotation marks in the content #160

@prince-data936

Description

@prince-data936

Good day.

I attempted to capture a workload on a database that has XML content in one of the columns. This content was an xml document with attributes specified. It appeared as if the normalisation process was not able to process the multiple quotation marks within the content. For example, a query

exec SampleStoredProcedure @param1=N'Name1',@key=N'123456',@content=N'
value'

would be normalised as

exec SampleStoredProcedure @param1= {STR}, @key = {STR}, @content = {STR}Attribute1" xmlns="http://namespace.com">value

To mitigate this, we looked at the code and saw that the regular expression in SqlTextNormalizer can be modified. We manually patched the dll to change the expression from

@(?\w+)\s?=\s?[N]?['"?[']"]

to

@(?\w+)\s*=\sN?'(?(?:[^']|''))'[ ]?

to cater for the additional quotation marks in the content. Would it be possible to update the expression in the project so that it can cater for this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions