Hi Dave,

That seems reasonable enough to me.

GetLastError only returns a wxString though, fed from PQerrorMessage so I guess it would be the string that would be tested for content?

Maybe passing the ExecStatusType into a DBConn/DBResult member variable that could be tested would work better?

Thoughts? :)

Cheers

Martin






Inactive hide details for Dave Page ---06/07/2012 11:06:04---Hi On Fri, Jul 6, 2012 at 8:04 AM, Martin FrenchDave Page ---06/07/2012 11:06:04---Hi On Fri, Jul 6, 2012 at 8:04 AM, Martin French

From: Dave Page <dp...@pgadmin.org>
To: Martin French <martin.fre...@romaxtech.com>,
Cc: pgadmin-support@postgresql.org
Date: 06/07/2012 11:06
Subject: Re: [pgadmin-support] pgAgent reports failure upon success





Hi

On Fri, Jul 6, 2012 at 8:04 AM, Martin French
<martin.fre...@romaxtech.com> wrote:
>
> I've been through the code, and the return of 1 is coming back from the
> number of rows inserted after ExecuteVoid so the logic following in job.cpp
> seems incorrect:
>
>                 wxString stepstatus;
>                 if (rc == 0)
>                         stepstatus = wxT("s");
>                 else
>                         stepstatus = steps->GetString(wxT("jstonerror"));
>
> "rc" is coming back as the number of rows, so in this case; 1. I assume
> because the "do" statement returns 0 it's reporting ok.

Yeah, that is a bug; though I don't think the issue is in that code
snippet. I think it's here:

stepConn = DBconn::Get(jstconnstr, jstdbname);
if (stepConn)
{
   LogMessage(wxString::Format(_("Executing SQL step %s (part of job
%s)"), stepid.c_str(), jobid.c_str()), LOG_DEBUG);
   rc = stepConn->ExecuteVoid(steps->GetString(wxT("jstcode")));
   output = stepConn->GetLastError();
   stepConn->Return();
}

I think rc should be set to either 0 or -1, depending on whether an
error was returned, not based on the return value from ExecuteVoid.

Seem reasonable?

--
Dave Page
Blog:
http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK:
http://www.enterprisedb.com
The Enterprise PostgreSQL Company


============================================= Romax Technology Limited Rutherford House Nottingham Science & Technology Park Nottingham, NG7 2PZ England Telephone numbers: +44 (0)115 951 88 00 (main) For other office locations see: http://www.romaxtech.com/Contact ================================= =============== E-mail: i...@romaxtech.com Website: www.romaxtech.com ================================= ================ Confidentiality Statement This transmission is for the addressee only and contains information that is confidential and privileged. Unless you are the named addressee, or authorised to receive it on behalf of the addressee you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please delete from your system and contact the sender. Thank you for your cooperation. =================================================

<<inline: graycol.gif>>

Reply via email to