Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_multi fails when single array reference passed. #4

Closed
rrb3942 opened this issue Feb 16, 2013 · 1 comment
Closed

set_multi fails when single array reference passed. #4

rrb3942 opened this issue Feb 16, 2013 · 1 comment

Comments

@rrb3942
Copy link

rrb3942 commented Feb 16, 2013

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 added a commit that referenced this issue Mar 21, 2013
Previously set_multi would crash when a single arrayref was used as part
of the list. This fixes that issue
@mnunberg
Copy link
Owner

Fixed in 1.0.1

mnunberg added a commit that referenced this issue Apr 16, 2013
This is a forward-port from the master branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants