Closed emman-ok closed 8 years ago
That doesnt look good. Any way to reproduce that?
Sent from my iPhone
On Jan 30, 2016, at 17:50, emman_ok notifications@github.com wrote:
How Do I Solve This rid: "#13:250000000000" Was Expecting rid:"13:25"
— Reply to this email directly or view it on GitHub.
@emman-ok - Is the problem solved? If yes, what was the solution?
Scott
Yes , I just have to edit the file path "PhpOrient\src\PhpOrient\Protocols\Binary\Data\ID.php" by casting the cluster and position into integer
public function __construct( $cluster = -1, $position = -1 ) { if ( is_array( $cluster ) ) { if ( isset( $cluster[ 'cluster' ] ) ) { $this->cluster = (int)$cluster[ 'cluster' ]; } if ( isset( $cluster[ 'position' ] ) ) { $this->position = (int)$cluster[ 'position' ]; } } else { if ( is_string( $cluster ) && $cluster[ 0 ] === '#' ) { list( $this->cluster, $this->position ) = self::parseString( $cluster ); } else { $this->cluster = (int)$cluster; $this->position = (int)$position; } } }
@emman-ok @smolinari i think a better solution would be to cast cluster and position into integer and then back to string again, since original ID cluster and position are strings initially
Can the casting be avoided altogether?
Scott
@smolinari technically problem should be fixed somewhere before the ID
is instantiated. It looks like some part of the code that deserializes RID passed from the server is initially casting it into a float or smth. Hence the problem with the floating point. After that ID is instantiated with a wrongly parsed $position
. @emman-ok did not get rid or the problem, but prevented it from happening again. I personally think that the problem stems from Reader::unpackLong
, but im not sure. @Ostico what do you think?
How Do I Solve This rid: "#13:25.0000000000". Was Expecting rid:"13:25"