NVarchar changes where conditional evaluation order - by Luxspes

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 772990 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/30/2012 6:49:32 AM
Access Restriction Public


If you use nvarchar in a query, it inverts the predicate in the execution plan of "AND" causing an "Error converting data type nvarchar to float" that should not happen because once the first part of an AND evaluates to false the second part should not be evaluated.

I discovered this bug migrating queries from SQL 2000 to SQL 2012, this bug does not exist in SQL 2000, it might have been introduced by SQL 2012 (or perhaps other version)
Sign in to post a comment.
Posted by Gus [MSFT] on 4/25/2013 at 2:28 PM

Thank you for submitting this feedback. After carefully evaluating all of the bugs in our pipeline, we are closing bugs that are by design.

Thanks again for reporting the product issue and continued support in improving our product.
Gus Apostol, SQL Server Program Manager
Posted by Vishal [MSFT] on 12/19/2012 at 3:10 PM
Thanks for your feedback, though we do not consider this to be a bug,we will add it as an item for consider for future enhancements
Posted by Martin Smith on 12/2/2012 at 5:36 AM
SQL Server doesn't guarantee any particular order of evaluation. See http://rusanu.com/2009/09/13/on-sql-server-boolean-operator-short-circuit/ and http://connect.microsoft.com/SQLServer/feedback/details/537419/sql-server-should-not-raise-illogical-errors for more about this.
Posted by Luxspes on 11/30/2012 at 6:57 AM
More detailed info here: http://luxspes.blogspot.mx/2012/11/sql-2012-bug-nvarchar-changes-where.html
Posted by Luxspes on 11/30/2012 at 6:53 AM
The Operating System was Windows 8. It was in English but its regional configuration was for Spanish (Mexico)