[svn:DBD-Pg] r11656 - in DBD-Pg/trunk: . lib/Bundle/DBD

[email protected]
Newsgroups perl.dbd.pg.changes
Message-ID <[email protected]>
Author: turnstep
Date: Sun Aug 17 20:05:07 2008
New Revision: 11656

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/META.yml
   DBD-Pg/trunk/Makefile.PL
   DBD-Pg/trunk/Pg.pm
   DBD-Pg/trunk/README
   DBD-Pg/trunk/dbdimp.c
   DBD-Pg/trunk/lib/Bundle/DBD/Pg.pm

Log:
Fix incorrect mapping of PG array to Perl array. Reported by 
Alex Cheshev on the dbi-users mailing list. CPAN bug #38552.
Bump version to 2.9.1. 


Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes	(original)
+++ DBD-Pg/trunk/Changes	Sun Aug 17 20:05:07 2008
@@ -1,5 +1,10 @@
 ('GSM' is Greg Sabino Mullane, [email protected])
 
+2.9.1 Released August 17, 2008
+
+	  - Return undef when mapping Postgres array to Perl array and 
+	  	the array is empty '{}'. (CPAN bug #38552) [GSM]
+
 2.9.0 Released August 3, 2008 (subversion r11624)
 
 	- Add support for database handle attribute "ReadOnly". This allows 

Modified: DBD-Pg/trunk/META.yml
==============================================================================
--- DBD-Pg/trunk/META.yml	(original)
+++ DBD-Pg/trunk/META.yml	Sun Aug 17 20:05:07 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name                        : DBD-Pg
-version                     : 2.9.0
+version                     : 2.9.1
 abstract                    : DBI PostgreSQL interface
 author:              
   - Greg Sabino Mullane <[email protected]>
@@ -38,10 +38,10 @@
 provides:
   DBD::Pg:
     file                    : Pg.pm
-    version                 : 2.9.0
+    version                 : 2.9.1
   Bundle::DBD::Pg:
     file                    : lib/Bundle/DBD/Pg.pm
-    version                 : 2.9.0
+    version                 : 2.9.1
 
 keywords:
   - Postgres

Modified: DBD-Pg/trunk/Makefile.PL
==============================================================================
--- DBD-Pg/trunk/Makefile.PL	(original)
+++ DBD-Pg/trunk/Makefile.PL	Sun Aug 17 20:05:07 2008
@@ -7,7 +7,7 @@
 use 5.006001;
 
 ## No version.pm for this one, as the prereqs are not loaded yet.
-my $VERSION = '2.9.0';
+my $VERSION = '2.9.1';
 
 my $lib;
 BEGIN {

Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm	(original)
+++ DBD-Pg/trunk/Pg.pm	Sun Aug 17 20:05:07 2008
@@ -17,7 +17,7 @@
 {
 	package DBD::Pg;
 
-	use version; our $VERSION = qv('2.9.0');
+	use version; our $VERSION = qv('2.9.1');
 
 	use DBI ();
 	use DynaLoader ();
@@ -1696,7 +1696,7 @@
 
 =head1 VERSION
 
-This documents version 2.9.0 of the DBD::Pg module
+This documents version 2.9.1 of the DBD::Pg module
 
 =head1 DESCRIPTION
 

Modified: DBD-Pg/trunk/README
==============================================================================
--- DBD-Pg/trunk/README	(original)
+++ DBD-Pg/trunk/README	Sun Aug 17 20:05:07 2008
@@ -6,7 +6,7 @@
 DESCRIPTION:
 ------------
 
-This is version 2.9.0 of DBD::Pg, the Perl interface to Postgres using DBI. 
+This is version 2.9.1 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: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c	(original)
+++ DBD-Pg/trunk/dbdimp.c	Sun Aug 17 20:05:07 2008
@@ -2471,6 +2471,7 @@
 	char*  string;
 	STRLEN section_size = 0;
 	bool   in_quote = 0;
+	bool   seen_quotes = 0;
 	int    opening_braces = 0;
 	int    closing_braces = 0;
 
@@ -2522,7 +2523,7 @@
 		else if ('}' == *input) {
 		}
 		else if ('"' == *input) {
-			in_quote = (bool)1;
+			in_quote = seen_quotes = (bool)1;
 		}
 		else {
 			string[section_size++] = *input;
@@ -2530,7 +2531,8 @@
 
 		if ('}' == *input || (coltype->array_delimeter == *input && '}' != *(input-1))) {
 			string[section_size] = '\0';
-			if (4 == section_size && 0 == strncmp(string, "NULL", 4) && '"' != *(input-1)) {
+			if ((0 == section_size && !seen_quotes) || 
+				((4 == section_size && 0 == strncmp(string, "NULL", 4) && '"' != *(input-1)))) {
 				av_push(currentav, &PL_sv_undef);
 			}
 			else {

Modified: DBD-Pg/trunk/lib/Bundle/DBD/Pg.pm
==============================================================================
--- DBD-Pg/trunk/lib/Bundle/DBD/Pg.pm	(original)
+++ DBD-Pg/trunk/lib/Bundle/DBD/Pg.pm	Sun Aug 17 20:05:07 2008
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-$VERSION = '2.9.0';
+$VERSION = '2.9.1';
 
 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.