[svn:DBD-Pg] r13046 - DBD-Pg/trunk

[email protected]
Newsgroups gmane.comp.db.postgresql.dbdpg.cvs
Message-ID <[email protected]>
Author: turnstep
Date: Sun Jul 12 17:37:29 2009
New Revision: 13046

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/dbdimp.c

Log:
Fix problem when arrays are not zero-based and the output appears as '[x:y]={z}'. Per report from Jeff Trout.


Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes	(original)
+++ DBD-Pg/trunk/Changes	Sun Jul 12 17:37:29 2009
@@ -6,6 +6,8 @@
   - Return ints and bools-cast-to-number from the db as true Perlish numbers.
     (CPAN bug #47619) [GSM]
   - Fix backslash quoting of arrays (CPAN bug #46732) [GSM]
+  - Fix error when destringifying array starting with '[x:y]='. Per report from 
+    Jeff Trout [GSM]
   - Fix problem with foreign_key_info() and NAME_uc (CPAN bug #46109) [GSM]
   - Make foreign_key_info() respect FetchHashKeyName (CPAN bug #46103) [GSM]
   - Fix Makefile.PL to apply POSTGRES_INCLUDE in a saner way.

Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c	(original)
+++ DBD-Pg/trunk/dbdimp.c	Sun Jul 12 17:37:29 2009
@@ -2527,6 +2527,14 @@
 	  the Postgres backend, and we rely on it to give us a sane and balanced structure
 	*/
 
+	/* The array may start with a non 1-based beginning. If so, we'll just eat the range */
+	if ('[' == *input) {
+		while (*input != '\0') {
+			if ('=' == *input++)
+				break;
+		}
+	}
+
 	/* Eat the opening brace and perform a sanity check */
 	if ('{' != *(input++))
 		croak("Tried to destringify a non-array!: %s", input);
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.