Why TestMathAcos and TestMathAsin can pass SqlClient test?

Oct 31, 2009 at 7:30 AM

Hello,

I find a strange thing, for TestMathAcos and TestMathAsin, they can pass SqlClient test without any exception.
Test 95: TestMathAcos - PASSED
Test 96: TestMathAsin - PASSED

The sql generated are:
SELECT t0.[CustomerID], t0.[OrderDate], t0.[OrderID]
FROM [Orders] AS t0
WHERE (ACOS(t0.[OrderID]) = 0.0)

SELECT t0.[CustomerID], t0.[OrderDate], t0.[OrderID]
FROM [Orders] AS t0
WHERE (ASIN(t0.[OrderID]) = 0.0)

When I run the sqls in SQL Server Management Studio, below errors occur:
Warning: A domain error occurred.
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded. 

When I try similar thing with OracleClient, exception throws when executing reader:
ORA-01428: argument '10290' is out of range

The error message is same as directly execute the sql on Oracle:
SELECT t0."CustomerID", t0."OrderDate", t0."OrderID"
FROM "Orders" t0
WHERE (ACOS(t0."OrderID") = 0.0)

For both Sql server and Oracle, exception is expected, because acos arguments should be -1 to 1.

So my question is, is it a SqlClient bug, or there is any secret in IQToolkit?

Thanks
Wicky

Coordinator
Nov 30, 2009 at 10:54 PM

Good question.  I don't know why it is succeeding.  It is likely failing, but not bad enough to cause an exception out of SqlClient since it also produces no rows.