yuan8825399 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

False positive for consumed flag #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call GridReader.Read<T> and then GridReader.Read<U>
2. The consumed flag should be specific for the typeof(T)

What is the expected output? What do you see instead?
No exception if the type has changed.

What version of the product are you using? On what operating system?
Latest source code on Windows 7 Enterprise SP 1

Please provide any additional information below:

Change the consumed variable to be new Dictionary<Type, Bool>() and modify the 
6 places or so it used to work with this flag as a dictionary.

Original issue reported on code.google.com by cmschick...@gmail.com on 27 Jul 2013 at 9:17

GoogleCodeExporter commented 9 years ago
I forgot to add that this issue is only evident in the case where two result 
sets are returned from the data provider and the first result set is empty 
while the second result set is not.  So essentially, the consumed flag is set 
to true before ReadDeferred<T> is called and if the enumeration returns no 
results the flag has already been set so that the second call to 
GridReader.Read<U> (with a different type) throws the exception.

Original comment by cmschick...@gmail.com on 28 Jul 2013 at 10:37