Subject: | Uninitialized value warnings |
CDBI::SQLite is warning about unitialized values when performing a split operation at line 45. This warning seems innocuous. I have attached a patch which avoids setting the @pks array if no primary key is found. The patch passes all tests and works fine under my environment.
Thanks,
William
--- lib/Class/DBI/SQLite.pm.orig 2005-07-04 14:51:26.000000000 -0400
+++ lib/Class/DBI/SQLite.pm 2005-07-04 14:50:51.000000000 -0400
@@ -42,7 +42,7 @@
@pks = ($primary);
} else {
my ($pks)= $sql =~ m/PRIMARY\s+KEY\s*\(\s*([^)]+)\s*\)/;
- @pks = split m/\s*\,\s*/, $pks;
+ @pks = split(m/\s*\,\s*/, $pks) if $pks;
}
$class->table($table);
$class->columns(Primary => @pks);