You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Øyvind Harboe (JIRA)" <ji...@apache.org> on 2008/09/12 12:47:44 UTC

[jira] Created: (DERBY-3876) Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause

Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause
-------------------------------------------------------------------------------------

                 Key: DERBY-3876
                 URL: https://issues.apache.org/jira/browse/DERBY-3876
             Project: Derby
          Issue Type: Bug
            Reporter: Øyvind Harboe


The problem is that e.g. Cayenne uses *long* SQL statements with *lots* of OR statements to implement certain operations.

This causes a stack overflow as evaluation of 'OR' is implemented recursively.

Could an iterative implementation trivially replace the recursive implementation? 





at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.BinaryLogicalOpera




See also

https://issues.apache.org/cayenne/browse/CAY-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974#action_12974

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3876) Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-3876:
----------------------------------

    Component/s: SQL

> Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-3876
>                 URL: https://issues.apache.org/jira/browse/DERBY-3876
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Øyvind Harboe
>
> The problem is that e.g. Cayenne uses *long* SQL statements with *lots* of OR statements to implement certain operations.
> This causes a stack overflow as evaluation of 'OR' is implemented recursively.
> Could an iterative implementation trivially replace the recursive implementation? 
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOpera
> See also
> https://issues.apache.org/cayenne/browse/CAY-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974#action_12974

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-3876) Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631158#action_12631158 ] 

Dag H. Wanvik commented on DERBY-3876:
--------------------------------------

A work-around would be to increase the thread stck size, -Xss=<size>.

I would reclassify this as an improvement, not a bug.

> Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-3876
>                 URL: https://issues.apache.org/jira/browse/DERBY-3876
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Øyvind Harboe
>
> The problem is that e.g. Cayenne uses *long* SQL statements with *lots* of OR statements to implement certain operations.
> This causes a stack overflow as evaluation of 'OR' is implemented recursively.
> Could an iterative implementation trivially replace the recursive implementation? 
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOpera
> See also
> https://issues.apache.org/cayenne/browse/CAY-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974#action_12974

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3876) Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-3876:
----------------------------------

    Issue Type: Improvement  (was: Bug)

> Stack overflow when issuing SELECT statements with *lots* of 'OR' in the WHERE clause
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-3876
>                 URL: https://issues.apache.org/jira/browse/DERBY-3876
>             Project: Derby
>          Issue Type: Improvement
>            Reporter: Øyvind Harboe
>
> The problem is that e.g. Cayenne uses *long* SQL statements with *lots* of OR statements to implement certain operations.
> This causes a stack overflow as evaluation of 'OR' is implemented recursively.
> Could an iterative implementation trivially replace the recursive implementation? 
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.OrNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(Unknown Source)
> at org.apache.derby.impl.sql.compile.BinaryLogicalOpera
> See also
> https://issues.apache.org/cayenne/browse/CAY-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974#action_12974

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.