Skip to content

Indexing attributes cause something wrong with get function #45

@crossknight

Description

@crossknight

I create an indexed attribute using SQL like "CREATE INDEX Data.dataID UNIQUE".
The schema shows that Data.dataID was indexed.
After that I tried to get data but I can not get data using SQL like
"SELECT from Data where dataID='<some_id_in_string>'"
however I can get the data using SQL like
"SELECT from <some_class_name_that_match_id> where dataID='<some_id_in_string>'"

Note <some_class_name_that_match_id> class extends Data class

This is the result of using get function directly before indexing attributes.

rs = Vertex::get((*txn), "Data", Condition("dataID").eq(did));
rs2 = Vertex::get((*txn), "CFCCategory", Condition("dataID").eq(did));
(lldb) p rs
(nogdb::ResultSet) $0 = size=1 {
  [0] = {
    descriptor = {
      rid = (first = 24, second = 7)
      depth = 0
    }
    record = {
      properties = size=3 {
        [0] = {
          first = "createdDate"
          second = (value_ = <no value available>, size_ = 8)
        }
        [1] = {
          first = "dataID"
          second = (value_ = "CFCCategory#0164CF50D638DD3C8AF25C6841A8A251D0D40180283B", size_ = 56)
        }
        [2] = {
          first = "lastModified"
          second = (value_ = <no value available>, size_ = 8)
        }
      }
      basicProperties = size=5 {
        [0] = {
          first = "@className"
          second = (value_ = "CFCCategory", size_ = 11)
        }
        [1] = {
          first = "@depth"
          second = (value_ = <no value available>, size_ = 4)
        }
        [2] = {
          first = "@recordId"
          second = (value_ = "24:7", size_ = 4)
        }
        [3] = {
          first = "@txnVersion"
          second = (value_ = "<", size_ = 8)
        }
        [4] = {
          first = "@version"
          second = (value_ = "\x01", size_ = 8)
        }
      }
    }
  }
}
(lldb) p rs2
(nogdb::ResultSet) $1 = size=1 {
  [0] = {
    descriptor = {
      rid = (first = 24, second = 7)
      depth = 0
    }
    record = {
      properties = size=3 {
        [0] = {
          first = "createdDate"
          second = (value_ = <no value available>, size_ = 8)
        }
        [1] = {
          first = "dataID"
          second = (value_ = "CFCCategory#0164CF50D638DD3C8AF25C6841A8A251D0D40180283B", size_ = 56)
        }
        [2] = {
          first = "lastModified"
          second = (value_ = <no value available>, size_ = 8)
        }
      }
      basicProperties = size=5 {
        [0] = {
          first = "@className"
          second = (value_ = "CFCCategory", size_ = 11)
        }
        [1] = {
          first = "@depth"
          second = (value_ = <no value available>, size_ = 4)
        }
        [2] = {
          first = "@recordId"
          second = (value_ = "24:7", size_ = 4)
        }
        [3] = {
          first = "@txnVersion"
          second = (value_ = "<", size_ = 8)
        }
        [4] = {
          first = "@version"
          second = (value_ = "\x01", size_ = 8)
        }
      }
    }
  }
}

This is the result of using get function directly after indexing attributes.

rs = Vertex::get((*txn), "Data", Condition("dataID").eq(did));
rs2 = Vertex::get((*txn), "CFCCategory", Condition("dataID").eq(did));
(lldb) p rs
(nogdb::ResultSet) $0 = size=0 {}
(lldb) p rs2
(nogdb::ResultSet) $1 = size=1 {
  [0] = {
    descriptor = {
      rid = (first = 24, second = 154)
      depth = 0
    }
    record = {
      properties = size=3 {
        [0] = {
          first = "createdDate"
          second = (value_ = <no value available>, size_ = 8)
        }
        [1] = {
          first = "dataID"
          second = (value_ = "CFCCategory#0164CF402A8FA28E66ACB30840858C15FDD65DEDC8E8", size_ = 56)
        }
        [2] = {
          first = "lastModified"
          second = (value_ = <no value available>, size_ = 8)
        }
      }
      basicProperties = size=5 {
        [0] = {
          first = "@className"
          second = (value_ = "CFCCategory", size_ = 11)
        }
        [1] = {
          first = "@depth"
          second = (value_ = <no value available>, size_ = 4)
        }
        [2] = {
          first = "@recordId"
          second = (value_ = "24:154", size_ = 6)
        }
        [3] = {
          first = "@txnVersion"
          second = (value_ = "\r", size_ = 8)
        }
        [4] = {
          first = "@version"
          second = (value_ = "\x01", size_ = 8)
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpendingAcknowledged issues but no actions yet

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions