You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Lars George <la...@gmail.com> on 2011/05/24 11:50:53 UTC
Thrift DemoClient Fails
Hi,
I am running the PHP DemoClient and it is supposed to bail out on an
invalid UTF-8 string, but that now passes and triggers the Jedi "You
should not be here!" waving.
The string is
#
# Test UTF-8 handling
#
$invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
$valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";
and the code
# non-utf8 is not allowed in row names
try {
$mutations = array(
new Mutation( array(
'column' => 'entry:foo',
'value' => $invalid
) ),
);
$client->mutateRow( $t, $invalid, $mutations );
throw new Exception( "shouldn't get here!" );
} catch ( IOError $e ) {
echo( "expected error: {$e->message}\n" );
}
Looking at the shell I see:
hbase(main):006:0> scan 'demo_table'
ROW COLUMN+CELL
column=entry:,
timestamp=1306229854784, value=
foo column=entry:foo,
timestamp=1306229854782, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\x column=entry:foo,
timestamp=1306229854787,
value=foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB
BC\xE3\x83\xAB
foo-\xFC\xA1\xA1\xA1\xA1\xA1 column=entry:foo,
timestamp=1306229854789, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
4 row(s) in 0.0430 seconds
So it happily created the row key. Did we "fix" the allowed character handling?
Lars
Re: Thrift DemoClient Fails
Posted by Moaz Reyad <mo...@gmail.com>.
The C++ and Java demos are fixed in these tickets :
https://issues.apache.org/jira/browse/HBASE-3593
https://issues.apache.org/jira/browse/HBASE-3630
Other demo files in PHP, Ruby, Python , ..etc probably need to be fixed in
the same way.
Moaz
On Tue, May 24, 2011 at 11:50 AM, Lars George <la...@gmail.com> wrote:
> Hi,
>
> I am running the PHP DemoClient and it is supposed to bail out on an
> invalid UTF-8 string, but that now passes and triggers the Jedi "You
> should not be here!" waving.
>
> The string is
>
> #
> # Test UTF-8 handling
> #
> $invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
> $valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";
>
> and the code
>
> # non-utf8 is not allowed in row names
> try {
> $mutations = array(
> new Mutation( array(
> 'column' => 'entry:foo',
> 'value' => $invalid
> ) ),
> );
> $client->mutateRow( $t, $invalid, $mutations );
> throw new Exception( "shouldn't get here!" );
> } catch ( IOError $e ) {
> echo( "expected error: {$e->message}\n" );
> }
>
> Looking at the shell I see:
>
> hbase(main):006:0> scan 'demo_table'
> ROW COLUMN+CELL
> column=entry:,
> timestamp=1306229854784, value=
> foo column=entry:foo,
> timestamp=1306229854782, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
> foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\x column=entry:foo,
> timestamp=1306229854787,
> value=foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB
> BC\xE3\x83\xAB
> foo-\xFC\xA1\xA1\xA1\xA1\xA1 column=entry:foo,
> timestamp=1306229854789, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
> 4 row(s) in 0.0430 seconds
>
> So it happily created the row key. Did we "fix" the allowed character
> handling?
>
> Lars
>