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

    • Bug
    • Resolution: Fixed
    • Major
    • 2.8.6
    • 2.8.5
    • library
    • None
    • 1

    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

          People

            avsej Sergey Avseyev
            matt.carabine Matt Carabine (Inactive)
            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