diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-12-15 03:03:37 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-12-15 03:03:37 +0000 |
commit | abdc701198fde5be73bd32e73c8c9d2ad294d649 (patch) | |
tree | 83b1e2aaf28d7f8b61db14da667d93eabc74be94 | |
parent | 8d075de12be6ba8eea701280b885417eeff7d106 (diff) |
Add support for freetds 0.82 which is being shipped now with newer distros, and maintain compatibility for 0.64 and up.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10890 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/extra/m_mssql.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 5e7662588..92e1970c8 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -21,6 +21,7 @@ #include "m_sqlv2.h" /* $ModDesc: MsSQL provider */ +/* $CompileFlags: exec("cat /usr/include/tdsver.h | grep VERSION_NO | perl -e 'if (<> =~ /freetds v([0-9]+\.[0-9]+)/i) { print "-D_TDSVER=".$1*100} else { print "-D_TDSVER=0" }'") */ /* $LinkerFlags: -ltds */ /* $ModDep: m_sqlv2.h */ @@ -469,7 +470,11 @@ class SQLConn : public classbase unsigned char* src; CONV_RESULT dres; ctype = tds_get_conversion_type(col->column_type, col->column_size); - src = &(sock->current_results->current_row[col->column_offset]); +#if _TDSVER >= 82 + src = col->column_data; +#else + src = &(sock->current_results->current_row[col->column_offset]); +#endif srclen = col->column_cur_size; tds_convert(sock->tds_ctx, ctype, (TDS_CHAR *) src, srclen, SYBCHAR, &dres); data[j] = (char*)dres.ib; |