Subject: | proposal to change the function code renameTable |
Hello!
RenameTable function comprises checking
the existence of the table with the proposed new name.
To check the function is called getTable.
This conflicts with the new table names of the form 0, 1, 2, etc.
Propose to use to test the function getTableByName.
Existing code function renameTable.
sub renameTable
{
my $self = shift;
my $table = $self->getTable(shift) or return undef;
my $newname = shift;
if ($self->getTable($newname, $self->{'xpath'}))
{
warn "[" . __PACKAGE__ . "::renameTable] " .
"Table name $newname already in use\n";
return undef;
}
return $self->setAttribute($table, 'table:name' => $newname);
}
Proposed code function renameTable.
sub renameTable
{
my $self = shift;
my $table = $self->getTable(shift) or return undef;
my $newname = shift;
if ($self->getTableByName($newname, $self->{'xpath'}))
{
warn "[" . __PACKAGE__ . "::renameTable] " .
"Table name $newname already in use\n";
return undef;
}
return $self->setAttribute($table, 'table:name' => $newname);
}