[Bast-commits] r5103 - in SQL-Abstract/1.x/branches/1.50_RC: . lib/SQL t

norbi at dev.catalyst.perl.org norbi at dev.catalyst.perl.org
Tue Nov 11 22:27:47 GMT 2008


Author: norbi
Date: 2008-11-11 22:27:47 +0000 (Tue, 11 Nov 2008)
New Revision: 5103

Modified:
   SQL-Abstract/1.x/branches/1.50_RC/
   SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
   SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
Log:
 r5114 at vger:  mendel | 2008-11-11 23:16:02 +0100
  * Changed behaviour to not stringify blessed objects, but pass them through to the bind data structure untouched.



Property changes on: SQL-Abstract/1.x/branches/1.50_RC
___________________________________________________________________
Name: svk:merge
   - 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5098
   + 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5114

Modified: SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2008-11-11 18:51:02 UTC (rev 5102)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2008-11-11 22:27:47 UTC (rev 5103)
@@ -874,11 +874,11 @@
 
   # $suffix = 'REF' x (length of ref chain, i. e. \\[] is REFREFREF)
   while (1) {
+    # blessed references are considered like scalars
+    last if blessed $data;
     $suffix .= 'REF';
+    $ref     = ref $data;
 
-    # blessed references that can stringify are considered like scalars
-    $ref = (blessed $data && overload::Method($data, '""')) ? ''
-                                                            : ref $data;
     last if $ref ne 'REF';
     $data = $$data;
   }

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/02where.t	2008-11-11 18:51:02 UTC (rev 5102)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/02where.t	2008-11-11 22:27:47 UTC (rev 5103)
@@ -6,13 +6,15 @@
 use Test::Exception;
 use SQL::Abstract::Test import => ['is_same_sql_bind'];
 
-plan tests => 17;
+plan tests => 18;
 
 use SQL::Abstract;
 
 # Make sure to test the examples, since having them break is somewhat
 # embarrassing. :-(
 
+my $not_stringifiable = SQLA::NotStringifiable->new();
+
 my @handle_tests = (
     {
         where => {
@@ -188,7 +190,13 @@
        bind => [ 'The Life, the Universe and Everything.' ],
    },
 
+   {
+       where => { foo => $not_stringifiable, },
+       stmt => " WHERE ( foo = ? )",
+       bind => [ $not_stringifiable ],
+   },
 
+
 );
 
 for my $case (@handle_tests) {
@@ -225,3 +233,18 @@
 }
 
 1;
+
+
+#======================================================================
+package SQLA::NotStringifiable; # testing stringification of arguments
+#======================================================================
+
+use strict;
+use warnings;
+
+sub new
+{
+  bless {}, shift;
+}
+
+1;




More information about the Bast-commits mailing list