Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-481

Call to bucket.counter() without delta results in segmentation fault

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 2.3.2
    • 2.3.1
    • None
    • None
    • PHP 7.1

    Description

      http://docs.couchbase.com/sdk-api/couchbase-php-client-2.3.1/classes/Couchbase.Bucket.html#method_counter

      Invoking bucket->counter('customer::counter') results in PHP shutting down and reporting "segmentation fault: 11" to the command line.

      $app->post('/api/customer', function($request, $response, $args) {

        $jsonDocType = $request->getAttribute('jsonDocType');
        $jsonBody = $request->getParsedBody();
        // $docId = $jsonDocType . '::' . $jsonBody['username']; // . uniqid();

        $increment = $this->bucket->counter('customer::counter');
        var_dump($increment); die();

       

      });

       

       

      Invoking either bucket->counter('customer::counter', 1) or bucket->counter('customer::counter', 1, ['1']) results in LCB_KEY_ENOENT: The key does not exist on the server.

      In our other SDKs, the first use of bucket.counter() causes the counter document to be created if it does not already exist, with a default value of 1 and a default increment of 1. 

      $app->post('/api/customer', function($request, $response, $args) {

        $jsonDocType = $request->getAttribute('jsonDocType');
        $jsonBody = $request->getParsedBody();
        // $docId = $jsonDocType . '::' . $jsonBody['username']; // . uniqid();

        // $increment = $this->bucket->counter('customer::counter', 1, ['1']);
        *  *$increment = $this->bucket->counter('customer::counter', 1);**

        var_dump($increment); die();

       

      });

      Attachments

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

        Activity

          People

            avsej Sergey Avseyev
            leo.schuman Leo Schuman [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty