Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing attributes cause something wrong with get function #45

Open
crossknight opened this issue Jul 25, 2018 · 1 comment
Open

Indexing attributes cause something wrong with get function #45

crossknight opened this issue Jul 25, 2018 · 1 comment
Assignees
Labels
bug Something isn't working pending Acknowledged issues but no actions yet

Comments

@crossknight
Copy link

crossknight commented Jul 25, 2018

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)
        }
      }
    }
  }
}
@pj4dev pj4dev self-assigned this Jul 30, 2018
@pj4dev pj4dev added the bug Something isn't working label Jul 30, 2018
@pj4dev
Copy link
Contributor

pj4dev commented Jul 30, 2018

Hi @crossknight,

This bug will be temporarily fixed in the next develop merge commit. The solution might not resolve the issue wisely but it will make everything work as expected. We will let you know again once the better solution is implemented and released.

@pj4dev pj4dev added the pending Acknowledged issues but no actions yet label Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending Acknowledged issues but no actions yet
Projects
None yet
Development

No branches or pull requests

2 participants