-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update zmupdate #1484
Update zmupdate #1484
Conversation
… to be in a separate module
Also of note here are some missing sth->finishes and some cases where we move the statement preparing outside of the loop. |
Rather than specify the full module name like this Would it be more efficient to do something like this? my syntax might not be exactly correct. Actually, I see you added "use ZoneMinder" ...wouldn't that import all zoneminder perl modules, including ZoneMinder::Config ? |
@@ -359,12 +361,12 @@ if ( $interactive ) { | |||
if ( $response =~ /^[yY]$/ ) { | |||
$dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors | |||
print "\nConverting MyISAM tables to InnoDB. Please wait.\n"; | |||
my $sql = "ALTER TABLE $_ ENGINE = InnoDB"; | |||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is right. These two lines got moved outside of the foreach loop just below, which means the default variable $_ won't contain the right value(s).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are totally right.
Matter of personal preference. I like to fully specify my function calls. Less ambiguous. |
So I broke zmupdate at some point.
This fixes it.
I have been cleaning up all the database connection code, hopefully leaving us with just one place for it.
I am also deprecating the ConfigAdmin module and moving it's two functions into Config.pm.