Bug 180

Summary: Slonik DATE command
Product: Slony-I Reporter: Christopher Browne <cbbrowne>
Component: slonikAssignee: Jose Arthur Benetasso Villanova <jose.arthur>
Severity: enhancement CC: jose.arthur, slony1-bugs
Priority: low    
Version: devel   
Hardware: All   
OS: All   
URL: http://lists.slony.info/pipermail/slony1-general/2010-November/011328.html
Attachments: Date patch for slonik
Results of rejections from patch
Date patch for slonik

Description Christopher Browne 2010-12-07 12:18:38 UTC
Add DATE command that emits the current date + time as output from Slonik.

Enables capturing timing information within a script.
Comment 1 Jose Arthur Benetasso Villanova 2010-12-30 12:12:51 UTC
Created attachment 80 [details]
Date patch for slonik


An implementation of the date command for slonik.

José Arthur.
Comment 2 Christopher Browne 2011-01-04 09:32:38 UTC
I'm not quite sure what's up; this doesn't seem to apply to HEAD...

postgres@cbbrowne [12:29:52] [~/slony1-engine.github] [master *]
-> % git checkout -b bug180 master
Switched to a new branch 'bug180'                                                                                                                                                   postgres@cbbrowne [12:29:58] [~/slony1-engine.github] [bug180 *]
-> % patch < /tmp/date.patch
patching file slonik_ref.sgml                                                                                                                                                       Hunk #1 FAILED at 379.
1 out of 1 hunk FAILED -- saving rejects to file slonik_ref.sgml.rej
patching file parser.y
Hunk #1 FAILED at 76.
Hunk #2 FAILED at 141.
Hunk #3 FAILED at 376.
Hunk #4 FAILED at 472.
Hunk #5 FAILED at 1597.
Hunk #6 FAILED at 1813.
6 out of 6 hunks FAILED -- saving rejects to file parser.y.rej
patching file scan.l
Hunk #1 FAILED at 88.
Hunk #2 FAILED at 99.
2 out of 2 hunks FAILED -- saving rejects to file scan.l.rej
patching file slonik.c
Hunk #1 FAILED at 264.
Hunk #2 FAILED at 1177.
2 out of 2 hunks FAILED -- saving rejects to file slonik.c.rej
patching file slonik.h
Hunk #1 FAILED at 16.
Hunk #2 FAILED at 64.
Hunk #3 FAILED at 146.
Hunk #4 FAILED at 634.
4 out of 4 hunks FAILED -- saving rejects to file slonik.h.rej

I'll attach the rejection notices from patch.
Comment 3 Christopher Browne 2011-01-04 09:35:19 UTC
Created attachment 81 [details]
Results of rejections from patch

Built this tarball thus:

postgres@cbbrowne [12:30:53] [~/slony1-engine.github] [bug180 *]
-> % tar cfvj rejects-date.tar.bz2 `find -name "*.rej"`
Comment 4 Christopher Browne 2011-01-04 09:53:56 UTC
A browse of the patch shows that the contents seem quite reasonable.  Perhaps "patch" isn't what I should be using to apply it...
Comment 5 Jose Arthur Benetasso Villanova 2011-01-04 10:19:41 UTC
(In reply to comment #4)
> A browse of the patch shows that the contents seem quite reasonable.  Perhaps
> "patch" isn't what I should be using to apply it...

I did the reverse patch :-(. Sorry about that, I'll post the correct one as soon as possible.

I could apply using: "patch -p1 -R < /tmp/date.patch"
Comment 6 Jose Arthur Benetasso Villanova 2011-01-05 06:41:53 UTC
Created attachment 82 [details]
Date patch for slonik

patch -p1 < ~/date.patch should do the job
Comment 7 Christopher Browne 2011-01-05 13:57:01 UTC
Cool, that's working now.

I have published the patch into a branch in my repo at GitHub.


Your patch:

I added in a further patch that puts DATE commands into one of the regression tests.

If someone else can take a peek at this, it looks addable to me.
Comment 8 Steve Singer 2011-01-06 13:12:46 UTC
This patch has been applied to master