Skip to content

Commit f58c385

Browse files
author
damoxc
committed
add support for nullable bits and ints
change version in setup.py to 1.9.909 and tag version with -dev in setup.cfg update changelog
1 parent fc08c63 commit f58c385

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
Thu Apr 29 16:20:00 2010 Damien Churchill <damoxc@gmail.com>
2+
* _mssql.py:
3+
+ feature: add support for nullable ints and nullable bits in
4+
stored procedure parameters.
5+
* version 1.9.909
6+
17
Wed Apr 28 11:10:00 2010 Damien Churchill <damoxc@gmail.com>
28
* MANIFEST.in:
39
+ bugfix: fix recursive-include for .pyrex
4-
* version 1.9.907.1
10+
* version 1.9.908
511

612
Wed Apr 21 16:02:00 2010 Damien Churchill <damoxc@gmail.com>
713
* MANIFEST.in:

_mssql.pyx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is an effort to convert the pymssql low-level C module to Cython.
66
#
77
# Copyright (C) 2003 Joon-cheol Park <jooncheol@gmail.com>
88
# 2008 Andrzej Kukula <akukula@gmail.com>
9-
# 2009 Damien Churchill <damoxc@gmail.com>
9+
# 2009-2010 Damien Churchill <damoxc@gmail.com>
1010
#
1111
# This library is free software; you can redistribute it and/or
1212
# modify it under the terms of the GNU Lesser General Public
@@ -601,6 +601,9 @@ cdef class MSSQLConnection:
601601
intValue[0] = <int>value
602602
return <BYTE *><DBBIT *>intValue
603603

604+
if dbtype[0] == SQLINTN:
605+
dbtype[0] = SQLINT4
606+
604607
if dbtype[0] in (SQLINT1, SQLINT2, SQLINT4):
605608
intValue = <int *>PyMem_Malloc(sizeof(int))
606609
intValue[0] = <int>value
@@ -1097,6 +1100,10 @@ cdef class MSSQLStoredProcedure:
10971100
# later.
10981101
self.params[name] = value
10991102

1103+
# We support nullable parameters by just not binding them
1104+
if dbtype in (SQLINTN, SQLBITN) and data == NULL:
1105+
return
1106+
11001107
# Store the converted parameter in our parameter list so we can
11011108
# free() it later.
11021109
if data != NULL:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[egg_info]
2-
tag_build =
2+
tag_build = -dev

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def upload(self, filename, comment):
244244

245245
setup(
246246
name = 'pymssql',
247-
version = '1.9.908',
247+
version = '1.9.909',
248248
description = 'A simple database interface to MS-SQL for Python.',
249249
long_description = 'A simple database interface to MS-SQL for Python.',
250250
author = 'Damien Churchill',

0 commit comments

Comments
 (0)