Issue 366: MS SQL Server + FreeTDS, getting garbage instead of NULL date and datediff fields
Status:  New
Owner: ----
Reported by VFLa...@gmail.com, Apr 9, 2014
Here is code snippet that illustrates the problem:

row = cursor.execute("""
set nocount on
declare @field datetime
set @field = NULL
select
  @field as field,
  datediff(minute, @field, getdate()) as diff
""").fetchone()
assert row.field == None, 'pyodbc bug, returns garbage instead of null datetime' # fails here
assert row.diff  == None, 'pyodbc bug, returns zero instead of null datediff' # and here

os: CentOS release 6.5 (Final)
python: 2.7.2
pyodbc: 3.0.6
driver: freetds-0.82-NTLMv2-64
server: Microsoft SQL Server 2008 (SP3) - 10.0.5512.0 (X64)

Unfortunately, I'm quite restricted here and can't check other versions of pyodbc/driver.