Re: pgAgent reports failure upon success
От | Dave Page |
---|---|
Тема | Re: pgAgent reports failure upon success |
Дата | |
Msg-id | CA+OCxox428wAm-Sf_VEkFfQ7oxkJSgYjYjD0Z_sV9_SjJx3cwA@mail.gmail.com обсуждение исходный текст |
Ответ на | pgAgent reports failure upon success ("Martin French" <Martin.French@romaxtech.com>) |
Ответы |
Re: pgAgent reports failure upon success
|
Список | pgadmin-support |
Hi On Fri, Jul 6, 2012 at 8:04 AM, Martin French <Martin.French@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
В списке pgadmin-support по дате отправления: