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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.5.0, 6.0.0, 5.5.2
    • 6.5.0, 6.0.0, 5.5.3
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Build couchbase-server-6.5.0-1416 contains query commit fbb64d8 with commit message:
            MB-31615 TRUE predicate not properly handled in where clause

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-1416 contains query commit fbb64d8 with commit message: MB-31615 TRUE predicate not properly handled in where clause

            Bingjie Miao please check in the fix into Alice & also 5.5.3

            Wayne Siu please add this but into 5.5.3 approved list

            raju Raju Suravarjjala added a comment - Bingjie Miao please check in the fix into Alice & also 5.5.3 Wayne Siu please add this but into 5.5.3 approved list

            Build couchbase-server-6.0.0-1693 contains query commit df2438a with commit message:
            MB-31615 TRUE predicate not properly handled in where clause

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.0.0-1693 contains query commit df2438a with commit message: MB-31615 TRUE predicate not properly handled in where clause
            ajay.bhullar Ajay Bhullar added a comment -

            This has been verified in 6.0.0-1693 and 6.5.0-1416 

            ajay.bhullar Ajay Bhullar added a comment - This has been verified in 6.0.0-1693 and 6.5.0-1416 

            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:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty