PCBC-327 and PCBC-328 #7

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
@malarky

malarky commented Feb 19, 2015

PCBC-327: Query parameter 'group_level' is not compatible with 'group'.
PCBC-328: range() method causes 'bad_request: invalid UTF-8 JSON: {{error,insufficient_data},[]}'

@joefaron

This comment has been minimized.

Show comment Hide comment
@joefaron

joefaron Mar 1, 2015

This is off subject here, I just upgraded to php5.6.6 and the php-couchbase 2.0.4 lib..
The example:
// array(1) {
// ["name"]=>
// string(5) "Frank"
// }

Returns it as:
// object(stdClass)#644 (1) {
// ["name"]=>
// string(5) "Frank"
// }
The only way to not get it like that, is to serialize on upsert(), and unserialize on get().. but that won't work as I have an existing couchbase db, with unserialized objects.

I'm either thinking this is an issue with my php5.6.6 compile, or just this new php-couchbase lib. I've tried all versions to 2.0.0.. no luck. I can give more details, but my configure was:
./configure' '--enable-mbstring' '--with-curl' '--with-openssl' '--with-xmlrpc' '--enable-soap' '--enable-zip' '--with-mysql' '--enable-fpm' '--with-gd' '--with-pdo-mysql' '--with-jpeg-dir' '--with-zlib'

I'm running couchbase server version 2.2.0 enterprise edition (build-821).. and when i go to view the 'testdoc' document via the web interface, it shows up as an array.. so it seems like the problem is with getting the doc.

joefaron commented Mar 1, 2015

This is off subject here, I just upgraded to php5.6.6 and the php-couchbase 2.0.4 lib..
The example:
// array(1) {
// ["name"]=>
// string(5) "Frank"
// }

Returns it as:
// object(stdClass)#644 (1) {
// ["name"]=>
// string(5) "Frank"
// }
The only way to not get it like that, is to serialize on upsert(), and unserialize on get().. but that won't work as I have an existing couchbase db, with unserialized objects.

I'm either thinking this is an issue with my php5.6.6 compile, or just this new php-couchbase lib. I've tried all versions to 2.0.0.. no luck. I can give more details, but my configure was:
./configure' '--enable-mbstring' '--with-curl' '--with-openssl' '--with-xmlrpc' '--enable-soap' '--enable-zip' '--with-mysql' '--enable-fpm' '--with-gd' '--with-pdo-mysql' '--with-jpeg-dir' '--with-zlib'

I'm running couchbase server version 2.2.0 enterprise edition (build-821).. and when i go to view the 'testdoc' document via the web interface, it shows up as an array.. so it seems like the problem is with getting the doc.

@joefaron

This comment has been minimized.

Show comment Hide comment
@joefaron

joefaron Mar 1, 2015

It looks like objects with libcouchbase2 are being json encoded by default.. whereas before, they were serialized.. which makes this backwards incompatible? Unless there's a setting somewhere I'm unaware of?

joefaron commented Mar 1, 2015

It looks like objects with libcouchbase2 are being json encoded by default.. whereas before, they were serialized.. which makes this backwards incompatible? Unless there's a setting somewhere I'm unaware of?

@joefaron

This comment has been minimized.

Show comment Hide comment
@joefaron

joefaron Mar 1, 2015

Solved the problem with doing:
$COUCHBASE_DEFAULT_ENCOPTS['cmprtype']=COUCHBASE_COMPRESSION_ZLIB;

joefaron commented Mar 1, 2015

Solved the problem with doing:
$COUCHBASE_DEFAULT_ENCOPTS['cmprtype']=COUCHBASE_COMPRESSION_ZLIB;

@brett19

This comment has been minimized.

Show comment Hide comment
@brett19

brett19 Mar 1, 2015

Owner

I am going to close this now as I believe that 5f32dbb fixes these issues.

Cheers, Brett

Owner

brett19 commented Mar 1, 2015

I am going to close this now as I believe that 5f32dbb fixes these issues.

Cheers, Brett

@brett19 brett19 closed this Mar 1, 2015

@brett19

This comment has been minimized.

Show comment Hide comment
@brett19

brett19 Mar 1, 2015

Owner

a94bc61 is related as well.

Owner

brett19 commented Mar 1, 2015

a94bc61 is related as well.

@brett19

This comment has been minimized.

Show comment Hide comment
@brett19

brett19 Mar 1, 2015

Owner

In terms of your php-ext-couchbase compatibility issue, I actually would suggest that you build your own object with the same properties as $COUCHBASE_DEFAULT_ENCOPTS, and then use setTranscoder to switch to a custom transcoder which internally calls couchbase_basic_encoder_v1.

Example:

$MY_ENCOPTS = array(
    'sertype' => COUCHBASE_SERTYPE_JSON,
    'cmprtype' => COUCHBASE_COMPRESSION_ZLIB,
    'cmprthresh' => 0,
    'cmprfactor' => 0
);
function my_encoder($value) {
    global $MY_ENCOPTS;
    return couchbase_basic_encoder_v1($value, $MY_ENCOPTS);
}
$bucket->setTranscoder("my_encoder", "couchbase_default_decoder");
Owner

brett19 commented Mar 1, 2015

In terms of your php-ext-couchbase compatibility issue, I actually would suggest that you build your own object with the same properties as $COUCHBASE_DEFAULT_ENCOPTS, and then use setTranscoder to switch to a custom transcoder which internally calls couchbase_basic_encoder_v1.

Example:

$MY_ENCOPTS = array(
    'sertype' => COUCHBASE_SERTYPE_JSON,
    'cmprtype' => COUCHBASE_COMPRESSION_ZLIB,
    'cmprthresh' => 0,
    'cmprfactor' => 0
);
function my_encoder($value) {
    global $MY_ENCOPTS;
    return couchbase_basic_encoder_v1($value, $MY_ENCOPTS);
}
$bucket->setTranscoder("my_encoder", "couchbase_default_decoder");
@joefaron

This comment has been minimized.

Show comment Hide comment
@joefaron

joefaron Mar 1, 2015

So I'm unable to get old encoded objects.. it just returns a null value..
key=22000847u5_3_
CouchbaseMetaDoc Object
(
[error] =>
[value] =>
[flags] => 52
[cas] => Resource id #61
)

but if I look in the couchbase web console for the document '22000847u5_3_', i see:
"GVoAAHicvTxrj+O4kX9F6QMOt0B6mhRJPdwIkuxudpNNdgZ3s5v5KMg2261rWfJIcrc7k/nvKb4kSqb8kDoBBuixSBbrzapiSR8WdHHza82rmwXDiy+1+Nm87vjNfd2OwH/9xU22vrnPFj5l8JMsbvbid72IFje+jxCKaCh+xoubPK2bpOa8ENOjCNHQ930YwkSPrdNXexxFPo1hPFzcrCqeNlzuEwZhQGLMFExYUrdrGIWHAcwWkGrxhAjwgOKmzNfJMs3TYgUErBc4jJEYQnqoKZs0FwM+YSjQix7K0lqULcwK+Vyv0E+Bgl2ZFY29hx/FONSgeMGrzetgEe6eZ1tumOIzNli1LIt9LSBSsxVPq7xHDsEaoBpqycFEwgIOPlQZL9bJS5UWm5wnaSP3YyiOaCznCGby1dNjejwLs ............................. (trimmed) ................ "

joefaron commented Mar 1, 2015

So I'm unable to get old encoded objects.. it just returns a null value..
key=22000847u5_3_
CouchbaseMetaDoc Object
(
[error] =>
[value] =>
[flags] => 52
[cas] => Resource id #61
)

but if I look in the couchbase web console for the document '22000847u5_3_', i see:
"GVoAAHicvTxrj+O4kX9F6QMOt0B6mhRJPdwIkuxudpNNdgZ3s5v5KMg2261rWfJIcrc7k/nvKb4kSqb8kDoBBuixSBbrzapiSR8WdHHza82rmwXDiy+1+Nm87vjNfd2OwH/9xU22vrnPFj5l8JMsbvbid72IFje+jxCKaCh+xoubPK2bpOa8ENOjCNHQ930YwkSPrdNXexxFPo1hPFzcrCqeNlzuEwZhQGLMFExYUrdrGIWHAcwWkGrxhAjwgOKmzNfJMs3TYgUErBc4jJEYQnqoKZs0FwM+YSjQix7K0lqULcwK+Vyv0E+Bgl2ZFY29hx/FONSgeMGrzetgEe6eZ1tumOIzNli1LIt9LSBSsxVPq7xHDsEaoBpqycFEwgIOPlQZL9bJS5UWm5wnaSP3YyiOaCznCGby1dNjejwLs ............................. (trimmed) ................ "

brett19 added a commit that referenced this pull request Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment