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

Undefined Index from existing keys in getMulti result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.4
    • Component/s: None
    • Security Level: Public
    • Labels:
      None

      Description

      Bug reporter is noticing some strange behavior from the getMulti function: keys which exist and are visible when print_r'ing the response give an undefined index error when reporter tries to access them.

      Full details are in http://www.couchbase.com/forums/thread/php-undefined-index-existing-keys-getmulti-result

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

        Activity

        Hide
        gregschoen greg schoen added a comment -

        I just noticed this issue as well when trying to switch over from Memcache to Couchbase. I came up with the following hack until it is corrected in the library.

        $get = $couchbase->getMulti($keys);

        foreach($get as $k => $v)

        { $hack_array[$k] = $v; }

        $get = $hack_array;

        It's interesting to note that you can iterate through the array with a foreach and setting it into a new array lets you access the values.

        Show
        gregschoen greg schoen added a comment - I just noticed this issue as well when trying to switch over from Memcache to Couchbase. I came up with the following hack until it is corrected in the library. $get = $couchbase->getMulti($keys); foreach($get as $k => $v) { $hack_array[$k] = $v; } $get = $hack_array; It's interesting to note that you can iterate through the array with a foreach and setting it into a new array lets you access the values.
        Hide
        ingenthr Matt Ingenthron added a comment -

        I think this is something at the extension level. Asking Laruence to have a look.

        Show
        ingenthr Matt Ingenthron added a comment - I think this is something at the extension level. Asking Laruence to have a look.
        Hide
        ingenthr Matt Ingenthron added a comment -

        Discussion with Laruence indicates that it was a libcouchbase bug which has been fixed. We'll add the referenced test to the suite and verify that it works with the latest libcouchbase.

        Show
        ingenthr Matt Ingenthron added a comment - Discussion with Laruence indicates that it was a libcouchbase bug which has been fixed. We'll add the referenced test to the suite and verify that it works with the latest libcouchbase.
        Hide
        ingenthr Matt Ingenthron added a comment -

        Update: it was actually a bug fixed in the extension now verified. This was actually fixed in 1.0.4 and this issue is a dupe of PCBC-66 (now, anyway).

        Show
        ingenthr Matt Ingenthron added a comment - Update: it was actually a bug fixed in the extension now verified. This was actually fixed in 1.0.4 and this issue is a dupe of PCBC-66 (now, anyway).

          People

          • Assignee:
            ingenthr Matt Ingenthron
            Reporter:
            ingenthr Matt Ingenthron
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes