Skip to content

Commit

Permalink
Issue 48: Patch to add SQL Server XML data type
Browse files Browse the repository at this point in the history
  • Loading branch information
John Chandler authored and mkleehammer committed May 14, 2009
1 parent 345c3c3 commit 31e2fae
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ PythonTypeFromSqlType(const SQLCHAR* name, SQLSMALLINT type, bool unicode_result
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
case SQL_GUID:
case SQL_SS_XML:
if (unicode_results)
pytype = (PyObject*)&PyUnicode_Type;
else
Expand Down
6 changes: 6 additions & 0 deletions src/dbspecific.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// ---------------------------------------------------------------------------------------------------------------------
// SQL Server


// SQL Server 2005 xml type

#define SQL_SS_XML -152


// SQL Server 2008 time type

#define SQL_SS_TIME2 -154
Expand Down
2 changes: 2 additions & 0 deletions src/getdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ GetDataString(Cursor* cur, int iCol)
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
case SQL_GUID:
case SQL_SS_XML:
if (cur->cnxn->unicode_results)
nTargetType = SQL_C_WCHAR;
else
Expand Down Expand Up @@ -580,6 +581,7 @@ GetData(Cursor* cur, Py_ssize_t iCol)
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
case SQL_GUID:
case SQL_SS_XML:
return GetDataString(cur, iCol);

case SQL_BINARY:
Expand Down
1 change: 1 addition & 0 deletions src/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ static const char* SqlTypeName(SQLSMALLINT n)
_MAKESTR(SQL_TYPE_TIME);
_MAKESTR(SQL_TYPE_TIMESTAMP);
_MAKESTR(SQL_SS_TIME2);
_MAKESTR(SQL_SS_XML);
}
return "unknown";
}
Expand Down
1 change: 1 addition & 0 deletions src/pyodbcmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ static const ConstantDef aConstants[] = {
MAKECONST(SQL_TYPE_TIME),
MAKECONST(SQL_TYPE_TIMESTAMP),
MAKECONST(SQL_SS_TIME2),
MAKECONST(SQL_SS_XML),
MAKECONST(SQL_INTERVAL_MONTH),
MAKECONST(SQL_INTERVAL_YEAR),
MAKECONST(SQL_INTERVAL_YEAR_TO_MONTH),
Expand Down

0 comments on commit 31e2fae

Please sign in to comment.