Quote some more MySQL8 Reserved keywords
See: https://bugs.launchpad.net/ubuntu/+source/zoneminder/+bug/1859295/comments/1 https://github.com/ZoneMinder/zoneminder/issues/2659 https://bugs.launchpad.net/ubuntu/+source/zoneminder/+bug/1859295
This commit is contained in:
parent
32e0c92747
commit
52ca2abf69
|
@ -146,15 +146,15 @@ sub zmDbGetMonitors {
|
||||||
|
|
||||||
if ( $function ) {
|
if ( $function ) {
|
||||||
if ( $function == DB_MON_CAPT ) {
|
if ( $function == DB_MON_CAPT ) {
|
||||||
$sql .= " where Function >= 'Monitor'";
|
$sql .= " where `Function` >= 'Monitor'";
|
||||||
} elsif ( $function == DB_MON_ACTIVE ) {
|
} elsif ( $function == DB_MON_ACTIVE ) {
|
||||||
$sql .= " where Function > 'Monitor'";
|
$sql .= " where `Function` > 'Monitor'";
|
||||||
} elsif ( $function == DB_MON_MOTION ) {
|
} elsif ( $function == DB_MON_MOTION ) {
|
||||||
$sql .= " where Function = 'Modect' or Function = 'Mocord'";
|
$sql .= " where `Function` = 'Modect' or Function = 'Mocord'";
|
||||||
} elsif ( $function == DB_MON_RECORD ) {
|
} elsif ( $function == DB_MON_RECORD ) {
|
||||||
$sql .= " where Function = 'Record' or Function = 'Mocord'";
|
$sql .= " where `Function` = 'Record' or Function = 'Mocord'";
|
||||||
} elsif ( $function == DB_MON_PASSIVE ) {
|
} elsif ( $function == DB_MON_PASSIVE ) {
|
||||||
$sql .= " where Function = 'Nodect'";
|
$sql .= " where `Function` = 'Nodect'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $sth = $dbh->prepare_cached( $sql );
|
my $sth = $dbh->prepare_cached( $sql );
|
||||||
|
|
|
@ -16,7 +16,7 @@ my @monitors;
|
||||||
my $dbh = zmDbConnect();
|
my $dbh = zmDbConnect();
|
||||||
|
|
||||||
my $sql = "SELECT * FROM Monitors
|
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=?' : '' )
|
( $Config{ZM_SERVER_ID} ? 'AND ServerId=?' : '' )
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue