Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

set_multi fails when single array reference passed. #4

Closed
rrb3942 opened this Issue · 1 comment

2 participants

@rrb3942

If you call set_multi with just a single array reference as the value it fails with the following errors:

'Using second stack item for AV '
'Expected array reference'

Example of how to reproduce:
my $ con = $con = Couchbase::Client->new({ server => '127.0.0.1', bucket => 'default' });
my $opret = $con->set_multi([ 'somekey', 'somevalue' ])

This may seem odd, but in my use case I am calling set_multi to bulk insert, I then check all of the returns and append any failed to a list to try again, and call set_multi with that list. Rinse, repeat in a loop until all items have been inserted successfully.

Since set_multi can't handle a single item list I was occasionally getting a crash when only a single item remained to be retried.

I am now checking to see if only a single insert remains, but it would be more convenient if set_multi worked with a single item list.

@mnunberg mnunberg referenced this issue from a commit
@mnunberg GH-4: Fix set_multi with single arrayref
Previously set_multi would crash when a single arrayref was used as part
of the list. This fixes that issue
69d3c35
@mnunberg
Owner

Fixed in 1.0.1

@mnunberg mnunberg closed this
@mnunberg mnunberg referenced this issue from a commit
@mnunberg GH-4: set_multi with single array ref
This is a forward-port from the master branch
1b18eb9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.