P4DTI issue job000328

TitleQueries with plus or percent signs fail in TeamTrack 5.0
Statusclosed
Prioritycritical
Assigned userGareth Rees
OrganizationTeamShare
DescriptionThe 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'.
AnalysisIt 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 [1]. This suggests that I'm using the wrong version of the API [2]. A one-character workaround appears to fix the problem [3].
How foundmanual_test
Evidence[1] <http://info.ravenbrook.com/2001/06/11/10-50-25/0.txt>
[2] <http://info.ravenbrook.com/2001/06/12/10-54-20/0.txt>
[3] <http://info.ravenbrook.com/2001/06/12/13-39-07/0.txt>
Observed in1.1.1
Test procedure<http://www.ravenbrook.com/project/p4dti/master/test/test_teamtrack.py>, section 2.4
Created byGareth Rees
Created on2001-06-07 16:05:24
Last modified byNick Barnes
Last modified on2003-06-04 10:48:19
History2001-06-07 GDR Created.
2001-06-12 GDR Added analysis.

Fixes

Change Effect Date User Description
13353 closed 2001-06-18 17:56:40 Gareth Rees Merged new version of TSSocket.C sent by John McGinley on 2001-06-15.