Closed VFLashM closed 9 years ago
It cannot behave correctly, because return value is sent at the end of the tds stream, basically you cannot read it before you read all returned rows. Throwing an exception is also not good, it would require client code to first to iterate through all results, and this may break some code that relies on it.
I can document this behavior, if you agree with current implementation.
Also I would suggest to avoid using "return" statement, because it is not DBAPI compliant, if possible.
I understand that it's how protocol works, there is nothing we can do to fix it completely. But is it possible to assert on fetch after return_value? Currently if you fetch after checking return_value, it silently returns nothing. It would be great if it threw an error like the one that says "Previous statement didn't produce any results", but mentioned that return_value might be the cause of that problem.
User calls stored procedure with callproc. Stored procedure returns resultset and return value. If return value is read before resultset, resultsset is always empty. It's not clear to me if it can be fixed easily. I suppose it should be at least asserted.