sql backend failure when deleting an account

Matthew Vanecek mevanecek@yahoo.com
Wed, 14 Nov 2001 20:06:27 -0800 (PST)


--- Dave Peticolas <dave@krondo.com> wrote:
> On Tue, 2001-11-13 at 12:03, Matthew Vanecek wrote:
> > Just from looking at the inserts, it looks like
> it's
> > only missing one field in the select
> > subquery--objtype.  I hadn't traced buf back to
> see
> > how it's all put together, but it shouldn't be too
> > difficult to add it in at the right spot.  I
> suspect
> > this is also the problem with deleting
> transactions.
> > 
> > If I were to make fixes to it, I would prefer they
> > work in the stable version.  Perhaps I could take
> a
> 
> Yes, I think that's best.
> 
> 
> > look at what you're doing in the unstable version,
> and
> > see if there's an acceptable way to back-port?  I
> 
> One thing you might start with is back-porting the
> automated test routines I have placed in
> src/backend/postgres/test.
> It was with these routines that I found the bugs in
> the
> unstable version.
> 
> dave

I'll  give that a whirl.  You don't have any
documentation on the test-db.c, do you?  any little
notes about it?  Sometimes that's easier than trying
to divine the process flow from the code...

I made a small change to kvp-sql.c in CPY_KVP(TYPE). I
 added the objtype in the following bit:

   p = stpcpy (p, "' as sessionGuid, datetime('NOW')
as date_changed, "	\
                  "'d' as change, 'z' as objtype, *
from gncKVPValue" TYPE " WHERE iguid=");\


I picked 'z' as an arbitrary value--ideally it should
come from the objtype of the object being removed.  I
hadn't quite figured out how to get that yet, but I'll
read the code some more.  Any hints would be
appreciated, though...

Anyhow, the above little change allows deletes (of
transactions and of accounts) to work correctly.  I
think the sql backend would be more-or-less OK if that
were implemented.  Of course, I still need to find the
best way to get the objtype field, to correctly note
the type of transaction being deleted.

I noticed that the src/engine/sql directory is empty
in the cvs head tree.  Is all that stuff moved to the
src/backend/postresql directory?

ciao


=====
Matt Vanecek

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com