X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=fc66f3bbc3b4eb568e33da8d515a8685450cbcc9;hb=8138f96a9bb627e9f27cf9908532021217eb89b9;hp=d6ef837aa78fea876f8a7406d4fe2dd8759e7ac5;hpb=584ea6e45cc0c7608789d3b6ea2d16151f15ed14;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index d6ef837..fc66f3b 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -2931,12 +2931,27 @@ sub _max_column_bytesize { } # Determine if a data_type is some type of BLOB +# FIXME: these regexes are expensive, result of these checks should be cached in +# the column_info . sub _is_lob_type { my ($self, $data_type) = @_; - $data_type && ($data_type =~ /(?:lob|bfile|text|image|bytea|memo)/i - || $data_type =~ /^long(?:\s*(?:raw|bit\s*varying|varbit|binary + $data_type && ($data_type =~ /lob|bfile|text|image|bytea|memo/i + || $data_type =~ /^long(?:\s+(?:raw|bit\s*varying|varbit|binary |varchar|character\s*varying|nvarchar - |national\s*character\s*varying))?$/xi); + |national\s*character\s*varying))?\z/xi); +} + +sub _is_binary_lob_type { + my ($self, $data_type) = @_; + $data_type && ($data_type =~ /blob|bfile|image|bytea/i + || $data_type =~ /^long(?:\s+(?:raw|bit\s*varying|varbit|binary))?\z/xi); +} + +sub _is_text_lob_type { + my ($self, $data_type) = @_; + $data_type && ($data_type =~ /^(?:clob|memo)\z/i + || $data_type =~ /^long(?:\s+(?:varchar|character\s*varying|nvarchar + |national\s*character\s*varying))\z/xi); } 1;