r18033 - in /branches/upstream/libdbd-pg-perl/current: .perlcriticrc Changes MANIFEST.SKIP META.yml Makefile.PL Pg.h Pg.pm README README.dev SIGNATURE dbdimp.c dbdimp.h t/00-signature.t t/00basic.t t/01connect.t t/03dbmethod.t t/03smethod.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Thu Mar 27 15:58:53 UTC 2008


Author: gregoa-guest
Date: Thu Mar 27 15:58:52 2008
New Revision: 18033

URL: http://svn.debian.org/wsvn/?sc=1&rev=18033
Log:
[svn-upgrade] Integrating new upstream version, libdbd-pg-perl (2.5.0)

Modified:
    branches/upstream/libdbd-pg-perl/current/.perlcriticrc
    branches/upstream/libdbd-pg-perl/current/Changes
    branches/upstream/libdbd-pg-perl/current/MANIFEST.SKIP
    branches/upstream/libdbd-pg-perl/current/META.yml
    branches/upstream/libdbd-pg-perl/current/Makefile.PL
    branches/upstream/libdbd-pg-perl/current/Pg.h
    branches/upstream/libdbd-pg-perl/current/Pg.pm
    branches/upstream/libdbd-pg-perl/current/README
    branches/upstream/libdbd-pg-perl/current/README.dev
    branches/upstream/libdbd-pg-perl/current/SIGNATURE
    branches/upstream/libdbd-pg-perl/current/dbdimp.c
    branches/upstream/libdbd-pg-perl/current/dbdimp.h
    branches/upstream/libdbd-pg-perl/current/t/00-signature.t
    branches/upstream/libdbd-pg-perl/current/t/00basic.t
    branches/upstream/libdbd-pg-perl/current/t/01connect.t
    branches/upstream/libdbd-pg-perl/current/t/03dbmethod.t
    branches/upstream/libdbd-pg-perl/current/t/03smethod.t

Modified: branches/upstream/libdbd-pg-perl/current/.perlcriticrc
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/.perlcriticrc?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/.perlcriticrc (original)
+++ branches/upstream/libdbd-pg-perl/current/.perlcriticrc Thu Mar 27 15:58:52 2008
@@ -2,7 +2,7 @@
 profile-strictness = quiet
 
 [Documentation::PodSpelling]
-stop_words = ActiveKids AutoCommit CachedKids ChildHandles ChopBlanks CompatMode CursorName DBD DBI Datatype dbdpg ErrCount FetchHashKeyName HandleError HandleSetErr InactiveDestroy LongReadLen LongTruncOk Mergl Momjian Mullane NULLABLE OID PgBouncer pgend pglibpq pglogin pgprefix pgquote pgstart Postgres PostgreSQL PrintError PrintWarn README RaiseError RowCache RowCacheSize SQL SQLSTATE SSL STDIN STDERR STDOUT Sabino Savepoints ShowErrorStatement TaintIn TaintOut TraceLevel UTF Username afterwards arrayrefs attr autocommit backend bitmask cancelled datatype dbd dbh errstr fd filename getfd getline largeobject len libpq pgbuiltin pgsql runtime savepoint savepoints schemas sslmode tablename tablespace tablespaces typename username varchar
+stop_words = ActiveKids AutoCommit CachedKids ChildHandles ChopBlanks CompatMode CursorName DBD DBI Datatype dbdpg ErrCount FetchHashKeyName HandleError HandleSetErr InactiveDestroy LongReadLen LongTruncOk Mergl Momjian Mullane NULLABLE OID PgBouncer pgend pglibpq pglogin pgprefix pgquote pgstart Postgres PostgreSQL PrintError PrintWarn README RaiseError RowCache RowCacheSize SQL SQLSTATE SSL STDIN STDERR STDOUT Sabino Savepoints ShowErrorStatement TaintIn TaintOut TraceLevel UTF Username afterwards arrayrefs attr autocommit backend bitmask cancelled datatype dbd dbh errstr fd filename getfd getline largeobject len libpq pgbuiltin pgsql runtime savepoint savepoints schemas sslmode tablename tablespace tablespaces tuple typename username varchar
 
 [-Bangs::ProhibitCommentedOutCode]
 [-Bangs::ProhibitFlagComments]

Modified: branches/upstream/libdbd-pg-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/Changes?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/Changes (original)
+++ branches/upstream/libdbd-pg-perl/current/Changes Thu Mar 27 15:58:52 2008
@@ -1,6 +1,22 @@
 ('GSM' is Greg Sabino Mullane, greg at turnstep.com)
 
-2.2.2 Released March 3, 2008
+2.5.0 Released March 23, 2008
+
+	- Add pg_enum_values to $dbh->column_info()
+		[Dave Rolsky] (CPAN ticket #34351)
+	- Minor test fixes.
+
+2.4.0 Released March 21, 2008 (subversion r10974)
+
+	- Remove problematic and unneeded Test::Warn test from 00basic.t.
+	- Add $sth->{pg_current_row} [GSM]
+
+2.3.0 Released March 19, 2008 (subversion r10951)
+
+	- Add $sth->{pg_bound} and $sth->{pg_numbound} [GSM]
+	- Fix broken call to $sth->{pg_segments} [GSM]
+
+2.2.2 Released March 3, 2008 (subversion r10873)
 
 	- Remove non-working tracing from types.c and quote.c
 
@@ -8,17 +24,17 @@
 
 2.2.1 Released March 1, 2008 (subversion r10865)
 
-	- Fixed memory leaks in dbdimp.c (CPAN bug #33743)
+	- Fix memory leaks in dbdimp.c (CPAN bug #33743)
 		[Alexey Tourbin]
-	- Fixed strlen problems in dbdimp.c (CPAN bug #33737)
+	- Fix strlen problems in dbdimp.c (CPAN bug #33737)
 		[Alexey Tourbin]
-	- Fixed char count in Renew() (CPAN bug #33738)
+	- Fix char count in Renew() (CPAN bug #33738)
 		[Alexey Tourbin]
 	- Change local trace_flags to lowercase.
 
 2.2.0 Released February 27, 2008 (subversion r10849)
 
-	- Introduced enhanced trace flags. See the documentation 
+	- Introduce enhanced trace flags. See the documentation 
 		 on parse_trace_flags() for details. [GSM]
 	- Remove version.pm dependency from Makefile.PL
 		(CPAN bug #33429)

Modified: branches/upstream/libdbd-pg-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/MANIFEST.SKIP?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libdbd-pg-perl/current/MANIFEST.SKIP Thu Mar 27 15:58:52 2008
@@ -17,5 +17,6 @@
 pm_to_blib
 \.tmp$
 \.svn/*
+\.blame$
 ^tmp/*
 cover_db/

Modified: branches/upstream/libdbd-pg-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/META.yml?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/META.yml (original)
+++ branches/upstream/libdbd-pg-perl/current/META.yml Thu Mar 27 15:58:52 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name                  : DBD-Pg
-version               : 2.2.2
+version               : 2.5.0
 abstract              : DBI PostgreSQL interface
 author:              
   - Greg Sabino Mullane <greg at turnstep.com>
@@ -34,7 +34,7 @@
 provides:
   DBD::Pg:
     file              : Pg.pm
-    version           : 2.2.2
+    version           : 2.5.0
 
 keywords:
   - Postgres

Modified: branches/upstream/libdbd-pg-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/Makefile.PL?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/Makefile.PL (original)
+++ branches/upstream/libdbd-pg-perl/current/Makefile.PL Thu Mar 27 15:58:52 2008
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL 10872 2008-03-03 17:03:27Z turnstep $
+# $Id: Makefile.PL 10988 2008-03-23 16:44:35Z turnstep $
 
 use ExtUtils::MakeMaker;
 use Config;
@@ -7,7 +7,7 @@
 use 5.006001;
 
 ## No version.pm for this one, as the prereqs are not loaded yet.
-my $VERSION = '2.2.2';
+my $VERSION = '2.5.0';
 
 my $lib;
 BEGIN {
@@ -119,12 +119,6 @@
 
 my $defines = " -DPGLIBVERSION=$serverversion -DPGDEFPORT=$defaultport";
 my $comp_opts = $Config{q{ccflags}} . $defines;
-
-for (1..$Config{config_argc}) {
-	my $arg = $Config{"config_arg$_"};
-	## Not used for the moment
-	#$defines .= " $arg" if $arg =~ /^\-D/;
-}
 
 if ($ENV{DBDPG_GCCDEBUG}) {
 	warn "Enabling many compiler options\n";

Modified: branches/upstream/libdbd-pg-perl/current/Pg.h
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/Pg.h?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/Pg.h (original)
+++ branches/upstream/libdbd-pg-perl/current/Pg.h Thu Mar 27 15:58:52 2008
@@ -1,5 +1,5 @@
 /*
-   $Id: Pg.h 10832 2008-02-26 13:43:52Z turnstep $
+   $Id: Pg.h 10925 2008-03-16 13:34:23Z turnstep $
 
    Copyright (c) 2000-2008 Greg Sabino Mullane and others: see the Changes file
    Copyright (c) 1997-2000 Edmund Mergl
@@ -74,14 +74,12 @@
 #define FLAGS_END      0x04000000
 #define FLAGS_PREFIX   0x08000000
 #define FLAGS_LOGIN    0x10000000
-#define FLAGS_QUOTE    0x20000000
 
 #define TFLIBPQ      (TFLAGS & FLAGS_LIBPQ)
 #define TFSTART      (TFLAGS & FLAGS_START)
 #define TFEND        (TFLAGS & FLAGS_END)
 #define TFPREFIX     (TFLAGS & FLAGS_PREFIX)
 #define TFLOGIN      (TFLAGS & FLAGS_LOGIN)
-#define TFQUOTE      (TFLAGS & FLAGS_QUOTE)
 
 #define TRACE1       (TLEVEL >= 1) /* Avoid using directly: DBI only */
 #define TRACE2       (TLEVEL >= 2) /* Avoid using directly: DBI only */
@@ -96,7 +94,6 @@
 #define TSTART       (TRACE4 || TFSTART) /* Start of a major function */
 #define TEND         (TRACE4 || TFEND)   /* End of a major function   */
 #define TLOGIN       (TRACE5 || TFLOGIN) /* Connect and disconnect    */
-#define TSTARTQ      (TRACE6 || TFQUOTE) /* Quote functions           */
 
 #define TRACEWARN    (TRACE1) /* Non-fatal but serious problems */
 
@@ -156,7 +153,7 @@
 #define TRACE_PQSENDQUERYPREPARED  TRACE_XX "%sPQsendQueryPrepared\n",   THEADER)
 #define TRACE_PQSERVERVERSION      TRACE_XX "%sPQserverVersion\n",       THEADER)
 #define TRACE_PQSETERRORVERBOSITY  TRACE_XX "%sPQsetErrorVerbosity\n",   THEADER)
-#define TRACE_PQSETNOTICEPROCESSOR TRACE_XX "%sPQdsetNoticeProcessor\n", THEADER)
+#define TRACE_PQSETNOTICEPROCESSOR TRACE_XX "%sPQsetNoticeProcessor\n",  THEADER)
 #define TRACE_PQSOCKET             TRACE_XX "%sPQsocket\n",              THEADER)
 #define TRACE_PQSTATUS             TRACE_XX "%sPQstatus\n",              THEADER)
 #define TRACE_PQTRACE              TRACE_XX "%sPQtrace\n",               THEADER)

Modified: branches/upstream/libdbd-pg-perl/current/Pg.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/Pg.pm?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/Pg.pm (original)
+++ branches/upstream/libdbd-pg-perl/current/Pg.pm Thu Mar 27 15:58:52 2008
@@ -1,5 +1,5 @@
 # -*-cperl-*-
-#  $Id: Pg.pm 10872 2008-03-03 17:03:27Z turnstep $
+#  $Id: Pg.pm 10988 2008-03-23 16:44:35Z 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.2.2');
+	use version; our $VERSION = qv('2.5.0');
 
 	use DBI ();
 	use DynaLoader ();
@@ -443,6 +443,8 @@
 				, a.attrelid AS "pg_attrelid"
 				, a.attnum AS "pg_attnum"
 				, a.atttypmod AS "pg_atttypmod"
+				, t.typtype AS "_pg_type_typtype"
+				, t.oid AS "_pg_type_oid"
 			FROM
 				pg_catalog.pg_type t
 				JOIN pg_catalog.pg_attribute a ON (t.oid = a.atttypid)
@@ -485,11 +487,14 @@
 			pg_schema            20
 			pg_table             21
 			pg_column            22
+			pg_enum_values       23
 			/);
 
 		my $oldconstraint_sth;
 
 		for my $row (@$data) {
+			my $typoid = pop @$row;
+			my $typtype = pop @$row;
 			my $typmod = pop @$row;
 			my $attnum = pop @$row;
 			my $aid = pop @$row;
@@ -498,9 +503,7 @@
  				_calc_col_size($typmod,$row->[$col_map{COLUMN_SIZE}]);
 
 			# Replace the Pg type with the SQL_ type
-			my $w = $row->[$col_map{DATA_TYPE}];
 			$row->[$col_map{DATA_TYPE}] = DBD::Pg::db::pg_type_info($dbh,$row->[$col_map{DATA_TYPE}]);
-			$w = $row->[$col_map{DATA_TYPE}];
 
 			# Add pg_constraint
 			my $SQL = "SELECT consrc FROM pg_catalog.pg_constraint WHERE contype = 'c' AND ".
@@ -512,11 +515,16 @@
 			else {
 				$row->[19] = undef;
 			}
-			$col_map{pg_constraint} = 19;
+
+			if ( $typtype eq 'e' ) {
+				my $SQL = "SELECT enumlabel FROM pg_catalog.pg_enum "
+					."WHERE enumtypid = $typoid ORDER BY oid";
+				$row->[23] = $dbh->selectcol_arrayref($SQL);
+			}
+			else {
+				$row->[23] = undef;
+			}
 		}
-
-		# get rid of atttypmod that we no longer need
-		delete $col_map{pg_atttypmod};
 
 		# Since we've processed the data in Perl, we have to jump through a hoop
 		# To turn it back into a statement handle
@@ -1651,7 +1659,7 @@
 
 =head1 VERSION
 
-This documents version 2.2.2 of the DBD::Pg module
+This documents version 2.5.0 of the DBD::Pg module
 
 =head1 SYNOPSIS
 
@@ -1928,11 +1936,6 @@
 Outputs a message showing the connection string right before a new database connection 
 is attempted, a message when the connection was successful, and a message right after 
 the database has been disconnected. Also output if trace level is 5 or greater.
-
-=item pgquote
-
-Outputs a message at the start of each quoting function. Not very useful outside of 
-DBD::Pg internal debugging purposes.
 
 =back
 
@@ -2625,13 +2628,14 @@
    SQL_DATETIME_SUB
    CHAR_OCTET_LENGTH
 
-Also, five additional non-standard fields are returned:
+Also, six additional non-standard fields are returned:
 
   pg_type - data type with additional info i.e. "character varying(20)"
   pg_constraint - holds column constraint definition
   pg_schema - the unquoted name of the schema
   pg_table - the unquoted name of the table
   pg_column - the unquoted name of the column
+  pg_enum_values - an array reference of allowed values for an enum column
 
 Note that the TABLE_SCHEM, TABLE_NAME, and COLUMN_NAME fields all return 
 output wrapped in quote_ident(). If you need the unquoted version, use 
@@ -3269,6 +3273,22 @@
 
 Not supported by this driver.
 
+=item B<pg_current_row>  (integer, read-only)
+
+PostgreSQL specific attribute. Returns the number of the tuple (row) that was
+most recently fetched. Returns zero before and after fetching is performed.
+
+=item B<pg_numbound>  (integer, read-only)
+
+PostgreSQL specific attribute. Returns the number of placeholders
+that are currently bound (via bind_param).
+
+=item B<pg_bound>  (hash-ref, read-only)
+
+PostgreSQL specific attribute. Returns a hash of all named placeholders. The
+key is the name of the placeholder, and the value is a 0 or a 1, indicating if
+the placeholder has been bound yet (e.g. via bind_param)
+
 =item B<pg_size>  (array-ref, read-only)
 
 PostgreSQL specific attribute. It returns a reference to an array of integer

Modified: branches/upstream/libdbd-pg-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/README?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/README (original)
+++ branches/upstream/libdbd-pg-perl/current/README Thu Mar 27 15:58:52 2008
@@ -1,11 +1,11 @@
 DBD::Pg  --  the DBI PostgreSQL interface for Perl
 
-# $Id: README 10872 2008-03-03 17:03:27Z turnstep $
+# $Id: README 10988 2008-03-23 16:44:35Z turnstep $
 
 DESCRIPTION:
 ------------
 
-This is version 2.2.2 of DBD-Pg.  The web site for this interface is at:
+This is version 2.5.0 of DBD-Pg.  The web site for this interface is at:
 
 	http://search.cpan.org/dist/DBD-Pg/
 

Modified: branches/upstream/libdbd-pg-perl/current/README.dev
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/README.dev?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/README.dev (original)
+++ branches/upstream/libdbd-pg-perl/current/README.dev Thu Mar 27 15:58:52 2008
@@ -1,5 +1,5 @@
 
-## $Id: README.dev 10797 2008-02-19 04:39:36Z turnstep $
+## $Id: README.dev 10953 2008-03-19 16:05:15Z 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 
@@ -557,7 +557,7 @@
 part of the test suite if the right modules are installed.
 
 * Update the SIGNATURE file with Module::Signature. Make sure this is done *after* 
-you check everything else in, due to the the $Id: README.dev 10797 2008-02-19 04:39:36Z turnstep $ lines.
+you check everything else in, due to the the magic (dollarsign)Id lines.
 
 * Run "perl Makefile.PL"
 

Modified: branches/upstream/libdbd-pg-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/SIGNATURE?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/SIGNATURE (original)
+++ branches/upstream/libdbd-pg-perl/current/SIGNATURE Thu Mar 27 15:58:52 2008
@@ -14,31 +14,31 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: RIPEMD160
 
-SHA1 9693daa699157b5e9c7f961e0677a6c9d63583d3 .perlcriticrc
-SHA1 4b4240b725947ffbc544f6eb7563d180bb7a1160 Changes
+SHA1 e4bbe8e3845d0a18ad4603cf6a09c8187419efbd .perlcriticrc
+SHA1 5783c528df7314e08e3a7e7455eaf77e99f020d1 Changes
 SHA1 413251e7c544b2c00d18749f6b572a718a1c3a2f MANIFEST
-SHA1 41e5f1b5a54fbe0b425fdf711416b7e7bb09d138 MANIFEST.SKIP
-SHA1 5cc1ed4794009cccc414b15bb17a0a780d73153d META.yml
-SHA1 129c0bf96a6875cd643697b5b28218c1c3e66bc5 Makefile.PL
-SHA1 e2aa8bbdf1c02c7f36eafff3e34b2ec850ac3be6 Pg.h
-SHA1 26bd5d2e3c0c6132c195969f308536f06fd00d49 Pg.pm
+SHA1 d7c42da45397de439a6096058d01fa29575c8b52 MANIFEST.SKIP
+SHA1 2496e495176223c70949d6f00175eeb6751e2019 META.yml
+SHA1 a93ad6968698a6cadc5e37d4eede247eb33b2f35 Makefile.PL
+SHA1 11fc65245a64a3be04e8a1aeed17849e476c4711 Pg.h
+SHA1 5d6a4e4a49f0bfaadc7b854e008c2663d7dcc346 Pg.pm
 SHA1 4aa6f624317b3d5bcf67bb3748c8ca733edfcc50 Pg.xs
-SHA1 8bb196f6e645e0efdf90d39f4d76f3384508901b README
-SHA1 9656852e1decad65ea393674a92e16c2feaa25a2 README.dev
+SHA1 1b8278986dabf85f8110901383e26399c080a9ce README
+SHA1 187281b6aed5c1f56fd0183c7ce4fe58b71282ea README.dev
 SHA1 968d5fad61bce160b31a9cb1a21dd240b9df930f README.win32
 SHA1 0a65051689ffee85bc401ac815ac3a89e203d891 TODO
-SHA1 a05b1f3b8178f4527b12d8ac16dd8dd7126fa088 dbdimp.c
-SHA1 38662ab3529be4356a087a5920bfd20e0b6cf303 dbdimp.h
+SHA1 c1bb6ed73b3d3b1f64fb54b92bb34f246bcc7959 dbdimp.c
+SHA1 38a3247078d2ababf659b30bcd2fdf7155330c19 dbdimp.h
 SHA1 6c33bcf138e577722283bef02fceb8cbce4d100d dbivport.h
 SHA1 88c44732cb614e916ae8aeff2c2f2faedbfd8e9a quote.c
 SHA1 2d49573ccc984da374ff77cd893bf65505c0b382 quote.h
-SHA1 b04258d4f9ccb9b4e22e9d84ebeab13dd95f7a9d t/00-signature.t
-SHA1 64cab818b5e918f45ada975feea5400977d76c53 t/00basic.t
-SHA1 1f5814d56177d90ca1e6ca48b2305f4299b83f61 t/01connect.t
+SHA1 4da4f8074e8f46d4e787906fa6de3ebbadef29ed t/00-signature.t
+SHA1 5af8ab01ab090be9daf556c5b03def8bacb3b8cd t/00basic.t
+SHA1 5602ad2b473d8cdbf8c10c5bdcd0cabc5f42ee9d t/01connect.t
 SHA1 655b72fa5f29886caa9b4a0ac7d69dc078d4bf55 t/01constants.t
 SHA1 6b4df4bb35345ed2d8a4ba9360d8b47e135fd73e t/02attribs.t
-SHA1 eb2ce2375c86ff21083fafd1d27080b0020fe1be t/03dbmethod.t
-SHA1 005a14c6eb9dc1e2bd8ce91ff8bb5dcc4f4f9369 t/03smethod.t
+SHA1 a2130b8428c30cd1f0b0d83539548fabbae7beb6 t/03dbmethod.t
+SHA1 267c1961ea9cce5ad491b95e01e465b9a6746dd3 t/03smethod.t
 SHA1 06aa87527ed7eb49a7b2572d55b8d1693a3f4932 t/04misc.t
 SHA1 d855410b526048d50a54eed6efda893ca459f042 t/06bytea.t
 SHA1 14867de37becfd9a1ccf5bc1a2d0683f62878d71 t/07copy.t
@@ -63,7 +63,7 @@
 SHA1 f07cd5ecaeb854c81ceb9206364979cf607e6546 win32.mak
 -----BEGIN PGP SIGNATURE-----
 
-iEYEAREDAAYFAkfML3QACgkQvJuQZxSWSsgOOQCgqqOvlm27GGhqd+UJvJldzfj5
-zt0An1XyKZz/ML8H0iPTFZNkh3Tu4QQg
-=kcY+
+iEYEAREDAAYFAkfmioAACgkQvJuQZxSWSsh+PwCgk3HIIuO/yLhqoiRcowpXM+ui
+XgcAoL3IXgVJFz5Lt9YDgo4rKCGtng8A
+=z8xY
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libdbd-pg-perl/current/dbdimp.c
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/dbdimp.c?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/dbdimp.c (original)
+++ branches/upstream/libdbd-pg-perl/current/dbdimp.c Thu Mar 27 15:58:52 2008
@@ -1,6 +1,6 @@
 /*
 
-  $Id: dbdimp.c 10869 2008-03-03 16:34:52Z turnstep $
+  $Id: dbdimp.c 10961 2008-03-20 14:08:19Z turnstep $
 
   Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 2002 Jeffrey W. Baker
@@ -65,7 +65,7 @@
 	(SvROK(h) && SvTYPE(SvRV(h)) == SVt_PVHV &&					\
 	 SvRMAGICAL(SvRV(h)) && (SvMAGIC(SvRV(h)))->mg_type == 'P')
 
-static void pg_error(pTHX_ SV *h, ExecStatusType error_num, const char *error_msg);
+static void pg_error(pTHX_ SV *h, int error_num, const char *error_msg);
 static void pg_warn (void * arg, const char * message);
 static ExecStatusType _result(pTHX_ imp_dbh_t *imp_dbh, const char *sql);
 static ExecStatusType _sqlstate(pTHX_ imp_dbh_t *imp_dbh, PGresult *result);
@@ -181,7 +181,7 @@
 	connstatus = PQstatus(imp_dbh->conn);
 	if (CONNECTION_OK != connstatus) {
 		TRACE_PQERRORMESSAGE;
-		pg_error(aTHX_ dbh, (ExecStatusType)connstatus, PQerrorMessage(imp_dbh->conn));
+		pg_error(aTHX_ dbh, connstatus, PQerrorMessage(imp_dbh->conn));
 		strncpy(imp_dbh->sqlstate, "08006", 6); /* "CONNECTION FAILURE" */
 		TRACE_PQFINISH;
 		PQfinish(imp_dbh->conn);
@@ -268,7 +268,7 @@
 /* ================================================================== */
 
 /* Database specific error handling. */
-static void pg_error (pTHX_ SV * h, ExecStatusType error_num, const char * error_msg)
+static void pg_error (pTHX_ SV * h, int error_num, const char * error_msg)
 {
 	D_imp_xxh(h);
 	size_t error_len;
@@ -797,7 +797,7 @@
 			/* Default to "1" if an invalid value is passed in */
 			imp_dbh->pg_errorlevel = 0==newval ? 0 : 2==newval ? 2 : 1;
 			TRACE_PQSETERRORVERBOSITY;
-			(void)PQsetErrorVerbosity(imp_dbh->conn, imp_dbh->pg_errorlevel);
+			(void)PQsetErrorVerbosity(imp_dbh->conn, (PGVerbosity)imp_dbh->pg_errorlevel);
 			if (TRACE5)
 				TRC(DBILOGFP, "%sReset error verbosity to %d\n", THEADER, imp_dbh->pg_errorlevel);
 			retval = 1;
@@ -868,13 +868,29 @@
 	/* Some can be done before we have a result: */
 	switch (kl) {
 
+	case 8: /* pg_bound */
+
+		if (strEQ("pg_bound", key)) {
+			HV *pvhv = newHV();
+			ph_t *currph;
+			int i;
+			for (i=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,i++) {
+				(void)hv_store_ent 
+					(pvhv,
+					 (3==imp_sth->placeholder_type ? newSVpv(currph->fooname,0) : newSViv(i+1)),
+					 newSViv(NULL == currph->bind_type ? 0 : 1), 0);
+			}
+			retsv = newRV_noinc((SV*)pvhv);
+		}
+		break;
+
 	case 9: /* pg_direct */
 
 		if (strEQ("pg_direct", key))
 			retsv = newSViv((IV)imp_sth->direct);
 		break;
 
-	case 10: /* ParamTypes  pg_segments */
+	case 10: /* ParamTypes */
 
 		if (strEQ("ParamTypes", key)) {
 			HV *pvhv = newHV();
@@ -894,18 +910,9 @@
 			}
 			retsv = newRV_noinc((SV*)pvhv);
 		}
-		else if (strEQ("pg_segments", key)) {
-			AV *arr = newAV();
-			seg_t *currseg;
-			int i;
-			for (i=0,currseg=imp_sth->seg; NULL != currseg; currseg=currseg->nextseg,i++) {
-				av_push(arr, newSVpv(currseg->segment ? currseg->segment : "NULL",0));
-			}
-			retsv = newRV_noinc((SV*)arr);
-		}
 		break;
 
-	case 11: /* ParamValues */
+	case 11: /* ParamValues pg_segments pg_numbound */
 
 		if (strEQ("ParamValues", key)) {
 			HV *pvhv = newHV();
@@ -927,12 +934,31 @@
 			}
 			retsv = newRV_noinc((SV*)pvhv);
 		}
+		else if (strEQ("pg_segments", key)) {
+			AV *arr = newAV();
+			seg_t *currseg;
+			int i;
+			for (i=0,currseg=imp_sth->seg; NULL != currseg; currseg=currseg->nextseg,i++) {
+				av_push(arr, newSVpv(currseg->segment ? currseg->segment : "NULL",0));
+			}
+			retsv = newRV_noinc((SV*)arr);
+		}
+		else if (strEQ("pg_numbound", key)) {
+			ph_t *currph;
+			int i = 0;
+			for (currph=imp_sth->ph; NULL != currph; currph=currph->nextph) {
+				i += NULL == currph->bind_type ? 0 : 1;
+			}
+			retsv = newSViv(i);
+		}
 		break;
 
-	case 14: /* pg_prepare_now */
+	case 14: /* pg_prepare_now pg_current_row */
 
 		if (strEQ("pg_prepare_now", key))
 			retsv = newSViv((IV)imp_sth->prepare_now);
+		else if (strEQ("pg_current_row", key))
+			retsv = newSViv(imp_sth->cur_tuple);
 		break;
 
 	case 15: /* pg_prepare_name */

Modified: branches/upstream/libdbd-pg-perl/current/dbdimp.h
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/dbdimp.h?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/dbdimp.h (original)
+++ branches/upstream/libdbd-pg-perl/current/dbdimp.h Thu Mar 27 15:58:52 2008
@@ -1,5 +1,5 @@
 /*
-	$Id: dbdimp.h 10829 2008-02-26 13:10:38Z turnstep $
+	$Id: dbdimp.h 10936 2008-03-18 16:29:33Z turnstep $
 	
     Copyright (c) 2000-2008 Greg Sabino Mullane and others: see the Changes file
 	Portions Copyright (c) 1997-2000 Edmund Mergl
@@ -52,17 +52,17 @@
 
 /* The placeholders are also a linked list */
 struct ph_st {
-	char  *fooname;             /* Name if using :foo style */
+	char  *fooname;             /* name if using :foo style */
 	char  *value;               /* the literal passed-in value, may be binary */
 	STRLEN valuelen;            /* length of the value */
 	char  *quoted;              /* quoted version of the value, for PQexec only */
 	STRLEN quotedlen;           /* length of the quoted value */
 	bool   referenced;          /* used for PREPARE AS construction */
 	bool   defaultval;          /* is it using a generic 'default' value? */
-	bool   iscurrent;           /* is it using a generic 'default' value? */
-	bool   isdefault;           /* Are we passing a literal 'DEFAULT'? */
-	bool   isinout;             /* Is this a bind_param_inout value? */
-	SV     *inout;              /* What variable we are updating via inout magic */
+	bool   iscurrent;           /* do we want to use a literal CURRENT_TIMESTAMP? */
+	bool   isdefault;           /* are we passing a literal 'DEFAULT'? */
+	bool   isinout;             /* is this a bind_param_inout value? */
+	SV     *inout;              /* what variable we are updating via inout magic */
 	sql_type_info_t* bind_type; /* type information for this placeholder */
 	struct ph_st *nextph;       /* more linked list goodness */
 };

Modified: branches/upstream/libdbd-pg-perl/current/t/00-signature.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/t/00-signature.t?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/t/00-signature.t (original)
+++ branches/upstream/libdbd-pg-perl/current/t/00-signature.t Thu Mar 27 15:58:52 2008
@@ -12,21 +12,23 @@
 }
 plan tests => 1;
 
-if (!eval { require Module::Signature; 1 }) {
-	fail 'Could not find Module::Signature';
-}
-elsif ( !-e 'SIGNATURE' ) {
-	fail 'SIGNATURE file was not found';
-}
-elsif ( ! -s 'SIGNATURE') {
-	fail 'SIGNATURE file was empty';
-}
-else {
-	my $ret = Module::Signature::verify();
-	if ($ret eq Module::Signature::SIGNATURE_OK()) {
-		pass 'Valid SIGNATURE file';
+SKIP: {
+	if (!eval { require Module::Signature; 1 }) {
+		skip 'Must have Module::Signature to test SIGNATURE file', 1;
+	}
+	elsif ( !-e 'SIGNATURE' ) {
+		fail 'SIGNATURE file was not found';
+	}
+	elsif ( ! -s 'SIGNATURE') {
+		fail 'SIGNATURE file was empty';
 	}
 	else {
-		fail 'Invalid SIGNATURE file';
+		my $ret = Module::Signature::verify();
+		if ($ret eq Module::Signature::SIGNATURE_OK()) {
+			pass 'Valid SIGNATURE file';
+		}
+		else {
+			fail 'Invalid SIGNATURE file';
+		}
 	}
 }

Modified: branches/upstream/libdbd-pg-perl/current/t/00basic.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/t/00basic.t?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/t/00basic.t (original)
+++ branches/upstream/libdbd-pg-perl/current/t/00basic.t Thu Mar 27 15:58:52 2008
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 4;
+use Test::More tests => 3;
 select(($|=1,select(STDERR),$|=1)[1]);
 
 BEGIN {
@@ -15,11 +15,3 @@
 use DBD::Pg;
 like( $DBD::Pg::VERSION, qr/^v?\d+\.\d+\.\d+(?:_\d+)?$/, qq{Found DBD::Pg::VERSION as "$DBD::Pg::VERSION"});
 
-SKIP: {
-	eval { require Test::Warn; };
-	$@ and skip 'Need Test::Warn to test version warning', 1;
-
-	my $t=q{Version comparison does not throw a warning};
-
-	Test::Warn::warnings_are (sub {$DBD::Pg::VERSION <= '1.49'}, [], $t );
-}

Modified: branches/upstream/libdbd-pg-perl/current/t/01connect.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/t/01connect.t?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/t/01connect.t (original)
+++ branches/upstream/libdbd-pg-perl/current/t/01connect.t Thu Mar 27 15:58:52 2008
@@ -82,7 +82,7 @@
 	eval {
 		$dbh = DBI->connect($dbi, $ENV{DBI_USER}, $ENV{DBI_PASS}, {RaiseError=>1});
 	};
-	like ($@, qr{invalid connection option}, $t);
+	like ($@, qr{DBI connect.+failed:}, $t);
 	for my $opt (qw/db dbname database/) {
 		$t=qq{Connect using string '$opt' works};
 		($dbi = $ENV{DBI_DSN}) =~ s/$alias\s*=/$opt=/;

Modified: branches/upstream/libdbd-pg-perl/current/t/03dbmethod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/t/03dbmethod.t?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/t/03dbmethod.t (original)
+++ branches/upstream/libdbd-pg-perl/current/t/03dbmethod.t Thu Mar 27 15:58:52 2008
@@ -25,7 +25,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 216;
+plan tests => 218;
 
 isnt( $dbh, undef, 'Connect to database for database handle method testing');
 
@@ -490,6 +490,29 @@
 $t = q{DB handle method "column_info" works with non-lowercased columns};
 is( $result->{COLUMN_NAME}, q{"CaseTest"}, $t);
 
+SKIP: {
+
+	if ($pgversion < 80300) {
+		skip 'DB handle method column_info attribute "pg_enum_values" requires at least Postgres 8.3', 2;
+	}
+
+    {
+        local $dbh->{Warn} = 0;
+
+        $dbh->do( q{CREATE TYPE dbd_pg_enumerated AS ENUM ('foo', 'bar', 'baz', 'buz')} );
+        $dbh->do( q{CREATE TEMP TABLE dbd_pg_enum_test ( is_enum dbd_pg_enumerated NOT NULL )} );
+    }
+
+    $sth = $dbh->column_info('','','dbd_pg_enum_test','is_enum');
+    $result = $sth->fetchall_arrayref({})->[0];
+	$t = q{DB handle method "column_info" returns proper pg_type};
+    is( $result->{pg_type}, 'dbd_pg_enumerated', $t);
+	$t = q{'DB handle method "column_info" returns proper pg_enum_values'};
+    is_deeply( $result->{pg_enum_values}, [ qw( foo bar baz buz ) ], $t);
+
+	$dbh->do('DROP TABLE dbd_pg_enum_test');
+	$dbh->do('DROP TYPE dbd_pg_enumerated');
+}
 
 #
 # Test of the "primary_key_info" database handle method
@@ -587,7 +610,7 @@
 };
 
 ## 8.1 has differences in hash index pages
-if ($pgversion < 80109) {
+if ($pgversion < 80109 or $pgversion == 80200) {
 	$correct_stats->{three}[5][11] = 0;
 }
 

Modified: branches/upstream/libdbd-pg-perl/current/t/03smethod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdbd-pg-perl/current/t/03smethod.t?rev=18033&op=diff
==============================================================================
--- branches/upstream/libdbd-pg-perl/current/t/03smethod.t (original)
+++ branches/upstream/libdbd-pg-perl/current/t/03smethod.t Thu Mar 27 15:58:52 2008
@@ -19,7 +19,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 75;
+plan tests => 96;
 
 isnt( $dbh, undef, 'Connect to database for statement handle method testing');
 
@@ -339,16 +339,23 @@
 $expected = [{id => 35, val => 'Guava'},{id => 36, val => 'Lemon'}];
 is_deeply( $result, $expected, 'Statement handle method "fetchall_arrayref" works with an empty hashref slice');
 
-# Test of the 'maxrows' argument
-$sth = $dbh->prepare('SELECT id, val FROM dbd_pg_test WHERE id >= 33 ORDER BY id ASC LIMIT 10');
-$sth->execute();
-$result = $sth->fetchall_arrayref(undef,2);
-$expected = [[33,'Peach'],[34,'Huckleberry']];
-is_deeply( $result, $expected, q{Statement handle method "fetchall_arrayref" works with a 'maxrows' argument});
-$result = $sth->fetchall_arrayref([1],2);
-$expected = [['Guava'],['Lemon']];
-is_deeply( $result, $expected, q{Statement handle method "fetchall_arrayref" works with an arrayref slice and a 'maxrows' argument});
-$sth->finish();
+
+SKIP: {
+	if ($DBI::VERSION >= 1.603) {
+		skip 'fetchall_arrayref max rows broken in DBI 1.603', 2;
+	}
+
+	# Test of the 'maxrows' argument
+	$sth = $dbh->prepare('SELECT id, val FROM dbd_pg_test WHERE id >= 33 ORDER BY id ASC LIMIT 10');
+	$sth->execute();
+	$result = $sth->fetchall_arrayref(undef,2);
+	$expected = [[33,'Peach'],[34,'Huckleberry']];
+	is_deeply( $result, $expected, q{Statement handle method "fetchall_arrayref" works with a 'maxrows' argument});
+	$result = $sth->fetchall_arrayref([1],2);
+	$expected = [['Guava'],['Lemon']];
+	is_deeply( $result, $expected, q{Statement handle method "fetchall_arrayref" works with an arrayref slice and a 'maxrows' argument});
+	$sth->finish();
+}
 
 #
 # Test of the "fetchall_hashref" statement handle method
@@ -457,6 +464,7 @@
 	if ($DBI::VERSION < 1.54) {
 		skip 'DBI must be at least version 1.54 to test private_attribute_info', 2;
 	}
+
 
 	$sth = $dbh->prepare('SELECT 123');
 	my $private = $sth->private_attribute_info();
@@ -470,6 +478,97 @@
 }
 
 
+#
+# Test of the statement handle method "pg_numbound"
+#
+
+$dbh->rollback();
+$t=q{Statement handle attribute pg_numbound returns 0 if no placeholders};
+$sth = $dbh->prepare('SELECT 123');
+is($sth->{pg_numbound}, 0, $t);
+
+$sth->execute();
+is($sth->{pg_numbound}, 0, $t);
+
+$t=q{Statement handle attribute pg_numbound returns 0 if no placeholders bound yet};
+$sth = $dbh->prepare('SELECT 123 WHERE 1 > ? AND 2 > ?');
+is($sth->{pg_numbound}, 0, $t);
+
+$t=q{Statement handle attribute pg_numbound returns 1 if one placeholder bound};
+$sth->bind_param(1, 123);
+is($sth->{pg_numbound}, 1, $t);
+
+$t=q{Statement handle attribute pg_numbound returns 2 if two placeholders bound};
+$sth->bind_param(2, 345);
+is($sth->{pg_numbound}, 2, $t);
+
+$t=q{Statement handle attribute pg_numbound returns 1 if one placeholders bound as NULL};
+$sth = $dbh->prepare('SELECT 123 WHERE 1 > ? AND 2 > ?');
+$sth->bind_param(1, undef);
+is($sth->{pg_numbound}, 1, $t);
+
+#
+# Test of the statement handle method "pg_bound"
+#
+
+$t=q{Statement handle attribute pg_bound returns an empty hash if no placeholders};
+$sth = $dbh->prepare('SELECT 123');
+is_deeply($sth->{pg_bound}, {}, $t);
+
+$sth->execute();
+is_deeply($sth->{pg_bound}, {}, $t);
+
+$t=q{Statement handle attribute pg_bound returns correct value if no placeholders bound yet};
+$sth = $dbh->prepare('SELECT 123 WHERE 1 > ? AND 2 > ?');
+is_deeply($sth->{pg_bound}, {1=>0, 2=>0}, $t);
+
+$t=q{Statement handle attribute pg_bound returns correct value if one placeholder bound};
+$sth->bind_param(2, 123);
+is_deeply($sth->{pg_bound}, {1=>0, 2=>1}, $t);
+
+$t=q{Statement handle attribute pg_bound returns correct value if two placeholders bound};
+$sth->bind_param(1, 123);
+is_deeply($sth->{pg_bound}, {1=>1, 2=>1}, $t);
+
+#
+# Test of the statement handle method "pg_numbound"
+#
+
+$t=q{Statement handle attribute pg_numbound returns 1 if one placeholders bound as NULL};
+$sth = $dbh->prepare('SELECT 123 WHERE 1 > ? AND 2 > ?');
+$sth->bind_param(1, undef);
+is_deeply($sth->{pg_bound}, {1=>1, 2=>0}, $t);
+
+
+#
+# Test of the statement handle method "pg_current_row"
+#
+
+$t=q{Statement handle attribute pg_current_row returns zero until first row fetched};
+$sth = $dbh->prepare('SELECT 1 FROM pg_class LIMIT 5');
+is($sth->{pg_current_row}, 0, $t);
+
+$t=q{Statement handle attribute pg_current_row returns zero until first row fetched};
+$sth->execute();
+is($sth->{pg_current_row}, 0, $t);
+
+$t=q{Statement handle attribute pg_current_row returns 1 after a fetch};
+$sth->fetch();
+is($sth->{pg_current_row}, 1, $t);
+
+$t=q{Statement handle attribute pg_current_row returns correct value while fetching};
+my $x = 2;
+while (defined $sth->fetch()) {
+	is($sth->{pg_current_row}, $x++, $t);
+}
+$t=q{Statement handle attribute pg_current_row returns 0 when done fetching};
+is($sth->{pg_current_row}, 0, $t);
+
+$t=q{Statement handle attribute pg_current_row returns 0 after fetchall_arrayref};
+$sth->execute();
+$sth->fetchall_arrayref();
+is($sth->{pg_current_row}, 0, $t);
+
 cleanup_database($dbh,'test');
 $dbh->rollback();
 $dbh->disconnect();




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