[Bast-commits] r7119 -
DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Sat Jul 25 14:10:32 GMT 2009
Author: caelum
Date: 2009-07-25 14:10:30 +0000 (Sat, 25 Jul 2009)
New Revision: 7119
Modified:
DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
Log:
move placeholder support detection into ::Sybase::Base
Modified: DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-07-24 19:22:25 UTC (rev 7118)
+++ DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm 2009-07-25 14:10:30 UTC (rev 7119)
@@ -27,6 +27,18 @@
return $@ ? 0 : 1;
}
+sub _placeholders_supported {
+ my $self = shift;
+ my $dbh = $self->_dbh;
+
+ return eval {
+# There's also $dbh->{syb_dynamic_supported} but it can be inaccurate for this
+# purpose.
+ local $dbh->{PrintError} = 0;
+ $dbh->selectrow_array('select 1 where 1 = ?', {}, 1);
+ };
+}
+
1;
=head1 AUTHORS
Modified: DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm 2009-07-24 19:22:25 UTC (rev 7118)
+++ DBIx-Class/0.08/branches/mssql_storage_minor_refactor/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm 2009-07-25 14:10:30 UTC (rev 7119)
@@ -13,14 +13,7 @@
my $self = shift;
my $dbh = $self->_dbh;
- my ($placeholders_supported) = eval {
-# There's also $dbh->{syb_dynamic_supported} but it can be inaccurate for this
-# purpose.
- local $dbh->{PrintError} = 0;
- $dbh->selectrow_array('select ?', {}, 1);
- };
-
- if (not $placeholders_supported) {
+ if (not $self->_placeholders_supported) {
bless $self,
'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars';
$self->_rebless;
More information about the Bast-commits
mailing list