Re: [pgScript patch] Output + bug fix - Mailing list pgadmin-hackers

From Mickael Deloison
Subject Re: [pgScript patch] Output + bug fix
Date
Msg-id 1f8f052b0903061437r629ce4e2j7bdb068065f24b9f@mail.gmail.com
Whole thread Raw
In response to Re: [pgScript patch] Output + bug fix  (Dave Page <dpage@pgadmin.org>)
Responses Re: [pgScript patch] Output + bug fix  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
2009/3/6 Dave Page <dpage@pgadmin.org>:
> There were some cases where error messages would be lost, and part of
> the fix was to try to make errors all go through SetLastResultError()
> for consistency in output. I modified SetLastResultError() so that if
> it's passed NULL, it gets the message via: lastResultError.msg_primary
> = GetLastError(); instead, so it /should/ get the same message.
>
> Can you supply an example of how to trigger the warning please? I
> assume it's a pgScript thing, as I get notices and errors from the
> backend just fine.
>

Here is the code you requested, I removed the useless parts:

pgQueryThread thread(m_app->connection(), stmt);

if (thread.Create() == wxTHREAD_NO_ERROR)
{
    if (thread.Run() == wxTHREAD_NO_ERROR)
    {
        // ...
    }

    if (thread.ReturnCode() != PGRES_COMMAND_OK
            && thread.ReturnCode() != PGRES_TUPLES_OK)
    {
        // ...
        wxString message(stmt + wxT("\n") +
-->            thread.GetMessagesAndClear().Strip(wxString::both));
        // ...
        (*m_cout) << message << wxT("\n");
        // ...
    }


Now, I always have nothing when I call GetMessagesAndClear().

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Greenplum patch for pgAdmin
Next
From: Dave Page
Date:
Subject: Re: [pgScript patch] Output + bug fix