mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 14:06:27 +00:00
Fix couple of bugs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -45,13 +45,13 @@ $statement = "SELECT * from $global_table_name order by variable";
|
|||||||
my $result = $dbh->selectall_arrayref($statement);
|
my $result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
my @resultSet = @{$result};
|
my @resultSet = @{$result};
|
||||||
if ( $#resultSet > 0 ) {
|
if ( $#resultSet > -1 ) {
|
||||||
print EXTEN "[globals]\n";
|
print EXTEN "[globals]\n";
|
||||||
foreach $row (@{ $result }) {
|
foreach $row (@{ $result }) {
|
||||||
my @result = @{ $row };
|
my @result = @{ $row };
|
||||||
@@ -65,14 +65,14 @@ $statement = "SELECT context from $table_name group by context";
|
|||||||
$result = $dbh->selectall_arrayref($statement);
|
$result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@resultSet = @{$result};
|
@resultSet = @{$result};
|
||||||
if ( $#resultSet == -1 ) {
|
if ( $#resultSet == -1 ) {
|
||||||
print EXTEN "No extensions defined in $table_name\n";
|
print "No extensions defined in $table_name\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,15 +83,15 @@ foreach my $row ( @{ $result } ) {
|
|||||||
my $result = $dbh->selectall_arrayref($statement);
|
my $result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @resSet = @{$result};
|
my @resSet = @{$result};
|
||||||
if ( $#resSet == -1 ) {
|
if ( $#resSet == -1 ) {
|
||||||
print EXTEN "no results\n";
|
print "no results\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
foreach my $row ( @{ $result } ) {
|
foreach my $row ( @{ $result } ) {
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ $statement = "SELECT * from $global_table_name order by variable";
|
|||||||
my $result = $dbh->selectall_arrayref($statement);
|
my $result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
my @resultSet = @{$result};
|
my @resultSet = @{$result};
|
||||||
if ( $#resultSet > 0 ) {
|
if ( $#resultSet > -1 ) {
|
||||||
print EXTEN "[globals]\n";
|
print EXTEN "[globals]\n";
|
||||||
foreach $row (@{ $result }) {
|
foreach $row (@{ $result }) {
|
||||||
my @result = @{ $row };
|
my @result = @{ $row };
|
||||||
@@ -65,14 +65,14 @@ $statement = "SELECT context from $table_name group by context";
|
|||||||
$result = $dbh->selectall_arrayref($statement);
|
$result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@resultSet = @{$result};
|
@resultSet = @{$result};
|
||||||
if ( $#resultSet == -1 ) {
|
if ( $#resultSet == -1 ) {
|
||||||
print EXTEN "No extensions defined in $table_name\n";
|
print "No extensions defined in $table_name\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,15 +83,15 @@ foreach my $row ( @{ $result } ) {
|
|||||||
my $result = $dbh->selectall_arrayref($statement);
|
my $result = $dbh->selectall_arrayref($statement);
|
||||||
unless ($result) {
|
unless ($result) {
|
||||||
# check for errors after every single database call
|
# check for errors after every single database call
|
||||||
print EXTEN "dbh->selectall_arrayref($statement) failed!\n";
|
print "dbh->selectall_arrayref($statement) failed!\n";
|
||||||
print EXTEN "DBI::err=[$DBI::err]\n";
|
print "DBI::err=[$DBI::err]\n";
|
||||||
print EXTEN "DBI::errstr=[$DBI::errstr]\n";
|
print "DBI::errstr=[$DBI::errstr]\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @resSet = @{$result};
|
my @resSet = @{$result};
|
||||||
if ( $#resSet == -1 ) {
|
if ( $#resSet == -1 ) {
|
||||||
print EXTEN "no results\n";
|
print "no results\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
foreach my $row ( @{ $result } ) {
|
foreach my $row ( @{ $result } ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user