Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Invalid rid value when getting it using function getRid on a record. #24

Closed odiel closed 9 years ago

odiel commented 9 years ago

Hi.

I found an issue related to RID.

When using method 'query' and executing a query like:

SELECT @rid FROM Event WHERE id = '123'

This is the resulted record:

class PhpOrient\Protocols\Binary\Data\Record#519 (4) {
  protected $rid =>
  class PhpOrient\Protocols\Binary\Data\ID#520 (2) {
    public $cluster =>
    string(2) "-2"
    public $position =>
    string(1) "1"
  }
  protected $oClass =>
  NULL
  protected $version =>
  int(0)
  protected $oData =>
  array(1) {
    'rid' =>
    class PhpOrient\Protocols\Binary\Data\ID#631 (2) {
      public $cluster =>
      string(2) "13"
      public $position =>
      string(1) "0"
    }
  }
}

Notice how the property $rid value is different from property $oData being this one the right value in the DB.

Ostico commented 9 years ago

Hi @odiel ,

this is by design, please refer to this thread by @sinfex: https://github.com/mogui/pyorient/issues/41#issuecomment-70405755