Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-3040

QueryParser wrong for a case of JOIN

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.2
    • 3.0.1
    • LiteCore
    • Security Level: Public
    • None
    • 3

    Description

      {"WHERE":["AND",["=",[".machines.Type"],"machine"],["OR",["=",[".machines.Disabled"],false],[".machines.Disabled"]]],"WHAT":[[".machines.Id"],["AS",[".machines.Label"],"Label2"],[".machines.ModelId"],["AS",[".models.Label2"],"ModelLabel"]],"FROM":[\{"AS":"machines"}

      ,{"AS":"models","ON":["=",[".models.Id"],[".machines.ModelId"]],"JOIN":"LEFT OUTER"}]}

      is translated to

      SELECT fl_result(fl_value(machines.body, 'Id')), fl_result(fl_value(machines.body, 'Label')) AS Label2, fl_result(fl_value(machines.body, 'ModelId')), fl_result(Label2) AS ModelLabel FROM kv_default AS machines LEFT OUTER JOIN kv_default AS models ON (fl_value(models.body, 'Id') = fl_value(machines.body, 'ModelId')) WHERE fl_value(machines.body, 'Type') = 'machine' AND (fl_value(machines.body, 'Disabled') = fl_bool(0) OR fl_value(machines.body, 'Disabled'))

      and it ought to be

      SELECT fl_result(fl_value(machines.body, 'Id')), fl_result(fl_value(machines.body, 'Label')) AS Label2, fl_result(fl_value(machines.body, 'ModelId')), fl_result(models.body, 'Label2') AS ModelLabel FROM kv_default AS machines LEFT OUTER JOIN kv_default AS models ON (fl_value(models.body, 'Id') = fl_value(machines.body, 'ModelId')) WHERE fl_value(machines.body, 'Type') = 'machine' AND (fl_value(machines.body, 'Disabled') = fl_bool(0) OR fl_value(machines.body, 'Disabled'))

      Attachments

        Issue Links

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

          Activity

            People

              jianmin.zhao Jianmin Zhao
              jianmin.zhao Jianmin Zhao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty