X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FODBC%2FFirebird.pm;h=b13cf0b17e17094979aefa2791bd050a8696c52b;hb=a6900c9127d90a9bec26228a16f68a11cc13fb1d;hp=366324e9ecbee131fb8ce38f189719c111b220e5;hpb=9990e58f49603b81e3c1195c0e83595b0333c8df;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm index 366324e..b13cf0b 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Firebird.pm @@ -6,10 +6,9 @@ use base qw/ DBIx::Class::Schema::Loader::DBI::ODBC DBIx::Class::Schema::Loader::DBI::InterBase /; -use Carp::Clan qw/^DBIx::Class/; -use Class::C3; +use mro 'c3'; -our $VERSION = '0.07000'; +our $VERSION = '0.07039'; =head1 NAME @@ -22,6 +21,35 @@ Proxy for L when using L See L for usage information. +=cut + +# Some (current) versions of the ODBC driver have a bug where ->type_info breaks +# with "data truncated". This "fixes" it, but some type names are truncated. +sub _dbh_type_info_type_name { + my ($self, $type_num) = @_; + + my $dbh = $self->schema->storage->dbh; + + local $dbh->{LongReadLen} = 100_000; + local $dbh->{LongTruncOk} = 1; + + my $type_info = $dbh->type_info($type_num); + + return undef if not $type_info; + + my $type_name = $type_info->{TYPE_NAME}; + + # fix up truncated type names + if ($type_name eq "VARCHAR(x) CHARACTER SET UNICODE_\0") { + return 'VARCHAR(x) CHARACTER SET UNICODE_FSS'; + } + elsif ($type_name eq "BLOB SUB_TYPE TEXT CHARACTER SET \0") { + return 'BLOB SUB_TYPE TEXT CHARACTER SET UNICODE_FSS'; + } + + return $type_name; +} + =head1 SEE ALSO L,