freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: LacaK <lacak AT zoznam.sk>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] PATCH for db-lib
- Date: Wed, 25 Aug 2010 11:46:51 +0200
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.
--- 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))
--- 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;
}
- [freetds] PATCH for db-lib, LacaK, 08/25/2010
Archive powered by MHonArc 2.6.24.