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

block comments are not properly handled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Neo, 7.0.2, 6.6.4
    • Fix Version/s: Neo
    • Component/s: query
    • Labels:
      None
    • Triage:
      Untriaged
    • Story Points:
      1
    • Is this a Regression?:
      Unknown

      Description

      create index ix1 ON default(c1,c2) WHERE type = "doc";
      EXPLAIN SELECT 1 FROM default d WHERE c1 = 2 /* xyz **/ AND type = "doc"; -- ignores every thing after comment. affect index selection. might results too.
       
      EXPLAIN SELECT 1 FROM default d WHERE c1 = 2 /* xyz */ AND type = "doc";  -- works
      
      

      https://forums.couchbase.com/t/block-comment/31684

        Attachments

          Issue Links

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

            Activity

            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-7.1.0-1289 contains query commit 28c34d6 with commit message:
            MB-48407 Fix block comment matching.

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-7.1.0-1289 contains query commit 28c34d6 with commit message: MB-48407 Fix block comment matching.
            Hide
            Donald.haggart Donald Haggart added a comment -

            The statements in the description should verify; any other statements with block comments of any text added should continue to produce the same results.

            Show
            Donald.haggart Donald Haggart added a comment - The statements in the description should verify; any other statements with block comments of any text added should continue to produce the same results.
            Hide
            pierre.regazzoni Pierre Regazzoni added a comment -

            Verified on 7.1.0-1289

            cbq> EXPLAIN SELECT 1 FROM default d WHERE c1 = 2 /* xyz **/ AND type = "doc" -- ignores every thing after comment. affect index selection. might results too. ;{
                "requestID": "a145c9c5-7b4b-4b7c-8fde-cd56c3d2b918",
                "signature": "json",
                "results": [
                {
                    "plan": {
                        "#operator": "Sequence",
                        "~children": [
                            {
                                "#operator": "IndexScan3",
                                "as": "d",
                                "covers": [
                                    "cover ((`d`.`c1`))",
                                    "cover ((`d`.`c2`))",
                                    "cover ((meta(`d`).`id`))"
                                ],
                                "filter": "((cover ((`d`.`c1`)) = 2) and (cover ((`d`.`type`)) = \"doc\"))",
                                "filter_covers": {
                                    "cover ((`d`.`type`))": "doc"
                                },
                                "index": "ix1",
                                "index_id": "b3353e096f73d50",
                                "index_projection": {
                                    "entry_keys": [
                                        0
                                    ]
                                },
                                "keyspace": "default",
                                "namespace": "default",
                                "spans": [
                                    {
                                        "exact": true,
                                        "range": [
                                            {
                                                "high": "2",
                                                "inclusion": 3,
                                                "index_key": "`c1`",
                                                "low": "2"
                                            }
                                        ]
                                    }
                                ],
                                "using": "gsi"
                            },
                            {
                                "#operator": "Parallel",
                                "~child": {
                                    "#operator": "Sequence",
                                    "~children": [
                                        {
                                            "#operator": "InitialProject",
                                            "result_terms": [
                                                {
                                                    "expr": "1"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "text": "SELECT 1 FROM default d WHERE c1 = 2 /* xyz **/ AND type = \"doc\" -- ignores every thing after comment. affect index selection. might results too.;"
                }
                ],
                "status": "success",
                "metrics": {
                    "elapsedTime": "1.104925ms",
                    "executionTime": "1.00642ms",
                    "resultCount": 1,
                    "resultSize": 2252,
                    "serviceLoad": 6
                }
            }
             

            Show
            pierre.regazzoni Pierre Regazzoni added a comment - Verified on 7.1.0-1289 cbq> EXPLAIN SELECT 1 FROM default d WHERE c1 = 2 /* xyz **/ AND type = "doc" -- ignores every thing after comment. affect index selection. might results too. ;{ "requestID" : "a145c9c5-7b4b-4b7c-8fde-cd56c3d2b918" , "signature" : "json" , "results" : [ { "plan" : { "#operator" : "Sequence" , "~children" : [ { "#operator" : "IndexScan3" , "as" : "d" , "covers" : [ "cover ((`d`.`c1`))" , "cover ((`d`.`c2`))" , "cover ((meta(`d`).`id`))" ], "filter" : "((cover ((`d`.`c1`)) = 2) and (cover ((`d`.`type`)) = \"doc\"))" , "filter_covers" : { "cover ((`d`.`type`))" : "doc" }, "index" : "ix1" , "index_id" : "b3353e096f73d50" , "index_projection" : { "entry_keys" : [ 0 ] }, "keyspace" : "default" , "namespace" : "default" , "spans" : [ { "exact" : true , "range" : [ { "high" : "2" , "inclusion" : 3 , "index_key" : "`c1`" , "low" : "2" } ] } ], "using" : "gsi" }, { "#operator" : "Parallel" , "~child" : { "#operator" : "Sequence" , "~children" : [ { "#operator" : "InitialProject" , "result_terms" : [ { "expr" : "1" } ] } ] } } ] }, "text" : "SELECT 1 FROM default d WHERE c1 = 2 /* xyz **/ AND type = \"doc\" -- ignores every thing after comment. affect index selection. might results too.;" } ], "status" : "success" , "metrics" : { "elapsedTime" : "1.104925ms" , "executionTime" : "1.00642ms" , "resultCount" : 1 , "resultSize" : 2252 , "serviceLoad" : 6 } }

              People

              Assignee:
              pierre.regazzoni Pierre Regazzoni
              Reporter:
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty