Re: pgAgent reports failure upon success - Mailing list pgadmin-support
From | Martin French |
---|---|
Subject | Re: pgAgent reports failure upon success |
Date | |
Msg-id | OFADEC17D7.B93BF89A-ON80257A33.0037A182-80257A33.003A3D3D@LocalDomain Whole thread Raw |
In response to | Re: pgAgent reports failure upon success (Dave Page <dpage@pgadmin.org>) |
Responses |
Re: pgAgent reports failure upon success
|
List | pgadmin-support |
<p><font face="sans-serif" size="2">Hi Dave,</font><br /><br /><font face="sans-serif" size="2">That seems reasonable enoughto me. </font><br /><br /><font face="sans-serif" size="2">GetLastError only returns a wxString though, fed from PQerrorMessageso I guess it would be the string that would be tested for content?</font><br /><br /><font face="sans-serif"size="2">Maybe passing the </font><tt><font size="1">ExecStatusType</font></tt><font face="sans-serif" size="2"> intoa DBConn/DBResult member variable that could be tested would work better?</font><br /><br /><font face="sans-serif"size="2">Thoughts? :)</font><br /><br /><font face="sans-serif" size="2">Cheers</font><br /><br /><fontface="sans-serif" size="2">Martin</font><br /><br /><br /><br /><br /><br /><br /><img alt="Inactive hide detailsfor Dave Page ---06/07/2012 11:06:04---Hi On Fri, Jul 6, 2012 at 8:04 AM, Martin French" border="0" height="16" src="cid:0__=0FBBF0A0DFA427128f9e8a93df@romaxtech.com"width="16" /><font color="#424282" face="sans-serif" size="2">DavePage ---06/07/2012 11:06:04---Hi On Fri, Jul 6, 2012 at 8:04 AM, Martin French</font><br /><br /><font color="#5F5F5F"face="sans-serif" size="1">From: </font><font face="sans-serif" size="1">Dave Page <dpage@pgadmin.org></font><br/><font color="#5F5F5F" face="sans-serif" size="1">To: </font><font face="sans-serif"size="1">Martin French <Martin.French@romaxtech.com>, </font><br /><font color="#5F5F5F" face="sans-serif"size="1">Cc: </font><font face="sans-serif" size="1">pgadmin-support@postgresql.org</font><br /><font color="#5F5F5F"face="sans-serif" size="1">Date: </font><font face="sans-serif" size="1">06/07/2012 11:06</font><br /><fontcolor="#5F5F5F" face="sans-serif" size="1">Subject: </font><font face="sans-serif" size="1">Re: [pgadmin-support]pgAgent reports failure upon success</font><br /><hr align="left" noshade size="2" style="color:#8091A5;" width="100%" /><br /><br /><br /><tt><font size="2">Hi<br /><br />On Fri, Jul 6, 2012 at 8:04 AM,Martin French<br /><Martin.French@romaxtech.com> wrote:<br />><br />> I've been through the code, and thereturn of 1 is coming back from the<br />> number of rows inserted after ExecuteVoid so the logic following in job.cpp<br/>> seems incorrect:<br />><br />> wxString stepstatus;<br />> if (rc== 0)<br />> stepstatus = wxT("s");<br />> else<br />> stepstatus = steps->GetString(wxT("jstonerror"));<br />><br />> "rc" is coming back as the number ofrows, so in this case; 1. I assume<br />> because the "do" statement returns 0 it's reporting ok.<br /><br />Yeah, thatis a bug; though I don't think the issue is in that code<br />snippet. I think it's here:<br /><br />stepConn = DBconn::Get(jstconnstr,jstdbname);<br />if (stepConn)<br />{<br /> LogMessage(wxString::Format(_("Executing SQL step %s(part of job<br />%s)"), stepid.c_str(), jobid.c_str()), LOG_DEBUG);<br /> rc = stepConn->ExecuteVoid(steps->GetString(wxT("jstcode")));<br/> output = stepConn->GetLastError();<br /> stepConn->Return();<br/>}<br /><br />I think rc should be set to either 0 or -1, depending on whether an<br />error wasreturned, not based on the return value from ExecuteVoid.<br /><br />Seem reasonable?<br /></font></tt><tt><font size="2"><br/>-- <br />Dave Page<br />Blog: </font></tt><tt><font size="2"><a href="http://pgsnake.blogspot.com">http://pgsnake.blogspot.com</a></font></tt><tt><fontsize="2"><br />Twitter: @pgsnake<br/><br />EnterpriseDB UK: </font></tt><tt><font size="2"><a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a></font></tt><tt><fontsize="2"><br />The Enterprise PostgreSQLCompany<br /></font></tt><tt><font size="2"><br /></font></tt><br /><font face="sans-serif">=============================================Romax Technology Limited Rutherford House Nottingham Science& Technology Park Nottingham, NG7 2PZ England Telephone numbers: +44 (0)115 951 88 00 (main) For other officelocations see: http://www.romaxtech.com/Contact ================================= =============== E-mail: info@romaxtech.comWebsite: www.romaxtech.com ================================= ================ Confidentiality StatementThis transmission is for the addressee only and contains information that is confidential and privileged. Unlessyou are the named addressee, or authorised to receive it on behalf of the addressee you may not copy or use it, ordisclose it to anyone else. If you have received this transmission in error please delete from your system and contactthe sender. Thank you for your cooperation. =================================================</font>
pgadmin-support by date: