fix uninitialized warnings for Firebird
Rafael Kitover [Wed, 19 Oct 2011 20:58:43 +0000 (16:58 -0400)]
Check if the character_set_id for a column is NULL before comparing it
to a value to fix uninitialized warnings in the tests.

lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm

index 122c41e..d761e04 100644 (file)
@@ -226,7 +226,7 @@ EOF
                     $info->{data_type} = 'blob';
                 }
                 elsif ($sub_type_name eq 'TEXT') {
-                    if ($char_set_id == 3) {
+                    if (defined $char_set_id && $char_set_id == 3) {
                         $info->{data_type} = 'blob sub_type text character set unicode_fss';
                     }
                     else {
@@ -275,7 +275,7 @@ EOF
         if ($data_type =~ /^(?:char|varchar)\z/) {
             $info->{size} = $char_length;
 
-            if ($char_set_id == 3) {
+            if (defined $char_set_id && $char_set_id == 3) {
                 $info->{data_type} .= '(x) character set unicode_fss';
             }
         }