|Title||Queries with plus or percent signs fail in TeamTrack 5.0|
|Assigned user||Gareth Rees|
|Description||The P4DTI can't send SQL queries including plus signs or percent signs: these appear to get URL-encoded before being sent to the database and the resulting SQL query can't be executed because it now contains syntax errors.|
Using the 2001-06-06 version of the TeamShare API, I called the TSServer::ReadRecordListWithWhere() method with whereClause = 'TS_ID BETWEEN 1 AND 1+1'. The TeamShare API returned with the following error:
TeamShare API error: ERROR: The record list with the 'select TS_CASES.TS_ID, TS_CASES.TS_ISSUEID, TS_CASES.TS_TITLE, TS_CASES.TS_DESCRIPTION, TS_CASES.TS_ISSUETYPE, TS_CASES.TS_ACTTIMETOFIX, TS_CASES.TS_ADDITIONALNOTES, TS_CASES.TS_ENGINEER, TS_CASES.TS_ESTTIMETOFIX, TS_CASES.TS_FUNCTIONALAREA, TS_CASES.TS_HOWFOUND, TS_CASES.TS_MANAGER, TS_CASES.TS_PRIORITY, TS_CASES.TS_RESOLUTION, TS_CASES.TS_SEVERITY, TS_CASES.TS_TESTER, TS_CASES.TS_VERSION, TS_CASES.TS_WORKAROUND, TS_CASES.TS_CLOSEDATE, TS_CASES.TS_SUBMITDATE, TS_CASES.TS_SUBMITTER, TS_CASES.TS_ACTIVEINACTIVE, TS_CASES.TS_OWNER, TS_CASES.TS_PROJECTID, TS_CASES.TS_STATE, TS_CASES.TS_LASTMODIFIEDDATE, TS_CASES.TS_LASTMODIFIER, TS_CASES.TS_LASTSTATECHANGEDATE, TS_CASES.TS_LASTSTATECHANGER, TS_CASES.TS_MULTISELECT, TS_CASES.TS_CODE, TS_CASES.TS_P4DTI_RID, TS_CASES.TS_P4DTI_SID, TS_CASES.TS_P4DTI_JOBNAME, TS_CASES.TS_PARENTID, TS_CASES.TS_TEMPID, TS_CASES.TS_TEMPOWNER from TS_CASES where TS_ID BETWEEN 1 AND 1 1' select statement could not be read from the 'Issues' table.
Syntax error (missing operator) in query expression 'TS_ID BETWEEN 1 AND 1 1'.
|Analysis||It looks to me as though the TeamShare API is applying HTTP form decoding to the SQL query: it has converted the plus sign into a space. I also note that it works as expected if I change the whereClause to 'TS_ID BETWEEN 1 AND 1 %2B 1'.|
The TeamShare API manual says nothing about this.
GDR 2001-06-12: TeamShare couldn't reproduce the problem . This suggests that I'm using the wrong version of the API . A one-character workaround appears to fix the problem .
|Created by||Gareth Rees|
|Created on||2001-06-07 16:05:24|
|Last modified by||Nick Barnes|
|Last modified on||2003-06-04 10:48:19|
|History||2001-06-07 GDR Created.|
2001-06-12 GDR Added analysis.
|13353||closed||2001-06-18 17:56:40||Gareth Rees||Merged new version of TSSocket.C sent by John McGinley on 2001-06-15.|