Обсуждение: patch for "Sequence: calculate next value to be expected"
Hi, Please find the attachments. I try to make a enhancement to sequence. As my understanding, add a property item to properties pane. The nextValue is lastValue + increment; Is it right? Regards, Quan Zongliang
Вложения
Hi On Tue, Sep 4, 2012 at 5:19 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: > Hi, > > Please find the attachments. > > I try to make a enhancement to sequence. > As my understanding, add a property item to properties pane. > The nextValue is lastValue + increment; > > Is it right? If looks right - but the patches don't apply (did you create it from the master branch?). Please see the errors below. Note that the most reliable and convenient way to create a patch is "git diff > patch.diff". Individual patches for each file are not so convenient to deal with. raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.cpp.patch /Users/dpage/Downloads/pgSequence.cpp.patch:9: trailing whitespace. nextValue = lastValue + increment; /Users/dpage/Downloads/pgSequence.cpp.patch:18: trailing whitespace. + GetOwnerSql(7, 3, wxT("SEQUENCE ") + GetQuotedFullIdentifier()); /Users/dpage/Downloads/pgSequence.cpp.patch:26: trailing whitespace. properties->AppendItem(_("Next value"), GetNextValue()); error: patch failed: pgadmin/schema/pgSequence.cpp:126 error: pgadmin/schema/pgSequence.cpp: patch does not apply raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.h.patch /Users/dpage/Downloads/pgSequence.h.patch:9: trailing whitespace. wxLongLong GetNextValue() const /Users/dpage/Downloads/pgSequence.h.patch:10: trailing whitespace. { /Users/dpage/Downloads/pgSequence.h.patch:11: trailing whitespace. return nextValue; /Users/dpage/Downloads/pgSequence.h.patch:12: trailing whitespace. } /Users/dpage/Downloads/pgSequence.h.patch:21: trailing whitespace. wxLongLong lastValue, nextValue, minValue, maxValue, cacheValue, increment; error: patch failed: pgadmin/include/schema/pgSequence.h:51 error: pgadmin/include/schema/pgSequence.h: patch does not apply -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On 2012/9/4 18:55, Dave Page wrote: > Hi > > On Tue, Sep 4, 2012 at 5:19 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: >> Hi, >> >> Please find the attachments. >> >> I try to make a enhancement to sequence. >> As my understanding, add a property item to properties pane. >> The nextValue is lastValue + increment; >> >> Is it right? > If looks right - but the patches don't apply (did you create it from > the master branch?). Please see the errors below. Note that the most > reliable and convenient way to create a patch is "git diff > > patch.diff". Individual patches for each file are not so convenient to > deal with. > > raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.cpp.patch > /Users/dpage/Downloads/pgSequence.cpp.patch:9: trailing whitespace. > nextValue = lastValue + increment; > /Users/dpage/Downloads/pgSequence.cpp.patch:18: trailing whitespace. > + GetOwnerSql(7, 3, wxT("SEQUENCE ") + GetQuotedFullIdentifier()); > /Users/dpage/Downloads/pgSequence.cpp.patch:26: trailing whitespace. > properties->AppendItem(_("Next value"), GetNextValue()); > error: patch failed: pgadmin/schema/pgSequence.cpp:126 > error: pgadmin/schema/pgSequence.cpp: patch does not apply > raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.h.patch > /Users/dpage/Downloads/pgSequence.h.patch:9: trailing whitespace. > wxLongLong GetNextValue() const > /Users/dpage/Downloads/pgSequence.h.patch:10: trailing whitespace. > { > /Users/dpage/Downloads/pgSequence.h.patch:11: trailing whitespace. > return nextValue; > /Users/dpage/Downloads/pgSequence.h.patch:12: trailing whitespace. > } > /Users/dpage/Downloads/pgSequence.h.patch:21: trailing whitespace. > wxLongLong lastValue, nextValue, minValue, maxValue, cacheValue, increment; > error: patch failed: pgadmin/include/schema/pgSequence.h:51 > error: pgadmin/include/schema/pgSequence.h: patch does not apply > > The vs2010 express save header and cpp files as dos format. I guess this is why the patch can not be commited. New patch file is attached, try again. Quan Zongliang
Вложения
On 2012/9/5 9:02, Quan Zongliang wrote: > On 2012/9/4 18:55, Dave Page wrote: >> Hi >> >> On Tue, Sep 4, 2012 at 5:19 AM, Quan Zongliang >> <quanzongliang@gmail.com> wrote: >>> Hi, >>> >>> Please find the attachments. >>> >>> I try to make a enhancement to sequence. >>> As my understanding, add a property item to properties pane. >>> The nextValue is lastValue + increment; >>> >>> Is it right? >> If looks right - but the patches don't apply (did you create it from >> the master branch?). Please see the errors below. Note that the most >> reliable and convenient way to create a patch is "git diff > >> patch.diff". Individual patches for each file are not so convenient to >> deal with. >> >> raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.cpp.patch >> /Users/dpage/Downloads/pgSequence.cpp.patch:9: trailing whitespace. >> nextValue = lastValue + increment; >> /Users/dpage/Downloads/pgSequence.cpp.patch:18: trailing whitespace. >> + GetOwnerSql(7, 3, wxT("SEQUENCE ") + >> GetQuotedFullIdentifier()); >> /Users/dpage/Downloads/pgSequence.cpp.patch:26: trailing whitespace. >> properties->AppendItem(_("Next value"), GetNextValue()); >> error: patch failed: pgadmin/schema/pgSequence.cpp:126 >> error: pgadmin/schema/pgSequence.cpp: patch does not apply >> raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgSequence.h.patch >> /Users/dpage/Downloads/pgSequence.h.patch:9: trailing whitespace. >> wxLongLong GetNextValue() const >> /Users/dpage/Downloads/pgSequence.h.patch:10: trailing whitespace. >> { >> /Users/dpage/Downloads/pgSequence.h.patch:11: trailing whitespace. >> return nextValue; >> /Users/dpage/Downloads/pgSequence.h.patch:12: trailing whitespace. >> } >> /Users/dpage/Downloads/pgSequence.h.patch:21: trailing whitespace. >> wxLongLong lastValue, nextValue, minValue, maxValue, cacheValue, >> increment; >> error: patch failed: pgadmin/include/schema/pgSequence.h:51 >> error: pgadmin/include/schema/pgSequence.h: patch does not apply >> >> > The vs2010 express save header and cpp files as dos format. > I guess this is why the patch can not be commited. > > New patch file is attached, try again. > > Quan Zongliang > Sorry, patch again. When the sequence is not called, nextValue should be lastValue. Otherwise, it is lastValue + increment. Regards, Quan Zongliang
Вложения
Hi On Wed, Sep 5, 2012 at 3:11 AM, Quan Zongliang <quanzongliang@gmail.com> wrote: > > Sorry, patch again. > When the sequence is not called, nextValue should be lastValue. > Otherwise, it is lastValue + increment. That one still doesn't apply (though, the other one now does). dos2unix didn't help :-(. Not sure why you're seeing those problems - I've used VC++ for years without problems - if memory serves, it normally uses the same lineendings as are already in use. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
2012/9/5 Dave Page <dpage@pgadmin.org>
HiThat one still doesn't apply (though, the other one now does).
On Wed, Sep 5, 2012 at 3:11 AM, Quan Zongliang <quanzongliang@gmail.com> wrote:
>
> Sorry, patch again.
> When the sequence is not called, nextValue should be lastValue.
> Otherwise, it is lastValue + increment.
dos2unix didn't help :-(. Not sure why you're seeing those problems -
I've used VC++ for years without problems - if memory serves, it
normally uses the same lineendings as are already in use.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
That's weird.
I downloaded the file from this mail. It can not be applied.
Before send it, I tried to apply by "git apply" command to make sure it is Ok.
Let's try zip file.
Quan Zongliang
Вложения
On Wed, Sep 5, 2012 at 3:04 PM, 权宗亮 <quanzongliang@gmail.com> wrote: > > > 2012/9/5 Dave Page <dpage@pgadmin.org> >> >> Hi >> >> On Wed, Sep 5, 2012 at 3:11 AM, Quan Zongliang <quanzongliang@gmail.com> >> wrote: >> > >> > Sorry, patch again. >> > When the sequence is not called, nextValue should be lastValue. >> > Otherwise, it is lastValue + increment. >> >> That one still doesn't apply (though, the other one now does). >> dos2unix didn't help :-(. Not sure why you're seeing those problems - >> I've used VC++ for years without problems - if memory serves, it >> normally uses the same lineendings as are already in use. >> > > That's weird. > > I downloaded the file from this mail. It can not be applied. > > Before send it, I tried to apply by "git apply" command to make sure it is > Ok. > > Let's try zip file. That worked. Thanks - patch applied. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company