[Oledb-dev] Is it time for 1.0.0.20?

Konstantin Izmailov kizmailov at gmail.com
Mon Apr 17 07:00:28 UTC 2006


Shachar,
after another 15 mins of experimentations I prepared another diff.txt for
you (see attachment). My main problem was that I couldn't figure sequence of
the options for the CVS. Finally, the following command worked:
    cvs -d :pserver:anonymous at cvs.pgfoundry.org:/cvsroot/oledb diff -uN >
diff.txt

Please check format of the diff file and let me know if it is what you
expect. Now question: if I try to get latest code from CVS with "cvs up
-Pd", will it override my own changes?

Thanks
Konstantin

On 4/16/06, Shachar Shemesh <psql at shemesh.biz> wrote:
>
> Konstantin Izmailov wrote:
>
> > Shachar,
>
>
> > Let me know what you think.
>
> I'm afraid I'm going to have to stop you with formality.
>
> You did not use unified diff format (-u option), and I therefor cannot
> apply these patches.
>
> Another thing you failed to do is to perform a CVS update before you
> took the diffs. The diffs contain changes I already commited into CVS
> some time ago.
>
> > Thanks
> > Konstantin
>
> Shachar
>
> >? oledb/Debug
> >? oledb/DebugT
> >? oledb/OleDb.aps
> >? oledb/OleDb.h
> >? oledb/OleDb.ncb
> >? oledb/OleDb.sln
> >? oledb/OleDb.suo
> >? oledb/OleDb.tlb
> >? oledb/OleDb.vcproj
> >? oledb/OleDb.vcproj.KONST.Kostya.user
> >? oledb/OleDb_i.c
> >? oledb/OleDb_p.c
> >? oledb/PgLocate.h
> >? oledb/PgScroll.h
> >? oledb/dlldata.c
> >
> >
> Most of these are covered by a .cvsignore, and should not have appeared.
> Strange.
>
> >? oledb/res
> >
> >
> Checking out of cvs (or performing an update) with the "-P" flag will
> solve this one.
>
> Just do "cvs up -Pd" every time you want to make your source tree up to
> date.
>
> >
> >> * Copyright (C) 2004 Shachar Shemesh for Lingnu Open Systems Consulting
> (http://www.lignu.com)
> >>
> >>
> While it is very generous of you to give me copyright over code you've
> written, I think your name should appear here.
>
>       Shachar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/oledb-devel/attachments/20060417/685d6a3a/attachment-0001.html 
-------------- next part --------------
? oledb/Debug
? oledb/DebugT
? oledb/OleDb.aps
? oledb/OleDb.h
? oledb/OleDb.ncb
? oledb/OleDb.sln
? oledb/OleDb.suo
? oledb/OleDb.tlb
? oledb/OleDb.vcproj
? oledb/OleDb.vcproj.KONST.Kostya.user
? oledb/OleDb_i.c
? oledb/OleDb_p.c
? oledb/PgLocate.h
? oledb/PgScroll.h
? oledb/dlldata.c
? oledb/res
Index: oledb/OleDb.cpp
===================================================================
RCS file: /cvsroot/oledb/oledb/OleDb.cpp,v
retrieving revision 1.4
diff -u -r1.4 OleDb.cpp
--- oledb/OleDb.cpp	28 Oct 2004 15:18:33 -0000	1.4
+++ oledb/OleDb.cpp	17 Apr 2006 06:53:20 -0000
@@ -151,13 +151,13 @@
 
 void _cdecl PgAtlTrace2(DWORD category, UINT level, LPCTSTR lpszFormat, ...)
 {
-	if (category & ATL_TRACE_CATEGORY && level <= ATL_TRACE_LEVEL)
+	if (/*category & ATL_TRACE_CATEGORY &&*/ level <= ATL_TRACE_LEVEL)
 	{
 		va_list args;
 		va_start(args, lpszFormat);
 
 		int nBuf;
-		TCHAR szBuffer[512];
+		TCHAR szBuffer[4096];
 
 		nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(*szBuffer), lpszFormat, args);
 		ATLASSERT(nBuf < sizeof(szBuffer)/sizeof(*szBuffer));
Index: oledb/PgCommand.cpp
===================================================================
RCS file: /cvsroot/oledb/oledb/PgCommand.cpp,v
retrieving revision 1.22
diff -u -r1.22 PgCommand.cpp
--- oledb/PgCommand.cpp	19 Mar 2005 18:59:02 -0000	1.22
+++ oledb/PgCommand.cpp	17 Apr 2006 06:53:20 -0000
@@ -219,7 +219,18 @@
     ATLTRACE2(atlTraceDBProvider, 0, "CPgCommand::Execute\n");
     CErrorLookupService::ClearError();
     HRESULT hr=S_OK;
-    // The transaction object is not exception safe, so we need to manually release it at the end
+
+	// Setup ICommand properties depending on what cursor type requested.
+	// Usually the server side cursor requires CANSCROLLBACKWARDS and
+	// the client side does not. Similarly IRowsetLocate and IRowsetScroll
+	// are used by SSC only.
+	CComVariant varProp;
+   	GetPropValue(&DBPROPSET_ROWSET, DBPROP_CANSCROLLBACKWARDS, &varProp);
+	SetPropValue(&DBPROPSET_ROWSET, DBPROP_BOOKMARKS, &varProp);
+	SetPropValue(&DBPROPSET_ROWSET, DBPROP_IRowsetLocate, &varProp);
+	SetPropValue(&DBPROPSET_ROWSET, DBPROP_IRowsetScroll, &varProp);
+
+	// The transaction object is not exception safe, so we need to manually release it at the end
     // of the function. This requires that certain vars will be available outside of the "try" block
     bool transactioninitiated=false;
     CPgSession *pgsess=NULL;
@@ -328,6 +339,8 @@
                                  IUnknown** ppRowset,
                                  PGresult *pRes)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgCommand::CreateResult\n");
+
     HRESULT hr;
 
     // XXX Need to check whether DBPROP_MULTIPLERESULTS was set on the command?
@@ -510,6 +523,8 @@
                                       DBPARAMINFO    **prgParamInfo,
                                       OLECHAR        **ppNamesBuffer)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgCommand::GetParameterInfo\n");
+
     if( pcParams==NULL || prgParamInfo==NULL ) {
         return E_INVALIDARG;
     }
@@ -891,6 +906,8 @@
 HRESULT CPgCommand::FillinValues( char *paramValues[], int paramLengths[], size_t num_params,
                                  DBPARAMS * pParams, CPgSession *sess, auto_array<char> &buffer )
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgCommand::FillinValues\n");
+
     if( num_params==0 && pParams==NULL )
         return S_OK;
 
@@ -978,6 +995,8 @@
 
 ATLCOLUMNINFO* CPgCommand::GetColumnInfo(CPgCommand* pv, ULONG* pcInfo)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "ATLCOLUMNINFO* CPgCommand::GetColumnInfo\n");
+
     return CPgRowset::GetColumnInfo(pv->m_rowset,pcInfo);
 }
 
@@ -985,6 +1004,8 @@
                                    DBCOLUMNINFO **prgInfo,
                                    OLECHAR      **ppStringsBuffer)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "HRESULT CPgCommand::GetColumnInfo\n");
+
     if( m_rowset==NULL )
         return DB_E_NOCOMMAND;
     // XXX Strictly speaking, we are returning DB_E_NOCOMMAND even when we should have returned
Index: oledb/PgCommand.h
===================================================================
RCS file: /cvsroot/oledb/oledb/PgCommand.h,v
retrieving revision 1.8
diff -u -r1.8 PgCommand.h
--- oledb/PgCommand.h	2 Mar 2005 23:06:53 -0000	1.8
+++ oledb/PgCommand.h	17 Apr 2006 06:53:20 -0000
@@ -142,13 +142,14 @@
 		PROPERTY_INFO_ENTRY(IRowset)
 		PROPERTY_INFO_ENTRY(IRowsetIdentity)
 		PROPERTY_INFO_ENTRY(IRowsetInfo)
-		PROPERTY_INFO_ENTRY(IRowsetLocate)
-		PROPERTY_INFO_ENTRY(BOOKMARKS)
+		PROPERTY_INFO_ENTRY_VALUE(IRowsetLocate, VARIANT_FALSE)
+		PROPERTY_INFO_ENTRY_VALUE(IRowsetScroll, VARIANT_FALSE)
+		PROPERTY_INFO_ENTRY_EX(BOOKMARKS, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_FALSE, DBPROPOPTIONS_OPTIONAL )
 		PROPERTY_INFO_ENTRY(BOOKMARKSKIPPED)
 		PROPERTY_INFO_ENTRY(BOOKMARKTYPE)
-		PROPERTY_INFO_ENTRY(CANFETCHBACKWARDS)
+		PROPERTY_INFO_ENTRY_VALUE(CANFETCHBACKWARDS, VARIANT_FALSE)
 		PROPERTY_INFO_ENTRY(CANHOLDROWS)
-		PROPERTY_INFO_ENTRY(CANSCROLLBACKWARDS)
+		PROPERTY_INFO_ENTRY_VALUE(CANSCROLLBACKWARDS, VARIANT_FALSE)
 		PROPERTY_INFO_ENTRY(LITERALBOOKMARKS)
 		PROPERTY_INFO_ENTRY(ORDEREDBOOKMARKS)
 	END_PROPERTY_SET(DBPROPSET_ROWSET)
@@ -194,4 +195,4 @@
     }
 };
 
-#endif //__CPgRowset_H_
+#endif __CPgCommand_H_
Index: oledb/PgRS.h
===================================================================
RCS file: /cvsroot/oledb/oledb/PgRS.h,v
retrieving revision 1.25
diff -u -r1.25 PgRS.h
--- oledb/PgRS.h	25 Apr 2005 21:12:27 -0000	1.25
+++ oledb/PgRS.h	17 Apr 2006 06:53:20 -0000
@@ -21,7 +21,7 @@
 #ifndef __CPgRowset_H_
 #define __CPgRowset_H_
 #include "PgCommand.h"
-
+#include "PgScroll.h"
 #include "typeinfo.h"
 
 class CPgSession;
@@ -65,7 +65,7 @@
             PQclear(m_res);
         m_res=NULL;
 	}
-	int GetSize() const
+	int GetCount() const
 	{
         return PQntuples(m_res);
 	}
@@ -124,8 +124,8 @@
 };
 
 class CPgRowset :
-    public CRowsetImpl< CPgRowset, CPgRemoteStorage, CPgCommand, CPgVirtualArray >,
-    public IPgRowset
+    public CRowsetImpl<CPgRowset, CPgRemoteStorage, CPgCommand, CPgVirtualArray, CSimpleRow, IPgRowsetScrollImpl<CPgRowset, IRowsetScroll> >
+    , public IPgRowset
 {
 public:
     HRESULT Execute(DBPARAMS * pParams, LONG* pcRowsAffected);
@@ -151,6 +151,11 @@
 	COM_INTERFACE_ENTRY(IRowsetIdentity)
 	COM_INTERFACE_ENTRY(IRowset)
 	COM_INTERFACE_ENTRY(IPgRowset)
+	COM_INTERFACE_ENTRY(IRowsetLocate)
+	COM_INTERFACE_ENTRY(IRowsetScroll)
+
+	//COM_INTERFACE_ENTRY(IRowsetExactScroll)
+	//COM_INTERFACE_ENTRY(IRowsetFind)
 END_COM_MAP()
 
     HRESULT PostConstruct( CPgSession *sess, PGresult *pRes );
Index: oledb/PgSess.cpp
===================================================================
RCS file: /cvsroot/oledb/oledb/PgSess.cpp,v
retrieving revision 1.37
diff -u -r1.37 PgSess.cpp
--- oledb/PgSess.cpp	25 Apr 2005 21:12:27 -0000	1.37
+++ oledb/PgSess.cpp	17 Apr 2006 06:53:20 -0000
@@ -112,6 +112,8 @@
 
 HRESULT STDMETHODCALLTYPE CPgSession::PgConnectDB( BSTR connectString )
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::PgConnectDB(%S)\n", connectString);
+
     CErrorLookupService::ClearError();
     USES_CONVERSION;
     HRESULT hr=S_OK;
@@ -248,7 +250,9 @@
 }
 HRESULT CPgSession::PgTransactionLevel( DWORD *level )
 {
-    *level=m_transaction?1:0;
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::PgTransactionLevel\n");
+
+	*level=m_transaction?1:0;
 
     return S_OK;
 }
@@ -263,7 +267,9 @@
         /* [in] */ ULONG isoFlags, /* [in] */ ITransactionOptions __RPC_FAR *pOtherOptions,
         /* [out] */ ULONG __RPC_FAR *pulTransactionLevel)
 {
-    CErrorLookupService::ClearError();
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::StartTransaction\n");
+
+	CErrorLookupService::ClearError();
 
     // Sanity call and params
     if( isoFlags!=0 )
@@ -326,6 +332,8 @@
 HRESULT STDMETHODCALLTYPE CPgSession::Commit( /* [in] */ BOOL fRetaining, /* [in] */ DWORD grfTC,
         /* [in] */ DWORD grfRM)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::Commit\n");
+
     CErrorLookupService::ClearError();
 
     return ErroredCommit( fRetaining, grfTC, grfRM );
@@ -370,6 +378,8 @@
 HRESULT STDMETHODCALLTYPE CPgSession::Abort( /* [unique][in] */ BOID __RPC_FAR *pboidReason,
         /* [in] */ BOOL fRetaining, /* [in] */ BOOL fAsync)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::Abort\n");
+
     CErrorLookupService::ClearError();
     if( !m_transaction ) {
         ATLTRACE2(atlTraceDBProvider, 0, "CPgSession::Abort called not inside a transaction\n");
@@ -405,6 +415,8 @@
 HRESULT STDMETHODCALLTYPE CPgSession::GetTransactionInfo(
         /* [out] */ XACTTRANSINFO __RPC_FAR *pinfo)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "GetTransactionInfo\n");
+
     if( m_transaction ) {
         *pinfo=m_transactioninfo;
     } else {
@@ -447,6 +459,8 @@
 
 STDMETHODIMP CPgSession::GetPgStatus(BSTR * result, BSTR param)
 {
+	ATLTRACE2(atlTraceDBProvider, TRACELVL, "CPgSession::GetPgStatus\n");
+
     USES_CONVERSION;
 
     const char *answer=PQparameterStatus( m_conn, OLE2CA(param) );
Index: oledb/StdAfx.h
===================================================================
RCS file: /cvsroot/oledb/oledb/StdAfx.h,v
retrieving revision 1.12
diff -u -r1.12 StdAfx.h
--- oledb/StdAfx.h	28 Oct 2004 13:50:05 -0000	1.12
+++ oledb/StdAfx.h	17 Apr 2006 06:53:20 -0000
@@ -38,6 +38,8 @@
 #define _ATL_APARTMENT_THREADED
 #define ATL_TRACE_LEVEL 3
 
+#define TRACELVL	0		//KI
+
 #ifdef TRACEOVERRIDE
 #define ATLTRACE PgAtlTrace
 #define ATLTRACE2 PgAtlTrace2


More information about the Oledb-devel mailing list