[Bast-commits] r5670 - in DBIx-Class/0.08/branches/prefetch: . lib/DBIx lib/DBIx/Class lib/DBIx/Class/Manual lib/DBIx/Class/Relationship lib/DBIx/Class/Storage lib/DBIx/Class/Storage/DBI lib/SQL/Translator/Parser/DBIx t t/resultset t/search

robkinyon at dev.catalyst.perl.org robkinyon at dev.catalyst.perl.org
Sun Mar 1 00:54:09 GMT 2009


Author: robkinyon
Date: 2009-03-01 00:54:09 +0000 (Sun, 01 Mar 2009)
New Revision: 5670

Modified:
   DBIx-Class/0.08/branches/prefetch/
   DBIx-Class/0.08/branches/prefetch/Changes
   DBIx-Class/0.08/branches/prefetch/Makefile.PL
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Manual/Cookbook.pod
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Relationship/Base.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/ResultSet.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Row.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
   DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/Sybase.pm
   DBIx-Class/0.08/branches/prefetch/lib/SQL/Translator/Parser/DBIx/Class.pm
   DBIx-Class/0.08/branches/prefetch/t/03podcoverage.t
   DBIx-Class/0.08/branches/prefetch/t/72pg.t
   DBIx-Class/0.08/branches/prefetch/t/77prefetch.t
   DBIx-Class/0.08/branches/prefetch/t/95sql_maker.t
   DBIx-Class/0.08/branches/prefetch/t/95sql_maker_quote.t
   DBIx-Class/0.08/branches/prefetch/t/resultset/as_query.t
   DBIx-Class/0.08/branches/prefetch/t/search/subquery.t
Log:
 r5648 at rkinyon-lt-osx (orig r5647):  edenc | 2009-02-25 09:14:38 -0500
 fixed alias prepending for OR'ed join conditions in relationships
 r5649 at rkinyon-lt-osx (orig r5648):  ribasushi | 2009-02-26 18:28:29 -0500
 Small test enhancement
 r5654 at rkinyon-lt-osx (orig r5653):  ribasushi | 2009-02-26 19:00:46 -0500
  r583 at Thesaurus (orig r4766):  matthewt | 2008-08-24 17:29:27 +0200
  first cut at vairable bind vars for sybase
 
 r5655 at rkinyon-lt-osx (orig r5654):  ribasushi | 2009-02-26 19:00:53 -0500
 
 r5656 at rkinyon-lt-osx (orig r5655):  ribasushi | 2009-02-26 19:18:15 -0500
 Reinstate examples after botched merge
 r5658 at rkinyon-lt-osx (orig r5657):  ribasushi | 2009-02-26 19:32:29 -0500
 Allow sqlt_deploy_hook on views
 r5661 at rkinyon-lt-osx (orig r5660):  ribasushi | 2009-02-26 20:03:03 -0500
 A couple more makefile prereqs
 r5662 at rkinyon-lt-osx (orig r5661):  ribasushi | 2009-02-26 20:06:55 -0500
 Throw away namespace::clean dependency
 r5663 at rkinyon-lt-osx (orig r5662):  ribasushi | 2009-02-26 20:24:37 -0500
 Fix some should_quote_data_type problems
 r5664 at rkinyon-lt-osx (orig r5663):  ribasushi | 2009-02-26 20:43:18 -0500
 We already depend on latest SQLA - remove all references to >= 1.50 - it will only add to the confusion
 r5666 at rkinyon-lt-osx (orig r5665):  ribasushi | 2009-02-26 20:59:29 -0500
 Dev-Release 0.08099_07



Property changes on: DBIx-Class/0.08/branches/prefetch
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/resultsetcolumn_custom_columns:5160
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5414
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/trunk:5635
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_column_attr:10946
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_trunk:10954
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/belongs_to_null_col_fix:5244
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/column_attr:5074
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rt_bug_41083:5437
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sqla_1.50_compat:5321
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subquery:5617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/views:5585
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:5645
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/resultsetcolumn_custom_columns:5160
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5414
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/trunk:5635
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_column_attr:10946
ab17426e-7cd3-4704-a2a2-80b7c0a611bb:/local/dbic_trunk:10954
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/belongs_to_null_col_fix:5244
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/column_attr:5074
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/multi_stuff:5565
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/rt_bug_41083:5437
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sqla_1.50_compat:5321
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/subquery:5617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/sybase:5651
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/views:5585
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:5665
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510

Modified: DBIx-Class/0.08/branches/prefetch/Changes
===================================================================
--- DBIx-Class/0.08/branches/prefetch/Changes	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/Changes	2009-03-01 00:54:09 UTC (rev 5670)
@@ -1,4 +1,6 @@
 Revision history for DBIx::Class
+
+0.08099_07 2009-02-27 02:00:00 (UTC)
         - multi-create using find_or_create rather than _related for post-insert
         - fix get_inflated_columns to check has_column_loaded
         - Add DBIC_MULTICREATE_DEBUG env var (undocumented, quasi-internal)
@@ -16,6 +18,8 @@
           to make it more matpath-friendly
         - deploy_statements called ddl_filename with the $version and $dir arguments
           in the wrong order. (groditi)
+        - columns/+columns attributes now support { as => select } hahsrefs
+        - support for views both in DBIC and via deploy() in SQLT
 
 0.08099_06 2009-01-23 07:30:00 (UTC)
         - Allow a scalarref to be supplied to the 'from' resultset attribute
@@ -30,9 +34,8 @@
           (http://msdn.microsoft.com/en-us/library/ms190315.aspx)
         - an sqlt_deploy_hook can now be shared between result sources using
           a configurable callback trigger
-        - new order_by => { -desc => 'colname' } syntax supported with
-          SQLA >= 1.50
-        - PG array datatype supported with SQLA >= 1.50
+        - new order_by => { -desc => 'colname' } syntax supported
+        - PG array datatype supported
         - insert should use store_column, not set_column to avoid marking
           clean just-stored values as dirty. New test for this (groditi)
         - regression test for source_name (groditi)

Modified: DBIx-Class/0.08/branches/prefetch/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/prefetch/Makefile.PL	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/Makefile.PL	2009-03-01 00:54:09 UTC (rev 5670)
@@ -26,7 +26,6 @@
 requires 'Path::Class'              => 0;
 requires 'List::Util'               => 1.19;
 requires 'Sub::Name'                => 0.04;
-requires 'namespace::clean'         => 0.09;
 
 # Perl 5.8.0 doesn't have utf8::is_utf8()
 requires 'Encode'                   => 0 if ($] <= 5.008000);  
@@ -45,10 +44,10 @@
 
 tests_recursive 't';
 
-# re-build README and require CDBI modules for testing if we're in a checkout
+# re-build README and require extra modules for testing if we're in a checkout
 
 my %force_requires_if_author = (
-  'Test::Pod::Coverage'       => 0,
+  'Test::Pod::Coverage'       => 1.04,
   'SQL::Translator'           => 0.09004,
 
   # CDBI-compat related
@@ -60,9 +59,15 @@
   # t/52cycle.t
   'Test::Memory::Cycle'       => 0,
 
+  # t/60core.t
+  'DateTime::Format::MySQL'   => 0,
+
   # t/93storage_replication.t
   'Moose',                    => 0,
   'MooseX::AttributeHelpers'  => 0.12,
+
+  # t/96_is_deteministic_value.t
+  'DateTime::Format::Strptime' => 0,
 );
 
 if ($Module::Install::AUTHOR) {

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Manual/Cookbook.pod	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Manual/Cookbook.pod	2009-03-01 00:54:09 UTC (rev 5670)
@@ -1381,10 +1381,10 @@
 
 =head2 Working with PostgreSQL array types
 
-If your SQL::Abstract version (>= 1.50) supports it, you can assign to
-PostgreSQL array values by passing array references in the C<\%columns>
-(C<\%vals>) hashref of the L<DBIx::Class::ResultSet/create> and
-L<DBIx::Class::Row/update> family of methods:
+You can also assign values to PostgreSQL array columns by passing array
+references in the C<\%columns> (C<\%vals>) hashref of the
+L<DBIx::Class::ResultSet/create> and L<DBIx::Class::Row/update> family of
+methods:
 
   $resultset->create({
     numbers => [1, 2, 3]

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Relationship/Base.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Relationship/Base.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Relationship/Base.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -209,7 +209,7 @@
         if (ref $_ eq 'HASH') {
           my $hash;
           foreach my $key (keys %$_) {
-            my $newkey = $key =~ /\./ ? "me.$key" : $key;
+            my $newkey = $key !~ /\./ ? "me.$key" : $key;
             $hash->{$newkey} = $_->{$key};
           }
           $hash;

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/ResultSet.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/ResultSet.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -2555,23 +2555,27 @@
 
 =over 4
 
-=item Value: ($order_by | \@order_by)
+=item Value: ( $order_by | \@order_by | \%order_by )
 
 =back
 
-Which column(s) to order the results by. This is currently passed
-through directly to SQL, so you can give e.g. C<year DESC> for a
-descending order on the column `year'.
+Which column(s) to order the results by. If a single column name, or
+an arrayref of names is supplied, the argument is passed through
+directly to SQL. The hashref syntax allows for connection-agnostic
+specification of ordering direction:
 
-Please note that if you have C<quote_char> enabled (see
-L<DBIx::Class::Storage::DBI/connect_info>) you will need to do C<\'year DESC' > to
-specify an order. (The scalar ref causes it to be passed as raw sql to the DB,
-so you will need to manually quote things as appropriate.)
+ For descending order:
 
-If your L<SQL::Abstract> version supports it (>=1.50), you can also use
-C<{-desc => 'year'}>, which takes care of the quoting for you. This is the
-recommended syntax.
+  order_by => { -desc => [qw/col1 col2 col3/] }
 
+ For explicit ascending order:
+
+  order_by => { -asc => 'col' }
+
+The old scalarref syntax (i.e. order_by => \'year DESC') is still
+supported, although you are strongly encouraged to use the hashref
+syntax as outlined above.
+
 =head2 columns
 
 =over 4

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Row.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Row.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -8,6 +8,10 @@
 use Scalar::Util ();
 use Scope::Guard;
 
+###
+### Internal method
+### Do not use
+###
 BEGIN {
   *MULTICREATE_DEBUG =
     $ENV{DBIC_MULTICREATE_DEBUG}

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/NoBindVars.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/NoBindVars.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -38,6 +38,9 @@
 
 sub _prep_for_execute {
   my $self = shift;
+
+  my ($op, $extra_bind, $ident) = @_;
+
   my ($sql, $bind) = $self->next::method(@_);
 
   # stringify args, quote via $dbh, and manually insert
@@ -46,12 +49,14 @@
   my $new_sql;
 
   foreach my $bound (@$bind) {
-    shift @$bound;
+    my $col = shift @$bound;
+    my $do_quote = $self->should_quote_data_type($col);
     foreach my $data (@$bound) {
         if(ref $data) {
             $data = ''.$data;
         }
-        $new_sql .= shift(@sql_part) . $self->_dbh->quote($data);
+        $data = $self->_dbh->quote($data) if $do_quote;
+        $new_sql .= shift(@sql_part) . $data;
     }
   }
   $new_sql .= join '', @sql_part;
@@ -59,6 +64,21 @@
   return ($new_sql);
 }
 
+=head2 should_quote_data_type
+
+This method is called by L</_prep_for_execute> for every column in
+order to determine if its value should be quoted or not. The sole
+argument is the current column data type, and the return value is
+interpreted as: true - do quote, false - do not quote. You should
+override this in you Storage::DBI::<database> subclass, if your
+RDBMS does not like quotes around certain datatypes (e.g. Sybase
+and integer columns). The default method always returns true (do
+quote).
+
+=cut
+
+sub should_quote_data_type { 1 }
+
 =head1 AUTHORS
 
 Brandon Black <blblack at gmail.com>

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/Sybase.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI/Sybase.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -5,6 +5,15 @@
 
 use base qw/DBIx::Class::Storage::DBI::NoBindVars/;
 
+my %noquote = map { $_ => 1 } qw(int integer);
+
+sub should_quote_data_type {
+  my $self = shift;
+  my ($type) = @_;
+  return 0 if $noquote{$type};
+  return $self->next::method(@_);
+}
+
 1;
 
 =head1 NAME

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class/Storage/DBI.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -1239,7 +1239,7 @@
 
 sub _dbh_execute {
   my ($self, $dbh, $op, $extra_bind, $ident, $bind_attributes, @args) = @_;
-  
+
   my ($sql, $bind) = $self->_prep_for_execute($op, $extra_bind, $ident, \@args);
 
   $self->_query_start( $sql, @$bind );

Modified: DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/DBIx/Class.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -24,7 +24,7 @@
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
 
-$VERSION = '0.08099_06';
+$VERSION = '0.08099_07';
 
 $VERSION = eval $VERSION; # numify for warning-free dev releases
 

Modified: DBIx-Class/0.08/branches/prefetch/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/prefetch/lib/SQL/Translator/Parser/DBIx/Class.pm	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/lib/SQL/Translator/Parser/DBIx/Class.pm	2009-03-01 00:54:09 UTC (rev 5670)
@@ -246,6 +246,8 @@
         if ($source->result_class->can('sqlt_deploy_hook')) {
           $source->result_class->sqlt_deploy_hook($view);
         }
+
+        $source->_invoke_sqlt_deploy_hook($view);
     }
 
     if ($dbicschema->can('sqlt_deploy_hook')) {

Modified: DBIx-Class/0.08/branches/prefetch/t/03podcoverage.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/03podcoverage.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/03podcoverage.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -44,6 +44,11 @@
             qw(setup_connection_class)
         ]
     },
+    'DBIx::Class::Storage::DBI::Sybase' => {
+        ignore => [
+            qw/should_quote_data_type/,
+        ]
+    },
     'DBIx::Class::CDBICompat::AccessorMapping'          => { skip => 1 },
     'DBIx::Class::CDBICompat::AbstractSearch' => {
         ignore => [qw(search_where)]

Modified: DBIx-Class/0.08/branches/prefetch/t/72pg.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/72pg.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/72pg.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -130,10 +130,7 @@
 is_deeply($type_info, $test_type_info,
           'columns_info_for - column data types');
 
-SKIP: {
-  skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 4
-    if $SQL::Abstract::VERSION < 1.49;
-
+{
   lives_ok {
     $schema->resultset('ArrayTest')->create({
       arrayfield => [1, 2],

Modified: DBIx-Class/0.08/branches/prefetch/t/77prefetch.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/77prefetch.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/77prefetch.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -17,7 +17,7 @@
     eval "use DBD::SQLite";
     plan $@
         ? ( skip_all => 'needs DBD::SQLite for testing' )
-        : ( tests => 68 );
+        : ( tests => 74 );
 }
 
 # figure out if we've got a version of sqlite that is older than 3.2.6, in
@@ -468,10 +468,18 @@
 {
     local $SIG{__WARN__} = sub { $w = shift };
 
-    my $track = $schema->resultset('CD')->search ({ 'me.title' => 'Forkful of bees' }, { prefetch => [qw/tracks tags/] })->first->tracks->first;
-    like ($w, qr/will currently disrupt both the functionality of .rs->count\(\), and the amount of objects retrievable via .rs->next\(\)/,
-        'warning on attempt to prefetch several same level has_many\'s (1 -> M + M)');
-    my $tag = $schema->resultset('LinerNotes')->search ({ notes => 'Buy Whiskey!' }, { prefetch => { cd => [qw/tags tracks/] } })->first->cd->tags->first;
-    like ($w, qr/will currently disrupt both the functionality of .rs->count\(\), and the amount of objects retrievable via .rs->next\(\)/,
-        'warning on attempt to prefetch several same level has_many\'s (M -> 1 -> M + M)');
+    my $rs = $schema->resultset('CD')->search ({ 'me.title' => 'Forkful of bees' }, { prefetch => [qw/tracks tags/] });
+    for (qw/all count next first/) {
+        undef $w;
+        my @stuff = $rs->search()->$_;
+        like ($w, qr/will currently disrupt both the functionality of .rs->count\(\), and the amount of objects retrievable via .rs->next\(\)/,
+            "warning on ->$_ attempt prefetching several same level has_manys (1 -> M + M)");
+    }
+    my $rs2 = $schema->resultset('LinerNotes')->search ({ notes => 'Buy Whiskey!' }, { prefetch => { cd => [qw/tags tracks/] } });
+    for (qw/all count next first/) {
+        undef $w;
+        my @stuff = $rs2->search()->$_;
+        like ($w, qr/will currently disrupt both the functionality of .rs->count\(\), and the amount of objects retrievable via .rs->next\(\)/,
+            "warning on ->$_ attempt prefetching several same level has_manys (M -> 1 -> M + M)");
+    }
 }

Modified: DBIx-Class/0.08/branches/prefetch/t/95sql_maker.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/95sql_maker.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/95sql_maker.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -20,10 +20,7 @@
 my $sql_maker = $schema->storage->sql_maker;
 
 
-SKIP: {
-  skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 2
-    if $SQL::Abstract::VERSION < 1.49;
-
+{
   my ($sql, @bind) = $sql_maker->insert(
             'lottery',
             {

Modified: DBIx-Class/0.08/branches/prefetch/t/95sql_maker_quote.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/95sql_maker_quote.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/95sql_maker_quote.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -110,10 +110,7 @@
   'scalar ORDER BY okay (multiple values)'
 );
 
-SKIP: {
-  skip "SQL::Abstract < 1.49 does not support hashrefs in order_by", 2
-    if $SQL::Abstract::VERSION < 1.49;
-
+{
   ($sql, @bind) = $sql_maker->select(
             [
               {
@@ -236,10 +233,7 @@
   'quoted table names for UPDATE'
 );
 
-SKIP: {
-  skip "select attr with star does not work in SQL::Abstract < 1.49", 1
-    if $SQL::Abstract::VERSION < 1.49;
-
+{
   ($sql, @bind) = $sql_maker->select(
         [
           {

Modified: DBIx-Class/0.08/branches/prefetch/t/resultset/as_query.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/resultset/as_query.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/resultset/as_query.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -7,12 +7,7 @@
 
 use Test::More;
 
-BEGIN {
-    eval "use SQL::Abstract 1.49";
-    plan $@
-        ? ( skip_all => "Needs SQLA 1.49+" )
-        : ( tests => 4 );
-}
+plan ( tests => 4 );
 
 use lib qw(t/lib);
 use DBICTest;

Modified: DBIx-Class/0.08/branches/prefetch/t/search/subquery.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/search/subquery.t	2009-02-28 22:52:18 UTC (rev 5669)
+++ DBIx-Class/0.08/branches/prefetch/t/search/subquery.t	2009-03-01 00:54:09 UTC (rev 5670)
@@ -7,12 +7,7 @@
 
 use Test::More;
 
-BEGIN {
-    eval "use SQL::Abstract 1.49";
-    plan $@
-        ? ( skip_all => "Needs SQLA 1.49+" )
-        : ( tests => 7 );
-}
+plan ( tests => 7 );
 
 use lib qw(t/lib);
 use DBICTest;




More information about the Bast-commits mailing list