Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-907

cbc-n1qlback requires a blank line at the end of file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.5
    • Fix Version/s: 2.8.6
    • Component/s: library
    • Labels:
      None

      Description

      Currently the logic used to read in the statements from the input file is as follows:

      while (std::getline(ifs, curline).good() && !ifs.eof()) {
                  if (!curline.empty()) {
                      m_queries.push_back(curline);
                  }
      }
      

      The problem with this logic is that it REQUIRES a newline at the end of the file to read in all statements. While technically this is true of every program (https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline), in practice people expect programs to be able to handle files with a newline at the end and without.

      Instead we probably need to move the check for !ifs.eof() to within the while loop.
      We may also require some additional processing to remove the trailing char received from getline().

        Attachments

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

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              avsej Sergey Avseyev
              Reporter:
              matt.carabine Matt Carabine
            • 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

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