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

toughen IBSONDocumentEnumerator against null elements #25

Open
stijnsanders opened this issue Jun 13, 2015 · 3 comments
Open

toughen IBSONDocumentEnumerator against null elements #25

stijnsanders opened this issue Jun 13, 2015 · 3 comments

Comments

@stijnsanders
Copy link
Owner

No description provided.

@scaleman114
Copy link

Hi,
Just trying out example1 and getting an 'invalid pointer error' when trying to refresh or load documents with a null field.
Will you be looking at this anytime soon?
Thanks

@stijnsanders
Copy link
Owner Author

It's not strictly related to this issue, but there was indeed a bug. Please update to the recent commit.

@stijnsanders
Copy link
Owner Author

Then again. Having a second look, this bug may have caused me to post this issue way back then. If I try IBSONEnumerator over {{x:1},null,{x:2}} now it now fails because Can't mix documents and non-documents with IBSONDocumentEnumerator. If I were ever to make IBSONDocumentEnumerator support null elements in the array, I'd have to change:

  • stmReadBSONDocArray if l=bsonNull, but then skip the part where the object's length is read (since there's nothing there)
  • TBSONDocumentEnumerator.Next if FPos[FPosCurrent]= 0 or -1 or something invalid just to not do Load, but do a 'Reset' to at least inc(FLoadIndex) on the document or something
  • see what an array that starts with an element bsonNULL does, as it currently doesn't lead into stmReadBSONDocArray...
  • decide if it's important that {{x:1},null,{x:2}} and {{x:1},{},{x:2}} will behave exactly the same...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants