Merge pull request #2975 from LocutusOfBorg/master

Quote some more MySQL8 Reserved keywords
This commit is contained in:
Isaac Connor 2020-07-11 10:39:13 -04:00 committed by GitHub
commit ba8ab85411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -146,15 +146,15 @@ sub zmDbGetMonitors {
if ( $function ) {
if ( $function == DB_MON_CAPT ) {
$sql .= " where Function >= 'Monitor'";
$sql .= " where `Function` >= 'Monitor'";
} elsif ( $function == DB_MON_ACTIVE ) {
$sql .= " where Function > 'Monitor'";
$sql .= " where `Function` > 'Monitor'";
} elsif ( $function == DB_MON_MOTION ) {
$sql .= " where Function = 'Modect' or Function = 'Mocord'";
$sql .= " where `Function` = 'Modect' or Function = 'Mocord'";
} elsif ( $function == DB_MON_RECORD ) {
$sql .= " where Function = 'Record' or Function = 'Mocord'";
$sql .= " where `Function` = 'Record' or Function = 'Mocord'";
} elsif ( $function == DB_MON_PASSIVE ) {
$sql .= " where Function = 'Nodect'";
$sql .= " where `Function` = 'Nodect'";
}
}
my $sth = $dbh->prepare_cached( $sql );

View File

@ -16,7 +16,7 @@ my @monitors;
my $dbh = zmDbConnect();
my $sql = "SELECT * FROM Monitors
WHERE find_in_set( Function, 'Modect,Mocord,Nodect' )".
WHERE find_in_set( `Function`, 'Modect,Mocord,Nodect' )".
( $Config{ZM_SERVER_ID} ? 'AND ServerId=?' : '' )
;