From: Peter Rabbitson Date: Sat, 4 Jun 2011 07:39:59 +0000 (+0200) Subject: Extra cleanup of leftovers from 70171cd7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c6b7885ff32a9c0238698da49d40ce75a651c1cd;p=dbsrgits%2FDBIx-Class-Historic.git Extra cleanup of leftovers from 70171cd7 Also some commentary --- diff --git a/Changes b/Changes index 9701d7f..2eb1ca3 100644 --- a/Changes +++ b/Changes @@ -1,14 +1,16 @@ Revision history for DBIx::Class * New Features / Changes - - Allow schema cloning to mutate attributes. + - Allow schema cloning to mutate attributes * Fixes - Fix issue where the query was becoming overly mangled when trying to use pagination with a query that has a sub-select in the WHERE - clause. + clause - Revert "Fix incorrect signature of the default sqlt_deploy_hook" from 0.08191 - documentation was in fact incorrect, not the code + - Fix Sybase ASE IC::DateTime support (::Storage going out of sync + with new default format expected by DateTime::Format::Sybase) 0.08192 2011-05-10 04:20 (UTC) * Fixes diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 571d187..e792d16 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -421,7 +421,6 @@ my $reqs = { $ENV{DBICTEST_SYBASE_DSN} ? ( %$rdbms_ase, - 'DateTime::Format::Sybase' => '0', ) : () }, }, diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index c738db4..94239c2 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -18,7 +18,9 @@ use namespace::clean; __PACKAGE__->sql_limit_dialect ('RowCountOrGenericSubQ'); __PACKAGE__->sql_quote_char ([qw/[ ]/]); -__PACKAGE__->datetime_parser_type('DateTime::Format::Sybase'); +__PACKAGE__->datetime_parser_type( + 'DBIx::Class::Storage::DBI::Sybase::ASE::DateTime::Format' +); __PACKAGE__->mk_group_accessors('simple' => qw/_identity _blob_log_on_update _writer_storage _is_extra_storage @@ -27,9 +29,6 @@ __PACKAGE__->mk_group_accessors('simple' => _identity_method/ ); -__PACKAGE__->datetime_parser_type( - 'DBIx::Class::Storage::DBI::Sybase::ASE::DateTime::Format' -); my @also_proxy_to_extra_storages = qw/ connect_call_set_auto_cast auto_cast connect_call_blob_setup @@ -854,9 +853,6 @@ In L to set: $dbh->syb_date_fmt('ISO_strict'); # output fmt: 2004-08-21T14:36:48.080Z $dbh->do('set dateformat mdy'); # input fmt: 08/13/1979 18:08:55.080 -On connection for use with L, using -L, which you will need to install. - This works for both C and C columns, note that C columns only have minute precision. @@ -875,8 +871,15 @@ sub connect_call_datetime_setup { 'Your DBD::Sybase is too old to support ' .'DBIx::Class::InflateColumn::DateTime, please upgrade!'; + # FIXME - in retrospect this is a rather bad US-centric choice + # of format. Not changing as a bugwards compat, though in reality + # the only piece that sees the results of $dt object formatting + # (as opposed to parsing) is the database itself, so theoretically + # changing both this SET command and the formatter definition of + # ::S::D::Sybase::ASE::DateTime::Format below should be safe and + # transparent + $dbh->do('SET DATEFORMAT mdy'); - 1; } } diff --git a/t/inflate/datetime_sybase.t b/t/inflate/datetime_sybase.t index 1531cac..afd7ef4 100644 --- a/t/inflate/datetime_sybase.t +++ b/t/inflate/datetime_sybase.t @@ -18,8 +18,10 @@ if (not ($dsn && $user)) { "\nWarning: This test drops and creates a table called 'track'"; } -plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase') - unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase'); +for (qw/test_rdbms_ase test_dt/) { + plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ($_) + unless DBIx::Class::Optional::Dependencies->req_ok_for ($_); +} my @storage_types = ( 'DBI::Sybase::ASE',