You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Wolfram Huesken <wo...@m18.io> on 2017/11/25 11:02:53 UTC
Memcached doesn't store flags
Hello together,
Ignite's current Memcached implementation doesn't store the flags value
which comes with the set command. As Memcached can only store strings,
memcached clients usually use this as a workaround to store the datatype
and later restore the string from memcached to the original datatype.
Default is 0 which is string. This short PHP snippet (Created with
php-memcached) illustrates the bug:
== code start ==
<?php
$mc = new Memcached();
$mc->setOption(Memcached::OPT_COMPRESSION, false);
$mc->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$mc->addServer('localhost', 11211);
$stringValue = "Hallo";
$floatValue = 1.5;
printf('$stringValue is a %s%s', gettype($stringValue), PHP_EOL);
printf('$floatValue is a %s%s', gettype($floatValue), PHP_EOL);
echo PHP_EOL;
$mc->set('stringValue', $stringValue);
$mc->set('floatValue', $floatValue);
printf('$stringValue is a %s%s', gettype($mc->get('stringValue')), PHP_EOL);
printf('$floatValue is a %s%s', gettype($mc->get('floatValue')), PHP_EOL);
var_dump($mc->get('stringValue'));
var_dump($mc->get('floatValue'));
== code end ==
The result is:
$stringValue is a string
$floatValue is a double
$stringValue is a string
$floatValue is a string
string(5) "Hallo"
string(3) "1.5"
Is this a known bug or should I file a ticket in JIRA for this?
Cheers
Wolfram
Re: Memcached doesn't store flags
Posted by Mikhail <mi...@gmail.com>.
Hi Wolfram,
Looks like it's broken, we parse those type bits in a request, but don't set
in for a response.
I created a ticket for this problem:
https://issues.apache.org/jira/browse/IGNITE-7028
Thanks,
Mike.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/