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

Please don't echo query when using "cbq -q"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0
    • Fix Version/s: 4.6.2, 5.0.0
    • Component/s: query
    • Labels:
      None
    • Triage:
      Untriaged
    • Is this a Regression?:
      Unknown

      Description

      Right now, if you use eg.

      cbq -q -e http://localhost:8095/ -f foo.sqlpp

      the command output will echo the contents of foo.sqlpp, despite the "-q" argument. This makes it impossible to use cbq in scripts or pipelines.

      I'm not sure it's ever reasonable to echo the query contents like this, but at a minimum "-q" should suppress it.

        Attachments

          Issue Links

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

            Activity

            Hide
            isha Isha Kandaswamy added a comment -

            MB-19078, MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session.

            Hence we can do the following
            1. ./cbq -q
            2. \SET quiet true;

            Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator 
             Enter Password: 
             Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.
             
             Path to history file for the shell : /Users/isha/.cbq_history 
            cbq> \source test.sql;
            select * from system:keyspaces;
            {
                "requestID": "145b6ef2-b63c-4f33-9899-7fe84bd64165",
                "signature": {
                    "*": "*"
                },
                "results": [
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "shellTest",
                            "name": "shellTest",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "travel-sample",
                            "name": "travel-sample",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "customer",
                            "name": "customer",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "default",
                            "name": "default",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "orders",
                            "name": "orders",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "product",
                            "name": "product",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "purchase",
                            "name": "purchase",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "review",
                            "name": "review",
                            "namespace_id": "default"
                        }
                    }
                ],
                "status": "success",
                "metrics": {
                    "elapsedTime": "46.861389ms",
                    "executionTime": "46.849332ms",
                    "resultCount": 8,
                    "resultSize": 1768
                }
            }
             
             
            \SET;
             Query Parameters : 
             
             Named Parameters : 
             
             User Defined Session Parameters : 
             
             Predefined Session Parameters : 
             Parameter name : histfile
             Value : [".cbq_history"]
             
             Parameter name : batch
             Value : ["off"]
             
             Parameter name : quiet
             Value : [false]
             
             
             
             
            \ECHO this is a test!!;
            this is a test!! 
             
             
            cbq> \set QUIET true;
            cbq> \source test.sql;
            {
                "requestID": "24088046-5e0d-44ad-8fb6-a71a90a0fadc",
                "signature": {
                    "*": "*"
                },
                "results": [
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "travel-sample",
                            "name": "travel-sample",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "customer",
                            "name": "customer",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "default",
                            "name": "default",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "orders",
                            "name": "orders",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "product",
                            "name": "product",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "purchase",
                            "name": "purchase",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "review",
                            "name": "review",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "shellTest",
                            "name": "shellTest",
                            "namespace_id": "default"
                        }
                    }
                ],
                "status": "success",
                "metrics": {
                    "elapsedTime": "47.371707ms",
                    "executionTime": "47.358715ms",
                    "resultCount": 8,
                    "resultSize": 1768
                }
            }
             
             
             Query Parameters : 
             
             Named Parameters : 
             
             User Defined Session Parameters : 
             
             Predefined Session Parameters : 
             Parameter name : quiet
             Value : [true]
             
             Parameter name : histfile
             Value : [".cbq_history"]
             
             Parameter name : batch
             Value : ["off"]
             
             
             
             
            this is a test!! 
             
             
            cbq> 
            

            OR

            Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator -q
             Enter Password: 
            cbq> \source test.sql;
            {
                "requestID": "dd16e650-3ffa-4474-9b33-c19dcd4d69c6",
                "signature": {
                    "*": "*"
                },
                "results": [
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "purchase",
                            "name": "purchase",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "review",
                            "name": "review",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "shellTest",
                            "name": "shellTest",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "travel-sample",
                            "name": "travel-sample",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "customer",
                            "name": "customer",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "default",
                            "name": "default",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "orders",
                            "name": "orders",
                            "namespace_id": "default"
                        }
                    },
                    {
                        "keyspaces": {
                            "datastore_id": "http://127.0.0.1:8091",
                            "id": "product",
                            "name": "product",
                            "namespace_id": "default"
                        }
                    }
                ],
                "status": "success",
                "metrics": {
                    "elapsedTime": "46.201462ms",
                    "executionTime": "46.187912ms",
                    "resultCount": 8,
                    "resultSize": 1768
                }
            }
             
             
             Query Parameters : 
             
             Named Parameters : 
             
             User Defined Session Parameters : 
             
             Predefined Session Parameters : 
             Parameter name : batch
             Value : ["off"]
             
             Parameter name : quiet
             Value : [true]
             
             Parameter name : histfile
             Value : [".cbq_history"]
             
             
             
             
            this is a test!! 
             
             
            cbq>
            

            Show
            isha Isha Kandaswamy added a comment - MB-19078 , MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session. Hence we can do the following 1. ./cbq -q 2. \SET quiet true; Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator Enter Password: Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.   Path to history file for the shell : /Users/isha/.cbq_history cbq> \source test.sql; select * from system:keyspaces; { "requestID": "145b6ef2-b63c-4f33-9899-7fe84bd64165", "signature": { "*": "*" }, "results": [ { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "shellTest", "name": "shellTest", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "travel-sample", "name": "travel-sample", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "customer", "name": "customer", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "default", "name": "default", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "orders", "name": "orders", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "product", "name": "product", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "purchase", "name": "purchase", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "review", "name": "review", "namespace_id": "default" } } ], "status": "success", "metrics": { "elapsedTime": "46.861389ms", "executionTime": "46.849332ms", "resultCount": 8, "resultSize": 1768 } }     \SET; Query Parameters :   Named Parameters :   User Defined Session Parameters :   Predefined Session Parameters : Parameter name : histfile Value : [".cbq_history"]   Parameter name : batch Value : ["off"]   Parameter name : quiet Value : [false]         \ECHO this is a test!!; this is a test!!     cbq> \set QUIET true; cbq> \source test.sql; { "requestID": "24088046-5e0d-44ad-8fb6-a71a90a0fadc", "signature": { "*": "*" }, "results": [ { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "travel-sample", "name": "travel-sample", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "customer", "name": "customer", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "default", "name": "default", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "orders", "name": "orders", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "product", "name": "product", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "purchase", "name": "purchase", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "review", "name": "review", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "shellTest", "name": "shellTest", "namespace_id": "default" } } ], "status": "success", "metrics": { "elapsedTime": "47.371707ms", "executionTime": "47.358715ms", "resultCount": 8, "resultSize": 1768 } }     Query Parameters :   Named Parameters :   User Defined Session Parameters :   Predefined Session Parameters : Parameter name : quiet Value : [true]   Parameter name : histfile Value : [".cbq_history"]   Parameter name : batch Value : ["off"]         this is a test!!     cbq> OR Ishas-MacBook-Pro:cbq isha$ ./cbq -u=Administrator -q Enter Password: cbq> \source test.sql; { "requestID": "dd16e650-3ffa-4474-9b33-c19dcd4d69c6", "signature": { "*": "*" }, "results": [ { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "purchase", "name": "purchase", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "review", "name": "review", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "shellTest", "name": "shellTest", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "travel-sample", "name": "travel-sample", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "customer", "name": "customer", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "default", "name": "default", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "orders", "name": "orders", "namespace_id": "default" } }, { "keyspaces": { "datastore_id": "http://127.0.0.1:8091", "id": "product", "name": "product", "namespace_id": "default" } } ], "status": "success", "metrics": { "elapsedTime": "46.201462ms", "executionTime": "46.187912ms", "resultCount": 8, "resultSize": 1768 } }     Query Parameters :   Named Parameters :   User Defined Session Parameters :   Predefined Session Parameters : Parameter name : batch Value : ["off"]   Parameter name : quiet Value : [true]   Parameter name : histfile Value : [".cbq_history"]         this is a test!!     cbq>
            Hide
            isha Isha Kandaswamy added a comment -

            Hi Ceej,

            This has been fixed now. Same issue as MB-19078.

            Thanks
            Isha

            Show
            isha Isha Kandaswamy added a comment - Hi Ceej, This has been fixed now. Same issue as MB-19078 . Thanks Isha
            Hide
            build-team Couchbase Build Team added a comment -

            Build 4.7.0-1219 contains query commit fb5c56dacfcaf6de0ab013b0021518972f5d40ed with commit message:
            MB-19078, MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session.
            https://github.com/couchbase/query/commit/fb5c56dacfcaf6de0ab013b0021518972f5d40ed

            Show
            build-team Couchbase Build Team added a comment - Build 4.7.0-1219 contains query commit fb5c56dacfcaf6de0ab013b0021518972f5d40ed with commit message: MB-19078 , MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session. https://github.com/couchbase/query/commit/fb5c56dacfcaf6de0ab013b0021518972f5d40ed
            Hide
            build-team Couchbase Build Team added a comment -

            Build 4.6.1-3822 contains query commit cbebea0193599071950d3988eae080fe2f89631e with commit message:
            MB-19078, MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session.
            https://github.com/couchbase/query/commit/cbebea0193599071950d3988eae080fe2f89631e

            Show
            build-team Couchbase Build Team added a comment - Build 4.6.1-3822 contains query commit cbebea0193599071950d3988eae080fe2f89631e with commit message: MB-19078 , MB-21215 : Allow -q to disable echoing queries in the source file. Also add a quiet predefined parameter to be able to set quiet flag during a shell session. https://github.com/couchbase/query/commit/cbebea0193599071950d3988eae080fe2f89631e
            Hide
            Sitaram.Vemulapalli Sitaram Vemulapalli added a comment -

            add 4.6.1

            Show
            Sitaram.Vemulapalli Sitaram Vemulapalli added a comment - add 4.6.1

              People

              • Assignee:
                ceej Chris Hillery
                Reporter:
                ceej Chris Hillery
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.