Commit 41f97b37 authored by Leo Gordon's avatar Leo Gordon
Browse files

show query/cmd/filename when debug is on

parent a1a53d6d
......@@ -205,6 +205,9 @@ sub _get_rows_from_list {
sub _get_rows_from_query {
my ($self, $inputquery) = @_;
if($self->debug()) {
warn qq{inputquery = "$inputquery"\n};
}
my @rows = ();
my $sth = $self->dbh()->prepare($inputquery);
$sth->execute();
......@@ -228,6 +231,9 @@ sub _get_rows_from_query {
sub _get_rows_from_open {
my ($self, $input_file_or_pipe, $delimiter, $parse_header) = @_;
if($self->debug()) {
warn qq{input_file_or_pipe = "$input_file_or_pipe"\n};
}
my @rows = ();
open(FILE, $input_file_or_pipe) or die "Could not open '$input_file_or_pipe' because: $!";
while(my $line = <FILE>) {
......
......@@ -108,6 +108,10 @@ sub run {
# Perform parameter substitution:
my $sql = $self->param_substitute($unsubst_sql);
if($self->debug()) {
warn qq{sql = "$sql"\n};
}
$dbh->do( $sql ) or die "Could not run '$sql': ".$dbh->errstr;
my $insert_id_name = '_insert_id_'.$counter++;
......
......@@ -108,6 +108,10 @@ sub run {
my $cmd = $self->param('cmd');
if($self->debug()) {
warn qq{cmd = "$cmd"\n};
}
$self->dbc and $self->dbc->disconnect_when_inactive(1); # release this connection for the duration of system() call
if(my $return_value = system($cmd)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment