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

        For Gerrit Dashboard: CCBC-907
        # Subject Branch Project Status CR V

          Activity

          Hide
          build-team Couchbase Build Team added a comment -

          Build libcouchbase-2.8.5-118 contains libcouchbase commit e90103e6dbe07aacbb85acc24910a988f359d7fd with commit message:
          CCBC-907: cbc-n1qlback: do not require trailing empty line for input
          https://github.com/couchbase/libcouchbase/commit/e90103e6dbe07aacbb85acc24910a988f359d7fd

          Show
          build-team Couchbase Build Team added a comment - Build libcouchbase-2.8.5-118 contains libcouchbase commit e90103e6dbe07aacbb85acc24910a988f359d7fd with commit message: CCBC-907 : cbc-n1qlback: do not require trailing empty line for input https://github.com/couchbase/libcouchbase/commit/e90103e6dbe07aacbb85acc24910a988f359d7fd

            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.