r26085 - in /trunk/libdbd-pg-perl: .perlcriticrc Changes META.yml Makefile.PL Pg.pm README SIGNATURE dbdimp.c debian/changelog lib/Bundle/DBD/Pg.pm t/02attribs.t t/07copy.t t/12placeholders.t t/99_pod.t t/99_spellcheck.t types.c

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Oct 17 14:01:55 UTC 2008


Author: gregoa
Date: Fri Oct 17 14:01:47 2008
New Revision: 26085

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26085
Log:
New upstream release, includes a fix for "Segmentation fault on INSERT"
(closes: #500788).

Modified:
    trunk/libdbd-pg-perl/.perlcriticrc
    trunk/libdbd-pg-perl/Changes
    trunk/libdbd-pg-perl/META.yml
    trunk/libdbd-pg-perl/Makefile.PL
    trunk/libdbd-pg-perl/Pg.pm
    trunk/libdbd-pg-perl/README
    trunk/libdbd-pg-perl/SIGNATURE
    trunk/libdbd-pg-perl/dbdimp.c
    trunk/libdbd-pg-perl/debian/changelog
    trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm
    trunk/libdbd-pg-perl/t/02attribs.t
    trunk/libdbd-pg-perl/t/07copy.t
    trunk/libdbd-pg-perl/t/12placeholders.t
    trunk/libdbd-pg-perl/t/99_pod.t
    trunk/libdbd-pg-perl/t/99_spellcheck.t
    trunk/libdbd-pg-perl/types.c

Modified: trunk/libdbd-pg-perl/.perlcriticrc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/.perlcriticrc?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/.perlcriticrc (original)
+++ trunk/libdbd-pg-perl/.perlcriticrc Fri Oct 17 14:01:47 2008
@@ -2,7 +2,7 @@
 profile-strictness = quiet
 
 [Documentation::PodSpelling]
-stop_words = ActiveKids AutoCommit boolean Bunce CachedKids ChildHandles ChopBlanks CompatMode CursorName DBD DBI Datatype dbdpg enum ErrCount FetchHashKeyName HandleError HandleSetErr InactiveDestroy LongReadLen LongTruncOk Mergl Momjian Mullane NULLABLE OID ParamValues ParamTypes PgBouncer pgend pglibpq pglogin pgprefix pgquote pgstart PGSERVICE PGSYSCONFDIR perl Postgres PostgreSQL PrintError PrintWarn README RaiseError RowCache RowCacheSize RowsInCache SQL SQLSTATE SSL STDIN STDERR STDOUT Sabino Savepoints ShowErrorStatement TaintIn TaintOut TraceLevel UTF Username afterwards arrayrefs attr autocommit backend bitmask bytea cancelled datatype dbd dbh errstr fd filename getfd getline hashref largeobject len libpq lseg pgbuiltin pgsql runtime savepoint savepoints schemas sslmode tablename tablespace tablespaces tuple typename username varchar undef Perlish arrayref datatypes bool func PID dr ReadOnly nullable
+stop_words = ActiveKids AutoCommit boolean Bunce CachedKids ChildHandles ChopBlanks CompatMode CursorName DBD DBI Datatype dbdpg enum ErrCount FetchHashKeyName HandleError HandleSetErr InactiveDestroy LongReadLen LongTruncOk Mergl Momjian Mullane NULLABLE OID ParamValues ParamTypes PgBouncer pgend pglibpq pglogin pgprefix pgquote pgstart PGSERVICE PGSYSCONFDIR perl Postgres PostgreSQL PrintError PrintWarn README RaiseError RowCache RowCacheSize RowsInCache SQL SQLSTATE SSL STDIN STDERR STDOUT Sabino Savepoints ShowErrorStatement TaintIn TaintOut TraceLevel UTF Username afterwards arrayrefs attr autocommit backend bitmask bytea cancelled datatype dbd dbh errstr fd filename getfd getline hashref largeobject len libpq lseg pgbuiltin pgsql runtime savepoint savepoints schemas sslmode tablename tablespace tablespaces tuple typename username varchar undef Perlish arrayref datatypes bool func PID dr ReadOnly nullable hashrefs
 
 [-Bangs::ProhibitCommentedOutCode]
 [-Bangs::ProhibitFlagComments]

Modified: trunk/libdbd-pg-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Changes?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Changes (original)
+++ trunk/libdbd-pg-perl/Changes Fri Oct 17 14:01:47 2008
@@ -1,6 +1,22 @@
 ('GSM' is Greg Sabino Mullane, greg at turnstep.com)
 
-2.10.7 Released September 22, 2008
+
+2.11.2 Released October 15, 2008
+
+	- Fix core dump when invalid placeholders used. (CPAN bug #40075) [GSM]
+
+2.11.1 Released October 14, 2008 (subversion r11980)
+
+	- $sth->{ParamTypes} returns 'TYPE' when possible.
+
+2.11.0 Released October 13, 2008 (subversion r11976)
+
+	- $sth->{ParamTypes} now returns a hashref per the DBI docs. [GSM]
+	- Adjustment of Makefile.PL to fix problem with Strawberry Perl.
+		Thanks to Martin Evan (martin.evans at easysoft.com) and Brian 
+		(elspicyjack at gmail.com) on the dbi-users list.
+
+2.10.7 Released September 22, 2008 (subversion r11869)
 
 	- Fix test issue when dbname contains dashes.
 		[Rainer Tammer]
@@ -79,7 +95,7 @@
 2.8.5 Released July 13, 2008 (subversion r11529)
 
 	- Fix an obscure bug in which a coredump occurs if client_min_messages 
-	  	is set to DEBUG3 or greater, and we then exit without disconnecting 
+		is set to DEBUG3 or greater, and we then exit without disconnecting 
 		while AutoCommit is off. The new behavior is to simply not attempt to 
 		output the debugging information about the final 'rollback'. [GSM]
 	- More documentation improvements. [GSM]

Modified: trunk/libdbd-pg-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/META.yml?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/META.yml (original)
+++ trunk/libdbd-pg-perl/META.yml Fri Oct 17 14:01:47 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name                        : DBD-Pg
-version                     : 2.10.7
+version                     : 2.11.2
 abstract                    : DBI PostgreSQL interface
 author:              
   - Greg Sabino Mullane <greg at turnstep.com>
@@ -24,6 +24,7 @@
   Cwd                       : 0
   Encode                    : 0
   File::Temp                : 0
+  File::Comments            : 0
   File::Comments::Plugin::C : 0
   Module::Signature         : 0.50
   Perl::Critic              : 0
@@ -38,10 +39,10 @@
 provides:
   DBD::Pg:
     file                    : Pg.pm
-    version                 : 2.10.7
+    version                 : 2.11.2
   Bundle::DBD::Pg:
     file                    : lib/Bundle/DBD/Pg.pm
-    version                 : 2.10.7
+    version                 : 2.11.2
 
 keywords:
   - Postgres

Modified: trunk/libdbd-pg-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Makefile.PL?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Makefile.PL (original)
+++ trunk/libdbd-pg-perl/Makefile.PL Fri Oct 17 14:01:47 2008
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL 11866 2008-09-22 23:13:10Z turnstep $
+# $Id: Makefile.PL 11982 2008-10-16 00:50:36Z 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.10.7';
+my $VERSION = '2.11.2';
 
 my $lib;
 BEGIN {
@@ -226,6 +226,22 @@
 	}
 }
 
+sub constants {
+	my $self = shift;
+
+	my $old_constants = $self->SUPER::constants();
+	my $new_constants = '';
+	for my $line (split /\n/ => $old_constants) {
+		if ($line =~ /^INC = .*strawberry.*/ ) {
+			print qq(Strawberry Perl found; adjusting the INC variable;\n);
+			$line . ' -I ' . DBI::DBD::dbd_dbi_arch_dir();
+			print qq(INC is now $line\n);
+		}
+		$new_constants .= "$line\n";
+	}
+	return $new_constants;
+}
+
 sub MY::postamble { ## no critic ProhibitQualifiedSubDeclarations
 	no strict 'subs'; ## no critic ProhibitNoStrict
 	my $string = DBI::DBD->dbd_postamble();

Modified: trunk/libdbd-pg-perl/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.pm?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.pm (original)
+++ trunk/libdbd-pg-perl/Pg.pm Fri Oct 17 14:01:47 2008
@@ -1,5 +1,5 @@
 #  -*-cperl-*-
-#  $Id: Pg.pm 11864 2008-09-22 23:07:24Z turnstep $
+#  $Id: Pg.pm 11982 2008-10-16 00:50:36Z 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.10.7');
+	use version; our $VERSION = qv('2.11.2');
 
 	use DBI ();
 	use DynaLoader ();
@@ -1703,7 +1703,7 @@
 
 =head1 VERSION
 
-This documents version 2.10.7 of the DBD::Pg module
+This documents version 2.11.2 of the DBD::Pg module
 
 =head1 DESCRIPTION
 
@@ -2038,21 +2038,34 @@
   $lobjId = $dbh->func($mode, 'lo_creat');
 
 Creates a new large object and returns the object-id. C<$mode> is a bitmask
-describing different attributes of the new object. Use the following
-constants:
-
+describing read and write access to the new object. This setting is ignored
+since Postgres version 8.1. For backwards compatibility, however, you should 
+set a valid mode anyway (see L</lo_open> for a list of valid modes).
+
+Upon failure it returns C<undef>.
+
+=item lo_open
+
+  $lobj_fd = $dbh->func($lobjId, $mode, 'lo_open');
+
+Opens an existing large object and returns an object-descriptor for use in
+subsequent C<lo_*> calls. C<$mode> is a bitmask describing read and write
+access to the opened object. It may be one of: 
+
+  $dbh->{pg_INV_READ}
   $dbh->{pg_INV_WRITE}
-  $dbh->{pg_INV_READ}
-
-Upon failure it returns C<undef>.
-
-=item lo_open
-
-  $lobj_fd = $dbh->func($lobjId, $mode, 'lo_open');
-
-Opens an existing large object and returns an object-descriptor for use in
-subsequent C<lo_*> calls. For the mode bits see L</lo_creat>. Returns C<undef>
-upon failure. Note that 0 is a perfectly correct (and common) object descriptor!
+  $dbh->{pg_INV_READ} | $dbh->{pg_INV_WRITE}
+
+C<pg_INV_WRITE> and C<pg_INV_WRITE | pg_INV_READ> modes are identical; in
+both modes, the large object can be read from or written to.
+Reading from the object will provide the object as written in other committed
+transactions, along with any writes performed by the current transaction.
+Objects opened with C<pg_INV_READ> cannot be written to. Reading from this
+object will provide the stored data at the time of the transaction snapshot
+which was active when C<lo_write> was called.
+
+Returns C<undef> upon failure. Note that 0 is a perfectly correct (and common)
+object descriptor!
 
 =item lo_write
 
@@ -3224,7 +3237,7 @@
   use DBI qw(:sql_types);
 
 This will import some constants into your script. You can plug those
-directly into the C<bind_param> call. Some common ones that you will
+directly into the L</bind_param> call. Some common ones that you will
 encounter are:
 
   SQL_INTEGER
@@ -3234,7 +3247,7 @@
   use DBD::Pg qw(:pg_types);
 
 You can then set the data types by setting the value of the C<pg_type>
-key in the hash passed to C<bind_param>. 
+key in the hash passed to L</bind_param>.
 The current list of Postgres data types exported is:
 
  PG_ABSTIME PG_ABSTIMEARRAY PG_ACLITEM PG_ACLITEMARRAY PG_ANY PG_ANYARRAY
@@ -3615,8 +3628,11 @@
 =head3 B<ParamTypes> (hash ref, read-only)
 
 Returns a reference to a hash containing the type names currently bound to placeholders. The keys 
-are the same as returned by the ParamValues method. Placeholders that have not yet been bound will return 
-undef as the value.
+are the same as returned by the ParamValues method. The values are hashrefs containing a single key value 
+pair, in which the key is either 'TYPE' if the type has a generic SQL equivalent, and 'pg_type' if the type can 
+only be expressed by a Postgres type. The value is the internal number corresponding to the type originally 
+passed in. (Placeholders that have not yet been bound will return undef as the value). This allows the output of 
+ParamTypes to be passed back to the L</bind_param> method.
 
 =head3 B<Statement> (string, read-only)
 
@@ -3978,7 +3994,7 @@
 
   $dbh->do("COPY foobar FROM STDIN");
 
-This would tell the server to enter a COPY OUT state. It is now ready to 
+This would tell the server to enter a COPY IN state. It is now ready to 
 receive information via the L</pg_putcopydata> method. The complete syntax of the 
 COPY command is more complex and not documented here: the canonical 
 PostgreSQL documentation for COPY can be found at:
@@ -4000,14 +4016,14 @@
 one data row at a time. The first argument to pg_getcopydata 
 is the variable into which the data will be stored (this variable should not 
 be undefined, or it may throw a warning, although it may be a reference). This 
-argument returns a number greater than 1 indicating the new size of the variable, 
+method returns a number greater than 1 indicating the new size of the variable, 
 or a -1 when the COPY has finished. Once a -1 has been returned, no other action is 
 necessary, as COPY mode will have already terminated. Example:
 
   $dbh->do("COPY mytable TO STDOUT");
   my @data;
   my $x=0;
-  1 while $dbh->pg_getcopydata($data[$x++]) > 0;
+  1 while $dbh->pg_getcopydata($data[$x++]) >= 0;
 
 There is also a variation of this method called B<pg_getcopydata_async>, which, 
 as the name suggests, returns immediately. The only difference from the original 

Modified: trunk/libdbd-pg-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/README?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/README (original)
+++ trunk/libdbd-pg-perl/README Fri Oct 17 14:01:47 2008
@@ -1,12 +1,12 @@
 
 DBD::Pg  --  the DBI PostgreSQL interface for Perl
 
-# $Id: README 11866 2008-09-22 23:13:10Z turnstep $
+# $Id: README 11982 2008-10-16 00:50:36Z turnstep $
 
 DESCRIPTION:
 ------------
 
-This is version 2.10.7 of DBD::Pg, the Perl interface to Postgres using DBI. 
+This is version 2.11.2 of DBD::Pg, the Perl interface to Postgres using DBI. 
 The web site for this interface, and the latest version, can be found at:
 
 	http://search.cpan.org/dist/DBD-Pg/

Modified: trunk/libdbd-pg-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/SIGNATURE?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/SIGNATURE (original)
+++ trunk/libdbd-pg-perl/SIGNATURE Fri Oct 17 14:01:47 2008
@@ -14,42 +14,42 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: RIPEMD160
 
-SHA1 14d7a3c7a0b0497e4ab463b67850bd5e1f70409d .perlcriticrc
-SHA1 fcb3bfb40d8c36ad8c3ca8b90207b7ceee353fee Changes
+SHA1 aad10b079c60a69de516d0dbbed951985a07fef4 .perlcriticrc
+SHA1 69047482057c08b22c4f887f1940e9588ce64697 Changes
 SHA1 4d91c71e5dbb19ece1505ab75c36d00a744bb076 MANIFEST
 SHA1 22055b195f5cf15d7909e8a08468e617f46154e7 MANIFEST.SKIP
-SHA1 b430714a84c9fb3cd81efab39173f7038d6bafb6 META.yml
-SHA1 11c74a12496d31d8124c08c6685861299c6b6c32 Makefile.PL
+SHA1 f64e262e87b47ec7fdef7d7babdca4e437089b46 META.yml
+SHA1 c8df0bec1a892c3e47ddbbb9a9077801715ca48a Makefile.PL
 SHA1 c51356c52c139265e20a2ad33bc8d3ee04f6ff48 Pg.h
-SHA1 fb4bd9a231477abd9d77d707914a32ab51d03399 Pg.pm
+SHA1 e92b93c7ed3f8ef6285f5df94a0698427cf2c693 Pg.pm
 SHA1 caf6c843024b2853bc2460c60f9c667f9150cbd4 Pg.xs
-SHA1 8a9d05559a59bc3b97530b231726307ef24f327d README
+SHA1 767824660572ad5c14dfe48724f03c00aa3ca579 README
 SHA1 c6d2633bdb72186bfb2887d6a1efab3a06f44cbd README.dev
 SHA1 968d5fad61bce160b31a9cb1a21dd240b9df930f README.win32
 SHA1 cb3078ec98906fc6381ca0af9e146e2d8b4176c6 TODO
-SHA1 de56b7328d402a3ba32431b97410d401aedc7f45 dbdimp.c
+SHA1 3a06a879e572ba1867bc0d146364eb67044dac2e dbdimp.c
 SHA1 e079dca9f560b265daba52e7daee42e1a17184bb dbdimp.h
 SHA1 6c33bcf138e577722283bef02fceb8cbce4d100d dbivport.h
-SHA1 1a52a88ba5ed8a39f7d659b2e98be26f58c845c3 lib/Bundle/DBD/Pg.pm
+SHA1 13e014a70465ab69ab77a33703f24300406d1083 lib/Bundle/DBD/Pg.pm
 SHA1 dbe8b0bd24538a61d4c617848e7fca27fd4ea3eb quote.c
 SHA1 0a1fdd0406c5c367a9aba366d1d35cfa8d5272ae quote.h
 SHA1 93aa7e8cae0a361d1e6163dea0281ebff41f3c5f t/00-signature.t
 SHA1 073baf503a601ceeb49516d61bd275f0c1e51563 t/00basic.t
 SHA1 f407ad828fe5898e1fa585523852b204ce9b5b2d t/01connect.t
 SHA1 ec842e6aaf11d6a55809318d69bd11ce8245092f t/01constants.t
-SHA1 73c4d8f20e828885828505f8266629af4f2e8ae9 t/02attribs.t
+SHA1 bb06303aa702844bb12861fa16e6255730e92c81 t/02attribs.t
 SHA1 790f36471738f6b701e86654f8cd0ffafce03f0b t/03dbmethod.t
 SHA1 7ce47f4163e23b3f3df589487707257f5158001a t/03smethod.t
 SHA1 910d6c2234d77a74a49cf189b6c799e13bf75280 t/04misc.t
 SHA1 ee7ecab04b202d5cd8816fbb8c2703971161dd53 t/06bytea.t
-SHA1 2aac29d06766d0edbf0848c433c2ff837908e6ea t/07copy.t
+SHA1 99aac4b46da5b138c42358854f8f9682b742c44d t/07copy.t
 SHA1 1413c886eaf1714db1cf8abfb989dabfd86dee87 t/08async.t
 SHA1 5027751944bdca8f0fe63c20c790c4c3beccf433 t/09arrays.t
-SHA1 ee401c485a5c6f36844268eac0e95485359790bf t/12placeholders.t
+SHA1 8d79dee1b89a66024f07019d6e88246a5fd73983 t/12placeholders.t
 SHA1 85b5df8ef0c78b1d2d0018d874c62af7ef01a28f t/20savepoints.t
 SHA1 3bfb78b128724d3badf19ec4db8c1674543c557e t/99_perlcritic.t
-SHA1 9f94e06ec6b6a27512f1f4c638635e4095ae6be7 t/99_pod.t
-SHA1 29ee4d1ebb593b2148e2b50f75e55c7c4b8ee376 t/99_spellcheck.t
+SHA1 3b22d5db94ca05d1fa1a8ea25d9c2ce866c36642 t/99_pod.t
+SHA1 08a946b20ffe16650b8b2e59e886ab0f6b795a7c t/99_spellcheck.t
 SHA1 ace40437561196dc6a08b5e725de35aed0e9902c t/99_yaml.t
 SHA1 60031c2db489d77291078ab6a418723e1a35f137 t/99cleanup.t
 SHA1 5e0f55ec185c686b583ceb0b94f54dd60d808f02 t/dbdpg_test_setup.pl
@@ -60,12 +60,12 @@
 SHA1 c4526a50a9266817c64a8f8a9e3fa19b27715f50 t/lib/App/Info/RDBMS/PostgreSQL.pm
 SHA1 188d73fe871cc0afa65837c19eb2a6b43884a8f4 t/lib/App/Info/Request.pm
 SHA1 6eaa2bdb5bc68d1b68933f59dd21882b920a5df0 t/lib/App/Info/Util.pm
-SHA1 c2e57ee10f8a32d66d6c7a314ca5a0f886bc8618 types.c
+SHA1 188a1e317ecb816dae753bd61906d22446a67ff8 types.c
 SHA1 01c443add5e4541921943d361025d3e82e9bc7d0 types.h
 SHA1 f07cd5ecaeb854c81ceb9206364979cf607e6546 win32.mak
 -----BEGIN PGP SIGNATURE-----
 
-iEYEAREDAAYFAkjYXlYACgkQvJuQZxSWSshmdQCgxoBXsxaWQ5G2xI8ISAEx6oq/
-Er4AoOOwG+EW8rSJ9nFYBqQU9ykSZpVd
-=qfFx
+iEYEAREDAAYFAkj2j/8ACgkQvJuQZxSWSsitiwCggY9cJeBkbAxg7EBw+ZWU2ney
+9jcAn1qlLQsAH0fc++vyOcZhlqxh/1Lg
+=AjNQ
 -----END PGP SIGNATURE-----

Modified: trunk/libdbd-pg-perl/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/dbdimp.c?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/dbdimp.c (original)
+++ trunk/libdbd-pg-perl/dbdimp.c Fri Oct 17 14:01:47 2008
@@ -1,6 +1,6 @@
 /*
 
-  $Id: dbdimp.c 11818 2008-09-18 19:10:13Z turnstep $
+  $Id: dbdimp.c 11981 2008-10-16 00:49:02Z turnstep $
 
   Copyright (c) 2002-2008 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 2002 Jeffrey W. Baker
@@ -921,9 +921,16 @@
 						 newSV(0), 0);
 				}
 				else {
+					HV *pvhv2 = newHV();
+					if (currph->bind_type->type.sql) {
+						(void)hv_store(pvhv2, "TYPE", 4, newSViv(currph->bind_type->type.sql), 0);
+					}
+					else {
+						(void)hv_store(pvhv2, "pg_type", 7, newSViv(currph->bind_type->type_id), 0);
+					}
 					(void)hv_store_ent
 						(pvhv, (3==imp_sth->placeholder_type ? newSVpv(currph->fooname,0) : newSViv(i+1)),
-						 newSVpv(currph->bind_type->type_name,0),0);
+						 newRV_noinc((SV*)pvhv2), 0);
 				}
 			}
 			retsv = newRV_noinc((SV*)pvhv);
@@ -2684,6 +2691,7 @@
 
 	imp_dbh->copystate = 0; /* Assume not in copy mode until told otherwise */
 
+	if (TRACE4) TRC(DBILOGFP, "%sGot a status of %d\n", THEADER, status);
 	switch (status) {
 	case PGRES_TUPLES_OK:
 		TRACE_PQNTUPLES;
@@ -3029,7 +3037,8 @@
 			New(0, statement, execsize+1, char); /* freed below */
 			statement[0] = '\0';
 			for (currseg=imp_sth->seg; NULL != currseg; currseg=currseg->nextseg) {
-				strcat(statement, currseg->segment);
+				if (currseg->segment != NULL)
+					strcat(statement, currseg->segment);
 				if (currseg->placeholder!=0)
 					sprintf(strchr(statement, '\0'), "$%d", currseg->placeholder);
 			}
@@ -3089,7 +3098,8 @@
 			New(0, statement, execsize+1, char); /* freed below */
 			statement[0] = '\0';
 			for (currseg=imp_sth->seg; NULL != currseg; currseg=currseg->nextseg) {
-				strcat(statement, currseg->segment);
+				if (currseg->segment != NULL)
+					strcat(statement, currseg->segment);
 				if (currseg->placeholder!=0)
 					strcat(statement, currseg->ph->quoted);
 			}
@@ -3696,7 +3706,7 @@
 
 	/* We must be in COPY OUT state */
 	if (PGRES_COPY_OUT != imp_dbh->copystate)
-		croak("pg_getcopydata can only be called directly after issuing a COPY command\n");
+		croak("pg_getcopydata can only be called directly after issuing a COPY FROM command\n");
 
 	tempbuf = NULL;
 
@@ -3755,7 +3765,7 @@
 
 	/* We must be in COPY IN state */
 	if (PGRES_COPY_IN != imp_dbh->copystate)
-		croak("pg_putcopydata can only be called directly after issuing a COPY command\n");
+		croak("pg_putcopydata can only be called directly after issuing a COPY TO command\n");
 
 	TRACE_PQPUTCOPYDATA;
 	copystatus = PQputCopyData

Modified: trunk/libdbd-pg-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/debian/changelog?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/debian/changelog (original)
+++ trunk/libdbd-pg-perl/debian/changelog Fri Oct 17 14:01:47 2008
@@ -1,3 +1,10 @@
+libdbd-pg-perl (2.11.2-1) UNRELEASED; urgency=low
+
+  * New upstream release, includes a fix for "Segmentation fault on INSERT"
+    (closes: #500788).
+
+ -- gregor herrmann <gregoa at debian.org>  Fri, 17 Oct 2008 15:58:57 +0200
+
 libdbd-pg-perl (2.10.7-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm (original)
+++ trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm Fri Oct 17 14:01:47 2008
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-$VERSION = '2.10.7';
+$VERSION = '2.11.2';
 
 1;
 

Modified: trunk/libdbd-pg-perl/t/02attribs.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/02attribs.t?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/02attribs.t (original)
+++ trunk/libdbd-pg-perl/t/02attribs.t Fri Oct 17 14:01:47 2008
@@ -18,7 +18,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 245;
+plan tests => 249;
 
 isnt ($dbh, undef, 'Connect to database for handle attributes testing');
 
@@ -846,19 +846,52 @@
 # Test of the statement handle attribute "ParamTypes"
 #
 
+
 $t='Statement handle attribute "ParamTypes" works before execute';
 $sth = $dbh->prepare('SELECT id FROM dbd_pg_test WHERE id=? AND val=? AND lii=?');
 $sth->bind_param(1, 1, SQL_INTEGER);
 $sth->bind_param(2, 'TMW', SQL_VARCHAR);
 $attrib = $sth->{ParamTypes};
-$expected = {1 => 'int4', 2 => 'varchar', 3 => undef};
+$expected = {1 => {TYPE => SQL_INTEGER}, 2 => {TYPE => SQL_VARCHAR}, 3 => undef};
 is_deeply ($attrib, $expected, $t);
 
+$t='Statement handle attributes "ParamValues" and "ParamTypes" can be pased back to bind_param';
+eval {
+	my $vals = $sth->{ParamValues};
+	my $types = $sth->{ParamTypes};
+    $sth->bind_param($_, $vals->{$_}, $types->{$_} )
+        for keys %$types;
+};
+is( $@, q{}, $t);
+
+$t='Statement handle attribute "ParamTypes" works before execute with named placeholders';
+$sth = $dbh->prepare('SELECT id FROM dbd_pg_test WHERE id=:foobar AND val=:foobar2 AND lii=:foobar3');
+$sth->bind_param(':foobar', 1, {pg_type => PG_INT4});
+$sth->bind_param(':foobar2', 'TMW', {pg_type => PG_TEXT});
+$attrib = $sth->{ParamTypes};
+$expected = {':foobar' => {TYPE => SQL_INTEGER}, ':foobar2' => {TYPE => SQL_LONGVARCHAR}, ':foobar3' => undef};
+is_deeply ($attrib, $expected, $t);
+
+$t='Statement handle attributes "ParamValues" and "ParamTypes" can be passed back to bind_param';
+eval {
+	my $vals = $sth->{ParamValues};
+	my $types = $sth->{ParamTypes};
+    $sth->bind_param($_, $vals->{$_}, $types->{$_} )
+        for keys %$types;
+};
+is( $@, q{}, $t);
+
 $t='Statement handle attribute "ParamTypes" works after execute';
-$sth->bind_param(3, 3, {pg_type => PG_INT4});
+$sth->bind_param(':foobar3', 3, {pg_type => PG_INT2});
 $sth->execute();
 $attrib = $sth->{ParamTypes};
-$expected->{3} = 'int4';
+$expected->{':foobar3'} = {TYPE => SQL_SMALLINT};
+is_deeply ($attrib, $expected, $t);
+
+$t='Statement handle attribute "ParamTypes" returns correct values';
+$sth->bind_param(':foobar2', 3, {pg_type => PG_CIRCLE});
+$attrib = $sth->{ParamTypes}{':foobar2'};
+$expected = {pg_type => PG_CIRCLE};
 is_deeply ($attrib, $expected, $t);
 
 #

Modified: trunk/libdbd-pg-perl/t/07copy.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/07copy.t?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/07copy.t (original)
+++ trunk/libdbd-pg-perl/t/07copy.t Fri Oct 17 14:01:47 2008
@@ -171,23 +171,23 @@
 
 $dbh->do("DELETE FROM $table");
 
-$t='pg_putcopydata fails if not after a COPY statement';
+$t='pg_putcopydata fails if not after a COPY TO statement';
 eval {
 	$dbh->pg_putcopydata("pizza\tpie");
 };
-like ($@, qr{COPY command}, $t);
-
-$t='pg_getcopydata fails if not after a COPY statement';
+like ($@, qr{COPY TO command}, $t);
+
+$t='pg_getcopydata fails if not after a COPY TO statement';
 eval {
 	$dbh->pg_getcopydata($data[0]);
 };
-like ($@, qr{COPY command}, $t);
-
-$t='pg_getcopydata_async fails if not after a COPY statement';
+like ($@, qr{COPY FROM command}, $t);
+
+$t='pg_getcopydata_async fails if not after a COPY TO statement';
 eval {
 	$dbh->pg_getcopydata_async($data[0]);
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY FROM command}, $t);
 
 $t='pg_putcopyend warns but does not die if not after a COPY statement';
 eval { require Test::Warn; };
@@ -204,7 +204,7 @@
 eval {
 	$dbh->pg_getcopydata($data[0]);
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY FROM command}, $t);
 
 $t='pg_putcopydata does not work if we are using COPY .. TO';
 $dbh->rollback();
@@ -212,7 +212,7 @@
 eval {
 	$dbh->pg_putcopydata("pizza\tpie");
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY TO command}, $t);
 
 $t='pg_putcopydata works and returns a 1 on success';
 $dbh->rollback();
@@ -238,7 +238,7 @@
 eval {
 	$dbh->pg_getcopydata($data[0]);
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY FROM command}, $t);
 
 $t='Calling do() gives an error when in the middle of COPY .. FROM';
 eval {
@@ -265,7 +265,7 @@
 eval {
 	$result = $dbh->pg_putcopydata('root');
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY TO command}, $t);
 
 $t='Normal queries work after pg_putcopyend is called';
 eval {
@@ -310,7 +310,7 @@
 eval {
 	$dbh->pg_putcopydata('pie');
 };
-like ($@, qr{COPY command}, $t);
+like ($@, qr{COPY TO command}, $t);
 
 $t='pg_getcopydata returns 0 when no more data';
 $dbh->pg_getcopydata(\$data[0]);

Modified: trunk/libdbd-pg-perl/t/12placeholders.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/12placeholders.t?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/12placeholders.t (original)
+++ trunk/libdbd-pg-perl/t/12placeholders.t Fri Oct 17 14:01:47 2008
@@ -15,7 +15,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 27;
+plan tests => 28;
 
 my $t='Connect to database for placeholder testing';
 isnt ($dbh, undef, $t);
@@ -152,6 +152,13 @@
 };
 is ($@, q{}, $t);
 
+$t='Calling do() with invalid crowded placeholders fails cleanly';
+$dbh->commit();
+eval {
+  $dbh->do(q{SELECT ??}, undef, 'public', 'error');
+};
+like ($@, qr{ERROR}, $t);
+
 $t='Prepare/execute with non-DML placeholder works';
 $dbh->commit();
 eval {

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=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/99_pod.t (original)
+++ trunk/libdbd-pg-perl/t/99_pod.t Fri Oct 17 14:01:47 2008
@@ -2,12 +2,17 @@
 
 ## Check our Pod, requires Test::Pod
 ## Also done if available: Test::Pod::Coverage
+## Requires TEST_AUTHOR env
 
 use 5.006;
 use strict;
 use warnings;
 use Test::More;
 select(($|=1,select(STDERR),$|=1)[1]);
+
+if (!$ENV{TEST_AUTHOR}) {
+	plan skip_all => 'Set the environment variable TEST_AUTHOR to enable this test';
+}
 
 plan tests => 3;
 

Modified: trunk/libdbd-pg-perl/t/99_spellcheck.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/99_spellcheck.t?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/99_spellcheck.t (original)
+++ trunk/libdbd-pg-perl/t/99_spellcheck.t Fri Oct 17 14:01:47 2008
@@ -612,6 +612,7 @@
 ## Pg.pm:
 lseg
 afterwards
+hashrefs
 PGSYSCONFDIR
 PGSERVICE
 
@@ -704,6 +705,7 @@
 ## types.c:
 ASYNC
 Autogenerate
+basename
 BIGINT
 BOOLOID
 DESCR

Modified: trunk/libdbd-pg-perl/types.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/types.c?rev=26085&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/types.c (original)
+++ trunk/libdbd-pg-perl/types.c Fri Oct 17 14:01:47 2008
@@ -1,6 +1,6 @@
 /*
 
-   $Id: types.c 11867 2008-09-23 02:32:59Z turnstep $
+   $Id: types.c 11872 2008-09-23 13:33:46Z turnstep $
 
    Copyright (c) 2003-2008 Greg Sabino Mullane and others: see the Changes file
    
@@ -394,6 +394,12 @@
 			sqlc    => 0,
 			svtype  => 0,
 		};
+		if ($name =~ /_/) {
+			(my $basename = $name) =~ s/_//;
+			if (exists $pgtype{$basename}) {
+				$pgtype{$name}{delim} = $pgtype{$basename}{delim};
+			}
+		}
 		length($name) > $maxlen and $maxlen = length($name);
 		$thisname = $name;
 		## Special hack for array types




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