[CORE-184] Generated SQL is not escaping single quotes correctly if a space exists between multiple values in C_DIMCODE Created: 18/Aug/15  Updated: 17/Oct/16  Resolved: 22/Sep/16

Status: Closed
Project: i2b2 Core Software
Component/s: CRC Cell
Affects Version/s: 1.7.06
Fix Version/s: 1.7.08

Type: Bug Priority: Major
Reporter: Janice Donahoe Assignee: Janice Donahoe
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Rank: 0|i0023r:
Affects View/s:
Query Tool
i2b2 Feature/s:
Queries
i2b2 Related Project/s:
BBP
Affects Database/s:
All databases
Reproduction Notes: This can be reproduced in the i2b2 test environment.
Participant/s:

 Description   
In the metadata tables, concepts can be setup as a multiple in which a single concept will automatically include other concepts when a query is run. The concepts to be included are defined in the C_DIMCODE column.

The problem is when there is a space between the values entered in the C_DIMCODE the single quotes are not being escaped properly when the SQL is generated. This is resulting in the incorrect number of patients being returned.

If you remove the spaces between values the single quotes are being escaped correctly.

The following two examples were done using the i2b2 demo data.

EXAMPLE 1: Spaces in the C_DIMCODE

C_FULLNAME = \i2b2\Demographics\Race\Black\
C_DIMCODE = 'b', 'black', 'hib', 'his/black'

Excerpt of SQL Generated =
       RACE_CD IN ('b'', ''black'', ''hib'', ''his/black')


EXAMPLE 2: No spaces in the C_DIMCODE

C_FULLNAME = \i2b2\Demographics\Race\Black\
C_DIMCODE = 'b','black','hib','his/black'

Excerpt of SQL Generated =
      RACE_CD IN ('b','black','hib','his/black')


WHAT SHOULD HAPPEN:
Regardless of whether or not there are spaces between the values, the generated SQL should escape the single quotes correctly.




 Comments   
Comment by Janice Donahoe [ 17/Oct/16 ]
This change was included in version 1.7.08, which was released on 10/07/2016.
Generated at Fri Apr 26 11:29:10 UTC 2024 using Jira 8.20.11#820011-sha1:0629dd8d260e3954ece49053e565d01dabe11609.