Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-31615

WHERE TRUE AND .... causes wrong pushdowns, causes wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.3, 6.0.0, 6.5.0
    • 5.5.2, 6.0.0, 6.5.0
    • query
    • None
    • Untriaged
    • Yes

    Description

      CREATE INDEX ix1 ON default(type);
      CREATE PRIMARY INDEX ON default;
      EXPLAIN SELECT * FROM default WHERE TRUE AND type = "xyz" LIMIT 2;

      Above query uses primary index instead of ix1 also pushes limit to indexer without
      pushing spans.

      https://github.com/couchbase/query/blob/master/planner/build_scan.go#L84
      This condition is true. It should have been false for AND clause.

      https://forums.couchbase.com/t/potential-bug-with-and-true-and-limit-couchbase-enterprise-edition-5-5-2-build-3733/18739

      Attachments

        Issue Links

          Activity

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty