[CDRIVER-1234] Inconsistent error reporting when advancing completed OP_QUERY and command cursor Created: 17/May/16 Updated: 10/Aug/16 Resolved: 24/May/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.4.0 |
| Fix Version/s: | 1.4.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
While revising older PHPC tests to account for proper behavior noted in _mongoc_cursor_next() and _mongoc_cursor_cursorid_next() are used for OP_QUERY and command cursor iteration, respectively. Both return true or false depending on whether a BSON document has been read (i.e. *bson is checked), although they differ in how cursor->done is calculated. An superfluous call to _mongoc_cursor_next() results in a cursor error being set ("Cannot advance a completed or failed cursor."); however, a superfluous call to _mongoc_cursor_cursorid_next() raise no such error. In PHPC, this means that extra iteration on a complete cursor may or may not throw an exception, depending on the underlying protocol. Is it feasible to make these two methods consistent, either by having _mongoc_cursor_cursorid_next() set an error or removing the exception error from _mongoc_cursor_next()? |
| Comments |
| Comment by Githook User [ 06/Jun/16 ] |
|
Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}Message: Test cursor iteration beyond last document for |
| Comment by Githook User [ 24/May/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |
| Comment by Jeremy Mikola [ 17/May/16 ] |
|
Current PHPC tests: https://github.com/mongodb/mongo-php-driver/pull/327 |