Thread: Fixed FB 20417

Fixed FB 20417

From
Akshay Joshi
Date:
Hi Dave

I have fixed the Fogbugz 20417 "PEM client: Unable to remove comments on slony Replication(edb_cluster) tab". Attached is the patch file, please review it.

--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Attachment

Re: Fixed FB 20417

From
Dave Page
Date:
On Mon, Jan 9, 2012 at 11:23 AM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi Dave
>
> I have fixed the Fogbugz 20417 "PEM client: Unable to remove comments on
> slony Replication(edb_cluster) tab". Attached is the patch file, please
> review it.

Hi,

I think the patch is basically correct, but needs a small mod so it
only appends the comment change if the user has actually changed it
from the existing value to something else.

Thanks!

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

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

Re: Fixed FB 20417

From
Akshay Joshi
Date:
Hi Dave

Modified the logic. Attached is the patch file, please review it.

On Mon, Jan 9, 2012 at 6:04 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Jan 9, 2012 at 11:23 AM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
> Hi Dave
>
> I have fixed the Fogbugz 20417 "PEM client: Unable to remove comments on
> slony Replication(edb_cluster) tab". Attached is the patch file, please
> review it.

Hi,

I think the patch is basically correct, but needs a small mod so it
only appends the comment change if the user has actually changed it
from the existing value to something else.

Thanks!

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

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



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Attachment

Re: Fixed FB 20417

From
Guillaume Lelarge
Date:
On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
> Hi Dave
>
> Modified the logic. Attached is the patch file, please review it.
>

This is still wrong. bIsChangeComment isn't always true when the user
creates a replication cluster. It's only true if there is a comment.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org


Re: Fixed FB 20417

From
Dave Page
Date:
On Tue, Jan 10, 2012 at 9:36 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
>> Hi Dave
>>
>> Modified the logic. Attached is the patch file, please review it.
>>
>
> This is still wrong. bIsChangeComment isn't always true when the user
> creates a replication cluster. It's only true if there is a comment.

Seems a little long-winded too - can't you just replace the current
IsEmpty() test with something like "if (txtComment->GetValue() !=
cluster->GetComment())"?

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

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

Re: Fixed FB 20417

From
Akshay Joshi
Date:

On Tue, Jan 10, 2012 at 3:09 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Jan 10, 2012 at 9:36 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
>> Hi Dave
>>
>> Modified the logic. Attached is the patch file, please review it.
>>
>
> This is still wrong. bIsChangeComment isn't always true when the user
> creates a replication cluster. It's only true if there is a comment.

Seems a little long-winded too - can't you just replace the current
IsEmpty() test with something like "if (txtComment->GetValue() !=
cluster->GetComment())"?

   No, I can't because when we create new Slony I-cluster "cluster->GetComment()" will not work as cluster object is NULL at that moment.

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

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



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Re: Fixed FB 20417

From
Dave Page
Date:
On Tue, Jan 10, 2012 at 10:09 AM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
>
> On Tue, Jan 10, 2012 at 3:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Tue, Jan 10, 2012 at 9:36 AM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>> > On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
>> >> Hi Dave
>> >>
>> >> Modified the logic. Attached is the patch file, please review it.
>> >>
>> >
>> > This is still wrong. bIsChangeComment isn't always true when the user
>> > creates a replication cluster. It's only true if there is a comment.
>>
>> Seems a little long-winded too - can't you just replace the current
>> IsEmpty() test with something like "if (txtComment->GetValue() !=
>> cluster->GetComment())"?
>
>
>    No, I can't because when we create new Slony I-cluster
> "cluster->GetComment()" will not work as cluster object is NULL at that
> moment.

If ((!cluster && !txtComment.IsEmpty()) || (cluster &&
cluster->GetComment() != txtComment->GetValue()) ?


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

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

Re: Fixed FB 20417

From
Akshay Joshi
Date:


On Tue, Jan 10, 2012 at 3:44 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Jan 10, 2012 at 10:09 AM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
>
> On Tue, Jan 10, 2012 at 3:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Tue, Jan 10, 2012 at 9:36 AM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>> > On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
>> >> Hi Dave
>> >>
>> >> Modified the logic. Attached is the patch file, please review it.
>> >>
>> >
>> > This is still wrong. bIsChangeComment isn't always true when the user
>> > creates a replication cluster. It's only true if there is a comment.
>>
>> Seems a little long-winded too - can't you just replace the current
>> IsEmpty() test with something like "if (txtComment->GetValue() !=
>> cluster->GetComment())"?
>
>
>    No, I can't because when we create new Slony I-cluster
> "cluster->GetComment()" will not work as cluster object is NULL at that
> moment.

If ((!cluster && !txtComment.IsEmpty()) || (cluster &&
cluster->GetComment() != txtComment->GetValue()) ?

  It works. Attached the modified patch. 


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

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



--
Akshay Joshi
Senior Software Engineer 
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246

Attachment

Re: Fixed FB 20417

From
Dave Page
Date:
Thanks, patch applied!

On Tue, Jan 10, 2012 at 10:53 AM, Akshay Joshi
<akshay.joshi@enterprisedb.com> wrote:
>
>
> On Tue, Jan 10, 2012 at 3:44 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Tue, Jan 10, 2012 at 10:09 AM, Akshay Joshi
>> <akshay.joshi@enterprisedb.com> wrote:
>> >
>> > On Tue, Jan 10, 2012 at 3:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >>
>> >> On Tue, Jan 10, 2012 at 9:36 AM, Guillaume Lelarge
>> >> <guillaume@lelarge.info> wrote:
>> >> > On Tue, 2012-01-10 at 14:31 +0530, Akshay Joshi wrote:
>> >> >> Hi Dave
>> >> >>
>> >> >> Modified the logic. Attached is the patch file, please review it.
>> >> >>
>> >> >
>> >> > This is still wrong. bIsChangeComment isn't always true when the user
>> >> > creates a replication cluster. It's only true if there is a comment.
>> >>
>> >> Seems a little long-winded too - can't you just replace the current
>> >> IsEmpty() test with something like "if (txtComment->GetValue() !=
>> >> cluster->GetComment())"?
>> >
>> >
>> >    No, I can't because when we create new Slony I-cluster
>> > "cluster->GetComment()" will not work as cluster object is NULL at that
>> > moment.
>>
>> If ((!cluster && !txtComment.IsEmpty()) || (cluster &&
>> cluster->GetComment() != txtComment->GetValue()) ?
>
>
>   It works. Attached the modified patch.
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>
>
>
> --
> Akshay Joshi
> Senior Software Engineer
> EnterpriseDB Corporation
> The Enterprise PostgreSQL Company
> Phone: +91 20-3058-9522
> Mobile: +91 976-788-8246
>



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

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