Subject: | Bug when trying to make a diff |
Date: | Sat, 24 Jun 2017 22:37:51 +0300 |
To: | bug-SQL-Translator [...] rt.cpan.org |
From: | Petru Trimbitas <petru.trimbitas [...] gmail.com> |
I tried to do a diff in order to upgrade db. After some discussion on
irc ribasushi gave me this code which produces the same bug as my
code.
perl -e '
my $s1 = <<"EOS";
CREATE TABLE users (
username text NOT NULL,
password text NOT NULL,
PRIMARY KEY (username)
);
EOS
my $s2 = <<"EOS";
CREATE TABLE users (
username text NOT NULL,
PRIMARY KEY (username)
);
EOS
use SQL::Translator::Diff;
use SQL::Translator;
print SQL::Translator::Diff::schema_diff(
SQL::Translator->new(
parser => "SQL::Translator::Parser::PostgreSQL",
)->translate(\$s1),
"PostgreSQL",
SQL::Translator->new(
parser => "SQL::Translator::Parser::PostgreSQL",
)->translate(\$s2),
"PostgreSQL",
);
print "\n";
'
It produces Use of uninitialized value $c_name in sprintf at
/home/petru/perl5/lib/perl5/SQL/Translator/Producer/PostgreSQL.pm line
950.