PATCH for db-lib

LacaK <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hi,

I send patch for some db-lib functions: dbsetlversion, dbcolinfo, dbiscount
(I wrote about it in my previous emails)
Please review and if ok, then please commit.
Thanks
-Laco.

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
sybdb.h.diff (text/plain, 541 B)
--- f:\tmp\sybdb.h.old	Sun Feb  7 22:56:10 2010
+++ f:\tmp\sybdb.h	Wed Aug 25 10:40:38 2010
@@ -626,6 +626,7 @@ DBINT dbcolutype(DBPROCESS * dbprocess, 
 DBINT dbconvert(DBPROCESS * dbproc, int srctype, const BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen);
 DBINT dbconvert_ps(DBPROCESS * dbprocess, int srctype, BYTE * src, DBINT srclen, int desttype, BYTE * dest, DBINT destlen,
 		   DBTYPEINFO * typeinfo);
+BOOL dbiscount(DBPROCESS * dbproc);
 DBINT dbcount(DBPROCESS * dbproc);
 
 #define DBCOUNT(x) dbcount((x))
dblib.c.diff (text/plain, 1.2 KB)
--- f:\tmp\dblib.c.old	Tue Jul 27 10:53:12 2010
+++ f:\tmp\dblib.c	Wed Aug 25 11:37:05 2010
@@ -915,7 +915,13 @@ dbsetlversion (LOGINREC * login, BYTE ve
 		login->tds_login->tds_version = 0x402;
 		return SUCCEED;
 	case DBVER60:
-		login->tds_login->tds_version = 0x600;
+		login->tds_login->tds_version = 0x700;
+		return SUCCEED;
+	case DBVERSION_71:
+		tds_set_version(login->tds_login, 7, 1);
+		return SUCCEED;
+	case DBVERSION_72:
+		tds_set_version(login->tds_login, 7, 2);
 		return SUCCEED;
 	}
 	
@@ -2703,6 +2709,15 @@ dbanullbind(DBPROCESS * dbproc, int comp
  * 	- for select, count of rows returned, after all rows have been fetched.  
  * \sa DBCOUNT(), dbnextrow(), dbresults().
  */
+BOOL
+dbiscount(DBPROCESS * dbproc)
+{
+	tdsdump_log(TDS_DBG_FUNC, "dbiscount(%p)\n", dbproc);
+	CHECK_PARAMETER(dbproc, SYBENULL, -1);
+
+	return dbproc && dbproc->tds_socket && dbproc->tds_socket->rows_affected != TDS_NO_COUNT;
+}
+
 DBINT
 dbcount(DBPROCESS * dbproc)
 {
@@ -2889,6 +2904,9 @@ dbcolinfo (DBPROCESS *dbproc, CI_TYPE ty
 			pdbcol->Precision = ps->precision;
 			pdbcol->Scale = ps->scale;
 		}
+
+		pdbcol->Updatable = colinfo->column_writeable ? TRUE : FALSE;
+		pdbcol->Identity = colinfo->column_identity ? TRUE : FALSE;
 
 		return SUCCEED;
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.