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

N1QL Syntax Error needs more details of the error

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • bug-backlog
    • 4.0.0
    • query
    • Security Level: Public
    • Sherlock Build 1891 on Debian 7

    Description

      N1QL needs better syntax error messages.. If I include a FROM clause after a WHERE clause when it is supposed to be before I get this error..

      500: Internal Server Error

      {
      "requestID": "19ad97c5-ebde-4229-85d2-249253ae102d",
      "errors": [

      { "code": 5000, "msg": "syntax error" }

      ],
      "status": "fatal"
      }

      Compare this error to MySQL 5.6...

      CREATE TABLE people
      (`first` varchar(5), `last` varchar(5), `age` int)
      ;

      INSERT INTO people
      (`first`, `last`, `age`)
      VALUES
      ('joe', 'blogs', 23),
      ('mary', 'smith', 25),
      ('chris', 'jones', 21)
      ;

      Now if I query it with,
      select * where age='23' from people;

      I get
      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where age='23' from people' at line 1

      It gives a descriptive error helping to point out the mistake.

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            ianmccloy Ian McCloy (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