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

MIN giving wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.5.0
    • 5.5.0
    • secondary-index
    • None
    • Untriaged
    • Centos 64-bit
    • Unknown

    Description

      In build 5.5.0-2669,

      create bucket: simple_table_db_4817420_simple_table

      load the following data:

      {
      "datetime_field1": "2012-03-23 00:00:00",
      "decimal_field1": 4
      },
      {
      "datetime_field1": "2001-12-23 00:00:00",
      "decimal_field1": 28
      },
      {
      "datetime_field1": "2011-05-14 00:00:00",
      "decimal_field1": 28
      },
      {
      "datetime_field1": "2001-08-04 00:00:00",
      "decimal_field1": 34
      },
      {
      "datetime_field1": "2014-08-14 00:00:00",
      "decimal_field1": 36
      },
      {
      "datetime_field1": "2010-11-11 00:00:00",
      "decimal_field1": 39
      }

      Create index:
      CREATE INDEX simple_table_aggregate_pushdown_index_24366568 ON simple_table_db_4817420_simple_table( decimal_field1 , datetime_field1 ) WHERE   decimal_field1  IN [  4 , 28 , 34 , 36 , 39  ]

      Run the following query (gives incorrect results):

      SELECT MIN( datetime_field1 ) FROM   simple_table_db_4817420_simple_table    WHERE   decimal_field1  IN [  4 , 28 , 34 , 36 , 39  ]

      [
      {
      "$1": "2012-03-23 00:00:00"
      }
      ]

      Run the following query (gives correct results):

      SELECT MIN( datetime_field1 ) as M1, MAX( datetime_field1) as M2 FROM   simple_table_db_4817420_simple_table  WHERE   decimal_field1  IN [  4 , 28 , 34 , 36 , 39  ]

      [
      {
      "M1": "2001-08-04 00:00:00",
      "M2": "2014-08-14 00:00:00"
      }
      ]

      Attachments

        For Gerrit Dashboard: MB-29553
        # Subject Branch Project Status CR V

        Activity

          People

            korrigan.clark Korrigan Clark (Inactive)
            korrigan.clark Korrigan Clark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty