Malformed SQL query causes StreamingRenderer infinite loop
----------------------------------------------------------

                 Key: GEOT-1025
                 URL: http://jira.codehaus.org/browse/GEOT-1025
             Project: GeoTools
          Issue Type: Bug
    Affects Versions: 2.3.M0, 2.2-RC4, 2.3
            Reporter: Saul Farber
            Priority: Critical
             Fix For: 2.2.2, 2.3, 2.4.M0
         Attachments: corrupted-connection-arcsde-gt-2.2.x.patch, 
corrupted-connection-arcsde-gt-2.3.x.patch, 
corrupted-connection-arcsde-gt-trunk.patch

If a certain kind of technically valid, but logically bad filter (specifically, 
a Filter with an empty "<Or/>" element) then the ArcSDE plugin attempts to 
execute a sql query like this:

... ((A OR B) OR ())

This is bad SQL, and the open query fails with a "DATABASE LEVEL ERROR 
OCCURRED".  However, the query continues to return "true" for hasNext(), and 
never closes itself, nor reports that it has failed.  In the case of the 
streamingRenderer, this means that the next call to "hasNext()" will return 
true, followed by a call to "query.fetch()" which will fail with a "FUNCTION 
CALLED OUT OF SEQUENCE" error.  This will repeat forever, as "hasNext()" will 
never figure out that the query has failed.

This patch checks for SeExceptions that might occur during the "SeRow.fetch()" 
call, and if they occur it assumes that the query is dead and closes it up.  
This might be aggressive, but in general, once a query has failed in SDE, it's 
a dead handle.  I suppose a single row might fail to fetch, not signalling a 
general failure, but I've never seen this behavior.

Patches included for 2.2.x, 2.3.x and trunk.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to