From abdc701198fde5be73bd32e73c8c9d2ad294d649 Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 15 Dec 2008 03:03:37 +0000 Subject: 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 --- src/modules/extra/m_mssql.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3