[Oledb-dev] bytea commits to PgRS.* files cause pgoledb to return uninitialized GetColumnInfo data

Victor Snezhko snezhko at indorsoft.ru
Wed Apr 12 11:20:24 GMT 2006


Hello!

I'm trying to tweak pgoledb to work with Microsoft client cursor
engine (CCE) and have found a bug introduced by commits which add the
support of bytea.

The following line has been added to PgRS.h:FillDataOffsets():

         for( int i=0; i<nfields; ++i ) {
             rpInfo[i].cbOffset=m_offsets[i];
+            rpInfo[i].ulColumnSize=m_sizes[i];
         }

m_sizes array is filled when a column data is requested. But CCE calls
GetColumnInfo before it requests any data. Thus ulColumnSize becomes
filled with uninitialized contents of m_sizes.

As far as I understand, bytea support is far from working (not tested,
there is a message stating this in the bugtracking system), so could
we revert this part of the commit?  

If needed, I can provide logs confirming this behaviour on a simple
jscript program:
  var objRs = new ActiveXObject("ADODB.Recordset");
  objRs.CursorLocation = adUseClient;
  objRs.Sort="field_1";
  objRs.open("my_table", 
             ConnectionString, 
             adOpenForwardOnly,
             adLockReadOnly,
             adCmdTable);

With the provider from HEAD the program fails with an exception "Sort
order cannot be applied" with at least int and varchar fields
(obviously because of bogus ulColumnSizes)

P.S.: first broken version of PgRS.h is 1.25

P.P.S: Reverting a commit is obvoiusly not a full solution (m_offsets
are as well uninitialized, although they seem not to be used by CCE at
this moment and not cause any visible breakage to me). Comments on how
to fix it are welcome.

-- 
WBR, Victor V. Snezhko
EMail: snezhko at indorsoft.ru




More information about the Oledb-devel mailing list