On Tue, 2004-08-03 at 03:41, Gavin Sherry wrote: > Attached is a patch fixing this. > > One question I do have: > > if (target->savepointLevel != s->savepointLevel) > > Will this ever be true in the current code? I cannot see anything setting > savepointLevel explicitly.
>From reading the lists, it seems like that's allowing for some functionality that was talked about but wasn't part of the semantics agreed upon by the end of the discussion. I have a question for you also. I just posted a patch at about the same time you did (I sent it to pgsql-patches, but I haven't seen it appear yet). Mine was a one-liner (appended to end of this email) and all it did was add a check into the aforementioned line for a non-null target pointer. My patch seemed to work, so I'd like to know why you changed the structure around more. I did notice some things were a little cleaner, so was it just clean-up or does my patch fail in some way? Regards, Jeff --- xact.c.old 2004-08-03 03:18:12.000000000 -0700 +++ xact.c 2004-08-03 03:19:05.000000000 -0700 @@ -2529,7 +2529,7 @@ target = target->parent; /* we don't cross savepoint level boundaries */ - if (target->savepointLevel != s->savepointLevel) + if (PointerIsValid(target) && (target->savepointLevel != s->savepointLevel)) ereport(ERROR, (errcode(ERRCODE_S_E_INVALID_SPECIFICATION), errmsg("no such savepoint"))); ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster