r18726 - in /trunk/libdbd-pg-perl: .perlcriticrc Changes MANIFEST META.yml Makefile.PL Pg.h Pg.pm Pg.xs README README.dev SIGNATURE TODO dbdimp.c dbdimp.h debian/changelog lib/ t/03dbmethod.t t/99_perlcritic.t t/99_pod.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Thu Apr 17 19:53:51 UTC 2008


Author: gregoa-guest
Date: Thu Apr 17 19:53:51 2008
New Revision: 18726

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=18726
Log:
New upstream release.

Added:
    trunk/libdbd-pg-perl/lib/
      - copied from r18725, branches/upstream/libdbd-pg-perl/current/lib/
Modified:
    trunk/libdbd-pg-perl/.perlcriticrc
    trunk/libdbd-pg-perl/Changes
    trunk/libdbd-pg-perl/MANIFEST
    trunk/libdbd-pg-perl/META.yml
    trunk/libdbd-pg-perl/Makefile.PL
    trunk/libdbd-pg-perl/Pg.h
    trunk/libdbd-pg-perl/Pg.pm
    trunk/libdbd-pg-perl/Pg.xs
    trunk/libdbd-pg-perl/README
    trunk/libdbd-pg-perl/README.dev
    trunk/libdbd-pg-perl/SIGNATURE
    trunk/libdbd-pg-perl/TODO
    trunk/libdbd-pg-perl/dbdimp.c
    trunk/libdbd-pg-perl/dbdimp.h
    trunk/libdbd-pg-perl/debian/changelog
    trunk/libdbd-pg-perl/t/03dbmethod.t
    trunk/libdbd-pg-perl/t/99_perlcritic.t
    trunk/libdbd-pg-perl/t/99_pod.t

Modified: trunk/libdbd-pg-perl/.perlcriticrc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/.perlcriticrc?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/.perlcriticrc (original)
+++ trunk/libdbd-pg-perl/.perlcriticrc Thu Apr 17 19:53:51 2008
@@ -24,14 +24,17 @@
 [-Editor::RequireEmacsFileVariables]
 [-ErrorHandling::RequireCarping]
 [-InputOutput::ProhibitOneArgSelect]
+[-InputOutput::RequireCheckedSyscalls]
 [-Lax::ProhibitComplexMappings::LinesNotStatements]
 [-Lax::ProhibitEmptyQuotes::ExceptAsFallback]
 [-Lax::ProhibitStringyEval::ExceptForRequire]
+[-Lax::RequireEndWithTrueConst]
 [-Miscellanea::RequireRcsKeywords]
 [-Modules::ProhibitAutomaticExportation] 
 [-Modules::ProhibitExcessMainComplexity]
 [-Modules::ProhibitMultiplePackages]
 [-Modules::RequireBarewordIncludes]
+[-Modules::RequireEndWithOne]
 [-References::ProhibitDoubleSigils]
 [-RegularExpressions::ProhibitCaptureWithoutTest]
 [-RegularExpressions::ProhibitFixedStringMatches]

Modified: trunk/libdbd-pg-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Changes?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Changes (original)
+++ trunk/libdbd-pg-perl/Changes Thu Apr 17 19:53:51 2008
@@ -1,6 +1,14 @@
 ('GSM' is Greg Sabino Mullane, greg at turnstep.com)
 
-2.5.1 Released April 7, 2008
+2.6.0 Released April 16, 2008
+
+	- Make pg_notifies a true function, so that you can now
+		use $dbh->pg_notifies instead of $dbh->func('pg_notifies') [GSM]
+	- Various performance improvements [GSM]
+	- Fix minor build and compilation issues with Strawberry Perl [GSM]
+	- Add Bundle::DBD::Pg [GSM]
+
+2.5.1 Released April 7, 2008 (subversion r11056)
 
 	- Correctly handle negative PID numbers on Win32 systems when
 		generating prepared statement names (CPAN bug # 34738) [GSM]

Modified: trunk/libdbd-pg-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/MANIFEST?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/MANIFEST (original)
+++ trunk/libdbd-pg-perl/MANIFEST Thu Apr 17 19:53:51 2008
@@ -50,3 +50,5 @@
 t/lib/App/Info/RDBMS/PostgreSQL.pm
 t/lib/App/Info/Request.pm
 t/lib/App/Info/Util.pm
+
+lib/Bundle/DBD/Pg.pm

Modified: trunk/libdbd-pg-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/META.yml?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/META.yml (original)
+++ trunk/libdbd-pg-perl/META.yml Thu Apr 17 19:53:51 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name                  : DBD-Pg
-version               : 2.5.1
+version               : 2.6.0
 abstract              : DBI PostgreSQL interface
 author:              
   - Greg Sabino Mullane <greg at turnstep.com>
@@ -34,7 +34,10 @@
 provides:
   DBD::Pg:
     file              : Pg.pm
-    version           : 2.5.1
+    version           : 2.6.0
+  Bundle::DBD::Pg:
+    file              : lib/Bundle/DBD/Pg.pm
+    version           : 2.6.0
 
 keywords:
   - Postgres

Modified: trunk/libdbd-pg-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Makefile.PL?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Makefile.PL (original)
+++ trunk/libdbd-pg-perl/Makefile.PL Thu Apr 17 19:53:51 2008
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL 11055 2008-04-07 16:46:23Z turnstep $
+# $Id: Makefile.PL 11094 2008-04-16 18:13:30Z turnstep $
 
 use ExtUtils::MakeMaker;
 use Config;
@@ -7,16 +7,18 @@
 use 5.006001;
 
 ## No version.pm for this one, as the prereqs are not loaded yet.
-my $VERSION = '2.5.1';
+my $VERSION = '2.6.0';
 
 my $lib;
 BEGIN {
-    my %sep = (MacOS   => ':',
+    my %sep = (
+			   MacOS   => ':',
                MSWin32 => '\\',
                os2     => '\\',
                VMS     => '\\',
                NetWare => '\\',
-               dos     => '\\');
+               dos     => '\\',
+			   );
     my $s = $sep{$^O} || '/';
     $lib = join $s, 't', 'lib';
 }
@@ -24,6 +26,40 @@
 use lib $lib;
 if ($VERSION =~ /_/) {
 	print "WARNING! This is a test version ($VERSION) and should not be used in production!\n";
+}
+
+if (grep { /help/ } @ARGV) {
+	print qq{
+Usage: perl $0
+
+No other options are necessary, although you may need to
+set some evironment variables. See the README file for full details.
+
+In brief:
+
+By default Makefile.PL uses App::Info to find the location of the
+PostgreSQL library and include directories.  However, if you want to
+control it yourself, define the environment variables POSTGRES_INCLUDE
+and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have
+compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB
+environment variable and add "-lssl" to it, like this:
+
+export POSTGRES_LIB="/usr/local/pgsql/lib -lssl"
+
+The usual steps to install DBD::Pg:
+
+1.   perl Makefile.PL
+2.   make
+3.   make test
+4.   make install
+
+Do steps 1 to 3 as a normal user, not as root!
+
+If all else fails, email dbd-pg\@perl.org for help.
+
+};
+	exit 1;
+
 }
 
 print "Configuring DBD::Pg $VERSION\n";
@@ -100,21 +136,16 @@
 }
 
 my $dbi_arch_dir;
-if ($os eq 'MSWin32') {
-	$dbi_arch_dir = "\$(INSTALLSITEARCH)/auto/DBI";
-}
-else {
-	{
-		eval {
-			require DBI::DBD;
-		};
-		if ($@) {
-			print "Could not load DBI::DBD - is the DBI module installed?\n";
-			exit 0;
-		}
-		local *STDOUT; ## Prevent duplicate debug info as WriteMakefile also calls this
-		$dbi_arch_dir = DBI::DBD::dbd_dbi_arch_dir();
+{
+	eval {
+		require DBI::DBD;
+	};
+	if ($@) {
+		print "Could not load DBI::DBD - is the DBI module installed?\n";
+		exit 0;
 	}
+	local *STDOUT; ## Prevent duplicate debug info as WriteMakefile also calls this
+	$dbi_arch_dir = DBI::DBD::dbd_dbi_arch_dir();
 }
 
 my $defines = " -DPGLIBVERSION=$serverversion -DPGDEFPORT=$defaultport";
@@ -169,7 +200,7 @@
 }
 elsif ($os =~ /Win32/) {
 	my $msdir = $POSTGRES_LIB;
-	$msdir =~ s#"$#/ms"#;
+	$msdir =~ s{"$}{/ms"};
 	$opts{LIBS}[0] .= " -L$msdir";
 }
 
@@ -177,13 +208,13 @@
     $opts{LINKTYPE} = 'static';
 }
 
-sub MY::postamble {
-	no strict 'subs';
+sub MY::postamble { ## no critic ProhibitQualifiedSubDeclarations
+	no strict 'subs'; ## no critic ProhibitNoStrict
 	my $string = DBI::DBD->dbd_postamble();
 	use strict 'subs';
 	## Evil, evil stuff - but we really want to suppress the "duplicate function" message!
 	$string =~ s/dependancy/dependency/g; ## why not, while we are here
-	$string =~ s#(BASEEXT\)/g)#$1; s/^do\\\(/dontdo\\\(/#;
+	$string =~ s{(BASEEXT\)/g)}{$1; s/^do\\\(/dontdo\\\(/};
 
         my $tags = <<'MAKE_FRAG';
 .PHONY: tags
@@ -238,7 +269,8 @@
 
 my $output = WriteMakefile(%opts);
 
-if (!exists $output->{EXTRALIBS} or $output->{EXTRALIBS} !~ /\-lpq/) {
+if (!exists $output->{EXTRALIBS} or
+	($output->{EXTRALIBS} !~ /\-lpq/ and $output->{EXTRALIBS} !~ /libpq/)) {
 
 	my $makefile = exists $output->{MAKEFILE}
 		? "\nRemoving ($output->{MAKEFILE})\n" : '';

Modified: trunk/libdbd-pg-perl/Pg.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.h?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.h (original)
+++ trunk/libdbd-pg-perl/Pg.h Thu Apr 17 19:53:51 2008
@@ -1,5 +1,5 @@
 /*
-   $Id: Pg.h 10925 2008-03-16 13:34:23Z turnstep $
+   $Id: Pg.h 11088 2008-04-16 03:17:45Z turnstep $
 
    Copyright (c) 2000-2008 Greg Sabino Mullane and others: see the Changes file
    Copyright (c) 1997-2000 Edmund Mergl
@@ -10,16 +10,18 @@
 
 */
 
-#include <strings.h>
 #include <math.h>
 #include <wchar.h>
 
 #ifdef WIN32
 static int errno;
-#define strcasecmp(s1,s2) lstrcmpiA((s1), (s2))
+#include <string.h>
+#define strcasecmp(s1,s2) stricmp((s1), (s2))
 #ifndef snprintf
 #define snprintf _snprintf
 #endif
+#else
+#include <strings.h>
 #endif
 
 #define DBDPG_TRUE (bool)1

Modified: trunk/libdbd-pg-perl/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.pm?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.pm (original)
+++ trunk/libdbd-pg-perl/Pg.pm Thu Apr 17 19:53:51 2008
@@ -1,5 +1,5 @@
 # -*-cperl-*-
-#  $Id: Pg.pm 11055 2008-04-07 16:46:23Z turnstep $
+#  $Id: Pg.pm 11094 2008-04-16 18:13:30Z turnstep $
 #
 #  Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
 #  Portions Copyright (c) 2002 Jeffrey W. Baker
@@ -17,7 +17,7 @@
 {
 	package DBD::Pg;
 
-	use version; our $VERSION = qv('2.5.1');
+	use version; our $VERSION = qv('2.6.0');
 
 	use DBI ();
 	use DynaLoader ();
@@ -124,6 +124,7 @@
 		DBD::Pg::db->install_method("pg_getline");
 		DBD::Pg::db->install_method("pg_getcopydata");
 		DBD::Pg::db->install_method("pg_getcopydata_async");
+		DBD::Pg::db->install_method("pg_notifies");
 		DBD::Pg::db->install_method("pg_putcopydata");
 		DBD::Pg::db->install_method("pg_putcopyend");
 		DBD::Pg::db->install_method("pg_ping");
@@ -1656,7 +1657,7 @@
 
 =head1 VERSION
 
-This documents version 2.5.1 of the DBD::Pg module
+This documents version 2.6.0 of the DBD::Pg module
 
 =head1 SYNOPSIS
 
@@ -2043,39 +2044,11 @@
 Exports a large object into a Unix file. Returns false upon failure, true
 otherwise.
 
-=item pg_notifies
-
-  $ret = $dbh->func('pg_notifies');
-
-Returns either C<undef> or a reference to two-element array [ $table,
-$backend_pid ] of asynchronous notifications received. Note that this does
-not check if the connection to the database is still valid - for that, 
-use the c<ping> method. Also note that you may need to commit if not in 
-autocommit mode - new notices will not be picked up while in the middle of 
-a transaction. An example:
-
-  $dbh->do("LISTEN abc");
-  $dbh->do("LISTEN def");
-
-  ## Hang around until we get the message we want
-  LISTENLOOP: {
-    while (my $notify = $dbh->func('pg_notifies')) {
-      my ($name, $pid) = @$notify;
-      print qq{I received notice "$name" from PID $pid\n};
-      ## Do something based on the notice received
-    }
-    $dbh->ping() or die qq{Ping failed!};
-    $dbh->commit();
-    sleep(5);
-    redo;
-  }
-
 =item getfd
 
   $fd = $dbh->func('getfd');
 
-Returns fd of the actual connection to server. Can be used with select() and
-func('pg_notifies'). Deprecated in favor of C<< $dbh->{pg_socket} >>.
+Deprecated, use C<< $dbh->{pg_socket} >> instead.
 
 =back
 
@@ -2541,6 +2514,33 @@
   $rc  = $dbh->disconnect;
 
 Supported by this driver as proposed by DBI.
+
+=item pg_notifies
+
+  $ret = $dbh->pg_notifies;
+
+Returns either C<undef> or a reference to two-element array [ $table,
+$backend_pid ] of asynchronous notifications received. Note that this does
+not check if the connection to the database is still valid - for that,
+use the c<ping> method. Also note that you may need to commit if not in
+autocommit mode - new notices will not be picked up while in the middle of
+a transaction. An example:
+
+  $dbh->do("LISTEN abc");
+  $dbh->do("LISTEN def");
+
+  ## Hang around until we get the message we want
+  LISTENLOOP: {
+    while (my $notify = $dbh->pg_notifies) {
+      my ($name, $pid) = @$notify;
+      print qq{I received notice "$name" from PID $pid\n};
+      ## Do something based on the notice received
+    }
+    $dbh->ping() or die qq{Ping failed!};
+    $dbh->commit();
+    sleep(5);
+    redo;
+  }
 
 =item B<ping>
 

Modified: trunk/libdbd-pg-perl/Pg.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.xs?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.xs (original)
+++ trunk/libdbd-pg-perl/Pg.xs Thu Apr 17 19:53:51 2008
@@ -1,5 +1,5 @@
 /*
-  $Id: Pg.xs 10830 2008-02-26 13:26:30Z turnstep $
+  $Id: Pg.xs 11069 2008-04-12 16:51:29Z turnstep $
 
   Copyright (c) 2000-2008 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 1997-2000 Edmund Mergl
@@ -282,7 +282,7 @@
 		int retval;
 		int asyncflag = 0;
 
-		if (strlen(statement)<1) { /* Corner case */
+		if (statement[0] == '\0') { /* Corner case */
 			XST_mUNDEF(0);
 			return;
 		}

Modified: trunk/libdbd-pg-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/README?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/README (original)
+++ trunk/libdbd-pg-perl/README Thu Apr 17 19:53:51 2008
@@ -1,11 +1,13 @@
+
 DBD::Pg  --  the DBI PostgreSQL interface for Perl
 
-# $Id: README 11055 2008-04-07 16:46:23Z turnstep $
+# $Id: README 11094 2008-04-16 18:13:30Z turnstep $
 
 DESCRIPTION:
 ------------
 
-This is version 2.5.1 of DBD-Pg.  The web site for this interface is at:
+This is version 2.6.0 of DBD-Pg.  The web site for this interface, and 
+the latst vesion, can be found at:
 
 	http://search.cpan.org/dist/DBD-Pg/
 
@@ -17,36 +19,11 @@
 
     http://www.nntp.perl.org/group/perl.dbd.pg/
 
-For further information about DBI look at:
-
-	http://dbi.perl.org/
-
 For information about PostgreSQL, visit:
 
 	http://www.postgresql.org/
 
 For information on what has changed for each version, see the Changes files.
-
-
-COPYRIGHT:
-----------
-
-	Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
-	Portions Copyright (c) 2002 Jeffrey W. Baker
-	Portions Copyright (c) 1997-2001 Edmund Mergl
-	Portions Copyright (c) 1994-1997 Tim Bunce
-
-You may distribute under the terms of either the GNU General Public
-License or the Artistic License, as specified in the Perl README file.
-
-
-HOW TO GET THE LATEST VERSION:
-------------------------------
-
-Use the following URL to look for new versions of this module: 
-
-http://search.cpan.org/dist/DBD-Pg/
-
 
 IF YOU HAVE PROBLEMS OR COMMENTS:
 ---------------------------------
@@ -65,8 +42,7 @@
 BUG REPORTS
 -----------
 
-If you feel certain you have found a bug, you can file a bug report 
-by visiting:
+If you feel certain you have found a bug, you can file a bug report by visiting:
 http://rt.cpan.org/Public/Dist/Display.html?Name=DBD-Pg
 and selecting the "Report a new bug" link. Please check that the bug 
 has not already been reported first.
@@ -103,7 +79,7 @@
 
 	export POSTGRES_LIB="/usr/local/pgsql/lib -lssl"
 
-Now, take the usual steps to install DBD::Pg:
+The usual steps to install DBD::Pg:
 
 	1.   perl Makefile.PL
 	2.   make
@@ -112,6 +88,9 @@
 
 Do steps 1 to 3 as a normal user, not as root!
 
+If the script cannot find the pg_config information itself, it will 
+ask you for the path to it. Enter the complete path to the pg_config 
+file here, including the name of the file itself.
 
 TESTING:
 --------
@@ -124,7 +103,7 @@
 	DBI_PASS=<password>
 
 If you are running on a non-standard port, you must set PGPORT or 
-add it to the DBI_DSN variable like this:
+add the port to the DBI_DSN variable like this:
 
 	DBI_DSN='dbi:Pg:dbname=<database>;port=<port#>'
 
@@ -313,3 +292,14 @@
 Once this is done, 'make test' succeeds properly.
 (thanks to <jmore at remote-print.com>)
 
+COPYRIGHT:
+----------
+
+	Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
+	Portions Copyright (c) 2002 Jeffrey W. Baker
+	Portions Copyright (c) 1997-2001 Edmund Mergl
+	Portions Copyright (c) 1994-1997 Tim Bunce
+
+You may distribute under the terms of either the GNU General Public
+License or the Artistic License, as specified in the Perl README file.
+

Modified: trunk/libdbd-pg-perl/README.dev
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/README.dev?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/README.dev (original)
+++ trunk/libdbd-pg-perl/README.dev Thu Apr 17 19:53:51 2008
@@ -1,5 +1,5 @@
 
-## $Id: README.dev 10953 2008-03-19 16:05:15Z turnstep $
+## $Id: README.dev 11083 2008-04-14 15:38:51Z turnstep $
 
 This file is for those interested in developing DBD::Pg. It is hoped that it 
 will be a good introduction as well as a continual reference. Suggestions 
@@ -77,7 +77,10 @@
 
 Makefile - Generated automatically by Makefile.PL
 
-META.yml - YAML description file. Updated by hand and contains version number in two places.
+META.yml - YAML description file. Updated by hand and contains version number in three places.
+
+lib/Bundle/DBD/Pg.pm - Simple file used to enable perl -MCPAN -e 'install Bundle::DBD::Pg'
+  Contains a version number.
 
 
 * Distribution files:
@@ -126,6 +129,7 @@
   types.h types.c Pg.xs Pg.pm t/01constants.t 99_pod.t
 
 types.h - Helper file for types.c
+
 
 * Test files:
 
@@ -473,16 +477,17 @@
 tweaks and bug fixes, and must be completely compatible with the version before it.
 
 Beta versions (aka release candidates) are the version with an underscore at the end of it. The 
-tells CPAN not to consider this a "real" release. For example, if the upcoming release is 2.2.3, 
+tells CPAN not to consider this a "real" release. For example, if the upcoming release is 2.2.4, 
 the first release candidate would be 2.2.3_1. A second would be 2.2.3_2 etc.
 
-Version numbers are currently set in five files:
+Version numbers are currently set in six files:
 
 README (one or two places)
 Pg.pm (two places)
 Changes
 Makefile.PL
-META.yml (two places)
+META.yml (three places)
+lib/Bundle/DBD/Pg.pm
 
 
 ===============

Modified: trunk/libdbd-pg-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/SIGNATURE?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/SIGNATURE (original)
+++ trunk/libdbd-pg-perl/SIGNATURE Thu Apr 17 19:53:51 2008
@@ -14,22 +14,23 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: RIPEMD160
 
-SHA1 e4bbe8e3845d0a18ad4603cf6a09c8187419efbd .perlcriticrc
-SHA1 3ddd9ec75240674ceb83595efa880f7299dbffb5 Changes
-SHA1 413251e7c544b2c00d18749f6b572a718a1c3a2f MANIFEST
+SHA1 7978ba2f16b8dd95eb95eec81b3360f928c749e7 .perlcriticrc
+SHA1 39038e12fb7d076729c4820282559a019846ac63 Changes
+SHA1 269c7ef4f136eac56f811380947f78fef3e5852f MANIFEST
 SHA1 d7c42da45397de439a6096058d01fa29575c8b52 MANIFEST.SKIP
-SHA1 cd85e310cb720c6a89517794f8df4f2c02df35e0 META.yml
-SHA1 686fe6956c76eb37f1f885d23decf73d3eb564fc Makefile.PL
-SHA1 11fc65245a64a3be04e8a1aeed17849e476c4711 Pg.h
-SHA1 25952f794c845b26255a8284a5357324ab58ac7a Pg.pm
-SHA1 4aa6f624317b3d5bcf67bb3748c8ca733edfcc50 Pg.xs
-SHA1 7c4163d86f81e81285c88e374e912b8f75c47573 README
-SHA1 187281b6aed5c1f56fd0183c7ce4fe58b71282ea README.dev
+SHA1 da9ef50598178e2b56a685cd09bfa75f0654f75e META.yml
+SHA1 78b9442c33cb138e6e2ec83f7b403941de60b984 Makefile.PL
+SHA1 05aa41f326c2e4045c77fb1f002cbbb08b704e70 Pg.h
+SHA1 6644ae257e6e1f1378d279d1e3dda9c647a6d58a Pg.pm
+SHA1 74deedcf6c03c4d2be067bc32291f1a738db8648 Pg.xs
+SHA1 51b952ef647fd937f7778e4bddd7be3523d2805a README
+SHA1 0af8b8a2d38665b42a356716fed9e9cb8087a7a8 README.dev
 SHA1 968d5fad61bce160b31a9cb1a21dd240b9df930f README.win32
-SHA1 0a65051689ffee85bc401ac815ac3a89e203d891 TODO
-SHA1 bd36637c8d70b941635976a1b26767db92d2b2b2 dbdimp.c
-SHA1 38a3247078d2ababf659b30bcd2fdf7155330c19 dbdimp.h
+SHA1 063d5e09e3593a8ea4b8149ab7ff1a41aba30d7f TODO
+SHA1 31b37b513aed78a7c5a663c82bc7eac254122b78 dbdimp.c
+SHA1 68847b3aa964ae598e6e4dd680943973f13c5715 dbdimp.h
 SHA1 6c33bcf138e577722283bef02fceb8cbce4d100d dbivport.h
+SHA1 c44f45d6300c49ae3b09730dbe28a2a55f027a32 lib/Bundle/DBD/Pg.pm
 SHA1 88c44732cb614e916ae8aeff2c2f2faedbfd8e9a quote.c
 SHA1 2d49573ccc984da374ff77cd893bf65505c0b382 quote.h
 SHA1 4da4f8074e8f46d4e787906fa6de3ebbadef29ed t/00-signature.t
@@ -37,7 +38,7 @@
 SHA1 5602ad2b473d8cdbf8c10c5bdcd0cabc5f42ee9d t/01connect.t
 SHA1 655b72fa5f29886caa9b4a0ac7d69dc078d4bf55 t/01constants.t
 SHA1 6b4df4bb35345ed2d8a4ba9360d8b47e135fd73e t/02attribs.t
-SHA1 a2130b8428c30cd1f0b0d83539548fabbae7beb6 t/03dbmethod.t
+SHA1 b25dbc33db552124ddb0505bf39248c47464d182 t/03dbmethod.t
 SHA1 267c1961ea9cce5ad491b95e01e465b9a6746dd3 t/03smethod.t
 SHA1 06aa87527ed7eb49a7b2572d55b8d1693a3f4932 t/04misc.t
 SHA1 d855410b526048d50a54eed6efda893ca459f042 t/06bytea.t
@@ -46,8 +47,8 @@
 SHA1 5d2c9e298a275163bda994b5fa64cd309a3ed4a1 t/09arrays.t
 SHA1 a0a00693ddc7ff3dd7726b32db0829262b55af76 t/12placeholders.t
 SHA1 6bdf8e55f3ea98f33af91e8f6af628901e66cd34 t/20savepoints.t
-SHA1 877a22e2953d9dfcc6652c8d66931cc031c88543 t/99_perlcritic.t
-SHA1 87a15c775cdf958f35ecd8df37b8ba1e7891acc0 t/99_pod.t
+SHA1 718aeadededafc298489463fce74ef19bc67f1c7 t/99_perlcritic.t
+SHA1 a7fc43f88188db79181b4f433fad9e91a5b7d3cf t/99_pod.t
 SHA1 e9e984b3c3366d5cee873f1dc59e2b7c26e744ee t/99_yaml.t
 SHA1 1d5475ff9b4706a6667e3c8d6ae0a6d03b650515 t/99cleanup.t
 SHA1 83246ff7edc24799e77637d900e9e3f54503ef52 t/dbdpg_test_setup.pl
@@ -63,7 +64,7 @@
 SHA1 f07cd5ecaeb854c81ceb9206364979cf607e6546 win32.mak
 -----BEGIN PGP SIGNATURE-----
 
-iEYEAREDAAYFAkf6UHYACgkQvJuQZxSWSshbiACdEtGiPbNs3Sa+zDoV4UJ6Tn9l
-RLYAmwdgBQJbMm4ZXRMIew63wnDomzMi
-=x6uD
+iEYEAREDAAYFAkgGQdEACgkQvJuQZxSWSshozQCeMemzgIK3yWulUu+ztyZj2ALJ
+r6AAoKNGhnQrD1EKorSmZuVYgC5Hrjx0
+=FMbL
 -----END PGP SIGNATURE-----

Modified: trunk/libdbd-pg-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/TODO?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/TODO (original)
+++ trunk/libdbd-pg-perl/TODO Thu Apr 17 19:53:51 2008
@@ -14,4 +14,3 @@
 - Remove libpq dependency
 - Handle and/or better tests for different encoding, especially those not 
    supported as a server encoding (e.g. BIG5)
-- Make a CPAN bundle

Modified: trunk/libdbd-pg-perl/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/dbdimp.c?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/dbdimp.c (original)
+++ trunk/libdbd-pg-perl/dbdimp.c Thu Apr 17 19:53:51 2008
@@ -1,6 +1,6 @@
 /*
 
-  $Id: dbdimp.c 11054 2008-04-07 16:45:39Z turnstep $
+  $Id: dbdimp.c 11089 2008-04-16 03:18:48Z turnstep $
 
   Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 2002 Jeffrey W. Baker
@@ -76,7 +76,7 @@
 static int pg_st_deallocate_statement(pTHX_ SV *sth, imp_sth_t *imp_sth);
 static PGTransactionStatusType pg_db_txn_status (pTHX_ imp_dbh_t *imp_dbh);
 static int pg_db_start_txn (pTHX_ SV *dbh, imp_dbh_t *imp_dbh);
-static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, int asyncflag);
+static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, const int asyncflag);
 
 /* ================================================================== */
 void dbd_init (dbistate_t *dbistate)
@@ -1339,6 +1339,9 @@
 
 	if (TSTART) TRC(DBILOGFP, "%sBegin dbd_st_prepare (statement: %s)\n", THEADER, statement);
 
+	if ('\0' == *statement)
+		croak ("Cannot prepare empty statement");
+
 	/* Set default values for this statement handle */
 	imp_sth->placeholder_type = 0;
 	imp_sth->numsegs          = 0;
@@ -1363,7 +1366,7 @@
 	imp_sth->has_default      = DBDPG_FALSE; /* Are any of the params DEFAULT? */
 	imp_sth->has_current      = DBDPG_FALSE; /* Are any of the params DEFAULT? */
 	imp_sth->use_inout        = DBDPG_FALSE; /* Are any of the placeholders using inout? */
-
+	imp_sth->all_bound        = DBDPG_FALSE; /* Have all placeholders been bound? */
 
 	/* We inherit some preferences from the database handle */
 	imp_sth->server_prepare   = imp_dbh->server_prepare;
@@ -1528,7 +1531,7 @@
 		}
 		if (TRACE6) TRC(DBILOGFP, "%sdirect split = (%s) length=(%d)\n",
 						THEADER, imp_sth->seg->segment, imp_sth->totalsize);
-		if (TEND) TRC(DBILOGFP, "%sEnd pg_St_split_statement (direct)\n", THEADER);
+		if (TEND) TRC(DBILOGFP, "%sEnd pg_st_split_statement (direct)\n", THEADER);
 		return;
 	}
 
@@ -2564,7 +2567,7 @@
 
 
 /* ================================================================== */
-int pg_quickexec (SV * dbh, const char * sql, int asyncflag)
+int pg_quickexec (SV * dbh, const char * sql, const int asyncflag)
 {
 	dTHX;
 	D_imp_dbh(dbh);
@@ -2647,10 +2650,20 @@
 		/* non-select statement */
 		TRACE_PQCMDSTATUS;
 		cmdStatus = PQcmdStatus(result);
-		if ((0==strncmp(cmdStatus, "DELETE", 6)) || (0==strncmp(cmdStatus, "INSERT", 6)) || 
-			(0==strncmp(cmdStatus, "UPDATE", 6))) {
-			TRACE_PQCMDTUPLES;
-			rows = atoi(PQcmdTuples(result));
+		/* If the statement indicates a number of rows, we want to return that */
+		/* Note: COPY and FETCH do not currently reach here, although they return numbers */
+		if (0 == strncmp(cmdStatus, "INSERT", 6)) {
+			/* INSERT(space)oid(space)numrows */
+			for (rows=8; cmdStatus[rows-1] != ' '; rows++) {
+			}
+			rows = atoi(cmdStatus + rows);
+		}
+		else if (0 == strncmp(cmdStatus, "MOVE", 4)) {
+			rows = atoi(cmdStatus + 5);
+		}
+		else if (0 == strncmp(cmdStatus, "DELETE", 6)
+ 			  || 0 == strncmp(cmdStatus, "UPDATE", 6)) {
+			rows = atoi(cmdStatus + 7);
 		}
 		break;
 	case PGRES_COPY_OUT:
@@ -2731,7 +2744,7 @@
 		croak("Must call pg_endcopy before issuing more commands");
 
 	/* Ensure that all the placeholders have been bound */
-	if (imp_sth->numphs!=0) {
+	if (!imp_sth->all_bound && imp_sth->numphs!=0) {
 		for (currph=imp_sth->ph; NULL != currph; currph=currph->nextph) {
 			if (NULL == currph->bind_type) {
 				pg_error(aTHX_ sth, PGRES_FATAL_ERROR, "execute called with an unbound placeholder");
@@ -2745,6 +2758,7 @@
 				currph->value[currph->valuelen] = '\0';
 			}
 		}
+		imp_sth->all_bound = DBDPG_TRUE;
 	}
 
 	/* Check for old async transactions */
@@ -3081,19 +3095,32 @@
 	else if (PGRES_COMMAND_OK == status) {
 		/* non-select statement */
 		char *cmdStatus = NULL;
+		bool gotrows = DBDPG_FALSE;
+
+		if (TRACE5)
+			TRC(DBILOGFP, "%sStatus was PGRES_COMMAND_OK\n", THEADER);
+
 		if (imp_sth->result) {
 			TRACE_PQCMDSTATUS;
 			cmdStatus = PQcmdStatus(imp_sth->result);
-		}
-		if (TRACE5)
-			TRC(DBILOGFP, "%sStatus was PGRES_COMMAND_OK\n", THEADER);
-                /* XXX DANGER We could be comparing against NULL */
-		if ((0==strncmp(cmdStatus, "DELETE", 6)) || (0==strncmp(cmdStatus, "INSERT", 6)) || 
-			(0==strncmp(cmdStatus, "UPDATE", 6))) {
-			TRACE_PQCMDTUPLES;
-			ret = atoi(PQcmdTuples(imp_sth->result));
-		}
-		else {
+			if (0 == strncmp(cmdStatus, "INSERT", 6)) {
+				/* INSERT(space)oid(space)numrows */
+				for (ret=8; cmdStatus[ret-1] != ' '; ret++) {
+				}
+				ret = atoi(cmdStatus + ret);
+				gotrows = DBDPG_TRUE;
+			}
+			else if (0 == strncmp(cmdStatus, "MOVE", 4)) {
+				ret = atoi(cmdStatus + 5);
+				gotrows = DBDPG_TRUE;
+			}
+			else if (0 == strncmp(cmdStatus, "DELETE", 6)
+					 || 0 == strncmp(cmdStatus, "UPDATE", 6)) {
+				ret = atoi(cmdStatus + 7);
+				gotrows = DBDPG_TRUE;
+			}
+		}
+		if (!gotrows) {
 			/* No rows affected, but check for change of state */
 			TRACE_PQTRANSACTIONSTATUS;
 			if (PQTRANS_IDLE == PQtransactionStatus(imp_dbh->conn)) {
@@ -3170,7 +3197,7 @@
 	}
 	
 	TRACE_PQNTUPLES;
-	if (imp_sth->cur_tuple == PQntuples(imp_sth->result) ) {
+	if (imp_sth->cur_tuple == imp_sth->rows) {
 		if (TRACE5)
 			TRC(DBILOGFP, "%sFetched the last tuple (%d)\n", THEADER, imp_sth->cur_tuple);
 		imp_sth->cur_tuple = 0;
@@ -4260,10 +4287,18 @@
 			/* non-select statement */
 			TRACE_PQCMDSTATUS;
 			cmdStatus = PQcmdStatus(result);
-			if ((0==strncmp(cmdStatus, "DELETE", 6)) || (0==strncmp(cmdStatus, "INSERT", 6)) || 
-				(0==strncmp(cmdStatus, "UPDATE", 6))) {
-				TRACE_PQCMDTUPLES;
-				rows = atoi(PQcmdTuples(result));
+			if (0 == strncmp(cmdStatus, "INSERT", 6)) {
+				/* INSERT(space)oid(space)numrows */
+				for (rows=8; cmdStatus[rows-1] != ' '; rows++) {
+				}
+				rows = atoi(cmdStatus + rows);
+			}
+			else if (0 == strncmp(cmdStatus, "MOVE", 4)) {
+				rows = atoi(cmdStatus + 5);
+			}
+			else if (0 == strncmp(cmdStatus, "DELETE", 6)
+					 || 0 == strncmp(cmdStatus, "UPDATE", 6)) {
+				rows = atoi(cmdStatus + 7);
 			}
 			break;
 		case PGRES_COPY_OUT:
@@ -4464,7 +4499,7 @@
 
  */
 /* ================================================================== */
-static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, int asyncflag) {
+static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, const int asyncflag) {
 
 	PGresult *result;
 	ExecStatusType status;

Modified: trunk/libdbd-pg-perl/dbdimp.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/dbdimp.h?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/dbdimp.h (original)
+++ trunk/libdbd-pg-perl/dbdimp.h Thu Apr 17 19:53:51 2008
@@ -1,5 +1,5 @@
 /*
-	$Id: dbdimp.h 10936 2008-03-18 16:29:33Z turnstep $
+	$Id: dbdimp.h 11071 2008-04-13 01:19:31Z turnstep $
 	
     Copyright (c) 2000-2008 Greg Sabino Mullane and others: see the Changes file
 	Portions Copyright (c) 1997-2000 Edmund Mergl
@@ -103,6 +103,7 @@
 	bool   has_current;      /* does it have one or more 'DEFAULT' values? */
 	bool   dollaronly;       /* Only use $1 as placeholders, allow all else */
 	bool   use_inout;        /* Any placeholders using inout? */
+	bool   all_bound;        /* Have all placeholders been bound? */
 };
 
 
@@ -183,7 +184,7 @@
 
 SV * pg_stringify_array(SV * input, const char * array_delim, int server_version);
 
-int pg_quickexec (SV *dbh, const char *sql, int asyncflag);
+int pg_quickexec (SV *dbh, const char *sql, const int asyncflag);
 
 int pg_db_putline (SV *dbh, const char *buffer);
 

Modified: trunk/libdbd-pg-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/debian/changelog?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/debian/changelog (original)
+++ trunk/libdbd-pg-perl/debian/changelog Thu Apr 17 19:53:51 2008
@@ -1,3 +1,9 @@
+libdbd-pg-perl (2.6.0-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Thu, 17 Apr 2008 21:49:37 +0200
+
 libdbd-pg-perl (2.5.1-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libdbd-pg-perl/t/03dbmethod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/03dbmethod.t?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/03dbmethod.t (original)
+++ trunk/libdbd-pg-perl/t/03dbmethod.t Thu Apr 17 19:53:51 2008
@@ -25,7 +25,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 218;
+plan tests => 220;
 
 isnt( $dbh, undef, 'Connect to database for database handle method testing');
 
@@ -34,7 +34,7 @@
 my ($table1,$table2,$table3) = ('dbd_pg_test1','dbd_pg_test2','dbd_pg_test3');
 my ($sequence2,$sequence3,$sequence4) = ('dbd_pg_testsequence2','dbd_pg_testsequence3','dbd_pg_testsequence4');
 
-my ($SQL, $sth, $result, @result, $expected, $warning, $rows, $t);
+my ($SQL, $sth, $result, @result, $expected, $warning, $rows, $t, $info);
 
 # Quick simple "tests"
 
@@ -1151,14 +1151,25 @@
 # Test of the "pg_notifies" database handle method
 #
 
-#   [-Perl::Critic::Policy::Bangs::ProhibitCommentedOutCode]$ret = $dbh->func('pg_notifies');
-# Returns either undef or a reference to two-element array [ $table,
-# $backend_pid ] of asynchronous notifications received.
-
 eval {
   $dbh->func('pg_notifies');
 };
 is( $@, q{}, 'DB handle method "pg_notifies" does not throw an error');
+
+$t=q{DB handle method "pg_notifies" (func) returns the correct values};
+my $notify_name = 'dbdpg_notify_test';
+my $pid = $dbh->selectall_arrayref('SELECT pg_backend_pid()')->[0][0];
+$dbh->do("LISTEN $notify_name");
+$dbh->do("NOTIFY $notify_name");
+$dbh->commit();
+$info = $dbh->func('pg_notifies');
+is_deeply($info, [$notify_name, $pid], $t);
+
+$t=q{DB handle method "pg_notifies" returns the correct values};
+$dbh->do("NOTIFY $notify_name");
+$dbh->commit();
+$info = $dbh->pg_notifies;;
+is_deeply($info, [$notify_name, $pid], $t);
 
 #
 # Test of the "getfd" database handle method

Modified: trunk/libdbd-pg-perl/t/99_perlcritic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/99_perlcritic.t?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/99_perlcritic.t (original)
+++ trunk/libdbd-pg-perl/t/99_perlcritic.t Thu Apr 17 19:53:51 2008
@@ -25,14 +25,14 @@
 	opendir my $dir, 't' or die qq{Could not open directory 't': $!\n};
 	@testfiles = map { "t/$_" } grep { /^.+\.(t|pl)$/ } readdir $dir;
 	closedir $dir;
-	plan tests => 3+ at testfiles;
+	plan tests => 5+ at testfiles;
 }
 ok(@testfiles, 'Found files in test directory');
 
-## Check the non-test files - just Pg.pm for now
+## Check some non-test files
 my $critic = Perl::Critic->new(-severity => 1);
 
-for my $filename (qw/Pg.pm/) {
+for my $filename (qw{Pg.pm Makefile.PL lib/Bundle/DBD/Pg.pm }) {
 
 	if ($ENV{TEST_CRITIC_SKIPNONTEST}) {
 		pass qq{Skipping non-test file "$filename"};

Modified: trunk/libdbd-pg-perl/t/99_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/99_pod.t?rev=18726&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/99_pod.t (original)
+++ trunk/libdbd-pg-perl/t/99_pod.t Thu Apr 17 19:53:51 2008
@@ -7,18 +7,20 @@
 use Test::More;
 select(($|=1,select(STDERR),$|=1)[1]);
 
-plan tests => 2;
+plan tests => 3;
 
 my $PODVERSION = '0.95';
 eval {
 	require Test::Pod;
 	Test::Pod->import;
 };
-if ($@ or $Test::Pod::VERSION < $PODVERSION) {
-	pass('Skipping Test::Pod testing');
-}
-else {
+
+SKIP: {
+	if ($@ or $Test::Pod::VERSION < $PODVERSION) {
+		skip "Test::Pod $PODVERSION is required", 2;
+	}
 	pod_file_ok('Pg.pm');
+	pod_file_ok('lib/Bundle/DBD/Pg.pm');
 }
 
 ## We won't require everyone to have this, so silently move on if not found
@@ -27,10 +29,12 @@
 	require Test::Pod::Coverage;
 	Test::Pod::Coverage->import;
 };
-if ($@ or $Test::Pod::Coverage::VERSION < $PODCOVERVERSION) {
-	pass ('Skipping Test::Pod::Coverage testing');
-}
-else {
+SKIP: {
+
+	if ($@ or $Test::Pod::Coverage::VERSION < $PODCOVERVERSION) {
+		skip "Test::Pod::Coverage $PODCOVERVERSION is required", 1;
+	}
+
 	my $trusted_names  =
 		[
 		 qr{^CLONE$},




More information about the Pkg-perl-cvs-commits mailing list