Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3876

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • SQL
    • Normal

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            oharboe Øyvind Harboe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: