Bug 180 - Slonik DATE command
Summary: Slonik DATE command
Status: RESOLVED FIXED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: slonik (show other bugs)
Version: devel
Hardware: All All
: low enhancement
Assignee: Jose Arthur Benetasso Villanova
URL: http://lists.slony.info/pipermail/slo...
Depends on:
Blocks:
 
Reported: 2010-12-07 12:18 UTC by Christopher Browne
Modified: 2011-01-06 13:12 UTC (History)
2 users (show)

See Also:


Attachments
Date patch for slonik (6.23 KB, patch)
2010-12-30 12:12 UTC, Jose Arthur Benetasso Villanova
Details
Results of rejections from patch (2.02 KB, application/x-bzip)
2011-01-04 09:35 UTC, Christopher Browne
Details
Date patch for slonik (6.23 KB, patch)
2011-01-05 06:41 UTC, Jose Arthur Benetasso Villanova
Details

Note You need to log in before you can comment on or make changes to this bug.
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

Hi.

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"`
./scan.l.rej
./slonik.c.rej
./slonik_ref.sgml.rej
./parser.y.rej
./slonik.h.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.

https://github.com/cbbrowne/slony1-engine/commits/bug180

Your patch:
https://github.com/cbbrowne/slony1-engine/commit/c734f36a5812ebf82dbd06092ad7dac27dfa1957

I added in a further patch that puts DATE commands into one of the regression tests.
https://github.com/cbbrowne/slony1-engine/commit/8ad1dbcc21d8a3ab830920369c83bf956c257594

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

Thanks

http://git.postgresql.org/gitweb?p=slony1-engine.git;a=commit;h=f1f570ea7965f18ba048a452fba2a7f5a411eba0