r41353 - in /trunk/libdbd-pg-perl: Changes META.yml Makefile.PL Pg.pm Pg.xs README SIGNATURE dbdimp.c dbdimp.h debian/changelog lib/Bundle/DBD/Pg.pm t/03smethod.t t/09arrays.t t/99cleanup.t t/dbdpg_test_setup.pl

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Aug 5 04:56:55 UTC 2009


Author: jawnsy-guest
Date: Wed Aug  5 04:56:48 2009
New Revision: 41353

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41353
Log:
* New upstream release
  + Use PQexecPrepared even with no placeholders (RT#48155)
  + Allow execute_array and bind_param_array to take an odd number of items:
    DBI will make the missing ones undef (RT#39829)
  + Single quites around array literals when quoting arrays (RT#48420)

Modified:
    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/Pg.xs
    trunk/libdbd-pg-perl/README
    trunk/libdbd-pg-perl/SIGNATURE
    trunk/libdbd-pg-perl/dbdimp.c
    trunk/libdbd-pg-perl/dbdimp.h
    trunk/libdbd-pg-perl/debian/changelog
    trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm
    trunk/libdbd-pg-perl/t/03smethod.t
    trunk/libdbd-pg-perl/t/09arrays.t
    trunk/libdbd-pg-perl/t/99cleanup.t
    trunk/libdbd-pg-perl/t/dbdpg_test_setup.pl

Modified: trunk/libdbd-pg-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Changes?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Changes (original)
+++ trunk/libdbd-pg-perl/Changes Wed Aug  5 04:56:48 2009
@@ -1,6 +1,14 @@
 ('GSM' is Greg Sabino Mullane, greg at turnstep.com)
 
-2.14.1 Released July 28, 2009
+2.15.0 Released August 4, 2009
+
+  - Use PQexecPrepared even when no placeholders (CPAN bug #48155) [GSM]
+  - Allow execute_array and bind_param_array to take oddly numbered items, 
+    such that DBI will make missing entries undef/null (CPAN bug #39829) [GSM]
+  - Put single quotes around array literals when quoting arrays via
+    the quote() method. Per report from David Garamond (CPAN bug #48420) [GSM]
+
+2.14.1 Released July 28, 2009 (subversion r13140)
 
   - Remove invalid bigint assignment [Tim Bunce]
 

Modified: trunk/libdbd-pg-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/META.yml?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/META.yml (original)
+++ trunk/libdbd-pg-perl/META.yml Wed Aug  5 04:56:48 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name                        : DBD-Pg
-version                     : 2.14.1
+version                     : 2.15.0
 abstract                    : DBI PostgreSQL interface
 author:              
   - Greg Sabino Mullane <greg at turnstep.com>
@@ -39,10 +39,10 @@
 provides:
   DBD::Pg:
     file                    : Pg.pm
-    version                 : 2.14.1
+    version                 : 2.15.0
   Bundle::DBD::Pg:
     file                    : lib/Bundle/DBD/Pg.pm
-    version                 : 2.14.1
+    version                 : 2.15.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=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Makefile.PL (original)
+++ trunk/libdbd-pg-perl/Makefile.PL Wed Aug  5 04:56:48 2009
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL 13139 2009-07-28 17:03:10Z turnstep $
+# $Id: Makefile.PL 13158 2009-08-04 15:06:22Z 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.14.1';
+my $VERSION = '2.15.0';
 
 my $lib;
 BEGIN {

Modified: trunk/libdbd-pg-perl/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.pm?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.pm (original)
+++ trunk/libdbd-pg-perl/Pg.pm Wed Aug  5 04:56:48 2009
@@ -1,5 +1,5 @@
 #  -*-cperl-*-
-#  $Id: Pg.pm 13139 2009-07-28 17:03:10Z turnstep $
+#  $Id: Pg.pm 13158 2009-08-04 15:06:22Z turnstep $
 #
 #  Copyright (c) 2002-2009 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.14.1');
+	use version; our $VERSION = qv('2.15.0');
 
 	use DBI ();
 	use DynaLoader ();
@@ -1659,34 +1659,26 @@
 
 	sub bind_param_array {
 
+		## Binds an array of data to a specific placeholder in a statement
 		## The DBI version is broken, so we implement a near-copy here
+
 		my $sth = shift;
 		my ($p_id, $value_array, $attr) = @_;
 
+		## Bail if the second arg is not undef or an an arrayref
 		return $sth->set_err(1, "Value for parameter $p_id must be a scalar or an arrayref, not a ".ref($value_array))
 			if defined $value_array and ref $value_array and ref $value_array ne 'ARRAY';
 
+		## Bail if the first arg is not a number
 		return $sth->set_err(1, q{Can't use named placeholders for non-driver supported bind_param_array})
 			unless DBI::looks_like_number($p_id); # because we rely on execute(@ary) here
 
-		# get/create arrayref to hold params
-		my $hash_of_arrays = $sth->{ParamArrays} ||= { };
-
-		if (ref $value_array eq 'ARRAY') {
-			# check that input has same length as existing
-			# find first arrayref entry (if any)
-			for (keys %$hash_of_arrays) {
-				my $v = $$hash_of_arrays{$_};
-				next unless ref $v eq 'ARRAY';
-				return $sth->set_err
-					(1,"Arrayref for parameter $p_id has ".@$value_array.' elements'
-					 ." but parameter $_ has ".@$v)
-					if @$value_array != @$v;
-			}
-		}
-
-		$$hash_of_arrays{$p_id} = $value_array;
+		## Store the list of items in the hash (will be undef or an arayref)
+		$sth->{ParamArrays}{$p_id} = $value_array;
+
+		## If any attribs were passed in, we need to call bind_param
 		return $sth->bind_param($p_id, '', $attr) if $attr; ## This is the big change so -w does not complain
+
 		return 1;
 	} ## end bind_param_array
 
@@ -1739,7 +1731,7 @@
 
 =head1 VERSION
 
-This documents version 2.14.1 of the DBD::Pg module
+This documents version 2.15.0 of the DBD::Pg module
 
 =head1 DESCRIPTION
 

Modified: trunk/libdbd-pg-perl/Pg.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/Pg.xs?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/Pg.xs (original)
+++ trunk/libdbd-pg-perl/Pg.xs Wed Aug  5 04:56:48 2009
@@ -1,5 +1,5 @@
 /*
-  $Id: Pg.xs 12626 2009-03-24 00:59:45Z turnstep $
+  $Id: Pg.xs 13162 2009-08-04 18:10:35Z turnstep $
 
   Copyright (c) 2000-2009 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 1997-2000 Edmund Mergl
@@ -205,7 +205,7 @@
 		else if (SvROK(to_quote_sv) && !SvAMAGIC(to_quote_sv)) {
 			if (SvTYPE(SvRV(to_quote_sv)) != SVt_PVAV)
 				croak("Cannot quote a reference");
-			RETVAL = pg_stringify_array(to_quote_sv, ",", imp_dbh->pg_server_version);
+			RETVAL = pg_stringify_array(to_quote_sv, ",", imp_dbh->pg_server_version, 1);
 		}
 		else {
 			sql_type_info_t *type_info;

Modified: trunk/libdbd-pg-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/README?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/README (original)
+++ trunk/libdbd-pg-perl/README Wed Aug  5 04:56:48 2009
@@ -3,7 +3,7 @@
 DESCRIPTION:
 ------------
 
-This is version 2.14.1 of DBD::Pg, the Perl interface to Postgres using DBI. 
+This is version 2.15.0 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=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/SIGNATURE (original)
+++ trunk/libdbd-pg-perl/SIGNATURE Wed Aug  5 04:56:48 2009
@@ -15,40 +15,39 @@
 Hash: RIPEMD160
 
 SHA1 415d25a8628815a50a8f79317de4abff11ac73e8 .perlcriticrc
-SHA1 84e7f0d368767192d629da49abdb473575423a8b Changes
+SHA1 b8c19263a8478c914538ab9a0098b80796874e6a Changes
 SHA1 2321e712956f60fd30edcb57f65e14ce2fdcc37e MANIFEST
 SHA1 dc863ce481b321833db84c95bbe976e8c65f296e MANIFEST.SKIP
-SHA1 8a7d3eaba85f9f19f7a7c4c4babfa0901abe004c META.yml
-SHA1 28fab5a7be91c920b366d1f6b788f1c9e9c93062 Makefile.PL
+SHA1 0cd8ab9ac61a573ed7cc814e5fad5a2ec44257b9 META.yml
+SHA1 70fc50e50840b7bbec0d401dfdaa0e75a882921e Makefile.PL
 SHA1 23ff9a53497b927573048b7457d5eb8173d8b9b0 Pg.h
-SHA1 2e43bdcdc0f7e3f5f8ad82b3d568ccfb02fe2e72 Pg.pm
-SHA1 4e39c717f6050aff330b22e2bc52f6f2532d21c5 Pg.xs
-SHA1 770a8a0ee0c7274164386c86e312e9a493126d8f README
+SHA1 3441d2a74f691c6278a63684ac1a85a96d5874ae Pg.pm
+SHA1 affb86cc0322859b8e39c52bc292abaf60b1e942 Pg.xs
+SHA1 39a5293997d88778977dce53e296bc0f945d97a7 README
 SHA1 9b580d39cb46985462ce93817ed7875f58920d6d README.dev
 SHA1 7e213bf90f513595b59c0a2c4ef94fea1592efcf README.win32
 SHA1 fe7a42afdeec6a218c45f76e875cc3324b870956 TODO
-SHA1 41f6f4b1f84edc2f423e66965877b910d752ae0f dbdimp.c
-SHA1 3852dea79080d2c3e1ed9644fbbd6d25c2151c13 dbdimp.h
+SHA1 d659920ba5a11e33c10f42ac07e96cd7f97f3593 dbdimp.c
+SHA1 bbc79c5ee1fbc1cdaac98ced768ae031a696a304 dbdimp.h
 SHA1 6c33bcf138e577722283bef02fceb8cbce4d100d dbivport.h
-SHA1 cbae54b151b09d11895477c6ea9e334df2e8e93f lib/Bundle/DBD/Pg.pm
+SHA1 e5c1fe0a40c69bb796eaa23fc70daaf91f480800 lib/Bundle/DBD/Pg.pm
 SHA1 10aecc125180e97a19c8e0b7ea82a64d0356efea quote.c
 SHA1 54f10c6d76db2f2bfbaa7f345d7034029b88453c quote.h
 SHA1 93aa7e8cae0a361d1e6163dea0281ebff41f3c5f t/00-signature.t
-SHA1 073baf503a601ceeb49516d61bd275f0c1e51563 t/00basic.t
 SHA1 f407ad828fe5898e1fa585523852b204ce9b5b2d t/01connect.t
 SHA1 1e0d8cad9de0063d4258739f6c8eb2cee27d9937 t/01constants.t
 SHA1 01f352b31c7d68eeb09cf3b65a88cb09d95af341 t/02attribs.t
 SHA1 1e32a11968bfacf6f4cf3b09cd7822408f0ecb4c t/03dbmethod.t
-SHA1 7ce47f4163e23b3f3df589487707257f5158001a t/03smethod.t
+SHA1 56c1dbf645c0849ad10ec7fc9542a4a4bed11f47 t/03smethod.t
 SHA1 910d6c2234d77a74a49cf189b6c799e13bf75280 t/04misc.t
 SHA1 ee7ecab04b202d5cd8816fbb8c2703971161dd53 t/06bytea.t
 SHA1 e55c0c4bf65b8d25dff7b7c9fed429fb8d07259b t/07copy.t
 SHA1 3aa283c6065bc2a7b734fc4c7d1f21ac79acfdde t/08async.t
-SHA1 744de03dfff7021403162d278d504e0ea991e8c9 t/09arrays.t
+SHA1 dbbb66906bed8f24879ad757e58be889ac4cee4d t/09arrays.t
 SHA1 fad986d7f22e33107fb1fe5db18a3c435ebbb240 t/12placeholders.t
 SHA1 85b5df8ef0c78b1d2d0018d874c62af7ef01a28f t/20savepoints.t
-SHA1 60031c2db489d77291078ab6a418723e1a35f137 t/99cleanup.t
-SHA1 2546e20e8439532f743b8a525944b0a7f21ab37c t/dbdpg_test_setup.pl
+SHA1 35e3cc228bb48e23a5f1ef74d10a78b87ec64b73 t/99cleanup.t
+SHA1 b530865b212e34318a0cfbb7b9057a9491a0bf38 t/dbdpg_test_setup.pl
 SHA1 bc4a58bdd5e853139f9e1fc6129f83e50a07a2c6 t/lib/App/Info.pm
 SHA1 58befda00c12b1721875262505112203bf230450 t/lib/App/Info/Handler.pm
 SHA1 b5bf85b12a5fc207c44113a9c028fb7fbd68531f t/lib/App/Info/Handler/Prompt.pm
@@ -61,7 +60,7 @@
 SHA1 f07cd5ecaeb854c81ceb9206364979cf607e6546 win32.mak
 -----BEGIN PGP SIGNATURE-----
 
-iEYEAREDAAYFAkpvL6IACgkQvJuQZxSWSsj8BACghUFxjgLT77bB+I9qYzoqFdhk
-ngEAoNSuGF55AXJCWtg2EhTiaW1039ZQ
-=1TXZ
+iEYEAREDAAYFAkp4emIACgkQvJuQZxSWSshkwgCfdfwTwfuP/1QKveYeWoQ29OOl
+Qr0AnjtFax1hIzB9dHYg2zHsW9qK3C8Q
+=8KQj
 -----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=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/dbdimp.c (original)
+++ trunk/libdbd-pg-perl/dbdimp.c Wed Aug  5 04:56:48 2009
@@ -1,6 +1,6 @@
 /*
 
-  $Id: dbdimp.c 13137 2009-07-28 17:01:34Z turnstep $
+  $Id: dbdimp.c 13162 2009-08-04 18:10:35Z turnstep $
 
   Copyright (c) 2002-2009 Greg Sabino Mullane and others: see the Changes file
   Portions Copyright (c) 2002 Jeffrey W. Baker
@@ -1986,16 +1986,18 @@
 	if (TRACE7) {
 		TRC(DBILOGFP, "%sPlaceholder type: %d numsegs: %d numphs: %d\n",
 			THEADER, imp_sth->placeholder_type, imp_sth->numsegs, imp_sth->numphs);
-		TRC(DBILOGFP, "%sPlaceholder numbers, ph id, and segments:\n",
+		TRC(DBILOGFP, "%sPlaceholder numbers and segments:\n",
 			THEADER);
 		for (currseg=imp_sth->seg; NULL != currseg; currseg=currseg->nextseg) {
 			TRC(DBILOGFP, "%sPH: (%d) SEG: (%s)\n",
 				THEADER, currseg->placeholder, currseg->segment);
 		}
-		TRC(DBILOGFP, "%sPlaceholder number, fooname, id:\n", THEADER);
-		for (xlen=1,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,xlen++) {
-			TRC(DBILOGFP, "%s#%d FOONAME: (%s)\n",
-				THEADER, (int)xlen, currph->fooname);
+		if (imp_sth->numphs) {
+			TRC(DBILOGFP, "%sPlaceholder number, fooname, id:\n", THEADER);
+			for (xlen=1,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,xlen++) {
+				TRC(DBILOGFP, "%s#%d FOONAME: (%s)\n",
+					THEADER, (int)xlen, currph->fooname);
+			}
 		}
 	}
 
@@ -2244,7 +2246,7 @@
 		}
 		else if (SvTYPE(SvRV(newvalue)) == SVt_PVAV) {
 			SV * quotedval;
-			quotedval = pg_stringify_array(newvalue,",",imp_dbh->pg_server_version);
+			quotedval = pg_stringify_array(newvalue,",",imp_dbh->pg_server_version, 0);
 			currph->valuelen = sv_len(quotedval);
 			Renew(currph->value, currph->valuelen+1, char); /* freed in dbd_st_destroy */
 			currph->value = SvUTF8(quotedval) ? SvPVutf8_nolen(quotedval) : SvPV_nolen(quotedval);
@@ -2378,7 +2380,7 @@
 
 
 /* ================================================================== */
-SV * pg_stringify_array(SV *input, const char * array_delim, int server_version) {
+SV * pg_stringify_array(SV *input, const char * array_delim, int server_version, int extraquotes) {
 
 	dTHX;
 	AV * toparr;
@@ -2397,12 +2399,14 @@
 	if (TSTART) TRC(DBILOGFP, "%sBegin pg_stringify_array\n", THEADER);
 
 	toparr = (AV *) SvRV(input);
-	value = newSVpv("{", 1);
+	value = extraquotes ? newSVpv("'{", 2) : newSVpv("{", 1);
 
 	/* Empty arrays are easy */
 	if (av_len(toparr) < 0) {
 		av_clear(toparr);
 		sv_catpv(value, "}");
+		if (extraquotes)
+			sv_catpv(value, "'");
 		if (TEND) TRC(DBILOGFP, "%sEnd pg_stringify_array (empty)\n", THEADER);
 		return value;
 	}
@@ -2504,6 +2508,8 @@
 	for (xy=0; xy<array_depth; xy++) {
 		sv_catpv(value, "}");
 	}
+	if (extraquotes)
+		sv_catpv(value, "'");
 
 	if (TEND) TRC(DBILOGFP, "%sEnd pg_stringify_array (string: %s)\n", THEADER, neatsvpv(value,0));
 	return value;
@@ -2976,10 +2982,10 @@
 	}
 	
 	/* We use the new server_side prepare style if:
-	   1. The statement is DML
+	   1. The statement is DML (DDL is not preparable)
 	   2. The attribute "pg_direct" is false
 	   3. The attribute "pg_server_prepare" is not 0
-	   4. There is one or more placeholders (but "onetime" has not been set)
+	   4. The "onetime" attribute has not been set
 	   5. There are no DEFAULT or CURRENT values
 	   6a. The attribute "pg_server_prepare" is 1
 	   OR
@@ -3000,7 +3006,7 @@
 		&& 0 != imp_sth->server_prepare
 		&& !imp_sth->has_default
 		&& !imp_sth->has_current
-		&& (1 <= imp_sth->numphs && !imp_sth->onetime)
+		&& !imp_sth->onetime
 		&& (1 == imp_sth->server_prepare
 			|| (imp_sth->numbound == imp_sth->numphs))
 		){
@@ -3033,8 +3039,8 @@
 			}
 		}
 		
-		if (TRACE5) TRC(DBILOGFP, "%sRunning PQexecPrepared with (%s)\n",
-						THEADER, imp_sth->prepare_name);
+		if (TRACE5) TRC(DBILOGFP, "%sRunning PQexecPrepared with (%s) (%s)\n",
+						THEADER, imp_sth->prepare_name, (char *)imp_sth->PQvals);
 		if (TSQL) {
 			TRC(DBILOGFP, "EXECUTE %s (\n", imp_sth->prepare_name);
 			for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph,x++) {

Modified: trunk/libdbd-pg-perl/dbdimp.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/dbdimp.h?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/dbdimp.h (original)
+++ trunk/libdbd-pg-perl/dbdimp.h Wed Aug  5 04:56:48 2009
@@ -1,5 +1,5 @@
 /*
-	$Id: dbdimp.h 12599 2009-03-10 23:28:35Z turnstep $
+	$Id: dbdimp.h 13162 2009-08-04 18:10:35Z turnstep $
 	
     Copyright (c) 2000-2009 Greg Sabino Mullane and others: see the Changes file
 	Portions Copyright (c) 1997-2000 Edmund Mergl
@@ -187,7 +187,7 @@
 
 SV * pg_db_pg_notifies (SV *dbh, imp_dbh_t *imp_dbh);
 
-SV * pg_stringify_array(SV * input, const char * array_delim, int server_version);
+SV * pg_stringify_array(SV * input, const char * array_delim, int server_version, int extraquotes);
 
 int pg_quickexec (SV *dbh, const char *sql, const int asyncflag);
 

Modified: trunk/libdbd-pg-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/debian/changelog?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/debian/changelog (original)
+++ trunk/libdbd-pg-perl/debian/changelog Wed Aug  5 04:56:48 2009
@@ -1,3 +1,13 @@
+libdbd-pg-perl (2.15.0-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + Use PQexecPrepared even with no placeholders (RT#48155)
+    + Allow execute_array and bind_param_array to take an odd number of items:
+      DBI will make the missing ones undef (RT#39829)
+    + Single quites around array literals when quoting arrays (RT#48420)
+
+ -- Jonathan Yu <frequency at cpan.org>  Tue, 04 Aug 2009 20:54:29 -0400
+
 libdbd-pg-perl (2.14.1-1) unstable; urgency=low
 
   [ Jonathan Yu ]

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=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm (original)
+++ trunk/libdbd-pg-perl/lib/Bundle/DBD/Pg.pm Wed Aug  5 04:56:48 2009
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-$VERSION = '2.14.1';
+$VERSION = '2.15.0';
 
 1;
 

Modified: trunk/libdbd-pg-perl/t/03smethod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/03smethod.t?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/03smethod.t (original)
+++ trunk/libdbd-pg-perl/t/03smethod.t Wed Aug  5 04:56:48 2009
@@ -236,17 +236,17 @@
 };
 is ($@, q{}, $t);
 
-$t='Statement handle method "bind_param_array" fails when binding one value to the first placeholder';
-eval {
-	$sth->bind_param_array(1, [ 30 ]);
-};
-isnt ($@, q{}, $t);
-
-$t='Statement handle method "bind_param_array" fails when binding two values to the second placeholder';
+$t='Statement handle method "bind_param_array" works when binding one value to the second placeholder';
+eval {
+	$sth->bind_param_array(2, [ 'Mangoz' ]);
+};
+is ($@, q{}, $t);
+
+$t='Statement handle method "bind_param_array" works when binding two values to the second placeholder';
 eval {
 	$sth->bind_param_array(2, [ 'Plantain', 'Apple' ]);
 };
-isnt ($@, q{}, $t);
+is ($@, q{}, $t);
 
 #
 # Test of the "execute_array" statement handle method

Modified: trunk/libdbd-pg-perl/t/09arrays.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/09arrays.t?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/09arrays.t (original)
+++ trunk/libdbd-pg-perl/t/09arrays.t Wed Aug  5 04:56:48 2009
@@ -18,7 +18,7 @@
 if (! defined $dbh) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 256;
+plan tests => 257;
 
 isnt ($dbh, undef, 'Connect to database for array testing');
 
@@ -50,6 +50,17 @@
 
 $SQL = q{SELECT testarray3 FROM dbd_pg_test WHERE pname= 'Array Testing'};
 my $getarray_bool = $dbh->prepare($SQL);
+
+$t='Array quoting allows direct insertion into statements';
+$SQL = q{INSERT INTO dbd_pg_test (id,testarray2) VALUES };
+my $quoteid = $dbh->quote(123);
+my $quotearr = $dbh->quote([456]);
+$SQL .= qq{($quoteid, $quotearr)};
+eval {
+	$dbh->do($SQL);
+};
+is ($@, q{}, $t);
+$dbh->rollback();
 
 ## Input
 ## Expected
@@ -200,6 +211,9 @@
 	my $qexpected = $expected;
 	if ($expected =~ s/\s*quote:\s*(.+)//) {
 		$qexpected = $1;
+	}
+	if ($qexpected !~ /^ERROR/) {
+		$qexpected = qq{'$qexpected'};
 	}
 
 	if ($msg =~ s/NEED (\d+):\s*//) {
@@ -568,7 +582,7 @@
 
 	$t='quote() handles utf8 inside array';
 	$quoted = $dbh->quote([$utf8_str, $utf8_str]);
-	is ($quoted, qq!{"$utf8_str","$utf8_str"}!, $t);
+	is ($quoted, qq!'{"$utf8_str","$utf8_str"}'!, $t);
 
 	$t='Quoted array of strings should be UTF-8';
     ok (Encode::is_utf8( $quoted ), $t);
@@ -581,7 +595,7 @@
 
 	$t='Inserting utf-8 into an array via quoted do() works';
 	$dbh->do('DELETE FROM dbd_pg_test');
-	$SQL = qq{INSERT INTO dbd_pg_test (id, testarray, val) VALUES (1, '$quoted', 'one')};
+	$SQL = qq{INSERT INTO dbd_pg_test (id, testarray, val) VALUES (1, $quoted, 'one')};
 	eval {
 		$dbh->do($SQL);
 	};

Modified: trunk/libdbd-pg-perl/t/99cleanup.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/99cleanup.t?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/99cleanup.t (original)
+++ trunk/libdbd-pg-perl/t/99cleanup.t Wed Aug  5 04:56:48 2009
@@ -27,3 +27,5 @@
 $dbh->disconnect() if defined $dbh and ref $dbh;
 
 shutdown_test_database();
+
+unlink 'README.testdatabase';

Modified: trunk/libdbd-pg-perl/t/dbdpg_test_setup.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-pg-perl/t/dbdpg_test_setup.pl?rev=41353&op=diff
==============================================================================
--- trunk/libdbd-pg-perl/t/dbdpg_test_setup.pl (original)
+++ trunk/libdbd-pg-perl/t/dbdpg_test_setup.pl Wed Aug  5 04:56:48 2009
@@ -398,7 +398,12 @@
 			$@ = qq{Could not open "$conf": $!};
 			last GETHANDLE; ## Fail - no conf file
 		}
-		print $cfh "\n\n## DBD::Pg testing parameters\nport=$testport\nmax_connections=4\n";
+		print $cfh "\n\n## DBD::Pg testing parameters\n";
+		print $cfh "port=$testport\n";
+		print $cfh "max_connections=4\n";
+		print $cfh "log_statement = 'all'\n";
+		print $cfh "log_line_prefix = '%m [%p] '\n";
+		print $cfh "log_min_messages = 'DEBUG1'\n";
 		print $cfh "listen_addresses='127.0.0.1'\n" if $^O =~ /Win32/;
 		print $cfh "\n";
 		close $cfh or die qq{Could not close "$conf": $!\n};




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