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

Couchbase.so intermittently returns incorrect value for integer values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.0.1
    • Fix Version/s: 1.0.2
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      OS X 10.7, PHP 5.3.8, Apache 2.2.21, Couchbase.so 1.0.0, Couchbase Server 1.8.0

      Description

      See http://www.couchbase.com/forums/thread/php-ext-incorrect-data-returned

      I'm setting various integers to different keys. When I subsequently get them, the couchbase.so result "mixes" the values. I can verify via the command line that the values are set correctly, but they're not the same as what couchbase.so returns to me.

      PHP Example:
      $cb->set("userid", 642349292);
      $cb->set("productid", 5);
      $user_id = $cb->get("userid");
      echo $user_id."\n";
      $pid = $cb->get("productid");
      echo $pid."\n";

      This outputs:
      642349292
      542349292

      On the command line however:
      get userid
      VALUE userid 1 9
      642349292
      END
      get productid
      VALUE productid 1 1
      5
      END

      I can "work around" this (and the other issue), by setting integers as strings, but something is clearly the matter with couchbase.so.

      If I set the integers as strings, like this:

      $cb->set("userid", "642349292");
      $cb->set("productid", "5");
      $user_id = $cb->get("userid");
      echo $user_id."\n";
      $pid = $cb->get("productid");
      echo $pid."\n";

      the subsequent output is correct:

      642349292
      5

        Issue Links

        # Subject Project Status CR V
        For Gerrit Dashboard: &For+PCBC-54=message:PCBC-54

          Activity

          Hide
          avsej Sergey Avseyev added a comment -

          The fix is published on github https://github.com/couchbase/php-ext-couchbase

          Could you try to build the master version and confirm the problem is fixed, so that we can close the issue?

          Show
          avsej Sergey Avseyev added a comment - The fix is published on github https://github.com/couchbase/php-ext-couchbase Could you try to build the master version and confirm the problem is fixed, so that we can close the issue?
          Hide
          ingenthr Matt Ingenthron added a comment -

          Actually Sergey, we'll send Michael a built binary.

          Show
          ingenthr Matt Ingenthron added a comment - Actually Sergey, we'll send Michael a built binary.
          Hide
          mssteuer Michael Steuer added a comment -

          I already rebuilt and tested the same case as described above.

          It now returns the correct data..

          $cb->set("userid", 642349292);
          $cb->set("productid", 5);
          $user_id = $cb->get("userid");
          echo $user_id."\n";
          $pid = $cb->get("productid");
          echo $pid."\n";

          ---- OUTPUT ----
          642349292
          5

          Show
          mssteuer Michael Steuer added a comment - I already rebuilt and tested the same case as described above. It now returns the correct data.. $cb->set("userid", 642349292); $cb->set("productid", 5); $user_id = $cb->get("userid"); echo $user_id."\n"; $pid = $cb->get("productid"); echo $pid."\n"; ---- OUTPUT ---- 642349292 5
          Hide
          mssteuer Michael Steuer added a comment -

          By the way, separate issue and I'm happy to file a ticket if you want - the extension doesn't report its version correctly in PHPINFO. Both 1.0.1 and the 1.0.2 I just built report their version as 1.0.0 in phpinfo()

          Show
          mssteuer Michael Steuer added a comment - By the way, separate issue and I'm happy to file a ticket if you want - the extension doesn't report its version correctly in PHPINFO. Both 1.0.1 and the 1.0.2 I just built report their version as 1.0.0 in phpinfo()
          Hide
          jan Jan Lehnardt (Inactive) added a comment -

          Fixed, latest downloads are here: http://www.couchbase.com/develop/php/current

          Show
          jan Jan Lehnardt (Inactive) added a comment - Fixed, latest downloads are here: http://www.couchbase.com/develop/php/current

            People

            • Assignee:
              ingenthr Matt Ingenthron
              Reporter:
              mssteuer Michael Steuer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes