[Libreoffice] curiosity in OResultSet.cxx

Terrence Enger tenger at iseries-guru.com
Mon Aug 8 09:51:39 PDT 2011


On Mon, 2011-08-08 at 15:10 +0100, Caolán McNamara wrote:
> On Sat, 2011-08-06 at 14:01 -0400, Terrence Enger wrote:
> > Do you know what I might be able to do to make LibreOffice
> > execute the line in question?  The queries I tried did not
> > execute the line, and I confess that I did not persist very
> > long exploring in opengrok.
> 
> Given that our default allocator spits out a message in debug mode when
> there's a new/delete[] mismatch it might be the case that it's rare for
> it to be non NULL seeing as this code is probably around a long time.

Not that it matters, but I suspect the scalar delete is new
since I was looking at this source file back in the time of
openoffice.org.

I do not think the pointer would ever be NULL.  It is
assigned from operator new[1] in the constructor and from
operator new[_par0] in setFetchSize, _par0 being a parameter
received from the caller.  It seems unlikely that the caller
to setFetchSize would pass a new size of zero, and it has
never occurred to me wonder what happens if you do new[0].

As the pointed-to data is array of SQLUSMALLINT, which lacks
a destructor for the scalar delete to fail to call, I
suspect that the scalar delete would not even leak heap
space.  So only somebody watching the debug error messages
or a compulsively anal-retentive reader of the code--not
naming any names, mind you!--is likely to see a problem.  Of
course, a fix is good anyway, even if only for letting that
compulsively anal-retentive reader maintain his serenity.

> 
> I've no good ideas really except to "mess around with it" unfortunately.
> So much of the database stuff requires fairly steep set up times for the
> databases themselves that I don't personally play with them much.

Yeah, "mess around with it" is what I was doing.  Hence my
subsequent question "two assertions and a failed query".

<aside>
  About setup and so forth ... I remember reading somewhere
  on the net a complaint from in interviewer about a
  candidate for a development position on the IBM i.  The
  interviewer complained that every attempt to dig into the
  answer to a question of the form how-do-you-do
  such-and-such was met with with a dumb look and the
  response "you just do it".  Yes, the IBM i takes care of
  so much on its own, and we i programmers *are* so spoiled.
  I can sympathise with both sides in this failure to
  communicate.
</aside>

Thanks,
Terry.




More information about the LibreOffice mailing list