[Mono-dev] patch for bug#76213 : DataTable.Compute

T Senganal tsenganal at novell.com
Mon Oct 17 11:29:55 EDT 2005


Hi 

Can someone review the patch attached to see if its appropriate for bug
#76213.. 

the bug is essentially this : 
when a xml data (without any schema info) is read into a dataset and an
aggregate function is applied on the data (DataTable.Compute), it
returns DBNull as the result ..
The issue is that in the absence of any schema info , all the data are
assumed as strings, and, since aggregate functions works only on numbers
, we  returns a DBNull is such cases .. Ideally, we shud check if the
string can be converted to a number.. 

msdotnet behavior is something like this: 
1. Only Max and Min works on such data .. Others like SUM, AVG etc
throw an exception 
2. Max and Min works only if the data can be converted to integers (Not
sure as to why only integers are supported) 
3. If the data is a float/double, an exception is raised only if the
result of the function is a float .. as in , if i have 1,2,5,3 .. then
everything works fine .. but 1.5,2,3  or  1,2,3.5 throws an exception
..This definitely is a bug..

for the fix : do we assume that we will support max and min functions
for integers or do we also support  floats?
i feel the msdotnet behavior is most likely a bug and dont see any
reason why floats shudnt be supported.. 

Also, not sure why the other aggregate functions dont support this
conversion .. Not sure if its a bug or a 'feature' in msdotnet.. 

pls advise.. 

Cheers
Senga
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_76213
Type: application/octet-stream
Size: 966 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051017/eee97768/attachment.obj 


More information about the Mono-devel-list mailing list